home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sources / misc / 3810 < prev    next >
Encoding:
Text File  |  1992-08-15  |  60.8 KB  |  2,258 lines

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