home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume31 / tin / patch05b < prev    next >
Encoding:
Text File  |  1992-08-16  |  60.5 KB  |  2,251 lines

  1. Newsgroups: comp.sources.misc
  2. From: iain%anl433.uucp@Germany.EU.net (Iain Lea)
  3. Subject:  v31i081:  tin - threaded full screen newsreader v1.1, Patch05b/7
  4. Message-ID: <1992Aug16.012436.12378@sparky.imd.sterling.com>
  5. X-Md4-Signature: 366ef4cf046ce783faf7be2e9e7050f3
  6. Date: Sun, 16 Aug 1992 01:24:36 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: iain%anl433.uucp@Germany.EU.net (Iain Lea)
  10. Posting-number: Volume 31, Issue 81
  11. Archive-name: tin/patch05b
  12. Environment: BSD, SCO, ISC, SUNOS, SYSVR3, SYSVR4, ULTRIX, XENIX
  13. Patch-To: tin: Volume 31, Issue 1-15
  14.  
  15. #!/bin/sh
  16. # this is patch-1.15.shar.02 (part 2 of tin-1.15)
  17. # do not concatenate these parts, unpack them in order with /bin/sh
  18. # file tin-1.15.patch continued
  19. #
  20. if test ! -r _shar_seq_.tmp; then
  21.     echo 'Please unpack part 1 first!'
  22.     exit 1
  23. fi
  24. (read Scheck
  25.  if test "$Scheck" != 2; then
  26.     echo Please unpack part "$Scheck" next!
  27.     exit 1
  28.  else
  29.     exit 0
  30.  fi
  31. ) < _shar_seq_.tmp || exit 1
  32. if test ! -f _shar_wnt_.tmp; then
  33.     echo 'x - still skipping tin-1.15.patch'
  34. else
  35. echo 'x - continuing file tin-1.15.patch'
  36. sed 's/^X//' << 'SHAR_EOF' >> 'tin-1.15.patch' &&
  37. !    UNDER NNTP USE newnews COMMAND FROM NNTPSERVER
  38. X  
  39. ! o  Add 'r' command to newsgroup level.
  40. X  
  41. X  FIX FEATURES V2.0
  42. X  -----------------
  43. X  
  44. X  o  If saving in mailbox format and mailbox does not exist query the user?
  45. X  
  46. X  o  In kill.c should kill_both only kill when subj & from are matched?
  47. --- 1,95 ----
  48. X  FIX FEATURES V1.x
  49. X  -----------------
  50. X  
  51. ! o  Add auto-delete attribute to group attributes.
  52. X  
  53. ! o  If -f .newsrc -S/-M specified then don't use attribute.batch_save to
  54. !    determine if group should be saved just save the groups that are
  55. !    specified in -f .newsrc-file. 
  56. X  
  57. X  o  Add code to decrement/increment counter of NEW killed & hot articles 
  58. X     so that 'h' is not offered as default when there are no NEW hot articles.
  59. !    Look at 
  60. !    'r'  group N   page N    
  61. !    'zZ' group Y   page ?(will return) N  thread N
  62. !    'k'  group Y   page ?N  thread N 
  63. !     & code that marks arts read.
  64. !    need a routine to redraw screen title to reflect changes.
  65. X  
  66. ! o  Add ~/.tin/newsgroups to write LIBDIR/newsgroups after 1st being read
  67. !    so on rereading active file you have a local copy and don't waste net 
  68. !    bandwidth.
  69. X  
  70. ! o  Fix 'm' mail t)hread because it does not redraw the screen.
  71. X  
  72. ! o  Add code to read LOGIN/NAME env. vars as username/fullname when posting an article.
  73. !    ie. LOGIN=billy NAME=billy boy   billy@addr (billy boy)
  74. ! o  Fix 'NP' so they goto next/prev unread group.
  75. ! o  Fix 'C' do that it wraps around group list (like TAB).
  76. ! o  Fix PRINTER env var problem overriding option 18?
  77. !    Do a strstr(buf, "-P") and if -P is there do not use the PRINTER var?
  78. ! o  Fix threading arts so global can be set but local (group level) can
  79. !    override it. At moment once set global unthreaded cannot toggle
  80. !    threading within group.
  81. ! o  Fix local group check to hash the groups read in from ~/.tin/active and
  82. !    mark active[].flag as TRUE. then find flag=FALSE and ask user if
  83. !    they want to subscribe to group. Also of CNEWS just do a compare of 
  84. !    active.times.
  85. X  
  86. + o  Add quick post mode to tin (like elm) (Dave Sch?? yale)
  87. +    tin -w subject -g group,group,...
  88. + o  Fix '|' more of articles when done a 2nd time you have to add a <CR>
  89. +    to command to get it to work
  90. + o  Fix when in a thread and you auto-select a author ^K. After selection the
  91. +    header is from the basenote article while the article body is from the
  92. +    correct article in the thread.
  93. + o  Fix kill last article in thread when at page level from within thread level
  94. +    that causes an assertion failure in thread.c line 801. (David Bindermann)
  95. + o  Fix set show only unread in 'M' menu at article viewer level that causes
  96. +    'cannot find basenote articles' (Thomas Omerzu).
  97. +    Save respnum before so that it can be found after with which_thread() ?
  98. + o  Fix CDROM SPOOLDIRS to read newsgroups file from 'newsgrps' file.
  99. X  o  Fix -S option to create an active file when new articles are
  100. X     saved to <savedir>. Also fix -R option to read ACTIVE file created
  101. X     by -S command. Use minimax code from tony travis to help in -R cmd
  102. X     line option.
  103. X  
  104. ! o  Add write_attributes_file () to write active attributes that are different
  105. !    than global settings. Also a menu 'M' interface to set all the options PL6.
  106. X  
  107. ! o  Add options to 'M' menu to allow setting all the variables that are now in 
  108. !    the tinrc file.
  109. ! o  If 'a' in pipe to less and 423 error msg from NNTP it starts less with 
  110. !    no file.
  111. X  
  112. ! o  Add Msg-Id: field contents to reply & followups.
  113. X  
  114. ! o  In inews.c also allow reply_to var to be used in From: field.
  115. X  
  116. ! o  Fix Save in feed.c routines. 
  117. !    Also fix so SAVING routines just use save_art_to_file() and print
  118. !    *** X Articles saved *** & none of the BS done at the moment
  119. X  
  120. X  FIX FEATURES V2.0
  121. X  -----------------
  122. X  
  123. + o  Add Xref handling of articles so that read ones are marked read in 
  124. +    other groups. Use update_group() to do it?
  125. +    Needs to handle 'c' 'C' 'k' 'K' commands. Perhaps it should be an
  126. +    option so that performance is not impaired. (JIM).
  127. X  o  If saving in mailbox format and mailbox does not exist query the user?
  128. X  
  129. X  o  In kill.c should kill_both only kill when subj & from are matched?
  130. ***************
  131. *** 65,73 ****
  132. X  
  133. X  o  Add elm like mini-menu to tin for first time users.
  134. X  
  135. - o  Add option to 'M' menu to allow unlinking/not of ~/.article
  136. -    after posting an article.
  137. X  o  Add hashing to speedup valid_art() in big groups. Make it compile
  138. X     option so tin is still usable on Minix/small memory machines.
  139. X     -DSMALL_MEMORY_MACHINE
  140. --- 106,111 ----
  141. ***************
  142. *** 74,89 ****
  143. X  
  144. X  o  Add auto-aliasing of peoples mail addresses to mail aliases file.
  145. X  
  146. - o  Add Xref handling of articles so that read ones are marked read in 
  147. -    other groups. Use update_group() to do it?
  148. -    Needs to handle 'c' 'C' 'k' 'K' commands. Perhaps it should be an
  149. -    option so that performance is not impaired. (JIM).
  150. X  o  Add ^G command to skip to next Subject: in digests.
  151. X  
  152. X  o  Try compiling with -D_POSIX_SOURCE
  153. X  
  154. ! o  Add filename & groupname completion (readline?).
  155. X  
  156. X  o  Fix uuscram code in uudecode.
  157. X  
  158. --- 112,122 ----
  159. X  
  160. X  o  Add auto-aliasing of peoples mail addresses to mail aliases file.
  161. X  
  162. X  o  Add ^G command to skip to next Subject: in digests.
  163. X  
  164. X  o  Try compiling with -D_POSIX_SOURCE
  165. X  
  166. ! o  Add filename & groupname completion (editline).
  167. X  
  168. X  o  Fix uuscram code in uudecode.
  169. X  
  170. ***************
  171. *** 98,106 ****
  172. X  
  173. X  o  Add elm style print command with %s in it for printing in 'M'.
  174. X  
  175. - o  Add 'C' command at group level to catchup present group and
  176. -    enter next group with unread news in it.
  177. X  o  Sort .newsrc according to preference. (sort active file as it is read)
  178. X  
  179. X  o  Add time period to killing articles
  180. --- 131,136 ----
  181. ***************
  182. *** 126,137 ****
  183. X  o  Add Virtual newsgroups (combination of newsgroups ie. virtual.ibm
  184. X     consists of comp.sys.ibm.* groups). ~/.tin/virtual
  185. X  
  186. ! o  Change defaults on a per group basis
  187. ! Group        Connect   Read    Thread    Save  Savedir  Maildir  Sigfile    
  188. !                        Unread  Unthread  Mail  ProcTyp  Mailbox
  189. X  -----------------------------------------------------------------------------
  190. ! junk         local     Unread  Thread    None  Default  Default  Default
  191. ! alt.sources  1.3.3.3   Read    Thread    Save  $SRC/alt Default  ~/.Sig-alt
  192. X  
  193. X  Add a menu interface to define all this. Also add edit menu for entries in
  194. X  kill file.
  195. --- 156,170 ----
  196. X  o  Add Virtual newsgroups (combination of newsgroups ie. virtual.ibm
  197. X     consists of comp.sys.ibm.* groups). ~/.tin/virtual
  198. X  
  199. ! Group        Read    Thread    Save  Savedir  Maildir  Sigfile    
  200. !              Unread  Unthread  Mail  ProcTyp  Mailbox
  201. X  -----------------------------------------------------------------------------
  202. ! junk         Unread  OFF       OFF   Default  Default  Default
  203. ! alt.sources  Read    ON        ON    $SRC/alt Default  ~/.Sig-alt
  204. ! Also following fields (to override globally defined ones in tinrc):
  205. ! replyto:
  206. ! organization:
  207. X  
  208. X  Add a menu interface to define all this. Also add edit menu for entries in
  209. X  kill file.
  210. ***************
  211. *** 138,140 ****
  212. --- 171,176 ----
  213. X  
  214. X  Each group could have a field to say which NNTP/local connection to use so
  215. X  as to be able to plug into different NNTP servers for different newsgroups
  216. + Add global attributes file for site. LIST ATTRIBUTES ??
  217. diff -rcs ../1.14/active.c ./active.c
  218. *** ../1.14/active.c    Tue Aug 11 21:23:01 1992
  219. --- ./active.c    Tue Aug 11 20:24:15 1992
  220. ***************
  221. *** 3,9 ****
  222. X   *  Module    : active.c
  223. X   *  Author    : I.Lea
  224. X   *  Created   : 16-02-92
  225. !  *  Updated   : 08-06-92
  226. X   *  Notes     :
  227. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  228. X   *              You may  freely  copy or  redistribute  this software,
  229. --- 3,9 ----
  230. X   *  Module    : active.c
  231. X   *  Author    : I.Lea
  232. X   *  Created   : 16-02-92
  233. !  *  Updated   : 07-08-92
  234. X   *  Notes     :
  235. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  236. X   *              You may  freely  copy or  redistribute  this software,
  237. ***************
  238. *** 14,26 ****
  239. X  
  240. X  #include    "tin.h"
  241. X  
  242. X  int group_hash[TABLE_SIZE];            /* group name --> active[] */
  243. X  int reread_active_file = FALSE;
  244. X  
  245. X  /*
  246. X   *  Resync active file when SIGALRM signal received that
  247. !  *  is triggered by alarm (RESYNC_ACTIVE_SECS) call.
  248. X   */
  249. X  
  250. X  void resync_active_file ()
  251. --- 14,28 ----
  252. X  
  253. X  #include    "tin.h"
  254. X  
  255. + char new_active_file_server[PATH_LEN];
  256. + char new_active_file_attribute[32];
  257. X  int group_hash[TABLE_SIZE];            /* group name --> active[] */
  258. X  int reread_active_file = FALSE;
  259. + int active_index = -1;
  260. X  
  261. X  /*
  262. X   *  Resync active file when SIGALRM signal received that
  263. !  *  is triggered by alarm (reread_active_file_secs) call.
  264. X   */
  265. X  
  266. X  void resync_active_file ()
  267. ***************
  268. *** 30,37 ****
  269. --- 32,42 ----
  270. X          max_active = DEFAULT_ACTIVE_NUM;
  271. X          expand_active ();
  272. X          read_active_file ();
  273. +         read_attributes_file ();
  274. X          read_newsgroups_file ();
  275. X          read_newsrc (TRUE);
  276. +         toggle_my_groups (show_only_unread_groups);
  277. +         set_groupname_len (FALSE);
  278. X          set_alarm_signal ();
  279. X          mail_setup ();
  280. X          group_selection_page ();
  281. ***************
  282. *** 39,59 ****
  283. X  }
  284. X  
  285. X  /*
  286. X   *  Load the active file into active[] and create copy of active ~/.tin/active
  287. X   */
  288. X  
  289. ! int read_active_file ()
  290. X  {
  291. X      FILE *fp;
  292. X      char *p, *q, *r;
  293. X      char buf[LEN];
  294. X      char moderated = 'y';
  295. !     int created, i;
  296. X      long h;
  297. !     
  298. X      num_active = 0;
  299. X  
  300. !     if (! update) {
  301. X          wait_message (txt_reading_active_file);
  302. X      }
  303. X  
  304. --- 44,91 ----
  305. X  }
  306. X  
  307. X  /*
  308. +  *  Find group name in active[] array and return index otherwise -1
  309. +  */
  310. +  
  311. + int find_group_index (group)
  312. +     char *group;
  313. + {
  314. +     int i = -1;
  315. +     long h;
  316. +     h = hash_groupname (group);
  317. +     i = group_hash[h];
  318. +     
  319. +     /* 
  320. +      * hash linked list chaining 
  321. +      */
  322. +     while (i >= 0) {
  323. +         if (strcmp (active[i].name, group) == 0) {
  324. +             return (i);
  325. +         }
  326. +         i = active[i].next;
  327. +     }
  328. +     return (-1);
  329. + }
  330. + /*
  331. X   *  Load the active file into active[] and create copy of active ~/.tin/active
  332. X   */
  333. X  
  334. ! void read_active_file ()
  335. X  {
  336. X      FILE *fp;
  337. X      char *p, *q, *r;
  338. X      char buf[LEN];
  339. X      char moderated = 'y';
  340. !     int i;
  341. X      long h;
  342. !         
  343. X      num_active = 0;
  344. X  
  345. !     if ((update && update_fork) || ! update) {
  346. X          wait_message (txt_reading_active_file);
  347. X      }
  348. X  
  349. ***************
  350. *** 127,147 ****
  351. X          active[num_active].min = (long) atol (q);
  352. X          active[num_active].moderated = moderated;
  353. X          active[num_active].next = -1;            /* hash chaining */
  354. !         active[num_active].flag = UNSUBSCRIBED;    /* not in my_group[] yet */
  355. !         /*
  356. !          * Per group attributes
  357. !          */
  358. !         active[num_active].attribute.server  = (char *) 0;
  359. !         active[num_active].attribute.maildir = default_maildir;
  360. !         active[num_active].attribute.savedir = default_savedir;
  361. !         active[num_active].attribute.sigfile = default_sigfile;
  362. !         active[num_active].attribute.read    = FALSE;    /* read/unread */
  363. !         active[num_active].attribute.showall = show_only_unread;
  364. !         active[num_active].attribute.thread  = thread_arts;
  365. !         active[num_active].attribute.sortby  = sort_art_type;
  366. !         active[num_active].attribute.author  = show_author;
  367. !         active[num_active].attribute.autosave= save_archive_name;
  368. !         active[num_active].attribute.process = post_proc_type; 
  369. X  
  370. X          num_active++;
  371. X  
  372. --- 159,166 ----
  373. X          active[num_active].min = (long) atol (q);
  374. X          active[num_active].moderated = moderated;
  375. X          active[num_active].next = -1;            /* hash chaining */
  376. !         active[num_active].my_group = UNSUBSCRIBED;    /* not in my_group[] yet */
  377. !         active[num_active].unread = 0;
  378. X  
  379. X          num_active++;
  380. X  
  381. ***************
  382. *** 158,192 ****
  383. X          exit (1);
  384. X      }
  385. X  
  386. !     /*
  387. !      * create backup of LIBDIR/active for use by -n option to notify new groups 
  388. !      */
  389. !     created = backup_active (TRUE);
  390. ! /*    if (cmd_line && (read_news_via_nntp && update == FALSE)) {
  391. !         if (! (update && ! verbose)) {
  392. !             wait_message ("\n");
  393. !         }
  394. !     }
  395. ! */
  396. !     if (cmd_line && ! update && ! verbose) {
  397. X          wait_message ("\n");
  398. X      }
  399. X  
  400. !     return (created);
  401. X  }
  402. X  
  403. X  /*
  404. !  *  create ~/.tin/active from LIBDIR/active if it does not exist 
  405. X   */
  406. X  
  407. ! int backup_active (create)
  408. X      int create;
  409. X  {
  410. !     char buf[LEN];
  411. X      FILE *fp;
  412. !     int created = FALSE;
  413. !     int i;
  414. X      struct stat sb;
  415. X      
  416. X      sprintf (buf, "%s/active", rcdir);
  417. --- 177,200 ----
  418. X          exit (1);
  419. X      }
  420. X  
  421. !     if ((cmd_line && ! update && ! verbose) || (update && update_fork)) {
  422. ! /* || ! update && ! verbose) { */
  423. X          wait_message ("\n");
  424. X      }
  425. X  
  426. !     check_for_any_new_groups ();
  427. X  }
  428. X  
  429. X  /*
  430. !  *  create ~/.tin/active if it does not exist (local news only) 
  431. X   */
  432. X  
  433. ! void backup_active (create)
  434. X      int create;
  435. X  {
  436. !     char buf[PATH_LEN];
  437. X      FILE *fp;
  438. !     register int i;
  439. X      struct stat sb;
  440. X      
  441. X      sprintf (buf, "%s/active", rcdir);
  442. ***************
  443. *** 193,248 ****
  444. X      
  445. X      if (create) {
  446. X          if (stat (buf, &sb) != -1) {
  447. !             goto backup_active_done;
  448. X          }
  449. X      }
  450. X      
  451. !     if ((fp = fopen (buf, "w")) != NULL) {
  452. X          for (i = 0; i < num_active ; i++) {    /* for each group */
  453. X              fprintf (fp, "%s\n", active[i].name);
  454. X          }
  455. X          fclose (fp);
  456. X          chmod (buf, 0644);
  457. -         created = TRUE;
  458. X      }
  459. - backup_active_done:
  460. -     return (created);
  461. X  }
  462. X  
  463. X  /*
  464. !  *  Option -n to check for any newly created newsgroups.
  465. X   */
  466. X  
  467. ! void notify_groups ()
  468. X  {
  469. X      char buf[LEN];
  470. X      FILE *fp;
  471. X      int group_not_found;
  472. !     int index;
  473. !     int num = 0;
  474. X      int update_old_active = FALSE;
  475. X      int max_old_active;
  476. X      register int i, j;
  477. X      struct notify_t {
  478. !         char name[LEN];
  479. X          int len;
  480. X          int visited;
  481. X      } *old_active = (struct notify_t *) 0;
  482. X      
  483. !     sprintf (buf, "%s/active", rcdir);
  484. X      
  485. !     if ((fp = fopen (buf, "r")) == NULL) {
  486. !         perror_message (txt_cannot_open, buf);
  487. X          goto notify_groups_done;
  488. X      }
  489. X  
  490. X      Raw (TRUE);
  491. -     
  492. -     wait_message (txt_checking_active_file);
  493. X  
  494. -     max_old_active = num_active;
  495. -     
  496. X      old_active = (struct notify_t *) my_malloc ((unsigned) sizeof (struct notify_t) * max_old_active);
  497. X      if (old_active == (struct notify_t *) 0) {
  498. X          error_message (txt_out_of_memory, progname);
  499. --- 201,308 ----
  500. X      
  501. X      if (create) {
  502. X          if (stat (buf, &sb) != -1) {
  503. !             return;
  504. X          }
  505. X      }
  506. X      
  507. !     if ((fp = fopen (buf, "w")) != (FILE *) 0) {
  508. X          for (i = 0; i < num_active ; i++) {    /* for each group */
  509. X              fprintf (fp, "%s\n", active[i].name);
  510. X          }
  511. X          fclose (fp);
  512. X          chmod (buf, 0644);
  513. X      }
  514. X  }
  515. X  
  516. X  /*
  517. !  *  check for any newly created newsgroups.
  518. !  *
  519. !  * If reading news locally stat() the active file to get its
  520. !  * size otherwise do a LIST NEWGROUPS to the NNTP server
  521. X   */
  522. X  
  523. ! void check_for_any_new_groups ()
  524. X  {
  525. +     char old_active_file_server[LEN];
  526. +     char old_active_file_attribute[LEN];
  527. X      char buf[LEN];
  528. X      FILE *fp;
  529. X      int group_not_found;
  530. !     int ch, num = 0;
  531. !     int ch_default = 'n';
  532. X      int update_old_active = FALSE;
  533. X      int max_old_active;
  534. +     int new_active_size;
  535. +     int old_active_size;
  536. +     long epoch;
  537. X      register int i, j;
  538. +     struct stat sb;
  539. +     struct tm *tm;
  540. X      struct notify_t {
  541. !         char name[PATH_LEN];
  542. X          int len;
  543. X          int visited;
  544. X      } *old_active = (struct notify_t *) 0;
  545. +     if (! check_for_new_newsgroups) {
  546. +         return;
  547. +     }
  548. X      
  549. !     /*
  550. !      * reading news locally (local) or via NNTP (server name)
  551. !      */    
  552. !     if (read_news_via_nntp) {
  553. !         time (&epoch);
  554. !         tm = localtime (&epoch);
  555. !         sprintf (new_active_file_attribute, "%02d%02d%02d %02d%02d%02d",
  556. !             tm->tm_year, tm->tm_mon+1, tm->tm_mday, 
  557. !             tm->tm_hour, tm->tm_min, tm->tm_sec);
  558. !         strcpy (new_active_file_server, nntp_server);
  559. !         max_old_active = 16;
  560. !     } else {
  561. !         backup_active (TRUE);
  562. !         strcpy (new_active_file_server, "local");
  563. !         max_old_active = num_active;
  564. !         if (stat (active_file, &sb) >= 0) {
  565. !             sprintf (new_active_file_attribute, "%d", sb.st_size);
  566. !         }
  567. !     }
  568. X      
  569. !     /*
  570. !      * find out if we have read news from here before otherwise -1
  571. !      */
  572. !     active_index = find_active_size_index (new_active_file_server);
  573. !         
  574. !     if (debug == 2) {
  575. !         if (active_index >= 0) {    
  576. !             strcpy (old_active_file_server, active_size[active_index].server); 
  577. !             strcpy (old_active_file_attribute, active_size[active_index].attribute);
  578. !         } else {
  579. !             strcpy (old_active_file_server, "UNKNOWN"); 
  580. !             strcpy (old_active_file_attribute, "UNKNOWN");
  581. !         }    
  582. !         sprintf (msg, "Active size index=[%d]  old=[%s %s]  new=[%s %s]", 
  583. !             active_index,
  584. !             old_active_file_server, old_active_file_attribute,
  585. !             new_active_file_server, new_active_file_attribute);
  586. !         error_message (msg, "");                        
  587. !         sleep (2);
  588. !     }
  589. !             
  590. !     if (! read_news_via_nntp && active_index >= 0) {
  591. !         new_active_size = atoi (new_active_file_attribute);
  592. !         old_active_size = atoi (active_size[active_index].attribute);
  593. !         if (new_active_size <= old_active_size) {
  594. !             goto notify_groups_done;
  595. !         }
  596. !     }
  597. !     if ((fp = open_newgroups_fp (active_index)) == (FILE *) 0) {
  598. X          goto notify_groups_done;
  599. X      }
  600. X  
  601. X      Raw (TRUE);
  602. X  
  603. X      old_active = (struct notify_t *) my_malloc ((unsigned) sizeof (struct notify_t) * max_old_active);
  604. X      if (old_active == (struct notify_t *) 0) {
  605. X          error_message (txt_out_of_memory, progname);
  606. ***************
  607. *** 249,390 ****
  608. X          goto notify_groups_done;
  609. X      }
  610. X      
  611. !     while (fgets (old_active[num].name, sizeof (old_active[num].name), fp) != NULL) {
  612. !         old_active[num].len = strlen (old_active[num].name)-1;
  613. !         old_active[num].name[old_active[num].len] = '\0';
  614. !         old_active[num].visited = FALSE;
  615. !         num++;
  616. !         if (num >= max_old_active) {
  617. !             max_old_active= max_old_active + (max_old_active / 2);
  618. !             old_active= (struct notify_t*) my_realloc(
  619. !                 (char *) old_active, 
  620. !                 (unsigned) sizeof(struct notify_t) * max_old_active);
  621. !             if (old_active == (struct notify_t *) 0) {
  622. !                 error_message (txt_out_of_memory, progname);
  623. !                 goto notify_groups_done;
  624. X              }
  625. !         }
  626. X      }
  627. X  
  628. !     for (i = 0 ; i < num_active ; i++) {    
  629. !         group_not_found = TRUE;
  630. !         for (j=0; j < num ; j++) {
  631. !             if (strcmp (old_active[j].name, active[i].name) == 0) {
  632. !                 group_not_found = FALSE;    /* found it so read in next group */
  633. !                 old_active[j].visited = TRUE;
  634. !                 break;
  635. X              }
  636. X          }
  637. !         if (group_not_found == FALSE) {
  638. !             continue;
  639. !         }    
  640. X  
  641. !         update_old_active = TRUE;
  642. !         do {
  643. !             fputc ('\r', stdout);
  644. !             CleartoEOLN();
  645. !             printf (txt_subscribe_to_new_group, active[i].name);
  646. !             fflush (stdout);
  647. !             buf[0] = ReadCh();
  648. !         } while (buf[0] != 'y' && buf[0] != 'n');
  649. !             
  650. !         if (buf[0] == 'y') {
  651. !             index = add_group (active[i].name, TRUE);
  652. !             subscribe (active[my_group[index]].name, ':',
  653. !                    my_group[index], FALSE);
  654. X          }
  655. !         printf ("\r\n%s", txt_checking);
  656. X          fflush (stdout);
  657. X      }
  658. -     fclose (fp);
  659. -     fputc ('\r', stdout);
  660. -     fflush (stdout);
  661. X      CleartoEOLN();
  662. X  
  663. !     /*
  664. !      * Look for bogus groups 
  665. !      */
  666. !     for (j = 0 ; j < num ; j++)  {
  667. !         if (old_active[j].visited) {
  668. !             continue;
  669. !         }
  670. !         do {    
  671. !             update_old_active= 1;
  672. !             fputc ('\r', stdout);
  673. !             CleartoEOLN ();
  674. !             printf (txt_delete_bogus_group, old_active[j].name);
  675. !             fflush (stdout);
  676. !             buf[0] = ReadCh ();
  677. !         } while (buf[0] != 'y' && buf[0] != 'n');
  678. !         if (buf[0] == 'y') {
  679. !             delete_group (old_active[j].name);
  680. X          }
  681. -         printf ("\r\n");
  682. X      }
  683. X      
  684. -     Raw (TRUE);
  685. X      /*
  686. !      *  write active[] to ~/.tin/active
  687. X       */
  688. !     if (update_old_active) {
  689. X          backup_active (FALSE);
  690. X      }
  691. X  
  692. X  notify_groups_done:
  693. X      if (old_active != (struct notify_t *) 0) {
  694. X          free ((char *) old_active);
  695. X          old_active = (struct notify_t *) 0;
  696. X      }
  697. X  }
  698. X  
  699. X  /*
  700. !  *  Mark any groups in my_group[] that are in ~/.tin/unthread so they
  701. !  *  will not be threaded
  702. X   */
  703. X   
  704. ! void mark_unthreaded_groups ()
  705. X  {
  706. !     FILE *fp;
  707. !     char buf[LEN];
  708. !     int i, len;
  709. !     long h;
  710. X  
  711. X  #ifndef INDEX_DAEMON
  712. X  
  713. !     if ((fp = fopen (unthreadfile, "r")) == NULL) {
  714. !         perror_message (txt_cannot_open, unthreadfile);
  715. X          return;
  716. X      }
  717. X  
  718. !     while (fgets (buf, sizeof (buf), fp) != NULL) {
  719. !         buf[strlen (buf)-1] = '\0'; 
  720. !         h = hash_groupname (buf);
  721. !         sprintf (msg, "Unthreading %s...\n", buf);
  722. !         wait_message (msg);
  723. !         
  724. !         i = group_hash[h];
  725. !         
  726. !         if (active[i].next == -1) {
  727. !             len = strlen (active[i].name);
  728. !             if (strncmp (active[i].name, buf, len) == 0) {
  729. !                 active[i].attribute.thread = FALSE;
  730. X              }
  731. !         
  732. !         } else {
  733. !             for (i=group_hash[h] ; i >= 0 ; i=active[i].next) {
  734. !                 len = strlen (active[i].name);
  735. !                 if (strncmp (active[i].name, buf, len) == 0) {
  736. !                     active[i].attribute.thread = FALSE;
  737. !                     break;
  738. !                 }
  739. X              }
  740. !         }    
  741. X      }
  742. X  
  743. X      fclose (fp);
  744. ! #endif /* INDEX_DAEMON */
  745. X  }
  746. X  
  747. X  /*
  748. --- 309,663 ----
  749. X          goto notify_groups_done;
  750. X      }
  751. X      
  752. !     while (fgets (buf, sizeof (buf), fp) != NULL) {
  753. !         if (buf[0] != '.') {
  754. !             strncpy (old_active[num].name, buf, sizeof (old_active[num].name));        
  755. !             old_active[num].len = strlen (old_active[num].name)-1;
  756. !             old_active[num].name[old_active[num].len] = '\0';
  757. !             old_active[num].visited = FALSE;
  758. !             num++;
  759. !             if (num >= max_old_active) {
  760. !                 max_old_active= max_old_active + (max_old_active / 2);
  761. !                 old_active= (struct notify_t*) my_realloc(
  762. !                     (char *) old_active, 
  763. !                     (unsigned) sizeof(struct notify_t) * max_old_active);
  764. !                 if (old_active == (struct notify_t *) 0) {
  765. !                     error_message (txt_out_of_memory, progname);
  766. !                     goto notify_groups_done;
  767. !                 }
  768. X              }
  769. !         }    
  770. X      }
  771. X  
  772. !     fclose (fp);
  773. !     if (read_news_via_nntp) {
  774. !         for (i = 0 ; i < num ; i++) {    
  775. !             if (! prompt_subscribe_group (old_active[i].name)) {
  776. !                 goto notify_groups_done;
  777. X              }
  778. X          }
  779. !     } else {    
  780. !         wait_message (txt_checking_active_file);
  781. !         for (i = 0 ; i < num_active ; i++) {    
  782. !             group_not_found = TRUE;
  783. !             for (j=0; j < num ; j++) {
  784. !                 if (strcmp (old_active[j].name, active[i].name) == 0) {
  785. !                     group_not_found = FALSE;    /* found it so read in next group */
  786. !                     old_active[j].visited = TRUE;
  787. !                     break;
  788. !                 }
  789. !             }
  790. X  
  791. !             if (group_not_found == FALSE) {
  792. !                 continue;
  793. !             }    
  794. !     
  795. !             update_old_active = TRUE;
  796. !     
  797. !             if (! prompt_subscribe_group (active[i].name)) {
  798. !                 goto notify_groups_done;
  799. !             }
  800. X          }
  801. !     }
  802. !     if (cmd_line) {
  803. !         fputc ('\r', stdout);
  804. X          fflush (stdout);
  805. X      }
  806. X      CleartoEOLN();
  807. X  
  808. !     if (! read_news_via_nntp) {
  809. !         /*
  810. !          * Look for bogus groups 
  811. !          */
  812. !         ch_default = 'y';
  813. !         for (j = 0 ; j < num ; j++)  {
  814. !             if (old_active[j].visited) {
  815. !                 continue;
  816. !             }
  817. !             do {    
  818. !                 update_old_active= 1;
  819. !                 fputc ('\r', stdout);
  820. !                 CleartoEOLN ();
  821. !                 printf (txt_delete_bogus_group, old_active[j].name, ch_default);
  822. !                 fflush (stdout);
  823. !                 ch = ReadCh ();
  824. !                 if (ch == CR) {
  825. !                     ch = ch_default;
  826. !                 }
  827. !             } while (ch != 'y' && ch != 'n' && ch != 'q');
  828. !     
  829. !             switch (ch) {
  830. !                 case 'y':
  831. !                     delete_group (old_active[j].name);
  832. !                     break;       
  833. !                 case 'q':
  834. !                     goto notify_groups_done;       
  835. !                 case 'n':
  836. !                 default:
  837. !                     break;       
  838. !             }        
  839. !             printf ("\r\n");
  840. X          }
  841. X      }
  842. X      
  843. X      /*
  844. !      *  write active[] to ~/.tin/active (local spooldir)
  845. X       */
  846. !     if (! read_news_via_nntp && update_old_active) {
  847. X          backup_active (FALSE);
  848. X      }
  849. X  
  850. X  notify_groups_done:
  851. +     
  852. +     /*
  853. +      * update attribute field/create new entry with new size/date
  854. +      */
  855. +     if (active_index >= 0) {
  856. +         if (active_size[active_index].attribute != (char *) 0) {
  857. +             free (active_size[active_index].attribute);
  858. +             active_size[active_index].attribute = (char *) 0;
  859. +         }
  860. +         active_size[active_index].attribute = 
  861. +             str_dup (new_active_file_attribute);
  862. +     } else {
  863. +         sprintf (buf, "%s[%s]", new_active_file_server, new_active_file_attribute);
  864. +         load_active_size_info (buf);
  865. +     }
  866. X      if (old_active != (struct notify_t *) 0) {
  867. X          free ((char *) old_active);
  868. X          old_active = (struct notify_t *) 0;
  869. X      }
  870. +     if (cmd_line) {
  871. +         Raw (FALSE);
  872. +     }
  873. X  }
  874. X  
  875. X  /*
  876. !  * prompt user if new group should be subscribed to
  877. X   */
  878. X   
  879. ! int prompt_subscribe_group (group)
  880. !     char *group;
  881. X  {
  882. !     int ch, ch_default = 'n';
  883. !     int idx;
  884. !     
  885. !     do {
  886. !         if (cmd_line) {
  887. !             fputc ('\r', stdout);
  888. !         }
  889. !         CleartoEOLN ();
  890. !         printf (txt_subscribe_to_new_group, group, ch_default);
  891. !         fflush (stdout);
  892. !         ch = ReadCh ();
  893. !         if (ch == CR) {
  894. !             ch = ch_default;
  895. !         }
  896. !     } while (! strchr ("nqy\033", ch));
  897. !         
  898. !     fputc (ch, stdout);
  899. !     
  900. !     switch (ch) {
  901. !         case 'y':
  902. !             idx = add_group (group, TRUE);
  903. !             subscribe (active[my_group[idx]].name, ':',
  904. !                    my_group[idx], FALSE);
  905. !             break;       
  906. !         case 'q':
  907. !         case ESC:
  908. !             return FALSE;               
  909. !         case 'n':
  910. !         default:
  911. !             break;       
  912. !     }    
  913. !         
  914. !     if (cmd_line) {
  915. !         printf ("\r\n%s", txt_checking);
  916. !         fflush (stdout);
  917. !     } else {    
  918. !         wait_message (txt_checking);
  919. !     }
  920. !     return TRUE;               
  921. ! }
  922. ! /*
  923. !  * Per group attributes
  924. !  */
  925. !  
  926. ! void set_default_attributes ()
  927. ! {
  928. ! #ifndef INDEX_DAEMON
  929. !     register int i;
  930. !     
  931. !     for (i = 0; i < num_active ; i++) {
  932. !         active[i].attribute.maildir = default_maildir;
  933. !         active[i].attribute.savedir = default_savedir;
  934. !         active[i].attribute.sigfile = default_sigfile;
  935. !         active[i].attribute.followup_to = (char *) 0;
  936. !         active[i].attribute.read_during_session = FALSE;
  937. !         active[i].attribute.show_only_unread = default_show_only_unread;
  938. !         active[i].attribute.thread_arts = default_thread_arts;
  939. !         active[i].attribute.sort_art_type = default_sort_art_type;
  940. !         active[i].attribute.show_author  = default_show_author;
  941. !         active[i].attribute.auto_save= default_auto_save;
  942. !         active[i].attribute.batch_save = default_batch_save;
  943. !         active[i].attribute.post_proc_type = default_post_proc_type; 
  944. !     }
  945. ! #endif    /* INDEX_DAEMON */
  946. ! }
  947. X  
  948. + /*
  949. +  *  Load the group attributes into active[].attribute from ~/.tin/attributes 
  950. +  *
  951. +  *  attribute.maildir          = STRING
  952. +  *  attribute.savedir          = STRING
  953. +  *  attribute.sigfile          = STRING
  954. +  *  attribute.followup_to      = STRING
  955. +  *  attribute.auto_save        = ON/OFF
  956. +  *  attribute.batch_save       = ON/OFF
  957. +  *  attribute.show_only_unread = ON/OFF
  958. +  *  attribute.thread_arts      = ON/OFF
  959. +  *  attribute.sort_art_type    = NUM
  960. +  *    0=??, 1=??, 2=??, 3=??, 4=??
  961. +  *  attribute.show_author      = NUM
  962. +  *    
  963. +  *  attribute.post_proc_type   = NUM
  964. +  *  
  965. +  */
  966. + void read_attributes_file ()
  967. + {
  968. X  #ifndef INDEX_DAEMON
  969. X  
  970. !     char buf[PATH_LEN];
  971. !     char line[PATH_LEN];
  972. !     FILE *fp;
  973. !     int num;
  974. !     int index = -1;
  975. !         
  976. !     set_default_attributes ();
  977. !     if ((fp = fopen (attributes_file, "r")) == (FILE *) 0) {
  978. X          return;
  979. X      }
  980. X  
  981. !     if ((update && update_fork) || ! update) {
  982. !         wait_message (txt_reading_attributes_file);
  983. !     }
  984. !     while (fgets (line, sizeof (line), fp) != NULL) {
  985. !         if (line[0] == '#' || line[0] == '\n') {
  986. !             continue;
  987. !         }
  988. !         if (match_string (line, "newsgroup=", buf, sizeof (buf))) {
  989. ! if (debug == 2) {
  990. !     error_message("group=[%s]",buf);
  991. ! }
  992. !             index = find_group_index (buf);
  993. !             continue;
  994. !         }
  995. !         if (match_string (line, "maildir=", buf, sizeof (buf))) {
  996. !             if (index >= 0) {
  997. !                 active[index].attribute.maildir = str_dup (buf);
  998. ! if (debug == 2) {
  999. !     error_message("maildir=[%s]",active[index].attribute.maildir);
  1000. ! }
  1001. X              }
  1002. !             continue;
  1003. !         }
  1004. !         if (match_string (line, "savedir=", buf, sizeof (buf))) {
  1005. !             if (index >= 0) {
  1006. !                 active[index].attribute.savedir = str_dup (buf);
  1007. ! if (debug == 2) {
  1008. !     error_message("savedir=[%s]",active[index].attribute.savedir);
  1009. ! }
  1010. X              }
  1011. !             continue;
  1012. !         }
  1013. !         if (match_string (line, "sigfile=", buf, sizeof (buf))) {
  1014. !             if (index >= 0) {
  1015. !                 active[index].attribute.sigfile = str_dup (buf);
  1016. ! if (debug == 2) {
  1017. !     error_message("sigfile=[%s]",active[index].attribute.sigfile);
  1018. ! }
  1019. !             }
  1020. !             continue;
  1021. !         }
  1022. !         if (match_string (line, "followup_to=", buf, sizeof (buf))) {
  1023. !             if (index >= 0) {
  1024. !                 active[index].attribute.followup_to = str_dup (buf);
  1025. ! if (debug == 2) {
  1026. !     error_message("followup_to=[%s]",active[index].attribute.followup_to);
  1027. ! }
  1028. !             }
  1029. !             continue;
  1030. !         }
  1031. !         if (match_boolean (line, "show_only_unread=", &num)) {
  1032. !             if (index >= 0) {
  1033. !                 active[index].attribute.show_only_unread = num;
  1034. !             }
  1035. !             continue;
  1036. !         }
  1037. !         if (match_boolean (line, "thread_arts=", &num)) {
  1038. !             if (index >= 0) {
  1039. !                 active[index].attribute.thread_arts = num;
  1040. !             }
  1041. !             continue;
  1042. !         }
  1043. !         if (match_boolean (line, "auto_save=", &num)) {
  1044. !             if (index >= 0) {
  1045. !                 active[index].attribute.auto_save = num;
  1046. !             }
  1047. !             continue;
  1048. !         }
  1049. !         if (match_boolean (line, "batch_save=", &num)) {
  1050. !             if (index >= 0) {
  1051. !                 active[index].attribute.batch_save = num;
  1052. !             }
  1053. !             continue;
  1054. !         }
  1055. !         if (match_number (line, "sort_art_type=", &num)) {
  1056. !             if (index >= 0) {
  1057. !                 active[index].attribute.sort_art_type = num;
  1058. !             }
  1059. !             continue;
  1060. !         }
  1061. !         if (match_number (line, "show_author=", &num)) {
  1062. !             if (index >= 0) {
  1063. !                 active[index].attribute.show_author = num;
  1064. !             }
  1065. !             continue;
  1066. !         }
  1067. !         if (match_number (line, "post_proc_type=", &num)) {
  1068. !             if (index >= 0) {
  1069. !                 active[index].attribute.post_proc_type = num;
  1070. !             }
  1071. !             continue;
  1072. !         }
  1073. X      }
  1074. X  
  1075. X      fclose (fp);
  1076. !     if ((cmd_line && ! update && ! verbose) || (update && update_fork)) {
  1077. !         wait_message ("\n");
  1078. !     }
  1079. ! #endif    /* INDEX_DAEMON */
  1080. ! }
  1081. ! /*
  1082. !  *  Save the group attributes from active[].attribute to ~/.tin/attributes 
  1083. !  */
  1084. ! void write_attributes_file ()
  1085. ! {
  1086. ! #ifndef INDEX_DAEMON
  1087. ! #endif    /* INDEX_DAEMON */
  1088. X  }
  1089. X  
  1090. X  /*
  1091. ***************
  1092. *** 394,413 ****
  1093. X  
  1094. X  void read_newsgroups_file ()
  1095. X  {
  1096. X      FILE *fp;
  1097. X      char *p, *q;
  1098. X      char buf[LEN];
  1099. X      char group[PATH_LEN];
  1100. X      int i;
  1101. -     long h;
  1102. X      
  1103. !     if (! show_description || update) {
  1104. !         return;
  1105. X      }
  1106. X  
  1107. X      wait_message (txt_reading_newsgroups_file);
  1108. X  
  1109. !     if ((fp = open_newsgroups_fp ()) == NULL) {
  1110. X          return;
  1111. X      }
  1112. X  
  1113. --- 667,689 ----
  1114. X  
  1115. X  void read_newsgroups_file ()
  1116. X  {
  1117. + #ifndef INDEX_DAEMON
  1118. X      FILE *fp;
  1119. X      char *p, *q;
  1120. X      char buf[LEN];
  1121. X      char group[PATH_LEN];
  1122. X      int i;
  1123. X      
  1124. !     if (! show_description || save_news) {
  1125. !         if (update && ! update_fork) {
  1126. !             return;
  1127. !         }    
  1128. X      }
  1129. X  
  1130. X      wait_message (txt_reading_newsgroups_file);
  1131. X  
  1132. !     if ((fp = open_newsgroups_fp ()) == (FILE *) 0) {
  1133. X          return;
  1134. X      }
  1135. X  
  1136. ***************
  1137. *** 419,457 ****
  1138. X          }
  1139. X          *q = '\0';
  1140. X  
  1141. !         for (;*p == '\t' || *p == ' '; p++) {
  1142. !             ;
  1143. X          }    
  1144. -                 
  1145. -         h = hash_groupname (group);
  1146. -         i = group_hash[h];
  1147. X  
  1148. !         if (debug == 2) {
  1149. !             fprintf (stderr, "HASH=[%5ld] IDX=[%5d] GRP=[%s] TXT=[%s]\n", h, i, group, p);
  1150. !         }
  1151. !         
  1152. !         if (active[i].next == -1) {
  1153. !             if (strcmp (active[i].name, group) == 0) {
  1154. ! if (debug == 2) {
  1155. !     fprintf (stderr, "FOUND HEAD\n");
  1156. ! }    
  1157. !                 if (active[i].description == (char *) 0) {
  1158. !                     active[i].description = str_dup (p);
  1159. !                 }
  1160. !             }
  1161. !         } else {
  1162. !             for (; i >= 0 ; i = active[i].next) {
  1163. !                 if (strcmp (active[i].name, group) == 0) {
  1164. ! if (debug == 2) {
  1165. !     fprintf (stderr, "FOUND LINK\n");
  1166. ! }    
  1167. !                     if (active[i].description == (char *) 0) {
  1168. !                         active[i].description = str_dup (p);
  1169. !                         break;
  1170. !                     }
  1171. !                 }
  1172. !             }
  1173. X          }
  1174. X      }
  1175. X      fclose (fp);
  1176. --- 695,708 ----
  1177. X          }
  1178. X          *q = '\0';
  1179. X  
  1180. !         while (*p == '\t' || *p == ' ') {
  1181. !             p++;
  1182. X          }    
  1183. X  
  1184. !         i = find_group_index (group);
  1185. !          
  1186. !         if (i >= 0 && active[i].description == (char *) 0) {
  1187. !             active[i].description = str_dup (p);
  1188. X          }
  1189. X      }
  1190. X      fclose (fp);
  1191. ***************
  1192. *** 459,462 ****
  1193. --- 710,778 ----
  1194. X      if (cmd_line && ! update && ! verbose) {
  1195. X          wait_message ("\n");
  1196. X      }
  1197. + #endif    /* INDEX_DAEMON */
  1198. + }
  1199. + void load_active_size_info (info)
  1200. +     char *info;
  1201. + {
  1202. +     char *ptr_name;
  1203. +     char *ptr_size;
  1204. +     char buf[PATH_LEN];
  1205. +     int i;
  1206. +         
  1207. +     /*
  1208. +      * initialize active_size[] if no entries
  1209. +      */
  1210. +     if (! num_active_size) {
  1211. +         for (i = 0 ; i < max_active_size ; i++) {
  1212. +             active_size[i].server = (char *) 0;
  1213. +             active_size[i].attribute = (char *) 0;
  1214. +         }
  1215. +     }
  1216. +     my_strncpy (buf, info, sizeof (buf));
  1217. +     
  1218. +     ptr_name = buf;
  1219. +     ptr_name = strchr (buf, ']'); 
  1220. +     if (*ptr_name) {
  1221. +         *ptr_name = '\0';
  1222. +     }
  1223. +     ptr_name = buf;
  1224. +     ptr_name = strchr (buf, '['); 
  1225. +     if (*ptr_name) {
  1226. +         ptr_size = ptr_name;
  1227. +         *ptr_name = '\0';
  1228. +         if (num_active_size > max_active_size) {
  1229. +             expand_active_size ();
  1230. +         }
  1231. +         active_size[num_active_size].server = str_dup (buf);
  1232. +         active_size[num_active_size].attribute = str_dup (++ptr_size);
  1233. +         if (debug == 2) {
  1234. +             sprintf (buf, "ACTIVE server=[%s] attribute=[%s]", 
  1235. +                 active_size[num_active_size].server,
  1236. +                 active_size[num_active_size].attribute);
  1237. +             error_message ("%s", buf);
  1238. +         }    
  1239. +         num_active_size++;
  1240. +     }
  1241. + }
  1242. + int find_active_size_index (cur_active_server)
  1243. +     char *cur_active_server;
  1244. + {
  1245. +     int i, found = FALSE;
  1246. +         
  1247. +     for (i = 0 ; i < num_active_size ; i++) {
  1248. +         if (strcmp (cur_active_server, active_size[i].server) == 0) {
  1249. +             found = TRUE;
  1250. +             break;
  1251. +         }
  1252. +       }
  1253. +     return (found ? i : -1);
  1254. X  }
  1255. diff -rcs ../1.14/art.c ./art.c
  1256. *** ../1.14/art.c    Tue Aug 11 21:23:02 1992
  1257. --- ./art.c    Fri Jul 24 20:46:24 1992
  1258. ***************
  1259. *** 3,9 ****
  1260. X   *  Module    : art.c
  1261. X   *  Author    : I.Lea & R.Skrenta
  1262. X   *  Created   : 01-04-91
  1263. !  *  Updated   : 12-05-92
  1264. X   *  Notes     :
  1265. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  1266. X   *              You may  freely  copy or  redistribute  this software,
  1267. --- 3,9 ----
  1268. X   *  Module    : art.c
  1269. X   *  Author    : I.Lea & R.Skrenta
  1270. X   *  Created   : 01-04-91
  1271. !  *  Updated   : 24-07-92
  1272. X   *  Notes     :
  1273. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  1274. X   *              You may  freely  copy or  redistribute  this software,
  1275. ***************
  1276. *** 27,34 ****
  1277. X   *  set to -2 (ART_EXPIRED).
  1278. X   */
  1279. X  
  1280. ! void find_base (only_unread)
  1281. !     int only_unread;
  1282. X  {
  1283. X      register int i;
  1284. X      register int j;
  1285. --- 27,34 ----
  1286. X   *  set to -2 (ART_EXPIRED).
  1287. X   */
  1288. X  
  1289. ! void find_base (index)
  1290. !     int index;    /* active[index] */
  1291. X  {
  1292. X      register int i;
  1293. X      register int j;
  1294. ***************
  1295. *** 37,43 ****
  1296. X  
  1297. X      debug_print_arts ();
  1298. X  
  1299. !     if (only_unread) {
  1300. X          for (i = 0; i < top; i++) {
  1301. X              if (IGNORE_ART(i) || arts[i].inthread != FALSE) {
  1302. X                  continue;
  1303. --- 37,43 ----
  1304. X  
  1305. X      debug_print_arts ();
  1306. X  
  1307. !     if (active[index].attribute.show_only_unread) {
  1308. X          for (i = 0; i < top; i++) {
  1309. X              if (IGNORE_ART(i) || arts[i].inthread != FALSE) {
  1310. X                  continue;
  1311. ***************
  1312. *** 134,139 ****
  1313. --- 134,140 ----
  1314. X      char *group;
  1315. X      char *group_path;
  1316. X  {
  1317. +     int index; 
  1318. X      int killed = FALSE;
  1319. X      int modified = FALSE;
  1320. X      glob_art_group = group;
  1321. ***************
  1322. *** 146,151 ****
  1323. --- 147,153 ----
  1324. X          sprintf (msg, txt_group, group);
  1325. X          wait_message (msg);
  1326. X      }
  1327. +     index = find_group_index (group);
  1328. X      hash_reclaim ();
  1329. X      free_art_array ();
  1330. X  
  1331. ***************
  1332. *** 162,171 ****
  1333. X      if (modified || purge_needed ()) {
  1334. X          write_index_file (group);
  1335. X      }
  1336. X      read_newsrc_line (group);
  1337. !     killed = kill_any_articles (group); /* do after read_newsrc_line() */
  1338. X      make_threads (FALSE);
  1339. !     find_base (show_only_unread);
  1340. X      
  1341. X      if ((modified || killed) && ! update) {
  1342. X          clear_message ();
  1343. --- 164,174 ----
  1344. X      if (modified || purge_needed ()) {
  1345. X          write_index_file (group);
  1346. X      }
  1347. +     
  1348. X      read_newsrc_line (group);
  1349. !     killed = kill_any_articles (index);
  1350. X      make_threads (FALSE);
  1351. !     find_base (index);
  1352. X      
  1353. X      if ((modified || killed) && ! update) {
  1354. X          clear_message ();
  1355. ***************
  1356. *** 230,235 ****
  1357. --- 233,239 ----
  1358. X  
  1359. X          if (! parse_headers (fp, &arts[top])) {
  1360. X              debug_nntp ("read_group", "FAILED parse_header()");
  1361. +             fclose (fp);
  1362. X              continue;
  1363. X          }
  1364. X  
  1365. ***************
  1366. *** 266,273 ****
  1367. X      register int i;
  1368. X      register int j;
  1369. X  
  1370. !     if (!cmd_line) {
  1371. !         if (thread_arts) {
  1372. X              wait_message (txt_threading_arts);
  1373. X          } else {
  1374. X              wait_message (txt_unthreading_arts);
  1375. --- 270,277 ----
  1376. X      register int i;
  1377. X      register int j;
  1378. X  
  1379. !     if (! cmd_line) {
  1380. !         if (active[my_group[cur_groupnum]].attribute.thread_arts) {
  1381. X              wait_message (txt_threading_arts);
  1382. X          } else {
  1383. X              wait_message (txt_unthreading_arts);
  1384. ***************
  1385. *** 274,283 ****
  1386. X          }
  1387. X      }
  1388. X  
  1389. X      /*
  1390. !      *  .thread & .inthread need to be reset if re-threading arts[]
  1391. X       */
  1392. !     if (rethread && active[my_group[cur_groupnum]].attribute.thread) {
  1393. X          for (i=0 ; i < top ; i++) {
  1394. X              arts[i].thread = ART_NORMAL;
  1395. X              arts[i].inthread = FALSE;
  1396. --- 278,296 ----
  1397. X          }
  1398. X      }
  1399. X  
  1400. + if (debug == 2) {
  1401. +     sprintf (msg, "rethread=[%d]  thread_arts=[%d]  attr_thread_arts=[%d]",     
  1402. +         rethread, default_thread_arts,
  1403. +         active[my_group[cur_groupnum]].attribute.thread_arts);
  1404. +     error_message (msg, "");
  1405. + }
  1406. X      /*
  1407. !      *  arts[].thread & arts[].inthread need to be reset if re-threading
  1408. X       */
  1409. !     if (rethread || active[my_group[cur_groupnum]].attribute.thread_arts) {
  1410. ! if (debug == 2) {
  1411. !     error_message("Resetting .thread & .inthread", "");
  1412. ! }
  1413. X          for (i=0 ; i < top ; i++) {
  1414. X              arts[i].thread = ART_NORMAL;
  1415. X              arts[i].inthread = FALSE;
  1416. ***************
  1417. *** 284,290 ****
  1418. X          }
  1419. X      }
  1420. X  
  1421. !     switch (sort_art_type) {
  1422. X          case SORT_BY_NOTHING:        /* don't sort at all */
  1423. X              qsort ((char *) arts, top, sizeof (struct article_t), artnum_comp);
  1424. X              break;
  1425. --- 297,303 ----
  1426. X          }
  1427. X      }
  1428. X  
  1429. !     switch (default_sort_art_type) {
  1430. X          case SORT_BY_NOTHING:        /* don't sort at all */
  1431. X              qsort ((char *) arts, top, sizeof (struct article_t), artnum_comp);
  1432. X              break;
  1433. ***************
  1434. *** 304,313 ****
  1435. X              break;
  1436. X      }
  1437. X  
  1438. !     if (thread_arts == 0 || active[my_group[cur_groupnum]].attribute.thread == 0) {
  1439. X          return;
  1440. X      }
  1441. X  
  1442. X      for (i = 0; i < top; i++) {
  1443. X          if (arts[i].thread != ART_NORMAL || IGNORE_ART(i)) {
  1444. X              continue;
  1445. --- 317,335 ----
  1446. X              break;
  1447. X      }
  1448. X  
  1449. !     /*
  1450. !      * FIXME - Once full group attributes are implemented what should the case be here?
  1451. !      */
  1452. !     if (active[my_group[cur_groupnum]].attribute.thread_arts == 0 || default_thread_arts == 0) {
  1453. ! if (debug == 2) {
  1454. !     error_message("Returning before threading", "");
  1455. ! }
  1456. X          return;
  1457. X      }
  1458. X  
  1459. + if (debug == 2) {
  1460. +     error_message("Threading", "");
  1461. + }
  1462. X      for (i = 0; i < top; i++) {
  1463. X          if (arts[i].thread != ART_NORMAL || IGNORE_ART(i)) {
  1464. X              continue;
  1465. ***************
  1466. *** 456,462 ****
  1467. X      /*
  1468. X       *  dump group header info.
  1469. X       */
  1470. !     if (sort_art_type != SORT_BY_NOTHING) {
  1471. X          qsort ((char *) arts, top, sizeof (struct article_t), artnum_comp);
  1472. X      }
  1473. X      fprintf (fp, "%s\n", group);
  1474. --- 478,484 ----
  1475. X      /*
  1476. X       *  dump group header info.
  1477. X       */
  1478. !     if (default_sort_art_type != SORT_BY_NOTHING) {
  1479. X          qsort ((char *) arts, top, sizeof (struct article_t), artnum_comp);
  1480. X      }
  1481. X      fprintf (fp, "%s\n", group);
  1482. ***************
  1483. *** 910,917 ****
  1484. X  
  1485. X      if (verbose) {
  1486. X          time (&end_epoch);
  1487. !         sprintf (msg, "%s %d groups in %ld seconds\n", 
  1488. !             (catchup ? "Caughtup" : "Updated"), group_top, end_epoch - beg_epoch);
  1489. X          wait_message (msg);
  1490. X      }
  1491. X  }
  1492. --- 932,940 ----
  1493. X  
  1494. X      if (verbose) {
  1495. X          time (&end_epoch);
  1496. !         sprintf (msg, txt_catchup_update_info,
  1497. !             (catchup ? "Caughtup" : "Updated"), 
  1498. !             group_top, end_epoch - beg_epoch);
  1499. X          wait_message (msg);
  1500. X      }
  1501. X  }
  1502. ***************
  1503. *** 1048,1054 ****
  1504. X      struct article_t *s2 = (struct article_t *) p2;
  1505. X  
  1506. X      /* return result of strcmp (reversed for descending) */
  1507. !     return (sort_art_type == SORT_BY_SUBJ_ASCEND 
  1508. X              ? my_stricmp (s1->subject, s2->subject) 
  1509. X              : my_stricmp (s2->subject, s1->subject));
  1510. X  }
  1511. --- 1071,1077 ----
  1512. X      struct article_t *s2 = (struct article_t *) p2;
  1513. X  
  1514. X      /* return result of strcmp (reversed for descending) */
  1515. !     return (default_sort_art_type == SORT_BY_SUBJ_ASCEND 
  1516. X              ? my_stricmp (s1->subject, s2->subject) 
  1517. X              : my_stricmp (s2->subject, s1->subject));
  1518. X  }
  1519. ***************
  1520. *** 1062,1068 ****
  1521. X      struct article_t *s2 = (struct article_t *) p2;
  1522. X  
  1523. X      /* return result of strcmp (reversed for descending) */
  1524. !     return (sort_art_type == SORT_BY_FROM_ASCEND 
  1525. X              ? my_stricmp (s1->from, s2->from) 
  1526. X              : my_stricmp (s2->from, s1->from));
  1527. X  }
  1528. --- 1085,1091 ----
  1529. X      struct article_t *s2 = (struct article_t *) p2;
  1530. X  
  1531. X      /* return result of strcmp (reversed for descending) */
  1532. !     return (default_sort_art_type == SORT_BY_FROM_ASCEND 
  1533. X              ? my_stricmp (s1->from, s2->from) 
  1534. X              : my_stricmp (s2->from, s1->from));
  1535. X  }
  1536. ***************
  1537. *** 1075,1081 ****
  1538. X      struct article_t *s1 = (struct article_t *) p1;
  1539. X      struct article_t *s2 = (struct article_t *) p2;
  1540. X      /* return result of strcmp (reversed for descending) */
  1541. !     return (sort_art_type == SORT_BY_DATE_ASCEND 
  1542. X              ? strcmp (s1->date, s2->date) 
  1543. X              : strcmp (s2->date, s1->date));
  1544. X  }
  1545. --- 1098,1104 ----
  1546. X      struct article_t *s1 = (struct article_t *) p1;
  1547. X      struct article_t *s2 = (struct article_t *) p2;
  1548. X      /* return result of strcmp (reversed for descending) */
  1549. !     return (default_sort_art_type == SORT_BY_DATE_ASCEND 
  1550. X              ? strcmp (s1->date, s2->date) 
  1551. X              : strcmp (s2->date, s1->date));
  1552. X  }
  1553. Files ../1.14/common.patch and ./common.patch are identical
  1554. diff -rcs ../1.14/curses.c ./curses.c
  1555. *** ../1.14/curses.c    Tue Aug 11 21:23:03 1992
  1556. --- ./curses.c    Mon Jul 20 12:51:09 1992
  1557. ***************
  1558. *** 2,9 ****
  1559. X   *  Project   : tin - a threaded Netnews reader
  1560. X   *  Module    : curses.c
  1561. X   *  Author    : D.Taylor & I.Lea
  1562. !  *  Created   : ??-??-86
  1563. !  *  Updated   : 20-06-92
  1564. X   *  Notes     : This is a screen management library borrowed with permission
  1565. X   *              from the Elm mail system (a great mailer--I highly recommend
  1566. X   *              it!).This library was hacked to provide what tin needs.
  1567. --- 2,9 ----
  1568. X   *  Project   : tin - a threaded Netnews reader
  1569. X   *  Module    : curses.c
  1570. X   *  Author    : D.Taylor & I.Lea
  1571. !  *  Created   : 01-01-86
  1572. !  *  Updated   : 06-07-92
  1573. X   *  Notes     : This is a screen management library borrowed with permission
  1574. X   *              from the Elm mail system (a great mailer--I highly recommend
  1575. X   *              it!).This library was hacked to provide what tin needs.
  1576. ***************
  1577. *** 46,51 ****
  1578. --- 46,55 ----
  1579. X  #        else
  1580. X  #            include <sgtty.h>
  1581. X  #        endif
  1582. + #    else
  1583. + #        ifdef HPUX
  1584. + #            include <termio.h>
  1585. + #        endif
  1586. X  #    endif
  1587. X  #endif
  1588. X  
  1589. ***************
  1590. *** 58,66 ****
  1591. X  #endif
  1592. X  
  1593. X  #if defined(BSD) || defined(MINIX)
  1594. X  #    define TCGETA    TIOCGETP
  1595. X  #    define TCSETAW    TIOCSETP
  1596. X  struct sgttyb _raw_tty,
  1597. X            _original_tty;
  1598. X  #else
  1599. --- 62,75 ----
  1600. X  #endif
  1601. X  
  1602. X  #if defined(BSD) || defined(MINIX)
  1603. + #    ifdef TCGETA
  1604. + #        undef TCGETA
  1605. + #    endif
  1606. X  #    define TCGETA    TIOCGETP
  1607. + #    ifdef TCSETAW
  1608. + #        undef TCSETAW
  1609. + #    endif
  1610. X  #    define TCSETAW    TIOCSETP
  1611. X  struct sgttyb _raw_tty,
  1612. X            _original_tty;
  1613. X  #else
  1614. ***************
  1615. *** 163,169 ****
  1616. X          _lines = DEFAULT_LINES_ON_TERMINAL;
  1617. X      if (_columns == -1)
  1618. X          _columns = DEFAULT_COLUMNS_ON_TERMINAL;
  1619. !     /* kludge to workaround no inverse */
  1620. X      if (_setinverse == 0) {
  1621. X          _setinverse = _setunderline;
  1622. X          _clearinverse = _clearunderline;
  1623. --- 172,180 ----
  1624. X          _lines = DEFAULT_LINES_ON_TERMINAL;
  1625. X      if (_columns == -1)
  1626. X          _columns = DEFAULT_COLUMNS_ON_TERMINAL;
  1627. !     /* 
  1628. !      * kludge to workaround no inverse 
  1629. !      */
  1630. X      if (_setinverse == 0) {
  1631. X          _setinverse = _setunderline;
  1632. X          _clearinverse = _clearunderline;
  1633. ***************
  1634. *** 227,238 ****
  1635. X  void set_keypad_on ()
  1636. X  {
  1637. X  #ifndef INDEX_DAEMON
  1638. ! /*
  1639. X       if (_keypadxmit) {
  1640. X          tputs (_keypadxmit, 1, outchar);
  1641. X          fflush (stdout);
  1642. X      }
  1643. ! */
  1644. X  #endif /* INDEX_DAEMON */
  1645. X  }
  1646. X  
  1647. --- 238,249 ----
  1648. X  void set_keypad_on ()
  1649. X  {
  1650. X  #ifndef INDEX_DAEMON
  1651. ! #    ifdef HPUX
  1652. X       if (_keypadxmit) {
  1653. X          tputs (_keypadxmit, 1, outchar);
  1654. X          fflush (stdout);
  1655. X      }
  1656. ! #    endif
  1657. X  #endif /* INDEX_DAEMON */
  1658. X  }
  1659. X  
  1660. ***************
  1661. *** 239,250 ****
  1662. X  void set_keypad_off ()
  1663. X  {
  1664. X  #ifndef INDEX_DAEMON
  1665. ! /*
  1666. X      if (_keypadlocal) {
  1667. X          tputs (_keypadlocal, 1, outchar);
  1668. X          fflush (stdout);
  1669. X      }
  1670. ! */
  1671. X  #endif /* INDEX_DAEMON */
  1672. X  }
  1673. X  
  1674. --- 250,261 ----
  1675. X  void set_keypad_off ()
  1676. X  {
  1677. X  #ifndef INDEX_DAEMON
  1678. ! #    ifdef HPUX
  1679. X      if (_keypadlocal) {
  1680. X          tputs (_keypadlocal, 1, outchar);
  1681. X          fflush (stdout);
  1682. X      }
  1683. ! #    endif
  1684. X  #endif /* INDEX_DAEMON */
  1685. X  }
  1686. X  
  1687. ***************
  1688. *** 387,398 ****
  1689. X      if (state == FALSE && _inraw) {
  1690. X        (void) ioctl(TTYIN, TCSETAW, &_original_tty);
  1691. X        _inraw = 0;
  1692. !     }
  1693. !     else if (state == TRUE && ! _inraw) {
  1694. X        (void) ioctl(TTYIN, TCGETA, &_original_tty);    /** current setting **/
  1695. X        (void) ioctl(TTYIN, TCGETA, &_raw_tty);    /** again! **/
  1696. X  #if defined(BSD) || defined(MINIX)
  1697. X        _raw_tty.sg_flags &= ~(ECHO | CRMOD);    /* echo off */
  1698. X        _raw_tty.sg_flags |= CBREAK;    /* raw on    */
  1699. --- 398,407 ----
  1700. X      if (state == FALSE && _inraw) {
  1701. X        (void) ioctl(TTYIN, TCSETAW, &_original_tty);
  1702. X        _inraw = 0;
  1703. !     } else if (state == TRUE && ! _inraw) {
  1704. X        (void) ioctl(TTYIN, TCGETA, &_original_tty);    /** current setting **/
  1705. X        (void) ioctl(TTYIN, TCGETA, &_raw_tty);    /** again! **/
  1706. X  #if defined(BSD) || defined(MINIX)
  1707. X        _raw_tty.sg_flags &= ~(ECHO | CRMOD);    /* echo off */
  1708. X        _raw_tty.sg_flags |= CBREAK;    /* raw on    */
  1709. ***************
  1710. *** 404,410 ****
  1711. X  #endif
  1712. X  
  1713. X        (void) ioctl(TTYIN, TCSETAW, &_raw_tty);
  1714. X        _inraw = 1;
  1715. X      }
  1716. X      
  1717. --- 413,418 ----
  1718. ***************
  1719. *** 436,442 ****
  1720. X  
  1721. X      return ((result == EOF) ? EOF : result & 0xFF);
  1722. X  #else
  1723. X      while ((result = read(0, &ch, 1)) < 0 && errno == EINTR)
  1724. X          ;    /* spin on signal interrupts */
  1725. X  
  1726. --- 444,449 ----
  1727. diff -rcs ../1.14/debug.c ./debug.c
  1728. *** ../1.14/debug.c    Tue Aug 11 21:23:03 1992
  1729. --- ./debug.c    Fri Jul 31 18:33:23 1992
  1730. ***************
  1731. *** 3,9 ****
  1732. X   *  Module    : debug.c
  1733. X   *  Author    : I.Lea
  1734. X   *  Created   : 01-04-91
  1735. !  *  Updated   : 03-06-92
  1736. X   *  Notes     : debug routines
  1737. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1738. X   *              You may  freely  copy or  redistribute  this software,
  1739. --- 3,9 ----
  1740. X   *  Module    : debug.c
  1741. X   *  Author    : I.Lea
  1742. X   *  Created   : 01-04-91
  1743. !  *  Updated   : 31-07-92
  1744. X   *  Notes     : debug routines
  1745. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1746. X   *              You may  freely  copy or  redistribute  this software,
  1747. ***************
  1748. *** 112,117 ****
  1749. --- 112,157 ----
  1750. X  }
  1751. X  
  1752. X  
  1753. + void debug_save_comp ()
  1754. + {
  1755. + #ifdef DEBUG
  1756. +     FILE *fp;
  1757. +     int i;
  1758. +     
  1759. +     if (debug != 2)
  1760. +         return;
  1761. +     if ((fp = fopen ("/tmp/SAVE_COMP","a+")) != NULL) {
  1762. +         for (i = 0 ; i < num_save ; i++) {
  1763. +             fprintf (fp,"subj=[%-38s]\n", save[i].subject);
  1764. +             fprintf (fp,"dir=[%s]  file=[%s]\n", save[i].dir, save[i].file);
  1765. +              if (save[i].archive) {
  1766. +                  fprintf (fp, "arch=[%-38s]  ", save[i].archive);
  1767. +              } else {
  1768. +                  fprintf (fp, "arch=[]  ");
  1769. +              }
  1770. +              if (save[i].part) {
  1771. +                  fprintf (fp, "part=[%s]  ", save[i].part);
  1772. +              } else {
  1773. +                  fprintf (fp, "part=[]  ");
  1774. +              }
  1775. +              if (save[i].patch) {
  1776. +                  fprintf (fp, "patch=[%s]\n", save[i].patch);
  1777. +             } else {
  1778. +                  fprintf (fp, "patch=[]\n");
  1779. +              }
  1780. +             fprintf (fp,"index=[%d]  saved=[%d]  mailbox=[%d]\n\n",
  1781. +                 save[i].index, save[i].saved, save[i].is_mailbox);
  1782. +         }    
  1783. +         fflush (fp);
  1784. +         fclose (fp);
  1785. +         chmod ("/tmp/SAVE_COMP", 0666);
  1786. +     }
  1787. + #endif
  1788. + }
  1789. X  void debug_print_comment (comment)
  1790. X      char *comment;
  1791. X  {
  1792. ***************
  1793. *** 163,182 ****
  1794. X  
  1795. X      if ((fp = fopen ("/tmp/ACTIVE","w")) != NULL) {
  1796. X          for (i = 0; i < num_active; i++) {    /* for each group */
  1797. !             fprintf (fp, "[%4d]=[%-28s] max=[%4ld] min=[%4ld] mod=[%c] nxt=[%4d] flag=[%d]\n",
  1798. X                  i, active[i].name, active[i].max, active[i].min,
  1799. !                 active[i].moderated, active[i].next, active[i].flag);
  1800. X              fprintf (fp, "hash=[%ld]  description=[%s]\n", hash_groupname (active[i].name), 
  1801. X                  (active[i].description ? active[i].description : ""));
  1802. X              fprintf (fp, "read=[%d] show=[%d] thread=[%d] sort=[%d] author=[%d] auto=[%d] process=[%d]\n",
  1803. !                 active[i].attribute.read,    active[i].attribute.showall,
  1804. !                 active[i].attribute.thread,  active[i].attribute.sortby,
  1805. !                 active[i].attribute.author,  active[i].attribute.autosave,
  1806. !                 active[i].attribute.process);
  1807. !             fprintf (fp, "server=[%s] ", (active[i].attribute.server  == (char *) 0 ? "" : active[i].attribute.server));
  1808. X              fprintf (fp, "maildir=[%s] ",(active[i].attribute.maildir == (char *) 0 ? "" : active[i].attribute.maildir));            
  1809. X              fprintf (fp, "savedir=[%s] ",(active[i].attribute.savedir == (char *) 0 ? "" : active[i].attribute.savedir));
  1810. !             fprintf (fp, "sigfile=[%s]\n\n",(active[i].attribute.sigfile == (char *) 0 ? "" : active[i].attribute.sigfile));
  1811. X          }
  1812. X          fflush (fp);
  1813. X          fclose (fp);
  1814. --- 203,225 ----
  1815. X  
  1816. X      if ((fp = fopen ("/tmp/ACTIVE","w")) != NULL) {
  1817. X          for (i = 0; i < num_active; i++) {    /* for each group */
  1818. !             fprintf (fp, "[%4d]=[%-28s] max=[%4ld] min=[%4ld] mod=[%c] nxt=[%4d] my_group=[%d]\n",
  1819. X                  i, active[i].name, active[i].max, active[i].min,
  1820. !                 active[i].moderated, active[i].next, active[i].my_group);
  1821. X              fprintf (fp, "hash=[%ld]  description=[%s]\n", hash_groupname (active[i].name), 
  1822. X                  (active[i].description ? active[i].description : ""));
  1823. X              fprintf (fp, "read=[%d] show=[%d] thread=[%d] sort=[%d] author=[%d] auto=[%d] process=[%d]\n",
  1824. !                 active[i].attribute.read_during_session,
  1825. !                 active[i].attribute.show_only_unread,
  1826. !                 active[i].attribute.thread_arts,
  1827. !                 active[i].attribute.sort_art_type,
  1828. !                 active[i].attribute.show_author,  
  1829. !                 active[i].attribute.auto_save,
  1830. !                 active[i].attribute.post_proc_type);
  1831. X              fprintf (fp, "maildir=[%s] ",(active[i].attribute.maildir == (char *) 0 ? "" : active[i].attribute.maildir));            
  1832. X              fprintf (fp, "savedir=[%s] ",(active[i].attribute.savedir == (char *) 0 ? "" : active[i].attribute.savedir));
  1833. !             fprintf (fp, "sigfile=[%s] ",(active[i].attribute.sigfile == (char *) 0 ? "" : active[i].attribute.sigfile));
  1834. !             fprintf (fp, "followup_to=[%s]\n\n", (active[i].attribute.followup_to  == (char *) 0 ? "" : active[i].attribute.followup_to));
  1835. X          }
  1836. X          fflush (fp);
  1837. X          fclose (fp);
  1838. diff -rcs ../1.14/extern.h ./extern.h
  1839. *** ../1.14/extern.h    Tue Aug 11 21:23:27 1992
  1840. --- ./extern.h    Fri Aug  7 11:46:41 1992
  1841. ***************
  1842. *** 3,9 ****
  1843. X   *  Module    : extern.h
  1844. X   *  Author    : I.Lea
  1845. X   *  Created   : 01-04-91
  1846. !  *  Updated   : 20-06-92
  1847. X   *  Notes     :
  1848. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1849. X   *              You may  freely  copy or  redistribute  this software,
  1850. --- 3,9 ----
  1851. X   *  Module    : extern.h
  1852. X   *  Author    : I.Lea
  1853. X   *  Created   : 01-04-91
  1854. !  *  Updated   : 07-08-92
  1855. X   *  Notes     :
  1856. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1857. X   *              You may  freely  copy or  redistribute  this software,
  1858. ***************
  1859. *** 69,80 ****
  1860. X  extern char *help_thread[];
  1861. X  extern char active_file[PATH_LEN];
  1862. X  extern char add_addr[LEN];
  1863. - extern char default_art_search[LEN];
  1864. X  extern char article[PATH_LEN];
  1865. ! extern char default_author_search[LEN];
  1866. X  extern char bug_addr[LEN];
  1867. X  extern char cvers[LEN];
  1868. X  extern char dead_article[PATH_LEN];
  1869. X  extern char default_crosspost_group[LEN];
  1870. X  extern char default_mail_address[LEN];
  1871. X  extern char default_pipe_command[LEN];
  1872. --- 69,82 ----
  1873. X  extern char *help_thread[];
  1874. X  extern char active_file[PATH_LEN];
  1875. X  extern char add_addr[LEN];
  1876. X  extern char article[PATH_LEN];
  1877. ! extern char attributes_file[PATH_LEN];
  1878. X  extern char bug_addr[LEN];
  1879. + extern char cmd_line_printer[LEN];
  1880. X  extern char cvers[LEN];
  1881. X  extern char dead_article[PATH_LEN];
  1882. + extern char default_art_search[LEN];
  1883. + extern char default_author_search[LEN];
  1884. X  extern char default_crosspost_group[LEN];
  1885. X  extern char default_mail_address[LEN];
  1886. X  extern char default_pipe_command[LEN];
  1887. ***************
  1888. *** 87,97 ****
  1889. --- 89,104 ----
  1890. X  extern char default_goto_group[LEN];
  1891. X  extern char default_group_search[LEN];
  1892. X  extern char default_maildir[PATH_LEN];
  1893. + extern char default_savedir[PATH_LEN];
  1894. + extern char default_sigfile[PATH_LEN];
  1895. + extern char default_signature[PATH_LEN];
  1896. + extern char default_subject_search[LEN];
  1897. X  extern char homedir[PATH_LEN];
  1898. X  extern char indexdir[PATH_LEN];
  1899. X  extern char killfile[PATH_LEN];
  1900. X  extern char killfrom[LEN];
  1901. X  extern char killsubj[LEN];
  1902. + extern char lock_file[PATH_LEN];
  1903. X  extern char mail_news_user[LEN];
  1904. X  extern char mailbox[PATH_LEN];
  1905. X  extern char mailer[PATH_LEN];
  1906. ***************
  1907. *** 98,127 ****
  1908. X  extern char msg[LEN];
  1909. X  extern char my_distribution[LEN];
  1910. X  extern char my_org[LEN];
  1911. X  extern char newsgroups_file[PATH_LEN];
  1912. X  extern char newnewsrc[PATH_LEN];
  1913. X  extern char newsrc[PATH_LEN];
  1914. ! extern char nntp_server[LEN];
  1915. X  extern char page_header[LEN];
  1916. X  extern char postfile[PATH_LEN];
  1917. X  extern char printer[LEN];
  1918. - extern char cmd_line_printer[LEN];
  1919. X  extern char proc_ch_default;                /* set in change_rcfile () */
  1920. X  extern char progname[PATH_LEN];
  1921. X  extern char rcdir[PATH_LEN];
  1922. X  extern char rcfile[PATH_LEN];
  1923. X  extern char redirect_output[LEN];
  1924. X  extern char reply_to[LEN];
  1925. - extern char default_savedir[PATH_LEN];
  1926. - extern char default_sigfile[PATH_LEN];
  1927. - extern char default_signature[PATH_LEN];
  1928. X  extern char spooldir[PATH_LEN];
  1929. X  extern char spooldir_alias[PATH_LEN];
  1930. - extern char default_subject_search[LEN];
  1931. X  extern char subscriptions_file[PATH_LEN];
  1932. ! extern char txt_help_bug_report[LEN];
  1933. ! extern char unthreadfile[PATH_LEN];
  1934. ! extern char userid[LEN];
  1935. X  
  1936. X  extern char txt_1_resp[];
  1937. X  extern char txt_active_file_is_empty[];
  1938. --- 105,130 ----
  1939. X  extern char msg[LEN];
  1940. X  extern char my_distribution[LEN];
  1941. X  extern char my_org[LEN];
  1942. + extern char new_active_file_attribute[32];
  1943. + extern char new_active_file_server[PATH_LEN];
  1944. X  extern char newsgroups_file[PATH_LEN];
  1945. X  extern char newnewsrc[PATH_LEN];
  1946. X  extern char newsrc[PATH_LEN];
  1947. ! extern char *nntp_server;
  1948. X  extern char page_header[LEN];
  1949. X  extern char postfile[PATH_LEN];
  1950. X  extern char printer[LEN];
  1951. X  extern char proc_ch_default;                /* set in change_rcfile () */
  1952. X  extern char progname[PATH_LEN];
  1953. + extern char quote_chars[PATH_LEN];
  1954. X  extern char rcdir[PATH_LEN];
  1955. X  extern char rcfile[PATH_LEN];
  1956. X  extern char redirect_output[LEN];
  1957. X  extern char reply_to[LEN];
  1958. X  extern char spooldir[PATH_LEN];
  1959. X  extern char spooldir_alias[PATH_LEN];
  1960. X  extern char subscriptions_file[PATH_LEN];
  1961. ! extern char userid[PATH_LEN];
  1962. X  
  1963. X  extern char txt_1_resp[];
  1964. X  extern char txt_active_file_is_empty[];
  1965. ***************
  1966. *** 150,155 ****
  1967. --- 153,161 ----
  1968. X  extern char txt_cannot_open_active_file[];
  1969. X  extern char txt_cannot_open_art[];
  1970. X  extern char txt_cannot_post[];
  1971. + extern char txt_cannot_change_spooldir[];
  1972. + extern char txt_catchup_update_info[];
  1973. + extern char txt_changing_sppoldir_to[];
  1974. X  extern char txt_checking[];
  1975. X  extern char txt_checking_active_file[];
  1976. X  extern char txt_checking_for_news[];
  1977. ***************
  1978. *** 183,188 ****
  1979. --- 189,195 ----
  1980. X  extern char txt_spooldir_com[];
  1981. X  extern char txt_group_selection[];
  1982. X  extern char txt_group_undeleted[];
  1983. + extern char txt_help_bug_report[LEN];
  1984. X  extern char txt_help_4[];
  1985. X  extern char txt_help_C[];
  1986. X  extern char txt_help_I[];
  1987. ***************
  1988. *** 198,203 ****
  1989. --- 205,211 ----
  1990. X  extern char txt_help_b[];
  1991. X  extern char txt_help_bug[];
  1992. X  extern char txt_help_c[];
  1993. + extern char txt_help_cC[];
  1994. X  extern char txt_help_ck[];
  1995. X  extern char txt_help_cr[];
  1996. X  extern char txt_help_catchup_groups[];
  1997. ***************
  1998. *** 221,226 ****
  1999. --- 229,235 ----
  2000. X  extern char txt_help_g_ctrl_r[];
  2001. X  extern char txt_help_g_l[];
  2002. X  extern char txt_help_g_q[];
  2003. + extern char txt_help_g_r[];
  2004. X  extern char txt_help_g_search[];
  2005. X  extern char txt_help_g_tab[];
  2006. X  extern char txt_help_g_y[];
  2007. ***************
  2008. *** 310,315 ****
  2009. --- 319,325 ----
  2010. X  extern char txt_index_page_com[];
  2011. X  extern char txt_indexing[];
  2012. X  extern char txt_indexing_num[];
  2013. + extern char txt_ispell_define_not_compiled[];
  2014. X  extern char txt_inverse_off[];
  2015. X  extern char txt_inverse_on[];
  2016. X  extern char txt_kill_from[];
  2017. ***************
  2018. *** 358,363 ****
  2019. --- 368,374 ----
  2020. X  extern char txt_no_resp[];
  2021. X  extern char txt_no_resps_in_thread[];
  2022. X  extern char txt_no_search_string[];
  2023. + extern char txt_no_spooldirs[];
  2024. X  extern char txt_no_subject[];
  2025. X  extern char txt_not_active_newsfeed[];
  2026. X  extern char txt_not_in_active_file[];
  2027. ***************
  2028. *** 412,417 ****
  2029. --- 423,429 ----
  2030. X  extern char txt_read_art[];
  2031. X  extern char txt_read_resp[];
  2032. X  extern char txt_reading_active_file[];
  2033. + extern char txt_reading_attributes_file[];
  2034. X  extern char txt_reading_newsgroups_file[];
  2035. X  extern char txt_rejected_by_nntpserver[];
  2036. X  extern char txt_rename_error[];
  2037. ***************
  2038. *** 449,454 ****
  2039. --- 461,469 ----
  2040. X  extern char txt_sort_by_nothing[];
  2041. X  extern char txt_sort_by_subj_ascend[];
  2042. X  extern char txt_sort_by_subj_descend[];
  2043. + extern char txt_spooldir_server_error_1[];
  2044. + extern char txt_spooldir_server_error_2[];
  2045. + extern char txt_spooldirs_not_supported[];
  2046. X  extern char txt_stuff_nntp_cannot_open[];
  2047. X  extern char txt_subscribe_pattern[];
  2048. X  extern char txt_subscribe_to_new_group[];
  2049. ***************
  2050. *** 486,512 ****
  2051. X  extern char txt_yanking_sub_groups[];
  2052. X  extern char txt_you_have_mail[];
  2053. X  
  2054. X  extern int LINES, COLS;
  2055. X  extern int MORE_POS;
  2056. X  extern int NOTESLINES;
  2057. X  extern int RIGHT_POS;
  2058. X  extern int *my_group;
  2059. ! extern int *unread;
  2060. X  extern int can_post;
  2061. X  extern int catchup;
  2062. X  extern int catchup_read_groups;
  2063. X  extern int cmd_line;
  2064. X  extern int compiled_with_nntp;
  2065. X  extern int confirm_action;
  2066. X  extern int created_rcdir;
  2067. X  extern int debug;
  2068. X  extern int default_move_group;
  2069. X  extern int default_printer;
  2070. X  extern int default_show_author;
  2071. X  #ifdef SIGTSTP
  2072. X  extern int do_sigtstp;
  2073. X  #endif
  2074. X  extern int draw_arrow_mark;
  2075. X  extern int full_page_scroll;
  2076. X  extern int group_hash[TABLE_SIZE];
  2077. X  extern int group_top;
  2078. --- 501,539 ----
  2079. X  extern char txt_yanking_sub_groups[];
  2080. X  extern char txt_you_have_mail[];
  2081. X  
  2082. + extern int unread_art_mark;
  2083. + extern int hot_art_mark;
  2084. + extern int return_art_mark;
  2085. X  extern int LINES, COLS;
  2086. X  extern int MORE_POS;
  2087. X  extern int NOTESLINES;
  2088. X  extern int RIGHT_POS;
  2089. X  extern int *my_group;
  2090. ! extern int old_active_file_size;
  2091. X  extern int can_post;
  2092. X  extern int catchup;
  2093. X  extern int catchup_read_groups;
  2094. + extern int check_for_new_newsgroups;
  2095. X  extern int cmd_line;
  2096. X  extern int compiled_with_nntp;
  2097. X  extern int confirm_action;
  2098. X  extern int created_rcdir;
  2099. + extern int cur_active_size;
  2100. X  extern int debug;
  2101. + extern int default_auto_save;
  2102. + extern int default_batch_save;
  2103. X  extern int default_move_group;
  2104. + extern int default_post_proc_type;
  2105. X  extern int default_printer;
  2106. X  extern int default_show_author;
  2107. + extern int default_show_only_unread;
  2108. + extern int default_sort_art_type;
  2109. + extern int default_thread_arts;
  2110. X  #ifdef SIGTSTP
  2111. X  extern int do_sigtstp;
  2112. X  #endif
  2113. X  extern int draw_arrow_mark;
  2114. + extern int force_screen_redraw;
  2115. X  extern int full_page_scroll;
  2116. X  extern int group_hash[TABLE_SIZE];
  2117. X  extern int group_top;
  2118. ***************
  2119. *** 516,538 ****
  2120. X  extern int inverse_okay;
  2121. X  extern int killed_articles;
  2122. X  extern int kill_level;
  2123. - extern int kill_num;
  2124. X  extern int local_index;
  2125. X  extern int mail_news;
  2126. X  extern int mark_saved_read;
  2127. X  extern int max_active;
  2128. X  extern int max_art;
  2129. X  extern int max_from;
  2130. X  extern int max_subj;
  2131. X  extern int max_kill;
  2132. X  extern int max_save;
  2133. X  extern int nntp_codeno;
  2134. X  extern int num_active;
  2135. X  extern int num_of_hot_arts;
  2136. X  extern int num_of_killed_arts;
  2137. X  extern int num_of_tagged_arts;
  2138. X  extern int pos_first_unread;
  2139. - extern int post_proc_type;
  2140. X  extern int print_header;
  2141. X  extern int process_id;
  2142. X  extern int read_news_via_nntp;
  2143. --- 543,569 ----
  2144. X  extern int inverse_okay;
  2145. X  extern int killed_articles;
  2146. X  extern int kill_level;
  2147. X  extern int local_index;
  2148. X  extern int mail_news;
  2149. X  extern int mark_saved_read;
  2150. X  extern int max_active;
  2151. + extern int max_active_size;
  2152. X  extern int max_art;
  2153. X  extern int max_from;
  2154. X  extern int max_subj;
  2155. X  extern int max_kill;
  2156. X  extern int max_save;
  2157. + extern int max_spooldir;
  2158. X  extern int nntp_codeno;
  2159. X  extern int num_active;
  2160. + extern int num_active_size;
  2161. + extern int num_kill;
  2162. X  extern int num_of_hot_arts;
  2163. X  extern int num_of_killed_arts;
  2164. X  extern int num_of_tagged_arts;
  2165. + extern int num_save;
  2166. + extern int num_spooldir;
  2167. X  extern int pos_first_unread;
  2168. X  extern int print_header;
  2169. X  extern int process_id;
  2170. X  extern int read_news_via_nntp;
  2171. ***************
  2172. *** 540,560 ****
  2173. X  extern int real_uid;
  2174. SHAR_EOF
  2175. true || echo 'restore of tin-1.15.patch failed'
  2176. fi
  2177. echo 'End of tin-1.15 part 2'
  2178. echo 'File tin-1.15.patch is continued in part 3'
  2179. echo 3 > _shar_seq_.tmp
  2180. exit 0
  2181.  
  2182. --
  2183. NAME   Iain Lea 
  2184. EMAIL  iain%anl433.uucp@Germany.EU.net
  2185. SNAIL  Siemens AG, ANL A433SZ, Gruendlacher Str. 248, 8510 Fuerth, Germany.
  2186. PHONE  +49-911-3089-407 (work) +49-911-331963 (home) +49-911-3089-290 (FAX)  
  2187. exit 0 # Just in case...
  2188.