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

  1. Newsgroups: comp.sources.misc
  2. Path: sparky!kent
  3. From: iain%anl433.uucp@Germany.EU.net (Iain Lea)
  4. Subject:  v31i082:  tin - threaded full screen newsreader v1.1, Patch05c/7
  5. Message-ID: <1992Aug16.012519.12579@sparky.imd.sterling.com>
  6. Followup-To: comp.sources.d
  7. X-Md4-Signature: bb8ea06dc421b2edb2b1f04b7845baed
  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:25:19 GMT
  13. Approved: kent@sparky.imd.sterling.com
  14. Lines: 2268
  15.  
  16. Submitted-by: iain%anl433.uucp@Germany.EU.net (Iain Lea)
  17. Posting-number: Volume 31, Issue 82
  18. Archive-name: tin/patch05c
  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.03 (part 3 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" != 3; 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. X  extern int real_umask;
  45. X  extern int reread_active_file;
  46. ! extern int save_archive_name;
  47. X  extern int save_news;
  48. - extern int save_num;
  49. X  extern int show_author;
  50. X  extern int show_description;
  51. ! extern int show_only_unread;
  52. ! extern int sort_art_type;
  53. X  extern int space_mode;
  54. X  extern int spooldir_is_active;
  55. X  extern int start_editor_offset;
  56. X  extern int start_line_offset;
  57. X  extern int system_status;
  58. - extern int thread_arts;
  59. X  extern int tin_gid;
  60. X  extern int tin_uid;
  61. X  extern int top;
  62. X  extern int top_base;
  63. X  extern int unlink_article;
  64. --- 571,590 ----
  65. X  extern int real_uid;
  66. X  extern int real_umask;
  67. X  extern int reread_active_file;
  68. ! extern int reread_active_file_secs;
  69. X  extern int save_news;
  70. X  extern int show_author;
  71. X  extern int show_description;
  72. ! extern int show_last_line_prev_page;
  73. ! extern int show_only_unread_groups;
  74. X  extern int space_mode;
  75. X  extern int spooldir_is_active;
  76. X  extern int start_editor_offset;
  77. X  extern int start_line_offset;
  78. X  extern int system_status;
  79. X  extern int tin_gid;
  80. X  extern int tin_uid;
  81. + extern int tab_after_X_selection;
  82. X  extern int top;
  83. X  extern int top_base;
  84. X  extern int unlink_article;
  85. ***************
  86. *** 563,569 ****
  87. X  extern int update_fork;
  88. X  extern int check_any_unread;
  89. X  extern int start_any_unread;
  90. - extern int notify_new_groups;
  91. X  extern int xindex_supported;
  92. X  extern int xuser_supported;
  93. X  extern int xspooldir_supported;
  94. --- 593,598 ----
  95. ***************
  96. *** 573,581 ****
  97. --- 602,612 ----
  98. X  extern struct passwd *myentry;
  99. X  extern struct article_t *arts;
  100. X  extern struct group_t *active;
  101. + extern struct active_size_t *active_size;
  102. X  extern struct kill_t *killf;
  103. X  extern struct posted_t *posted;
  104. X  extern struct save_t *save;
  105. + extern struct spooldir_t *spooldirs;
  106. X  extern struct screen_t *screen;
  107. X  
  108. X  #ifdef POSIX_JOB_CONTROL
  109. diff -rcs ../1.14/feed.c ./feed.c
  110. *** ../1.14/feed.c    Tue Aug 11 21:23:04 1992
  111. --- ./feed.c    Fri Jul 24 18:59:53 1992
  112. ***************
  113. *** 3,9 ****
  114. X   *  Module    : feed.c
  115. X   *  Author    : I.Lea
  116. X   *  Created   : 31-08-91
  117. !  *  Updated   : 18-06-92
  118. X   *  Notes     : provides same interface to mail,pipe,print and save commands
  119. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  120. X   *              You may  freely  copy or  redistribute  this software,
  121. --- 3,9 ----
  122. X   *  Module    : feed.c
  123. X   *  Author    : I.Lea
  124. X   *  Created   : 31-08-91
  125. !  *  Updated   : 23-07-92
  126. X   *  Notes     : provides same interface to mail,pipe,print and save commands
  127. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  128. X   *              You may  freely  copy or  redistribute  this software,
  129. ***************
  130. *** 73,86 ****
  131. X       */
  132. X      if (num_of_tagged_arts) {
  133. X          ch_default = 'T';
  134. !     } else if (num_of_hot_arts) {
  135. X          ch_default = 'h';
  136. X      } else if (num_of_responses (b)) {
  137. X          ch_default = 't';
  138. X      }
  139. X  
  140. !     if ((save_archive_name == FALSE || arts[respnum].archive == (char *) 0) ||
  141. !         (save_archive_name == TRUE && function != FEED_SAVE) ||
  142. X          ch_default == 'T') {
  143. X          do {
  144. X              sprintf (msg, "%s%s%c", prompt, txt_art_thread_regex_tag, ch_default);
  145. --- 73,88 ----
  146. X       */
  147. X      if (num_of_tagged_arts) {
  148. X          ch_default = 'T';
  149. !     } else if (num_of_hot_arts && default_auto_save == FALSE) {
  150. X          ch_default = 'h';
  151. X      } else if (num_of_responses (b)) {
  152. X          ch_default = 't';
  153. +     } else {
  154. +         ch_default = 'a';
  155. X      }
  156. X  
  157. !     if ((default_auto_save == FALSE || arts[respnum].archive == (char *) 0) ||
  158. !         (default_auto_save == TRUE && function != FEED_SAVE) ||
  159. X          ch_default == 'T') {
  160. X          do {
  161. X              sprintf (msg, "%s%s%c", prompt, txt_art_thread_regex_tag, ch_default);
  162. ***************
  163. *** 88,95 ****
  164. X              MoveCursor (LINES, (int) strlen (msg)-1);
  165. X              if ((ch = (char) ReadCh ()) == CR)
  166. X                  ch = ch_default;
  167. !         } while (ch != ESC && ch != 'a' && ch != 't' && ch != 'T' && 
  168. !             ch != 'h' && ch != 'p' && ch != 'q');
  169. X      } else {
  170. X          filename[0] = '\0';
  171. X          ch = ch_default;
  172. --- 90,96 ----
  173. X              MoveCursor (LINES, (int) strlen (msg)-1);
  174. X              if ((ch = (char) ReadCh ()) == CR)
  175. X                  ch = ch_default;
  176. !         } while (! strchr ("ahpqtT\033", ch));
  177. X      } else {
  178. X          filename[0] = '\0';
  179. X          ch = ch_default;
  180. ***************
  181. *** 194,200 ****
  182. X              break;
  183. X          case FEED_SAVE:        /* ask user for filename */
  184. X              free_save_array ();
  185. !             if ((save_archive_name == FALSE || arts[respnum].archive == (char *) 0)) {
  186. X                  sprintf (msg, txt_save_filename, default_save_file);
  187. X                  if (! prompt_string (msg, filename)) {
  188. X                      clear_message ();
  189. --- 195,201 ----
  190. X              break;
  191. X          case FEED_SAVE:        /* ask user for filename */
  192. X              free_save_array ();
  193. !             if ((default_auto_save == FALSE || arts[respnum].archive == (char *) 0)) {
  194. X                  sprintf (msg, txt_save_filename, default_save_file);
  195. X                  if (! prompt_string (msg, filename)) {
  196. X                      clear_message ();
  197. ***************
  198. *** 244,251 ****
  199. X                          MoveCursor (LINES, (int) strlen (msg)-1);
  200. X                          if ((proc_ch = (char) ReadCh ()) == CR)
  201. X                              proc_ch = proc_ch_default;
  202. !                     } while (proc_ch != 'n' && proc_ch != 's' &&
  203. !                          proc_ch != 'u' && proc_ch != 'U');
  204. X                  }
  205. X              }
  206. X              clear_message ();
  207. --- 245,255 ----
  208. X                          MoveCursor (LINES, (int) strlen (msg)-1);
  209. X                          if ((proc_ch = (char) ReadCh ()) == CR)
  210. X                              proc_ch = proc_ch_default;
  211. !                     } while (! strchr ("nqsuU\033", proc_ch));
  212. !                     if (proc_ch == 'q' || proc_ch == ESC) {    /* exit */
  213. !                         clear_message ();
  214. !                         return;
  215. !                     }
  216. X                  }
  217. X              }
  218. X              clear_message ();
  219. ***************
  220. *** 472,479 ****
  221. --- 476,492 ----
  222. X              break;
  223. X      }
  224. X  
  225. + if (debug == 2) {
  226. +     printf ("REDRAW=[%d]  ", redraw_screen);
  227. +     fflush (stdout);
  228. + }
  229. X      redraw_screen = mail_check ();    /* in case of sending to oneself */
  230. X  
  231. + if (debug == 2) {
  232. +     printf ("REDRAW=[%d]", redraw_screen);
  233. +     fflush (stdout);
  234. +     sleep (2);
  235. + }
  236. X      switch (function) {
  237. X          case FEED_PIPE:
  238. X              pclose (fp);        
  239. ***************
  240. *** 499,504 ****
  241. --- 512,519 ----
  242. X      if (level == PAGE_LEVEL) {
  243. X          if (ch != 'a') {
  244. X              note_page = art_open (arts[respnum].artnum, group_path);
  245. +         } else if (force_screen_redraw) {
  246. +             redraw_screen = TRUE;
  247. X          }
  248. X          note_end = orig_note_end;
  249. X          note_page = orig_note_page;
  250. diff -rcs ../1.14/getline.c ./getline.c
  251. *** ../1.14/getline.c    Tue Aug 11 21:23:04 1992
  252. --- ./getline.c    Mon Jul 20 12:51:09 1992
  253. ***************
  254. *** 3,9 ****
  255. X   *  Module    : getline.c
  256. X   *  Author    : Chris Thewalt & Iain Lea 
  257. X   *  Created   : 09-11-91
  258. !  *  Updated   : 29-03-92
  259. X   *  Notes     : emacs style line editing input package.  
  260. X   *  Copyright : (c) Copyright 1991-92 by Chris Thewalt & Iain Lea
  261. X   *              Permission to use, copy, modify, and distribute this
  262. --- 3,9 ----
  263. X   *  Module    : getline.c
  264. X   *  Author    : Chris Thewalt & Iain Lea 
  265. X   *  Created   : 09-11-91
  266. !  *  Updated   : 25-06-92
  267. X   *  Notes     : emacs style line editing input package.  
  268. X   *  Copyright : (c) Copyright 1991-92 by Chris Thewalt & Iain Lea
  269. X   *              Permission to use, copy, modify, and distribute this
  270. ***************
  271. *** 140,151 ****
  272. X              switch (c) {
  273. X                  case ESC:             /* abort */
  274. X                      return (char *) 0;
  275. -                     break;
  276. X                  case '\n':             /* newline */
  277. X                  case '\r':
  278. X                      gl_newline ();
  279. X                      return gl_buf;
  280. -                     break;
  281. X                  case CTRL_A:
  282. X                      gl_fixup (-1, 0);
  283. X                      break;
  284. --- 140,149 ----
  285. diff -rcs ../1.14/group.c ./group.c
  286. *** ../1.14/group.c    Tue Aug 11 21:23:06 1992
  287. --- ./group.c    Fri Aug  7 13:28:43 1992
  288. ***************
  289. *** 3,9 ****
  290. X   *  Module    : group.c
  291. X   *  Author    : I.Lea & R.Skrenta
  292. X   *  Created   : 01-04-91
  293. !  *  Updated   : 20-06-92
  294. X   *  Notes     :
  295. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  296. X   *              You may  freely  copy or  redistribute  this software,
  297. --- 3,9 ----
  298. X   *  Module    : group.c
  299. X   *  Author    : I.Lea & R.Skrenta
  300. X   *  Created   : 01-04-91
  301. !  *  Updated   : 07-08-92
  302. X   *  Notes     :
  303. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  304. X   *              You may  freely  copy or  redistribute  this software,
  305. ***************
  306. *** 30,40 ****
  307. X  static int len_subj;
  308. X  static char *spaces = "XXXX";
  309. X  
  310. ! static int bld_sline();
  311. ! static int draw_sline();
  312. X  
  313. X  #ifndef ART_ADJUST    /* what we do here is bizarre */
  314. ! #define ART_ADJUST(n)    (show_only_unread \
  315. X                  ? ((n) > 1 ? (n) : 0) \
  316. X                  : ((n) > 0 ? (n) - 1 : 0))
  317. X  #endif
  318. --- 30,40 ----
  319. X  static int len_subj;
  320. X  static char *spaces = "XXXX";
  321. X  
  322. ! static int bld_sline ();
  323. ! static int draw_sline ();
  324. X  
  325. X  #ifndef ART_ADJUST    /* what we do here is bizarre */
  326. ! #define ART_ADJUST(n)    (active[my_group[cur_groupnum]].attribute.show_only_unread \
  327. X                  ? ((n) > 1 ? (n) : 0) \
  328. X                  : ((n) > 0 ? (n) - 1 : 0))
  329. X  #endif
  330. ***************
  331. *** 54,60 ****
  332. X      char *p;
  333. X      int ch;
  334. X      int dummy = 0;
  335. !     int flag, i, n;
  336. X      int kill_state;
  337. X      int old_top = 0;
  338. X      int posted;
  339. --- 54,61 ----
  340. X      char *p;
  341. X      int ch;
  342. X      int dummy = 0;
  343. !     int flag, i;
  344. !     int n = -1;
  345. X      int kill_state;
  346. X      int old_top = 0;
  347. X      int posted;
  348. ***************
  349. *** 64,73 ****
  350. X      int xflag = 0;
  351. X       struct art_stat_t sbuf;
  352. X  
  353. !     active[my_group[cur_groupnum]].attribute.read = TRUE;
  354. X  
  355. X      glob_group = group;
  356. X      sav_groupnum = cur_groupnum;
  357. X      
  358. X      strcpy (group_path, group);            /* turn comp.unix.amiga into */
  359. X      for (p = group_path; *p; p++)        /* comp/unix/amiga */
  360. --- 65,76 ----
  361. X      int xflag = 0;
  362. X       struct art_stat_t sbuf;
  363. X  
  364. !     show_author = active[my_group[cur_groupnum]].attribute.show_author;
  365. !     active[my_group[cur_groupnum]].attribute.read_during_session = TRUE;
  366. X  
  367. X      glob_group = group;
  368. X      sav_groupnum = cur_groupnum;
  369. +     num_of_tagged_arts = 0;
  370. X      
  371. X      strcpy (group_path, group);            /* turn comp.unix.amiga into */
  372. X      for (p = group_path; *p; p++)        /* comp/unix/amiga */
  373. ***************
  374. *** 96,103 ****
  375. X          index_point = 0;
  376. X      }
  377. X      
  378. X      clear_note_area ();
  379. X      show_group_page (group);
  380. X  
  381. X      while (TRUE) {
  382. --- 99,106 ----
  383. X          index_point = 0;
  384. X      }
  385. X      
  386. +     set_subj_from_size (COLS);
  387. X      clear_note_area ();
  388. X      show_group_page (group);
  389. X  
  390. X      while (TRUE) {
  391. ***************
  392. *** 216,241 ****
  393. X                  show_group_page (group);
  394. X                  break;
  395. X  
  396. !             case '\t':
  397. X                   space_mode = TRUE;
  398. !                 if (index_point < 0
  399. !                 || (n=next_unread((int) base[index_point]))<0) {
  400. !                     for (i = cur_groupnum+1 ; i < group_top ; i++)
  401. !                         if (unread[i] > 0)
  402. X                              break;
  403. !                     if (i >= group_top)
  404. X                          goto group_done;
  405. X                      cur_groupnum = i;
  406. X                      index_point = -3;
  407. X                      goto group_done;
  408. X                  }
  409. !                 index_point = show_page(n, &dummy, group, group_path);
  410. !                 if (index_point < 0)
  411. X                      goto group_done;
  412. X                  clear_note_area ();
  413. !                 show_group_page(group);
  414. X                  break;
  415. X      
  416. X              case ' ':        /* page down */
  417. --- 219,251 ----
  418. X                  show_group_page (group);
  419. X                  break;
  420. X  
  421. !             case '\t':    /* goto next unread article/group */
  422. ! tab_pressed:            
  423. X                   space_mode = TRUE;
  424. !                 if (index_point < 0) {
  425. !                     n == -1;
  426. !                 } else {
  427. !                     n = next_unread ((int) base[index_point]);
  428. !                 }    
  429. !                 if (index_point < 0 || n < 0) {
  430. !                     for (i = cur_groupnum+1 ; i < group_top ; i++) {
  431. !                         if (active[my_group[i]].unread > 0) {
  432. X                              break;
  433. !                         }
  434. !                     }        
  435. !                     if (i >= group_top) {
  436. X                          goto group_done;
  437. !                     }
  438. X                      cur_groupnum = i;
  439. X                      index_point = -3;
  440. X                      goto group_done;
  441. X                  }
  442. !                 index_point = show_page (n, &dummy, group, group_path);
  443. !                 if (index_point < 0) {
  444. X                      goto group_done;
  445. +                 }    
  446. X                  clear_note_area ();
  447. !                 show_group_page (group);
  448. X                  break;
  449. X      
  450. X              case ' ':        /* page down */
  451. ***************
  452. *** 288,296 ****
  453. X                  n = (int) base[index_point];
  454. X                  old_artnum = arts[n].artnum;
  455. X                  if (kill_art_menu (group, (int) base[index_point])) {
  456. !                     kill_any_articles (group);
  457. X                      make_threads (FALSE);
  458. !                     find_base (show_only_unread);
  459. X                      index_point = find_new_pos (old_top, old_artnum, index_point);
  460. X                  }
  461. X                  show_group_page (group);
  462. --- 298,306 ----
  463. X                  n = (int) base[index_point];
  464. X                  old_artnum = arts[n].artnum;
  465. X                  if (kill_art_menu (group, (int) base[index_point])) {
  466. !                     kill_any_articles (my_group[cur_groupnum]);
  467. X                      make_threads (FALSE);
  468. !                     find_base (my_group[cur_groupnum]);
  469. X                      index_point = find_new_pos (old_top, old_artnum, index_point);
  470. X                  }
  471. X                  show_group_page (group);
  472. ***************
  473. *** 331,341 ****
  474. X                      erase_subject_arrow();
  475. X  #endif                    
  476. X                      index_point++;
  477. !                     show_group_page(group);
  478. X                  } else {
  479. !                     erase_subject_arrow();
  480. X                      index_point++;
  481. !                     draw_subject_arrow();
  482. X                  }
  483. X                  break;
  484. X  
  485. --- 341,351 ----
  486. X                      erase_subject_arrow();
  487. X  #endif                    
  488. X                      index_point++;
  489. !                     show_group_page (group);
  490. X                  } else {
  491. !                     erase_subject_arrow ();
  492. X                      index_point++;
  493. !                     draw_subject_arrow ();
  494. X                  }
  495. X                  break;
  496. X  
  497. ***************
  498. *** 421,427 ****
  499. X  
  500. X                  i = (ch == 'a');
  501. X  
  502. !                 n = search_author(show_only_unread, (int) base[index_point], i);
  503. X                  if (n < 0)
  504. X                      break;
  505. X  
  506. --- 431,437 ----
  507. X  
  508. X                  i = (ch == 'a');
  509. X  
  510. !                 n = search_author (my_group[cur_groupnum], (int) base[index_point], i);
  511. X                  if (n < 0)
  512. X                      break;
  513. X  
  514. ***************
  515. *** 443,456 ****
  516. X                  break;
  517. X                  
  518. X              case 'c':    /* catchup - mark all articles as read */
  519. !                 if (!confirm_action || prompt_yn (LINES, txt_mark_all_read, 'y')) {
  520. X                      for (n = 0; n < top; n++) {
  521. X                          arts[n].unread = ART_READ;
  522. X                      }
  523. !                     if (cur_groupnum + 1 < group_top) {
  524. !                         cur_groupnum++;
  525. !                     }
  526. !                     goto group_done;
  527. X                  }
  528. X                  break;
  529. X  
  530. --- 453,471 ----
  531. X                  break;
  532. X                  
  533. X              case 'c':    /* catchup - mark all articles as read */
  534. !             case 'C':    /* catchup - and goto next unread group */
  535. !                 if (! confirm_action || prompt_yn (LINES, txt_mark_all_read, 'y')) {
  536. X                      for (n = 0; n < top; n++) {
  537. X                          arts[n].unread = ART_READ;
  538. X                      }
  539. !                     if (ch == 'c') {
  540. !                         if (cur_groupnum + 1 < group_top) {
  541. !                             cur_groupnum++;
  542. !                         }
  543. !                         goto group_done;
  544. !                     } else {
  545. !                         goto tab_pressed;
  546. !                     }    
  547. X                  }
  548. X                  break;
  549. X  
  550. ***************
  551. *** 484,497 ****
  552. X                      break;
  553. X                  }
  554. X                  for (i = (int) base[index_point]; i >= 0; i = arts[i].thread) {
  555. !                     arts[i].unread = ART_READ;
  556. !                 }    
  557. !                 bld_sline(index_point);
  558. !                 draw_sline(index_point, FALSE);
  559. !                 if (index_point + 1 < top_base)
  560. !                     goto group_down;
  561. !                 draw_subject_arrow();
  562. !                 info_message(txt_end_of_arts);
  563. X                  break;
  564. X  
  565. X              case 'l':    /* list articles within current thread */
  566. --- 499,537 ----
  567. X                      break;
  568. X                  }
  569. X                  for (i = (int) base[index_point]; i >= 0; i = arts[i].thread) {
  570. !                     if (arts[i].unread != ART_READ) {
  571. !                         arts[i].unread = ART_READ;
  572. !                         if (arts[i].hot) {
  573. !                             if (num_of_hot_arts) {
  574. !                                 num_of_hot_arts--;
  575. !                             }
  576. !                         }
  577. !                     }
  578. !                 }
  579. !                 show_group_title (TRUE);    
  580. !                 bld_sline (index_point);
  581. !                 draw_sline (index_point, FALSE);
  582. !                 n = next_unread (next_response ((int) base[index_point]));
  583. !                 if (n < 0) {
  584. !                     draw_subject_arrow ();
  585. !                     info_message (txt_no_next_unread_art);
  586. !                     break;
  587. !                 }
  588. !                 if ((n = which_thread (n)) < 0) {
  589. !                     error_message ("Internal error: K which_thread < 0", "");
  590. !                     break;
  591. !                 }
  592. !                 if (n < first_subj_on_screen || n >= last_subj_on_screen) {
  593. !                     index_point = n;
  594. !                     show_group_page (group);
  595. !                 } else {
  596. !                     erase_subject_arrow ();
  597. !                     index_point = n;
  598. !                     draw_subject_arrow ();
  599. !                 }
  600. X                  break;
  601. X  
  602. X              case 'l':    /* list articles within current thread */
  603. ***************
  604. *** 528,547 ****
  605. X                      n = (int) base[index_point];
  606. X                      old_artnum = arts[n].artnum;
  607. X                  }
  608. !                 n = sort_art_type;
  609. X                  kill_state = change_rcfile (group, TRUE);
  610. !                 if (kill_state == NO_KILLING && n != sort_art_type) {
  611. X                      make_threads (TRUE);
  612. !                     find_base (show_only_unread);
  613. X                  }
  614. X                  index_point = find_new_pos (old_top, old_artnum, index_point);
  615. X                  show_group_page (group);
  616. X                  break;
  617. X  
  618. !             case 'n':    /* next group */
  619. !                 clear_message();
  620. X                  if (cur_groupnum + 1 >= group_top)
  621. !                     info_message(txt_no_more_groups);
  622. X                  else {
  623. X                      cur_groupnum++;
  624. X                      index_point = -3;
  625. --- 568,588 ----
  626. X                      n = (int) base[index_point];
  627. X                      old_artnum = arts[n].artnum;
  628. X                  }
  629. !                 n = default_sort_art_type;
  630. X                  kill_state = change_rcfile (group, TRUE);
  631. !                 if (kill_state == NO_KILLING && n != default_sort_art_type) {
  632. X                      make_threads (TRUE);
  633. !                     find_base (my_group[cur_groupnum]);
  634. X                  }
  635. +                 set_subj_from_size (COLS);
  636. X                  index_point = find_new_pos (old_top, old_artnum, index_point);
  637. X                  show_group_page (group);
  638. X                  break;
  639. X  
  640. !             case 'n':    /* goto next group */
  641. !                 clear_message ();
  642. X                  if (cur_groupnum + 1 >= group_top)
  643. !                     info_message (txt_no_more_groups);
  644. X                  else {
  645. X                      cur_groupnum++;
  646. X                      index_point = -3;
  647. ***************
  648. *** 550,556 ****
  649. X                  }
  650. X                  break;
  651. X  
  652. !             case 'N':    /* go to next unread article */
  653. X                  if (index_point < 0) {
  654. X                      info_message(txt_no_next_unread_art);
  655. X                      break;
  656. --- 591,597 ----
  657. X                  }
  658. X                  break;
  659. X  
  660. !             case 'N':    /* goto next unread article */
  661. X                  if (index_point < 0) {
  662. X                      info_message(txt_no_next_unread_art);
  663. X                      break;
  664. ***************
  665. *** 627,643 ****
  666. X                    */
  667. X                   i = -1;
  668. X                   if (index_point >= 0) {
  669. !                      if (show_only_unread || new_responses(index_point))
  670. X                           i = base[index_point];
  671. !                      else if ((n = prev_unread(base[index_point])) >= 0)
  672. X                           i = n;
  673. !                      else if ((n = next_unread(base[index_point])) >= 0)
  674. X                           i = n;
  675. X                   }
  676. !                  show_only_unread = (show_only_unread ? FALSE : TRUE);
  677. !                  auto_select_articles (group);
  678. !                  find_base (show_only_unread);
  679. !                  if (i >= 0 && (n = which_thread(i)) >= 0)
  680. X                       index_point = n;
  681. X                   else if (top_base > 0)
  682. X                       index_point = top_base - 1;
  683. --- 668,687 ----
  684. X                    */
  685. X                   i = -1;
  686. X                   if (index_point >= 0) {
  687. !                      if (active[my_group[cur_groupnum]].attribute.show_only_unread || 
  688. !                          new_responses (index_point)) {
  689. X                           i = base[index_point];
  690. !                      } else if ((n = prev_unread (base[index_point])) >= 0) {
  691. X                           i = n;
  692. !                      } else if ((n = next_unread (base[index_point])) >= 0) {
  693. X                           i = n;
  694. +                      }    
  695. X                   }
  696. !                  active[my_group[cur_groupnum]].attribute.show_only_unread = 
  697. !                      !active[my_group[cur_groupnum]].attribute.show_only_unread;
  698. !                  auto_select_articles (my_group[cur_groupnum]);
  699. !                  find_base (my_group[cur_groupnum]);
  700. !                  if (i >= 0 && (n = which_thread (i)) >= 0)
  701. X                       index_point = n;
  702. X                   else if (top_base > 0)
  703. X                       index_point = top_base - 1;
  704. ***************
  705. *** 671,679 ****
  706. X  
  707. X              case 'u':    /* unthread/thread articles */
  708. X                   if (index_point >= 0) {
  709. !                     thread_arts = !thread_arts;
  710. X                      make_threads (TRUE);
  711. !                     find_base (show_only_unread);
  712. X                      show_group_page (group);
  713. X                  }
  714. X                  break;
  715. --- 715,724 ----
  716. X  
  717. X              case 'u':    /* unthread/thread articles */
  718. X                   if (index_point >= 0) {
  719. !                     active[my_group[cur_groupnum]].attribute.thread_arts = 
  720. !                         !active[my_group[cur_groupnum]].attribute.thread_arts;
  721. X                      make_threads (TRUE);
  722. !                     find_base (my_group[cur_groupnum]);
  723. X                      show_group_page (group);
  724. X                  }
  725. X                  break;
  726. ***************
  727. *** 681,687 ****
  728. X              case 'U':    /* untag all articles */
  729. X                   if (index_point >= 0) {
  730. X                      untag_all_articles ();
  731. !                     update_group_page (group);
  732. X                  }
  733. X                  break;
  734. X  
  735. --- 726,732 ----
  736. X              case 'U':    /* untag all articles */
  737. X                   if (index_point >= 0) {
  738. X                      untag_all_articles ();
  739. !                     update_group_page ();
  740. X                  }
  741. X                  break;
  742. X  
  743. ***************
  744. *** 720,725 ****
  745. --- 765,775 ----
  746. X                  }
  747. X                  n = 0;
  748. X                  for (i = (int) base[index_point] ; i != -1 ; i = arts[i].thread) {
  749. +                     if (arts[i].unread == ART_READ) {
  750. +                         if (arts[i].hot && num_of_hot_arts) {
  751. +                             num_of_hot_arts++;
  752. +                         }
  753. +                     }
  754. X                      arts[i].unread = ART_UNREAD;
  755. X                      ++n;
  756. X                      if (ch == 'z')
  757. ***************
  758. *** 726,731 ****
  759. --- 776,782 ----
  760. X                          break;
  761. X                  }
  762. X                  assert (n > 0);
  763. +                 show_group_title (TRUE);
  764. X                  bld_sline(index_point);
  765. X                  draw_sline(index_point, FALSE);
  766. X                  draw_subject_arrow();
  767. ***************
  768. *** 769,775 ****
  769. X              case '@':    /* reverse selections */
  770. X                  for (i=0; i<top; ++i)
  771. X                      arts[i].hot = (arts[i].hot ? 0 : 1);
  772. !                 update_group_page (group);
  773. X                  break;
  774. X  
  775. X                case '~':    /* undo selections */
  776. --- 820,826 ----
  777. X              case '@':    /* reverse selections */
  778. X                  for (i=0; i<top; ++i)
  779. X                      arts[i].hot = (arts[i].hot ? 0 : 1);
  780. !                 update_group_page ();
  781. X                  break;
  782. X  
  783. X                case '~':    /* undo selections */
  784. ***************
  785. *** 778,784 ****
  786. X                       arts[i].zombie = 0;
  787. X                   }
  788. X                   xflag = 0;
  789. !                   update_group_page(group);
  790. X                    break;
  791. X    
  792. X               case '=':    /* select matching patterns */
  793. --- 829,835 ----
  794. X                       arts[i].zombie = 0;
  795. X                   }
  796. X                   xflag = 0;
  797. !                   update_group_page ();
  798. X                    break;
  799. X    
  800. X               case '=':    /* select matching patterns */
  801. ***************
  802. *** 814,820 ****
  803. X                       ++flag;
  804. X                   }
  805. X                   if (flag)
  806. !                      update_group_page (group);
  807. X                   break;
  808. X  
  809. X              case ';':    /* make all unread hot if 1 is hot */
  810. --- 865,871 ----
  811. X                       ++flag;
  812. X                   }
  813. X                   if (flag)
  814. !                      update_group_page ();
  815. X                   break;
  816. X  
  817. X              case ';':    /* make all unread hot if 1 is hot */
  818. ***************
  819. *** 843,850 ****
  820. X                      }
  821. X                  }
  822. X  
  823. !                 if (show_only_unread) {
  824. !                     find_base (show_only_unread);
  825. X                  }
  826. X  
  827. X                  xflag = 1;
  828. --- 894,901 ----
  829. X                      }
  830. X                  }
  831. X  
  832. !                 if (active[my_group[cur_groupnum]].attribute.show_only_unread) {
  833. !                     find_base (my_group[cur_groupnum]);
  834. X                  }
  835. X  
  836. X                  xflag = 1;
  837. ***************
  838. *** 854,865 ****
  839. X                  break;
  840. X  
  841. X              case '+':    /* perform auto-selection on group */
  842. !                 if (auto_select_articles (group) == 0)
  843. !                     break;
  844. !                 update_group_page (group);
  845. X                  break;
  846. X  
  847. !             X_undo:
  848. X                  for (i=0; i<top; ++i) {
  849. X                      if (arts[i].unread == ART_READ
  850. X                          && arts[i].zombie == 1) {
  851. --- 905,916 ----
  852. X                  break;
  853. X  
  854. X              case '+':    /* perform auto-selection on group */
  855. !                 if (auto_select_articles (my_group[cur_groupnum])) {
  856. !                     update_group_page ();
  857. !                 }
  858. X                  break;
  859. X  
  860. ! X_undo:
  861. X                  for (i=0; i<top; ++i) {
  862. X                      if (arts[i].unread == ART_READ
  863. X                          && arts[i].zombie == 1) {
  864. ***************
  865. *** 868,875 ****
  866. X                      }
  867. X                  }
  868. X  
  869. !                 if (show_only_unread) {
  870. !                     find_base (show_only_unread);
  871. X                  }
  872. X  
  873. X                  xflag = 0;
  874. --- 919,926 ----
  875. X                      }
  876. X                  }
  877. X  
  878. !                 if (active[my_group[cur_groupnum]].attribute.show_only_unread) {
  879. !                     find_base (my_group[cur_groupnum]);
  880. X                  }
  881. X  
  882. X                  xflag = 0;
  883. ***************
  884. *** 916,922 ****
  885. X          }
  886. X      }
  887. X      
  888. !     unread[groupnum] = sum;
  889. X  }
  890. X  
  891. X  
  892. --- 967,973 ----
  893. X          }
  894. X      }
  895. X      
  896. !     active[my_group[groupnum]].unread = sum;
  897. X  }
  898. X  
  899. X  
  900. ***************
  901. *** 925,932 ****
  902. X  {
  903. X  #ifndef INDEX_DAEMON
  904. X  
  905. !     char buf[LEN];
  906. !     int i, art_cnt = 0;
  907. X  
  908. X      set_signals_group ();
  909. X      
  910. --- 976,982 ----
  911. X  {
  912. X  #ifndef INDEX_DAEMON
  913. X  
  914. !     int i;
  915. X  
  916. X      set_signals_group ();
  917. X      
  918. ***************
  919. *** 937,962 ****
  920. X      CleartoEOLN ();
  921. X  #endif
  922. X  
  923. !     if (show_only_unread) {
  924. !         for (i = 0 ; i < top_base ; i++) {
  925. !             art_cnt += new_responses (i);
  926. !         }    
  927. !     } else {
  928. !         for (i = 0 ; i < top ; i++) {
  929. !             if (! IGNORE_ART(i)) {
  930. !                 ++art_cnt;
  931. !             }
  932. !         }        
  933. !     }
  934. !     if (active[my_group[cur_groupnum]].attribute.thread && thread_arts) {
  935. !         sprintf (buf, "%s (%dT %dA %dK %dH)", group, top_base, art_cnt,
  936. !             num_of_killed_arts, num_of_hot_arts);
  937. !     } else {
  938. !         sprintf (buf, "%s (%dU %dK %dH)", group, art_cnt, 
  939. !             num_of_killed_arts, num_of_hot_arts);
  940. !     }
  941. !     show_title (buf);
  942. X  
  943. X  #ifndef USE_CLEARSCREEN
  944. X      MoveCursor (1, 0);
  945. --- 987,993 ----
  946. X      CleartoEOLN ();
  947. X  #endif
  948. X  
  949. !     show_group_title (FALSE);
  950. X  
  951. X  #ifndef USE_CLEARSCREEN
  952. X      MoveCursor (1, 0);
  953. ***************
  954. *** 1025,1050 ****
  955. X  }
  956. X  
  957. X  
  958. ! void update_group_page(group)
  959. ! char *group;
  960. X  {
  961. X  #ifndef INDEX_DAEMON
  962. X      register int i;
  963. X  
  964. X      for (i = first_subj_on_screen; i < last_subj_on_screen; ++i) {
  965. !         bld_sline(i);
  966. !         draw_sline(i, FALSE);
  967. X      }
  968. X  
  969. X      if (top_base <= 0)
  970. X          return;
  971. X  
  972. !     draw_subject_arrow();
  973. X  #endif /* INDEX_DAEMON */
  974. X  }
  975. X  
  976. X  
  977. ! void draw_subject_arrow()
  978. X  {
  979. X      MoveCursor (INDEX2LNUM(index_point), 0);
  980. X  
  981. --- 1056,1080 ----
  982. X  }
  983. X  
  984. X  
  985. ! void update_group_page ()
  986. X  {
  987. X  #ifndef INDEX_DAEMON
  988. X      register int i;
  989. X  
  990. X      for (i = first_subj_on_screen; i < last_subj_on_screen; ++i) {
  991. !         bld_sline (i);
  992. !         draw_sline (i, FALSE);
  993. X      }
  994. X  
  995. X      if (top_base <= 0)
  996. X          return;
  997. X  
  998. !     draw_subject_arrow ();
  999. X  #endif /* INDEX_DAEMON */
  1000. X  }
  1001. X  
  1002. X  
  1003. ! void draw_subject_arrow ()
  1004. X  {
  1005. X      MoveCursor (INDEX2LNUM(index_point), 0);
  1006. X  
  1007. ***************
  1008. *** 1059,1065 ****
  1009. X      MoveCursor (LINES, 0);
  1010. X  }
  1011. X  
  1012. ! void erase_subject_arrow()
  1013. X  {
  1014. X      MoveCursor (INDEX2LNUM(index_point), 0);
  1015. X  
  1016. --- 1089,1095 ----
  1017. X      MoveCursor (LINES, 0);
  1018. X  }
  1019. X  
  1020. ! void erase_subject_arrow ()
  1021. X  {
  1022. X      MoveCursor (INDEX2LNUM(index_point), 0);
  1023. X  
  1024. ***************
  1025. *** 1183,1189 ****
  1026. X  void set_subj_from_size (num_cols)
  1027. X      int num_cols;
  1028. X  {
  1029. !     int size = 0;
  1030. X      
  1031. X      if (show_author == SHOW_FROM_BOTH) {
  1032. X          max_subj = (num_cols / 2) - 2;
  1033. --- 1213,1221 ----
  1034. X  void set_subj_from_size (num_cols)
  1035. X      int num_cols;
  1036. X  {
  1037. !     int i, size = 0;
  1038. !     
  1039. !     i = my_group[cur_groupnum];
  1040. X      
  1041. X      if (show_author == SHOW_FROM_BOTH) {
  1042. X          max_subj = (num_cols / 2) - 2;
  1043. ***************
  1044. *** 1214,1219 ****
  1045. --- 1246,1278 ----
  1046. X  
  1047. X  void toggle_subject_from ()
  1048. X  {
  1049. +     int i;
  1050. + int tmp;
  1051. +     
  1052. +     i = my_group[cur_groupnum];
  1053. + tmp = show_author;
  1054. +     
  1055. +     if (active[i].attribute.show_author != SHOW_FROM_NONE) {
  1056. +         if (show_author != SHOW_FROM_NONE) {
  1057. +             show_author = SHOW_FROM_NONE;
  1058. +         } else {
  1059. +             show_author = active[i].attribute.show_author;
  1060. +         }
  1061. +     } else {
  1062. +         if (show_author + 1 > SHOW_FROM_BOTH) {
  1063. +             show_author = SHOW_FROM_NONE;
  1064. +         } else {
  1065. +             show_author++;
  1066. +         }
  1067. +     }
  1068. + if (debug == 2) {
  1069. + sprintf (msg, "Show before=[%d]  after=[%d]", tmp, show_author);
  1070. + error_message (msg, "");
  1071. + }
  1072. + #if 0
  1073. X      if (default_show_author != SHOW_FROM_NONE) {
  1074. X          if (show_author != SHOW_FROM_NONE) {
  1075. X              show_author = SHOW_FROM_NONE;
  1076. ***************
  1077. *** 1227,1232 ****
  1078. --- 1286,1293 ----
  1079. X              show_author++;
  1080. X          }
  1081. X      }
  1082. + #endif
  1083. X      set_subj_from_size (COLS);
  1084. X  }
  1085. X  
  1086. ***************
  1087. *** 1235,1241 ****
  1088. X   *
  1089. X   * WARNING: the routine is tightly coupled with draw_sline() in the sense
  1090. X   * that draw_sline() expects bld_sline() to place the article mark
  1091. !  * (READ_ART_MARK, HOT_ART_MARK, etc) at MARK_OFFSET in the screen[].col.
  1092. X   * So, if you change the format used in this routine, be sure to check
  1093. X   * that the value of MARK_OFFSET is still correct. 
  1094. X   * Yes, this is somewhat kludgy.
  1095. --- 1296,1302 ----
  1096. X   *
  1097. X   * WARNING: the routine is tightly coupled with draw_sline() in the sense
  1098. X   * that draw_sline() expects bld_sline() to place the article mark
  1099. !  * (read_art_makr, hot_art_mark, etc) at MARK_OFFSET in the screen[].col.
  1100. X   * So, if you change the format used in this routine, be sure to check
  1101. X   * that the value of MARK_OFFSET is still correct. 
  1102. X   * Yes, this is somewhat kludgy.
  1103. ***************
  1104. *** 1256,1262 ****
  1105. X      respnum = (int) base[i];
  1106. X      
  1107. X      stat_thread(i, &sbuf);
  1108. !     if (show_only_unread)
  1109. X          n = sbuf.unread + sbuf.seen;
  1110. X      else
  1111. X          n = sbuf.total;
  1112. --- 1317,1323 ----
  1113. X      respnum = (int) base[i];
  1114. X      
  1115. X      stat_thread(i, &sbuf);
  1116. !     if (active[my_group[cur_groupnum]].attribute.show_only_unread)
  1117. X          n = sbuf.unread + sbuf.seen;
  1118. X      else
  1119. X          n = sbuf.total;
  1120. ***************
  1121. *** 1328,1334 ****
  1122. X      /* it is somewhat less efficient to go back and redo that art mark
  1123. X       * if hot, but it is quite readable as to what is happening 
  1124. X       */
  1125. !     if (screen[j].col[k] == HOT_ART_MARK) {
  1126. X          MoveCursor (INDEX2LNUM(i), k);
  1127. X          ToggleInverse ();
  1128. X          fputc (screen[j].col[k], stdout);
  1129. --- 1389,1395 ----
  1130. X      /* it is somewhat less efficient to go back and redo that art mark
  1131. X       * if hot, but it is quite readable as to what is happening 
  1132. X       */
  1133. !     if (screen[j].col[k] == hot_art_mark) {
  1134. X          MoveCursor (INDEX2LNUM(i), k);
  1135. X          ToggleInverse ();
  1136. X          fputc (screen[j].col[k], stdout);
  1137. ***************
  1138. *** 1339,1342 ****
  1139. --- 1400,1444 ----
  1140. X      
  1141. X  #endif /* INDEX_DAEMON */
  1142. X      return(0);
  1143. + }
  1144. + void show_group_title (clear_title)
  1145. +     int clear_title;
  1146. + {
  1147. + #ifndef INDEX_DAEMON
  1148. +     char buf[PATH_LEN];
  1149. +     register int i, art_cnt = 0;
  1150. +     
  1151. +     if (active[my_group[cur_groupnum]].attribute.show_only_unread) {
  1152. +         for (i = 0 ; i < top_base ; i++) {
  1153. +             art_cnt += new_responses (i);
  1154. +         }    
  1155. +     } else {
  1156. +         for (i = 0 ; i < top ; i++) {
  1157. +             if (! IGNORE_ART(i)) {
  1158. +                 ++art_cnt;
  1159. +             }
  1160. +         }        
  1161. +     }
  1162. +     if (active[my_group[cur_groupnum]].attribute.thread_arts && default_thread_arts) {
  1163. +         sprintf (buf, "%s (%dT %dA %dK %dH)", 
  1164. +             active[my_group[cur_groupnum]].name, top_base, 
  1165. +             art_cnt, num_of_killed_arts, num_of_hot_arts);
  1166. +     } else {
  1167. +         sprintf (buf, "%s (%dU %dK %dH)", 
  1168. +             active[my_group[cur_groupnum]].name,
  1169. +             art_cnt, num_of_killed_arts, num_of_hot_arts);
  1170. +     }
  1171. +     if (clear_title) {
  1172. +         MoveCursor (0, 0);
  1173. +         CleartoEOLN ();
  1174. +     }
  1175. +     
  1176. +     show_title (buf);
  1177. + #endif /* INDEX_DAEMON */
  1178. X  }
  1179. Files ../1.14/hashstr.c and ./hashstr.c are identical
  1180. diff -rcs ../1.14/help.c ./help.c
  1181. *** ../1.14/help.c    Tue Aug 11 21:23:07 1992
  1182. --- ./help.c    Sun Jul 26 15:12:00 1992
  1183. ***************
  1184. *** 3,9 ****
  1185. X   *  Module    : help.c
  1186. X   *  Author    : I.Lea
  1187. X   *  Created   : 01-04-91
  1188. !  *  Updated   : 20-06-92
  1189. X   *  Notes     :
  1190. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1191. X   *              You may  freely  copy or  redistribute  this software,
  1192. --- 3,9 ----
  1193. X   *  Module    : help.c
  1194. X   *  Author    : I.Lea
  1195. X   *  Created   : 01-04-91
  1196. !  *  Updated   : 26-07-92
  1197. X   *  Notes     :
  1198. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1199. X   *              You may  freely  copy or  redistribute  this software,
  1200. ***************
  1201. *** 35,40 ****
  1202. --- 35,41 ----
  1203. X      txt_help_M,
  1204. X      txt_help_n,
  1205. X      txt_help_g_q,
  1206. +     txt_help_g_r,
  1207. X      txt_help_s,
  1208. X      txt_help_S,
  1209. X      txt_help_v,
  1210. ***************
  1211. *** 79,84 ****
  1212. --- 80,86 ----
  1213. X      txt_help_b,
  1214. X      txt_help_bug_report,
  1215. X      txt_help_c,
  1216. +     txt_help_cC,
  1217. X      txt_help_d,
  1218. X      txt_help_g,
  1219. X      txt_help_h,
  1220. ***************
  1221. *** 195,200 ****
  1222. --- 197,209 ----
  1223. X      (char *) 0
  1224. X  };
  1225. X  
  1226. + static char *info_title;
  1227. + static char **info_help;
  1228. + static int cur_page;
  1229. + static int group_len = 0;
  1230. + static int info_type;
  1231. + static int max_page;
  1232. + static int pos_help;
  1233. X  
  1234. X  void show_info_page (type, help, title)
  1235. X      int type; 
  1236. ***************
  1237. *** 201,219 ****
  1238. X      char *help[];
  1239. X      char *title;
  1240. X  {
  1241. -     char buf[LEN];
  1242. X      char ch;
  1243. X      int i, len;
  1244. -     int group_len = 0;
  1245. X      int old_page = 0;
  1246. -     int cur_page = 1;
  1247. -     int max_page = 1;
  1248. -     int pos_help = 0;
  1249. X  
  1250. X      if (NOTESLINES <= 0) {
  1251. X          return;
  1252. X      }
  1253. X  
  1254. X      /*
  1255. X       *  find how many elements in array
  1256. X       */
  1257. --- 210,233 ----
  1258. X      char *help[];
  1259. X      char *title;
  1260. X  {
  1261. X      char ch;
  1262. X      int i, len;
  1263. X      int old_page = 0;
  1264. X  
  1265. X      if (NOTESLINES <= 0) {
  1266. X          return;
  1267. X      }
  1268. X  
  1269. +     set_signals_help ();
  1270. +     cur_page = 1;
  1271. +     max_page = 1;
  1272. +     pos_help = 0;
  1273. +     
  1274. +     info_help = help;
  1275. +     info_type = type;
  1276. +     info_title = title;
  1277. +     
  1278. X      /*
  1279. X       *  find how many elements in array
  1280. X       */
  1281. ***************
  1282. *** 237,264 ****
  1283. X  
  1284. X      while (1) {
  1285. X          if (cur_page != old_page) {
  1286. !             ClearScreen ();
  1287. !             sprintf (buf, title, cur_page, max_page);
  1288. !             center_line (0, TRUE, buf);
  1289. !             MoveCursor (INDEX_TOP, 0);
  1290. !             if (type == HELP_INFO) { 
  1291. !                 for (i=pos_help ; i < (pos_help + NOTESLINES) && help[i] ; i++) {
  1292. !                     fputs (help[i], stdout);
  1293. !                 }
  1294. !             } else {
  1295. !                 for (i=pos_help ; i < (pos_help + NOTESLINES) && posted[i].date[0] ; i++) {
  1296. !                     sprintf (msg, "%8s  %c  %-*s  %s",
  1297. !                         posted[i].date, posted[i].action,  
  1298. !                         group_len, posted[i].group, posted[i].subj);
  1299. !                         msg[COLS-2] = '\0';
  1300. !                     printf ("%s\r\n", msg);
  1301. !                 }
  1302. !             }
  1303. !         }
  1304. !         if (cur_page != old_page) {
  1305. !             center_line (LINES, FALSE, txt_hit_space_for_more);
  1306. X          }
  1307. X  
  1308. X          old_page = cur_page;
  1309. --- 251,257 ----
  1310. X  
  1311. X      while (1) {
  1312. X          if (cur_page != old_page) {
  1313. !             display_info_page ();
  1314. X          }
  1315. X  
  1316. X          old_page = cur_page;
  1317. ***************
  1318. *** 269,324 ****
  1319. X                  switch (get_arrow_key ()) {
  1320. X                      case KEYMAP_UP:
  1321. X                      case KEYMAP_PAGE_UP:
  1322. !                         if (cur_page > 1) {
  1323. !                             cur_page--;
  1324. !                             pos_help = (cur_page-1)*NOTESLINES;
  1325. !                         }
  1326. X                          break;
  1327. X  
  1328. X                      case KEYMAP_DOWN:
  1329. X                      case KEYMAP_PAGE_DOWN:
  1330. !                         if (cur_page < max_page) {
  1331. !                             pos_help = cur_page*NOTESLINES;
  1332. !                             cur_page++;
  1333. !                         }
  1334. X                          break;
  1335. X  
  1336. X                      case KEYMAP_HOME:
  1337. !                         if (cur_page != 1) {
  1338. !                             cur_page = 1;
  1339. !                             pos_help = 0;
  1340. !                         }
  1341. X                          break;
  1342. X                      
  1343. X                      case KEYMAP_END:
  1344. !                         if (cur_page != max_page) {
  1345. !                             cur_page = max_page;
  1346. !                             pos_help = (max_page-1) * NOTESLINES;
  1347. !                         }
  1348. X                          break;
  1349. X                  }
  1350. X                  break;
  1351. X  
  1352. X              case ctrl('D'):            /* page down */
  1353. X              case ' ':
  1354. X              case 'j':
  1355. X                  if (cur_page < max_page) {
  1356. X                      pos_help = cur_page*NOTESLINES;
  1357. X                      cur_page++;
  1358. !                 }
  1359. X                  break;
  1360. X              
  1361. X              case ctrl('U'):            /* page up */
  1362. X              case 'b':
  1363. X              case 'k':
  1364. X                  if (cur_page > 1) {
  1365. X                      cur_page--;
  1366. X                      pos_help = (cur_page-1)*NOTESLINES;
  1367. !                 }
  1368. X                  break;
  1369. X  
  1370. X              case ctrl('R'):            /* Home */
  1371. X              case 'g':
  1372. X                  if (cur_page != 1) {
  1373. X                      cur_page = 1;
  1374. X                      pos_help = 0;
  1375. --- 262,316 ----
  1376. X                  switch (get_arrow_key ()) {
  1377. X                      case KEYMAP_UP:
  1378. X                      case KEYMAP_PAGE_UP:
  1379. !                         goto help_page_up;
  1380. X                          break;
  1381. X  
  1382. X                      case KEYMAP_DOWN:
  1383. X                      case KEYMAP_PAGE_DOWN:
  1384. !                         goto help_page_down;
  1385. X                          break;
  1386. X  
  1387. X                      case KEYMAP_HOME:
  1388. !                         goto help_home;
  1389. X                          break;
  1390. X                      
  1391. X                      case KEYMAP_END:
  1392. !                         goto help_end;
  1393. X                          break;
  1394. X                  }
  1395. X                  break;
  1396. X  
  1397. X              case ctrl('D'):            /* page down */
  1398. +             case ctrl('F'):            /* vi style */
  1399. X              case ' ':
  1400. X              case 'j':
  1401. + help_page_down:
  1402. X                  if (cur_page < max_page) {
  1403. X                      pos_help = cur_page*NOTESLINES;
  1404. X                      cur_page++;
  1405. !                 } else {
  1406. !                     pos_help = 0;
  1407. !                     cur_page = 1;
  1408. !                 }                
  1409. X                  break;
  1410. X              
  1411. X              case ctrl('U'):            /* page up */
  1412. +             case ctrl('B'):            /* vi style */
  1413. X              case 'b':
  1414. X              case 'k':
  1415. + help_page_up:
  1416. X                  if (cur_page > 1) {
  1417. X                      cur_page--;
  1418. X                      pos_help = (cur_page-1)*NOTESLINES;
  1419. !                 } else {
  1420. !                     pos_help = (max_page-1) * NOTESLINES;
  1421. !                     cur_page = max_page;
  1422. !                 }                
  1423. X                  break;
  1424. X  
  1425. X              case ctrl('R'):            /* Home */
  1426. X              case 'g':
  1427. + help_home:
  1428. X                  if (cur_page != 1) {
  1429. X                      cur_page = 1;
  1430. X                      pos_help = 0;
  1431. ***************
  1432. *** 327,332 ****
  1433. --- 319,325 ----
  1434. X  
  1435. X              case '$':                /* End */
  1436. X              case 'G':
  1437. + help_end:
  1438. X                  if (cur_page != max_page) {
  1439. X                      cur_page = max_page;
  1440. X                      pos_help = (max_page-1) * NOTESLINES;
  1441. ***************
  1442. *** 340,343 ****
  1443. --- 333,364 ----
  1444. X                  return;
  1445. X          }    
  1446. X      }
  1447. + }
  1448. + void display_info_page ()
  1449. + {
  1450. +     char buf[PATH_LEN];
  1451. +     int i;
  1452. +     
  1453. +     ClearScreen ();
  1454. +     sprintf (buf, info_title, cur_page, max_page);
  1455. +     center_line (0, TRUE, buf);
  1456. +     MoveCursor (INDEX_TOP, 0);
  1457. +     if (info_type == HELP_INFO) { 
  1458. +         for (i=pos_help ; i < (pos_help + NOTESLINES) && info_help[i] ; i++) {
  1459. +             fputs (info_help[i], stdout);
  1460. +         }
  1461. +     } else {
  1462. +         for (i=pos_help ; i < (pos_help + NOTESLINES) && posted[i].date[0] ; i++) {
  1463. +             sprintf (buf, "%8s  %c  %-*s  %s",
  1464. +                 posted[i].date, posted[i].action,  
  1465. +                 group_len, posted[i].group, posted[i].subj);
  1466. +                 buf[COLS-2] = '\0';
  1467. +             printf ("%s\r\n", buf);
  1468. +         }
  1469. +     }
  1470. +     center_line (LINES, FALSE, txt_hit_space_for_more);
  1471. X  }
  1472. diff -rcs ../1.14/inews.c ./inews.c
  1473. *** ../1.14/inews.c    Tue Aug 11 21:23:07 1992
  1474. --- ./inews.c    Mon Jul 27 06:55:29 1992
  1475. ***************
  1476. *** 3,9 ****
  1477. X   *  Module    : inews.c
  1478. X   *  Author    : I.Lea
  1479. X   *  Created   : 17-03-92
  1480. !  *  Updated   : 20-06-92
  1481. X   *  Notes     : NNTP builtin version of inews
  1482. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1483. X   *              You may  freely  copy or  redistribute  this software,
  1484. --- 3,9 ----
  1485. X   *  Module    : inews.c
  1486. X   *  Author    : I.Lea
  1487. X   *  Created   : 17-03-92
  1488. !  *  Updated   : 02-07-92
  1489. X   *  Notes     : NNTP builtin version of inews
  1490. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1491. X   *              You may  freely  copy or  redistribute  this software,
  1492. ***************
  1493. *** 14,20 ****
  1494. X  
  1495. X  #include    "tin.h"
  1496. X  
  1497. ! #if defined(BSD) || defined(RS6000)
  1498. X  #    ifdef apollo
  1499. X  #        include    </bsd4.3/usr/include/netdb.h>
  1500. X  #    else
  1501. --- 14,20 ----
  1502. X  
  1503. X  #include    "tin.h"
  1504. X  
  1505. ! #if defined(BSD) || defined(RS6000) || defined(sinix)
  1506. X  #    ifdef apollo
  1507. X  #        include    </bsd4.3/usr/include/netdb.h>
  1508. X  #    else
  1509. ***************
  1510. *** 63,69 ****
  1511. X       * Send Path: and From: article headers
  1512. X       */
  1513. X  #ifdef NNTP_INEWS_GATEWAY
  1514. !     sprintf (line, "Path: %s", userid);
  1515. X  #else
  1516. X      sprintf (line, "Path: %s!%s", host_name, userid);
  1517. X  #endif    
  1518. --- 63,73 ----
  1519. X       * Send Path: and From: article headers
  1520. X       */
  1521. X  #ifdef NNTP_INEWS_GATEWAY
  1522. !     if (*(NNTP_INEWS_GATEWAY)) {
  1523. !         sprintf (line, "Path: %s", userid);
  1524. !     } else {    
  1525. !         sprintf (line, "Path: %s!%s", host_name, userid);
  1526. !     }
  1527. X  #else
  1528. X      sprintf (line, "Path: %s!%s", host_name, userid);
  1529. X  #endif    
  1530. ***************
  1531. *** 110,158 ****
  1532. X  #ifndef INDEX_DAEMON
  1533. X  
  1534. X      char host[PATH_LEN];
  1535. ! #ifdef NNTP_INEWS_GATEWAY    
  1536. X      FILE *fp;
  1537. X  
  1538. X      host_name[0] = '\0';
  1539. X  
  1540. !     /*
  1541. !      * If 1st letter is '/' read gateway name from specified file
  1542. !      */
  1543. !     if (*(NNTP_INEWS_GATEWAY) == '/') {
  1544. !         if ((fp = fopen (NNTP_INEWS_GATEWAY, "r")) != (FILE *) 0) {
  1545. !             if (fgets (host, sizeof (host), fp) != (char *) 0) {
  1546. !                 my_strncpy (host_name, host, strlen (host)-1);
  1547. !             }    
  1548. !             fclose (fp);
  1549. X          }
  1550. !         if (! host_name[0]) {
  1551. !             strcpy(host_name, "PROBLEM_WITH_INEWS_GATEWAY_FILE");
  1552. !         }
  1553. !     } else {
  1554. !         strcpy (host_name, NNTP_INEWS_GATEWAY);
  1555. !     }    
  1556. ! #else
  1557. ! #    if defined(BSD) || defined(sinix) || defined(RS6000) || defined(HPUX)
  1558. !     {
  1559. !         struct hostent *host_entry;
  1560. !         gethostname (host, sizeof (host)); 
  1561. !         host_entry = gethostbyname (host);
  1562. !         my_strncpy (host, host_entry->h_name, sizeof (host)); 
  1563. !     }    
  1564. ! #    else    
  1565. !     {
  1566. !         struct utsname uts_name;
  1567. X  
  1568. !         uname (&uts_name);
  1569. !         my_strncpy (host, uts_name.nodename, sizeof (host));
  1570. X      }
  1571. - #    endif
  1572. -     strcpy (host_name, host);
  1573. - #endif
  1574. X  #endif /* INDEX_DAEMON */
  1575. X  }
  1576. X  
  1577. --- 114,168 ----
  1578. X  #ifndef INDEX_DAEMON
  1579. X  
  1580. X      char host[PATH_LEN];
  1581. !     char nntp_inews_gateway[PATH_LEN];
  1582. X      FILE *fp;
  1583. X  
  1584. X      host_name[0] = '\0';
  1585. +     nntp_inews_gateway[0] = '\0';
  1586. +     
  1587. + #ifdef NNTP_INEWS_GATEWAY
  1588. +     if (*(NNTP_INEWS_GATEWAY)) {
  1589. +         strcpy (nntp_inews_gateway, NNTP_INEWS_GATEWAY);
  1590. +     }
  1591. + #endif
  1592. +     
  1593. +     if (nntp_inews_gateway[0]) {
  1594. +         /*
  1595. +          * If 1st letter is '/' read gateway name from specified file
  1596. +          */
  1597. +         if (nntp_inews_gateway[0] == '/') {
  1598. +             if ((fp = fopen (nntp_inews_gateway, "r")) != (FILE *) 0) {
  1599. +                 if (fgets (host, sizeof (host), fp) != (char *) 0) {
  1600. +                     my_strncpy (host_name, host, strlen (host)-1);
  1601. +                 }    
  1602. +                 fclose (fp);
  1603. +             }
  1604. +             if (! host_name[0]) {
  1605. +                 strcpy(host_name, "PROBLEM_WITH_INEWS_GATEWAY_FILE");
  1606. +             }
  1607. +         } else {
  1608. +             strcpy (host_name, nntp_inews_gateway);
  1609. +         }    
  1610. +     } else {
  1611. + #        if defined(BSD) || defined(sinix) || defined(RS6000) || defined(HPUX)
  1612. +         {
  1613. +             struct hostent *host_entry;
  1614. +             gethostname (host, sizeof (host)); 
  1615. +             host_entry = gethostbyname (host);
  1616. +             my_strncpy (host, host_entry->h_name, sizeof (host)); 
  1617. +         }    
  1618. + #        else    
  1619. +         {
  1620. +             struct utsname uts_name;
  1621. X  
  1622. !             uname (&uts_name);
  1623. !             my_strncpy (host, uts_name.nodename, sizeof (host));
  1624. X          }
  1625. ! #        endif
  1626. X  
  1627. !         strcpy (host_name, host);
  1628. X      }
  1629. X  #endif /* INDEX_DAEMON */
  1630. X  }
  1631. X  
  1632. ***************
  1633. *** 165,185 ****
  1634. X  {
  1635. X  #ifndef INDEX_DAEMON
  1636. X  
  1637. !     char domain[256];
  1638. X      char full_name[128];
  1639. !     char host_name[256];
  1640. X      char *ptr;
  1641. - #ifdef NNTP_INEWS_DOMAIN
  1642. X      FILE *fp;
  1643. - #endif
  1644. X      
  1645. X      domain[0] = '\0';
  1646. !     
  1647. X      if ((ptr = (char *) getenv ("NAME")) != (char *) 0) {
  1648. X          my_strncpy (full_name, ptr, sizeof (full_name));
  1649. X      } else {    
  1650. X          my_strncpy (full_name, myentry->pw_gecos, sizeof (full_name));
  1651. !         if ((ptr = (char *) strchr (full_name, ','))) {
  1652. X              *ptr = '\0';            
  1653. X          }
  1654. X      }
  1655. --- 175,202 ----
  1656. X  {
  1657. X  #ifndef INDEX_DAEMON
  1658. X  
  1659. !     char domain[PATH_LEN];
  1660. X      char full_name[128];
  1661. !     char host_name[PATH_LEN];
  1662. !     char nntp_inews_domain[PATH_LEN];
  1663. X      char *ptr;
  1664. X      FILE *fp;
  1665. X      
  1666. X      domain[0] = '\0';
  1667. !     nntp_inews_domain[0] = '\0';
  1668. ! #ifdef NNTP_INEWS_DOMAIN
  1669. !     if (*(NNTP_INEWS_DOMAIN)) {
  1670. !         strcpy (nntp_inews_domain, NNTP_INEWS_DOMAIN);
  1671. !     }
  1672. ! #endif
  1673. !         
  1674. X      if ((ptr = (char *) getenv ("NAME")) != (char *) 0) {
  1675. X          my_strncpy (full_name, ptr, sizeof (full_name));
  1676. X      } else {    
  1677. X          my_strncpy (full_name, myentry->pw_gecos, sizeof (full_name));
  1678. !         ptr = (char *) strchr (full_name, ',');
  1679. !         if (ptr != (char *) 0) {
  1680. X              *ptr = '\0';            
  1681. X          }
  1682. X      }
  1683. ***************
  1684. *** 186,220 ****
  1685. X  
  1686. X      get_host_name (host_name);
  1687. X  
  1688. ! #ifdef NNTP_INEWS_DOMAIN
  1689. !     /*
  1690. !      * If 1st letter is '/' read domain name from specified file
  1691. !      */
  1692. !     if (*(NNTP_INEWS_DOMAIN) == '/') {
  1693. !         if ((fp = fopen (NNTP_INEWS_DOMAIN, "r")) != (FILE *) 0) {
  1694. !             if (fgets (domain, sizeof (domain), fp) != (char *) 0) {
  1695. !                 if (ptr = (char *) strchr (domain, '\n')) {
  1696. !                     *ptr = '\0';
  1697. X                  }
  1698. X              }
  1699. !             fclose (fp);
  1700. !         }
  1701. !         if (! domain[0]) {
  1702. !             strcpy (domain, "PROBLEM_WITH_INEWS_DOMAIN_FILE");
  1703. X          }
  1704. -     } else {
  1705. -         my_strncpy (domain, NNTP_INEWS_DOMAIN, sizeof (domain));
  1706. -     }
  1707. X      
  1708. !     if (domain[0] == '.') {
  1709. !         sprintf (from_name, "%s@%s%s (%s)",
  1710. !             userid, host_name, domain, full_name);
  1711. X      } else {    
  1712. !         sprintf (from_name, "%s@%s (%s)", userid, domain, full_name);
  1713. !     }        
  1714. ! #else    
  1715. !     sprintf (from_name, "%s@%s (%s)", userid, host_name, full_name);
  1716. ! #endif
  1717. X  
  1718. X      if (debug == 2) {
  1719. X          error_message ("FROM: %s", from_name);
  1720. --- 203,241 ----
  1721. X  
  1722. X      get_host_name (host_name);
  1723. X  
  1724. !     if (nntp_inews_domain[0]) {
  1725. !         /*
  1726. !          * If 1st letter is '/' read domain name from specified file
  1727. !          */
  1728. !         if (nntp_inews_domain[0] == '/') {
  1729. !             if ((fp = fopen (nntp_inews_domain, "r")) != (FILE *) 0) {
  1730. !                 if (fgets (domain, sizeof (domain), fp) != (char *) 0) {
  1731. !                     if (ptr = (char *) strchr (domain, '\n')) {
  1732. !                         *ptr = '\0';
  1733. !                     }
  1734. X                  }
  1735. +                 fclose (fp);
  1736. X              }
  1737. !             if (! domain[0]) {
  1738. !                 strcpy (domain, "PROBLEM_WITH_INEWS_DOMAIN_FILE");
  1739. !             }
  1740. !         } else {
  1741. !             my_strncpy (domain, nntp_inews_domain, sizeof (domain));
  1742. X          }
  1743. X      
  1744. !         if (domain[0] == '.') {
  1745. !             sprintf (from_name, "%s@%s%s (%s)",
  1746. !                 userid, host_name, domain, full_name);
  1747. !         } else {    
  1748. !             sprintf (from_name, "%s@%s (%s)", userid, domain, full_name);
  1749. !         }        
  1750. X      } else {    
  1751. !         if (host_name[0] == '%') {
  1752. !             sprintf (from_name, "%s%s (%s)", userid, host_name, full_name);
  1753. !         } else {
  1754. !             sprintf (from_name, "%s@%s (%s)", userid, host_name, full_name);
  1755. !         }
  1756. !     }
  1757. X  
  1758. X      if (debug == 2) {
  1759. X          error_message ("FROM: %s", from_name);
  1760. diff -rcs ../1.14/init.c ./init.c
  1761. *** ../1.14/init.c    Tue Aug 11 21:23:08 1992
  1762. --- ./init.c    Fri Aug  7 11:46:11 1992
  1763. ***************
  1764. *** 3,9 ****
  1765. X   *  Module    : init.c
  1766. X   *  Author    : I.Lea
  1767. X   *  Created   : 01-04-91
  1768. !  *  Updated   : 20-06-92
  1769. X   *  Notes     :
  1770. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1771. X   *              You may  freely  copy or  redistribute  this software,
  1772. --- 3,9 ----
  1773. X   *  Module    : init.c
  1774. X   *  Author    : I.Lea
  1775. X   *  Created   : 01-04-91
  1776. !  *  Updated   : 07-08-92
  1777. X   *  Notes     :
  1778. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1779. X   *              You may  freely  copy or  redistribute  this software,
  1780. ***************
  1781. *** 14,83 ****
  1782. X  
  1783. X  #include    "tin.h"
  1784. X  
  1785. - char rcdir[PATH_LEN];
  1786. - char rcfile[PATH_LEN];
  1787. - char indexdir[PATH_LEN];
  1788. - char killfile[PATH_LEN];
  1789. - char postfile[PATH_LEN];
  1790. - char unthreadfile[PATH_LEN];
  1791. - char cvers[LEN];
  1792. - char nntp_server[LEN];
  1793. X  char active_file[PATH_LEN];
  1794. ! char newsgroups_file[PATH_LEN];
  1795. ! char subscriptions_file[PATH_LEN];
  1796. ! char homedir[PATH_LEN];
  1797. ! char userid[LEN];
  1798. ! char delgroups[LEN];
  1799. ! char default_maildir[PATH_LEN];            /* mailbox dir where = saves are stored */
  1800. ! char newsrc[PATH_LEN];
  1801. ! char newnewsrc[PATH_LEN];
  1802. ! char add_addr[LEN];            /* address to add to rR reply to author with mail */
  1803. ! char bug_addr[LEN];            /* address to add send bug reports to */
  1804. ! char txt_help_bug_report[LEN];    /* address to add send bug reports to */
  1805. ! char reply_to[LEN];            /* Reply-To: address */
  1806. ! char my_org[LEN];            /* Organization: */
  1807. ! char my_distribution[LEN];        /* Distribution: */
  1808. X  char default_select_pattern[LEN];
  1809. X  char default_sigfile[PATH_LEN];
  1810. X  char default_signature[PATH_LEN];
  1811. X  char default_shell_command[LEN];    /* offers user default choice */
  1812. ! char killsubj[LEN];            /* contains Subject:'s not to be shown */
  1813. ! char killfrom[LEN];            /* conatins From:'s not to be shown */
  1814. ! char page_header[LEN];        /* page header of pgm name and version */
  1815. ! char default_savedir[PATH_LEN];            /* directory to save articles to */
  1816. ! char spooldir[PATH_LEN];        /* directory where news is */
  1817. ! char spooldir_alias[PATH_LEN];        /* alias of spooldir being used */
  1818. X  char mail_news_user[LEN];    /* mail new news to this user address */
  1819. ! char mailer[PATH_LEN];            /* mail program */
  1820. ! char mailbox[PATH_LEN];            /* system mailbox for each user */
  1821. ! char printer[LEN];            /* printer program specified from tinrc */
  1822. ! char cmd_line_printer[LEN];    /* printer program specified on cmd line */
  1823. ! char article[PATH_LEN];            /* ~/.article file */
  1824. ! char dead_article[PATH_LEN];    /* ~/dead.article file */
  1825. ! char progname[PATH_LEN];        /* program name */
  1826. X  char redirect_output[LEN];    /* /dev/null or nothing if -D option */
  1827. X  
  1828. X  int xindex_supported = FALSE;
  1829. X  int xuser_supported = FALSE;
  1830. X  int xspooldir_supported = FALSE;
  1831. ! int NOTESLINES;                        /* set in set_win_size () */
  1832. ! int RIGHT_POS;                        /* set in set_win_size () */
  1833. ! int MORE_POS;                        /* set in set_win_size () */
  1834. X  int confirm_action;
  1835. X  int max_subj = 0;
  1836. X  int max_from = 0;
  1837. ! int max_active;
  1838. ! int num_active;                        /* one past top of active */
  1839. ! int group_top;                        /* one past top of my_group */
  1840. ! int groupname_len = 0;                    /* one past top of my_group */
  1841. ! int catchup = FALSE;                /* mark all arts read in all subscribed groups */
  1842. ! int update_fork = FALSE;            /* update index files by forked tin -u */
  1843. ! int verbose = FALSE;                /* update index files only mode */
  1844. ! int start_line_offset;                /* used by invoke_editor for line no. */
  1845. ! int inn_nntp_server = FALSE;            /* read news via INN NNTP */
  1846. ! int read_news_via_nntp = FALSE;        /* read news locally or via NNTP */
  1847. ! int local_index;                    /* do private indexing? */
  1848. ! int max_art;
  1849. X  int real_gid;
  1850. X  int real_uid;
  1851. X  int real_umask;
  1852. --- 14,86 ----
  1853. X  
  1854. X  #include    "tin.h"
  1855. X  
  1856. X  char active_file[PATH_LEN];
  1857. ! char attributes_file[PATH_LEN];
  1858. ! char add_addr[LEN];        /* address to add to rR reply to author with mail */
  1859. ! char article[PATH_LEN];        /* ~/.article file */
  1860. ! char bug_addr[LEN];        /* address to add send bug reports to */
  1861. ! char cmd_line_printer[LEN];    /* printer program specified on cmd line */
  1862. ! char cvers[LEN];
  1863. ! char dead_article[PATH_LEN];    /* ~/dead.article file */
  1864. ! char default_maildir[PATH_LEN];    /* mailbox dir where = saves are stored */
  1865. X  char default_select_pattern[LEN];
  1866. X  char default_sigfile[PATH_LEN];
  1867. X  char default_signature[PATH_LEN];
  1868. X  char default_shell_command[LEN];    /* offers user default choice */
  1869. ! char default_savedir[PATH_LEN];        /* directory to save articles to */
  1870. ! char default_select_pattern[LEN];
  1871. ! char delgroups[LEN];
  1872. ! char homedir[PATH_LEN];
  1873. ! char indexdir[PATH_LEN];
  1874. ! char killfile[PATH_LEN];
  1875. ! char killsubj[LEN];        /* contains Subject:'s not to be shown */
  1876. ! char killfrom[LEN];        /* contains From:'s not to be shown */
  1877. ! char lock_file[PATH_LEN];    /* conatins name of index lock file */
  1878. X  char mail_news_user[LEN];    /* mail new news to this user address */
  1879. ! char mailbox[PATH_LEN];        /* system mailbox for each user */
  1880. ! char mailer[PATH_LEN];        /* mail program */
  1881. ! char my_org[LEN];        /* Organization: */
  1882. ! char my_distribution[LEN];    /* Distribution: */
  1883. ! char newsgroups_file[PATH_LEN];
  1884. ! char newsrc[PATH_LEN];
  1885. ! char newnewsrc[PATH_LEN];
  1886. ! char page_header[LEN];        /* page header of pgm name and version */
  1887. ! char postfile[PATH_LEN];
  1888. ! char printer[LEN];        /* printer program specified from tinrc */
  1889. ! char progname[PATH_LEN];    /* program name */
  1890. ! char quote_chars[PATH_LEN];    /* quote chars for posting/mails ": " */
  1891. ! char rcdir[PATH_LEN];
  1892. ! char rcfile[PATH_LEN];
  1893. X  char redirect_output[LEN];    /* /dev/null or nothing if -D option */
  1894. + char reply_to[LEN];        /* Reply-To: address */
  1895. + char spooldir[PATH_LEN];    /* directory where news is */
  1896. + char spooldir_alias[PATH_LEN];    /* alias of spooldir being used */
  1897. + char subscriptions_file[PATH_LEN];
  1898. + char txt_help_bug_report[LEN];    /* address to add send bug reports to */
  1899. + char userid[PATH_LEN];
  1900. X  
  1901. + int unread_art_mark;
  1902. + int hot_art_mark;
  1903. + int return_art_mark;
  1904. X  int xindex_supported = FALSE;
  1905. X  int xuser_supported = FALSE;
  1906. X  int xspooldir_supported = FALSE;
  1907. ! int NOTESLINES;            /* set in set_win_size () */
  1908. ! int RIGHT_POS;            /* set in set_win_size () */
  1909. ! int MORE_POS;            /* set in set_win_size () */
  1910. X  int confirm_action;
  1911. X  int max_subj = 0;
  1912. X  int max_from = 0;
  1913. ! int group_top;            /* one past top of my_group */
  1914. ! int groupname_len = 0;        /* one past top of my_group */
  1915. ! int catchup = FALSE;        /* mark all arts read in all subscribed groups */
  1916. ! int update_fork = FALSE;    /* update index files by forked tin -u */
  1917. ! int verbose = FALSE;        /* update index files only mode */
  1918. ! int start_line_offset;        /* used by invoke_editor for line no. */
  1919. ! int inn_nntp_server = FALSE;    /* read news via INN NNTP */
  1920. ! int read_news_via_nntp = FALSE;    /* read news locally or via NNTP */
  1921. ! int local_index;        /* do private indexing? */
  1922. X  int real_gid;
  1923. X  int real_uid;
  1924. X  int real_umask;
  1925. ***************
  1926. *** 88,102 ****
  1927. X  int top = 0;
  1928. X  int top_base;
  1929. X  int check_any_unread = FALSE;
  1930. - int notify_new_groups = FALSE;
  1931. X  int start_any_unread = FALSE;
  1932. X  
  1933. X  int catchup_read_groups;    /* ask if read groups are to be marked read */
  1934. ! int cmd_line;                /* batch / interactive mode */
  1935. ! int created_rcdir;            /* checks if first time tin is started */
  1936. X  int default_printer;        /* set to false if user give a printer with -p switch */
  1937. X  int default_show_author;    /* show_author value from 'M' menu in tinrc */
  1938. X  int draw_arrow_mark;        /* draw -> or highlighted bar */
  1939. X  int full_page_scroll;        /* page half/full screen of articles/groups */
  1940. X  int killed_articles;        /* killed / auto-selected hot articles */
  1941. X  int mark_saved_read;        /* mark saved article/thread as read */
  1942. --- 91,111 ----
  1943. X  int top = 0;
  1944. X  int top_base;
  1945. X  int check_any_unread = FALSE;
  1946. X  int start_any_unread = FALSE;
  1947. X  
  1948. X  int catchup_read_groups;    /* ask if read groups are to be marked read */
  1949. ! int cmd_line;            /* batch / interactive mode */
  1950. ! int check_for_new_newsgroups;    /* don't check for new newsgroups */
  1951. ! int created_rcdir;        /* checks if first time tin is started */
  1952. ! int default_auto_save;        /* save thread with name from Archive-name: field */
  1953. ! int default_batch_save;        /* save arts if -M/-S command line switch specified */
  1954. X  int default_printer;        /* set to false if user give a printer with -p switch */
  1955. X  int default_show_author;    /* show_author value from 'M' menu in tinrc */
  1956. + int default_show_only_unread;    /* show only new/unread arts or all arts */
  1957. + int default_sort_art_type;    /* sort arts[] array by subject,from or date field */
  1958. + int default_thread_arts;    /* thread/unthread articles for viewing */
  1959. X  int draw_arrow_mark;        /* draw -> or highlighted bar */
  1960. + int force_screen_redraw;    /* force screen redraw after external (shell) commands */
  1961. X  int full_page_scroll;        /* page half/full screen of articles/groups */
  1962. X  int killed_articles;        /* killed / auto-selected hot articles */
  1963. X  int mark_saved_read;        /* mark saved article/thread as read */
  1964. ***************
  1965. *** 105,127 ****
  1966. X  int num_of_tagged_arts;
  1967. X  int process_id;
  1968. X  int pos_first_unread;        /* position cursor at first/last unread article */
  1969. ! int post_proc_type;            /* type of post processing to be performed */
  1970. ! int print_header;            /* print all of mail header or just Subject: & From lines */
  1971. ! int save_archive_name;        /* save thread with name from Archive-name: field */
  1972. ! int mail_news;                /* mail all arts to specified user */
  1973. ! int save_news;                /* save all arts to savedir structure */
  1974. ! int show_author;            /* show Subject & From or only Subject in group menu */
  1975. ! int show_only_unread;        /* show only new/unread arts or all arts */
  1976. ! int spooldir_is_active;            /* set TRUE if current spooldir is active news feed */
  1977. ! int sort_art_type;            /* sort arts[] array by subject,from or date field */
  1978. ! int thread_arts;            /* thread/unthread articles for viewing */
  1979. X  int system_status;
  1980. X  
  1981. - #ifdef INDEX_DAEMON
  1982. - int update = TRUE;                    /* update index files only mode */
  1983. - #else
  1984. - int update = FALSE;                    /* update index files only mode */
  1985. - #endif
  1986. X  
  1987. X  struct passwd *myentry;
  1988. X  
  1989. --- 114,132 ----
  1990. X  int num_of_tagged_arts;
  1991. X  int process_id;
  1992. X  int pos_first_unread;        /* position cursor at first/last unread article */
  1993. ! int default_post_proc_type;        /* type of post processing to be performed */
  1994. ! int print_header;        /* print all of mail header or just Subject: & From lines */
  1995. ! int reread_active_file_secs;    /* reread active file interval in seconds */
  1996. ! int mail_news;            /* mail all arts to specified user */
  1997. ! int save_news;            /* save all arts to savedir structure */
  1998. ! int show_author;
  1999. ! int show_last_line_prev_page;    /* set TRUE to see last line of prev page (ala nn) */
  2000. ! int show_only_unread_groups;    /* set TRUE to see only subscribed groups with new news */
  2001. ! int spooldir_is_active;        /* set TRUE if current spooldir is active news feed */
  2002. X  int system_status;
  2003. + int tab_after_X_selection;    /* set TRUE if you want auto TAB after X */
  2004. + int update;            /* update index files only mode */
  2005. X  
  2006. X  
  2007. X  struct passwd *myentry;
  2008. X  
  2009. ***************
  2010. *** 181,186 ****
  2011. --- 186,194 ----
  2012. X          strcpy (homedir, myentry->pw_dir);
  2013. X      }
  2014. X  
  2015. +     unread_art_mark = UNREAD_ART_MARK;
  2016. +     hot_art_mark = HOT_ART_MARK;
  2017. +     return_art_mark = RETURN_ART_MARK;
  2018. X      catchup_read_groups = FALSE;
  2019. X      confirm_action = TRUE;
  2020. X      created_rcdir = FALSE;
  2021. ***************
  2022. *** 190,196 ****
  2023. --- 198,207 ----
  2024. X  #else
  2025. X      draw_arrow_mark = FALSE;
  2026. X  #endif
  2027. +     default_auto_save = TRUE;
  2028. +     default_batch_save = FALSE;
  2029. X      default_move_group = 0;
  2030. +     default_post_proc_type = POST_PROC_NONE;
  2031. X  #ifdef BSD
  2032. X      default_printer = TRUE;
  2033. X  #else    
  2034. ***************
  2035. *** 197,202 ****
  2036. --- 208,217 ----
  2037. X      default_printer = FALSE;
  2038. X  #endif
  2039. X      default_show_author = SHOW_FROM_NAME;
  2040. +     default_show_only_unread = FALSE;
  2041. +     default_sort_art_type = SORT_BY_DATE_ASCEND;
  2042. +     default_thread_arts = TRUE;
  2043. +     force_screen_redraw = FALSE;
  2044. X      full_page_scroll = TRUE;
  2045. X      killed_articles = FALSE;
  2046. X      mark_saved_read = TRUE;
  2047. ***************
  2048. *** 203,218 ****
  2049. X      num_of_hot_arts = 0;
  2050. X      num_of_killed_arts = 0;
  2051. X      num_of_tagged_arts = 0;
  2052. -     post_proc_type = POST_PROC_NONE;
  2053. X      pos_first_unread = TRUE;
  2054. X      print_header = FALSE;
  2055. !     save_archive_name = TRUE;
  2056. X      save_news = FALSE;
  2057. !     show_only_unread = FALSE;
  2058. X      show_description = TRUE;
  2059. !     sort_art_type = SORT_BY_DATE_ASCEND;
  2060. X      start_editor_offset = TRUE;
  2061. !     thread_arts = TRUE;
  2062. X      
  2063. X      killsubj[0] = '\0';
  2064. X      killfrom[0] = '\0';
  2065. --- 218,241 ----
  2066. X      num_of_hot_arts = 0;
  2067. X      num_of_killed_arts = 0;
  2068. X      num_of_tagged_arts = 0;
  2069. X      pos_first_unread = TRUE;
  2070. X      print_header = FALSE;
  2071. !     reread_active_file_secs = 0;
  2072. X      save_news = FALSE;
  2073. !     show_last_line_prev_page = FALSE;
  2074. X      show_description = TRUE;
  2075. !     show_only_unread_groups = FALSE;
  2076. X      start_editor_offset = TRUE;
  2077. !     tab_after_X_selection = FALSE;
  2078. ! #ifdef INDEX_DAEMON
  2079. !     check_for_new_newsgroups = FALSE;
  2080. !     update = TRUE;
  2081. ! #else
  2082. !     check_for_new_newsgroups = TRUE;
  2083. !     update = FALSE;
  2084. ! #endif
  2085. !     newsrc[0] = '\0';
  2086. X      
  2087. X      killsubj[0] = '\0';
  2088. X      killfrom[0] = '\0';
  2089. ***************
  2090. *** 231,237 ****
  2091. X      default_save_file[0] = '\0';
  2092. X      default_select_pattern[0] = '\0';
  2093. X      default_shell_command[0] = '\0';
  2094. -     nntp_server[0] = '\0';
  2095. X      proc_ch_default = 'n';
  2096. X  
  2097. X      /*
  2098. --- 254,259 ----
  2099. ***************
  2100. *** 243,248 ****
  2101. --- 265,271 ----
  2102. X      set_tindir ();    
  2103. X  
  2104. X      sprintf (active_file, "%s/active", LIBDIR);
  2105. +     sprintf (attributes_file, "%s/attributes", rcdir);
  2106. X      sprintf (article, "%s/.article", homedir);
  2107. X      sprintf (dead_article, "%s/dead.article", homedir);
  2108. X      sprintf (delgroups, "%s/.delgroups", homedir);
  2109. ***************
  2110. *** 256,291 ****
  2111. X  
  2112. X      strcpy (mailer, get_val ("MAILER", DEFAULT_MAILER));
  2113. X      strcpy (printer, DEFAULT_PRINTER);
  2114. X      strcpy (spooldir, SPOOLDIR);
  2115. X      strcpy (bug_addr, BUG_REPORT_ADDRESS);
  2116. X      strcpy (redirect_output, "> /dev/null 2>&1");
  2117. X  
  2118. X  #ifdef INDEX_DAEMON
  2119. !     /*
  2120. !      * Check for lock file to stop multiple copies of tind running and
  2121. !      * if it does not exist create it so this is the only copy running
  2122. !      */
  2123. !     if (stat (LOCK_FILE, &sb) == 0) {
  2124. !         if ((fp = fopen (LOCK_FILE, "r")) != (FILE *) 0) {
  2125. !             fgets (nam, sizeof (nam), fp);
  2126. !             fclose (fp);
  2127. !             fprintf(stderr, "%s: Already started pid=[%d] on %s", 
  2128. !                 progname, atoi(nam), nam+8);
  2129. !             exit (1);
  2130. !         }
  2131. !     } else {
  2132. !         {
  2133. !             long epoch;
  2134. !             
  2135. !             if ((fp = fopen (LOCK_FILE, "w")) != (FILE *) 0) {
  2136. !                 time (&epoch);
  2137. !                 fprintf (fp, "%6d  %s", process_id, ctime (&epoch));
  2138. !                 fclose (fp);
  2139. !                 chmod (LOCK_FILE, 0600);
  2140. !             }
  2141. !         }    
  2142. !     }
  2143. !      
  2144. X      strcpy (newsrc, active_file);    /* so that all groups are indexed */
  2145. X      sprintf (indexdir, "%s/.index", spooldir);
  2146. X  
  2147. --- 279,291 ----
  2148. X  
  2149. X      strcpy (mailer, get_val ("MAILER", DEFAULT_MAILER));
  2150. X      strcpy (printer, DEFAULT_PRINTER);
  2151. +     strcpy (quote_chars, DEFAULT_COMMENT);
  2152. X      strcpy (spooldir, SPOOLDIR);
  2153. X      strcpy (bug_addr, BUG_REPORT_ADDRESS);
  2154. X      strcpy (redirect_output, "> /dev/null 2>&1");
  2155. X  
  2156. X  #ifdef INDEX_DAEMON
  2157. !     strcpy (lock_file, LOCK_FILE);    
  2158. X      strcpy (newsrc, active_file);    /* so that all groups are indexed */
  2159. X      sprintf (indexdir, "%s/.index", spooldir);
  2160. X  
  2161. ***************
  2162. *** 293,298 ****
  2163. --- 293,304 ----
  2164. X          mkdir (indexdir, 0777);
  2165. X      }
  2166. X  #else
  2167. + #    ifdef LONG_FILENAMES
  2168. +         sprintf (lock_file, "/tmp/tin.%s.LCK", userid);    
  2169. + #    else
  2170. +         sprintf (lock_file, "/tmp/%s.LCK", userid);    
  2171. + #endif
  2172. X      if (stat (rcdir, &sb) == -1) {
  2173. X          created_rcdir = TRUE;
  2174. X          mkdir (rcdir, 0755);
  2175. ***************
  2176. *** 313,328 ****
  2177. X              fclose (fp);
  2178. X          }
  2179. X      }
  2180. -     if (stat (unthreadfile, &sb) == -1) {
  2181. -         if ((fp = fopen (unthreadfile, "w")) != NULL) {
  2182. -             fclose (fp);
  2183. -         }
  2184. -     }
  2185. X  
  2186. X      read_rcfile ();
  2187. X  
  2188. -     show_author = default_show_author;
  2189. X  #endif /* INDEX_DAEMON */    
  2190. X  
  2191. X      if (stat (active_file, &sb) >= 0)
  2192. --- 319,327 ----
  2193. ***************
  2194. *** 520,529 ****
  2195. X          sprintf (rcfile,   "%s/%s", rcdir, RCFILE);
  2196. X          sprintf (killfile, "%s/%s", rcdir, KILLFILE);
  2197. X          sprintf (postfile, "%s/%s", rcdir, POSTFILE);
  2198. !         sprintf (unthreadfile, "%s/%s", rcdir, UNTHREADFILE);
  2199. !         sprintf (newsrc, "%s/.newsrc", homedir);
  2200. !         sprintf (newnewsrc, "%s/.newnewsrc", homedir);
  2201. X          spooldir_is_active = TRUE;
  2202. X          reread_active_file = TRUE;
  2203. X      }
  2204. --- 519,528 ----
  2205. X          sprintf (rcfile,   "%s/%s", rcdir, RCFILE);
  2206. X          sprintf (killfile, "%s/%s", rcdir, KILLFILE);
  2207. X          sprintf (postfile, "%s/%s", rcdir, POSTFILE);
  2208. !         if (newsrc[0] == '\0') {
  2209. !             sprintf (newsrc, "%s/.newsrc", homedir);
  2210. !             sprintf (newnewsrc, "%s/.newnewsrc", homedir);
  2211. !         }    
  2212. X          spooldir_is_active = TRUE;
  2213. X          reread_active_file = TRUE;
  2214. X      }
  2215. ***************
  2216. *** 550,552 ****
  2217. --- 549,552 ----
  2218. X      
  2219. X      return (created);
  2220. X  }
  2221. Files ../1.14/kill and ./kill are identical
  2222. diff -rcs ../1.14/kill.c ./kill.c
  2223. *** ../1.14/kill.c    Tue Aug 11 21:23:09 1992
  2224. --- ./kill.c    Wed Aug  5 06:58:05 1992
  2225. ***************
  2226. *** 3,9 ****
  2227. X   *  Module    : kill.c
  2228. X   *  Author    : I.Lea & J.Robinson
  2229. X   *  Created   : 01-04-91
  2230. !  *  Updated   : 20-06-92
  2231. X   *  Notes     : kill & auto select (hot) articles
  2232. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Jim Robinson
  2233. X   *              You may  freely  copy or  redistribute  this software,
  2234. SHAR_EOF
  2235. true || echo 'restore of tin-1.15.patch failed'
  2236. fi
  2237. echo 'End of tin-1.15 part 3'
  2238. echo 'File tin-1.15.patch is continued in part 4'
  2239. echo 4 > _shar_seq_.tmp
  2240. exit 0
  2241.  
  2242. --
  2243. NAME   Iain Lea 
  2244. EMAIL  iain%anl433.uucp@Germany.EU.net
  2245. SNAIL  Siemens AG, ANL A433SZ, Gruendlacher Str. 248, 8510 Fuerth, Germany.
  2246. PHONE  +49-911-3089-407 (work) +49-911-331963 (home) +49-911-3089-290 (FAX)  
  2247. exit 0 # Just in case...
  2248.