home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume28 / tin / part05 < prev    next >
Encoding:
Text File  |  1992-02-22  |  50.4 KB  |  1,624 lines

  1. Newsgroups: comp.sources.misc
  2. From: iain%estevax.uucp@unido.Informatik.Uni-Dortmund.DE (Iain Lea)
  3. Subject:  v28i049:  tin - threaded full screen newsreader v1.1, Part05/11
  4. Message-ID: <1992Feb18.043724.13083@sparky.imd.sterling.com>
  5. X-Md4-Signature: ab1fe184547579d29e9003e091f7674a
  6. Date: Tue, 18 Feb 1992 04:37:24 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: iain%estevax.uucp@unido.Informatik.Uni-Dortmund.DE (Iain Lea)
  10. Posting-number: Volume 28, Issue 49
  11. Archive-name: tin/part05
  12. Environment: BSD, SCO, ISC, SUNOS, SYSVR3, SYSVR4, ULTRIX, XENIX
  13. Supersedes: tin: Volume 23, Issue 15-23
  14.  
  15. #!/bin/sh
  16. # this is tin.shar.05 (part 5 of tin1.1)
  17. # do not concatenate these parts, unpack them in order with /bin/sh
  18. # file help.c continued
  19. #
  20. if test ! -r _shar_seq_.tmp; then
  21.     echo 'Please unpack part 1 first!'
  22.     exit 1
  23. fi
  24. (read Scheck
  25.  if test "$Scheck" != 5; then
  26.     echo Please unpack part "$Scheck" next!
  27.     exit 1
  28.  else
  29.     exit 0
  30.  fi
  31. ) < _shar_seq_.tmp || exit 1
  32. if test ! -f _shar_wnt_.tmp; then
  33.     echo 'x - still skipping help.c'
  34. else
  35. echo 'x - continuing file help.c'
  36. sed 's/^X//' << 'SHAR_EOF' >> 'help.c' &&
  37. X                }
  38. X            }
  39. X        }
  40. X
  41. X        if (cur_page != old_page) {
  42. X            center_line (LINES, FALSE, txt_hit_space_for_more);
  43. X        }
  44. X
  45. X        old_page = cur_page;
  46. X        
  47. X        ch = (char) ReadCh ();
  48. X        switch (ch) {
  49. X            case ESC:    /* common arrow keys */
  50. X                switch (get_arrow_key ()) {
  51. X                    case KEYMAP_UP:
  52. X                    case KEYMAP_PAGE_UP:
  53. X                        if (cur_page > 1) {
  54. X                            cur_page--;
  55. X                            pos_help = (cur_page-1)*NOTESLINES;
  56. X                        }
  57. X                        break;
  58. X
  59. X                    case KEYMAP_DOWN:
  60. X                    case KEYMAP_PAGE_DOWN:
  61. X                        if (cur_page < max_page) {
  62. X                            pos_help = cur_page*NOTESLINES;
  63. X                            cur_page++;
  64. X                        }
  65. X                        break;
  66. X
  67. X                    case KEYMAP_HOME:
  68. X                        if (cur_page != 1) {
  69. X                            cur_page = 1;
  70. X                            pos_help = 0;
  71. X                        }
  72. X                        break;
  73. X                    
  74. X                    case KEYMAP_END:
  75. X                        if (cur_page != max_page) {
  76. X                            cur_page = max_page;
  77. X                            pos_help = (max_page-1) * NOTESLINES;
  78. X                        }
  79. X                        break;
  80. X                }
  81. X                break;
  82. X
  83. X            case ctrl('D'):            /* page down */
  84. X            case ' ':
  85. X                if (cur_page < max_page) {
  86. X                    pos_help = cur_page*NOTESLINES;
  87. X                    cur_page++;
  88. X                }
  89. X                break;
  90. X            
  91. X            case ctrl('U'):            /* page up */
  92. X            case 'b':
  93. X                if (cur_page > 1) {
  94. X                    cur_page--;
  95. X                    pos_help = (cur_page-1)*NOTESLINES;
  96. X                }
  97. X                break;
  98. X
  99. X            case ctrl('R'):            /* Home */
  100. X            case 'g':
  101. X                if (cur_page != 1) {
  102. X                    cur_page = 1;
  103. X                    pos_help = 0;
  104. X                }
  105. X                break;
  106. X
  107. X            case '$':                /* End */
  108. X            case 'G':
  109. X                if (cur_page != max_page) {
  110. X                    cur_page = max_page;
  111. X                    pos_help = (max_page-1) * NOTESLINES;
  112. X                }
  113. X                break;
  114. X
  115. X            default:
  116. #ifndef USE_CLEARSCREEN
  117. X                ClearScreen ();
  118. #endif    
  119. X                return;
  120. X        }    
  121. X    }
  122. }
  123. SHAR_EOF
  124. echo 'File help.c is complete' &&
  125. chmod 0600 help.c ||
  126. echo 'restore of help.c failed'
  127. Wc_c="`wc -c < 'help.c'`"
  128. test 5206 -eq "$Wc_c" ||
  129.     echo 'help.c: original size 5206, current size' "$Wc_c"
  130. rm -f _shar_wnt_.tmp
  131. fi
  132. # ============= init.c ==============
  133. if test -f 'init.c' -a X"$1" != X"-c"; then
  134.     echo 'x - skipping init.c (File already exists)'
  135.     rm -f _shar_wnt_.tmp
  136. else
  137. > _shar_wnt_.tmp
  138. echo 'x - extracting init.c (Text)'
  139. sed 's/^X//' << 'SHAR_EOF' > 'init.c' &&
  140. /*
  141. X *  Project   : tin - a threaded Netnews reader
  142. X *  Module    : init.c
  143. X *  Author    : I.Lea
  144. X *  Created   : 01-04-91
  145. X *  Updated   : 04-02-92
  146. X *  Notes     :
  147. X *  Copyright : (c) Copyright 1991-92 by Iain Lea
  148. X *              You may  freely  copy or  redistribute  this software,
  149. X *              so  long as there is no profit made from its use, sale
  150. X *              trade or  reproduction.  You may not change this copy-
  151. X *              right notice, and it must be included in any copy made
  152. X */
  153. X
  154. #include    "tin.h"
  155. X
  156. X
  157. char rcdir[LEN];
  158. char rcfile[LEN];
  159. char indexdir[LEN];
  160. char killfile[LEN];
  161. char postfile[LEN];
  162. char unthreadfile[LEN];
  163. X
  164. char active_file[LEN];
  165. char homedir[LEN];
  166. char userid[LEN];
  167. char delgroups[LEN];
  168. char newsrc[LEN];
  169. char newnewsrc[LEN];
  170. char add_addr[LEN];            /* address to add to rR reply to author with mail */
  171. char bug_addr[LEN];            /* address to add send bug reports to */
  172. char txt_help_bug_report[LEN];    /* address to add send bug reports to */
  173. char reply_to[LEN];            /* reply-to address */
  174. char my_org[LEN];            /* organization */
  175. char sig[LEN];
  176. char signature[LEN];
  177. char default_shell_command[LEN];    /* offers user default choice */
  178. char killsubj[LEN];            /* contains Subject:'s not to be shown */
  179. char killfrom[LEN];            /* conatins From:'s not to be shown */
  180. char page_header[LEN];        /* page header of pgm name and version */
  181. char savedir[LEN];            /* directory to save articles to */
  182. char spooldir[LEN];            /* directory where new is */
  183. char mail_news_user[LEN];    /* mail new news to this user address */
  184. char mailer[LEN];            /* mail program */
  185. char maildir[LEN];            /* mailbox dir where = saves are stored */
  186. char mailbox[LEN];            /* system mailbox for each user */
  187. char printer[LEN];            /* printer program specified from tinrc */
  188. char cmd_line_printer[LEN];    /* printer program specified on cmd line */
  189. char article[LEN];            /* ~/.article file */
  190. char dead_article[LEN];        /* ~/dead.article file */
  191. char progname[LEN];            /* program name */
  192. char redirect_output[LEN];    /* /dev/null or nothing if -D option */
  193. int catchup_read_groups;    /* ask if read groups are to be marked read */
  194. int cmd_line;                /* batch / interactive mode */
  195. int created_rcdir;            /* checks if first time tin is started */
  196. int default_printer;        /* set to false if user give a printer with -p switch */
  197. int default_show_author;    /* show_author value from 'M' menu in tinrc */
  198. int draw_arrow_mark;        /* draw -> or highlighted bar */
  199. int full_page_scroll;        /* page half/full screen of articles/groups */
  200. int kill_articles;            /* kill articles matching kill file contents */
  201. int mark_saved_read;        /* mark saved article/thread as read */
  202. int num_of_killed_files;
  203. int num_of_tagged_files;
  204. int pos_first_unread;        /* position cursor at first/last unread article */
  205. int post_proc_type;            /* type of post processing to be performed */
  206. int print_header;            /* print all of mail header or just Subject: & From lines */
  207. int save_archive_name;        /* save thread with name from Archive-name: field */
  208. int mail_news;                /* mail all arts to specified user */
  209. int save_news;                /* save all arts to savedir structure */
  210. int save_separate;            /* save a each part of a thread to a separate file */
  211. int show_author;            /* show Subject & From or only Subject in group menu */
  212. int show_only_unread;        /* show only new/unread arts or all arts */
  213. int sort_art_type;            /* sort arts[] array by subject,from or date field */
  214. int thread_arts;            /* thread/unthread articles for viewing */
  215. struct passwd *myentry;
  216. X
  217. /*
  218. X * init_selfinfo
  219. X *   Deterimines users home directory, userid, and a path
  220. X *   for an rc file in the home directory
  221. X */
  222. X
  223. void init_selfinfo ()
  224. {
  225. X    extern char *getenv ();
  226. X    extern char *getlogin ();
  227. X    extern struct passwd *getpwuid ();
  228. X    extern struct passwd *getpwnam ();
  229. X    char nam[LEN];
  230. X    char *p;
  231. X    FILE *fp;
  232. X    struct stat sb;
  233. X
  234. X    myentry = (struct passwd *) 0;
  235. X    if ((p = getlogin ()) != (char *) 0) {
  236. X        myentry = getpwnam (p);
  237. X    } else {
  238. X        myentry = getpwuid (getuid ());
  239. X    }
  240. X
  241. X    strcpy (userid, myentry->pw_name);
  242. X
  243. X    if ((p = getenv ("HOME")) != NULL) {
  244. X        strcpy (homedir, p);
  245. X    } else {
  246. X        strcpy (homedir, myentry->pw_dir);
  247. X    }
  248. X
  249. X    catchup_read_groups = TRUE;
  250. X    created_rcdir = FALSE;
  251. #ifdef USE_INVERSE_HACK
  252. X    draw_arrow_mark = TRUE;
  253. #else
  254. X    draw_arrow_mark = FALSE;
  255. #endif
  256. #ifdef BSD
  257. X    default_printer = TRUE;
  258. #else    
  259. X    default_printer = FALSE;
  260. #endif
  261. X    full_page_scroll = TRUE;
  262. X    kill_articles = FALSE;
  263. X    mark_saved_read = TRUE;
  264. X    num_of_killed_files = 0;
  265. X    num_of_tagged_files = 0;
  266. X    post_proc_type = POST_PROC_NONE;
  267. X    pos_first_unread = TRUE;
  268. X    print_header = FALSE;
  269. X    save_separate = TRUE;
  270. X    save_archive_name = TRUE;
  271. X    default_show_author = SHOW_FROM_NAME;
  272. X    show_only_unread = FALSE;
  273. X    sort_art_type = SORT_BY_NOTHING;
  274. X    save_news = FALSE;
  275. X    thread_arts = TRUE;
  276. X    
  277. X    killsubj[0] = '\0';
  278. X    killfrom[0] = '\0';
  279. X    
  280. X    nntp_server[0] = '\0';
  281. X    author_search_string[0] = '\0';
  282. X    group_search_string[0] = '\0';
  283. X    subject_search_string[0] = '\0';
  284. X    art_search_string[0] = '\0';
  285. X    default_mail_address[0] = '\0';
  286. X    default_regex_pattern[0] = '\0';
  287. X    default_save_file[0] = '\0';
  288. X    default_shell_command[0] = '\0';
  289. X    default_post_subject[0] = '\0';
  290. X    cmd_line_printer[0] = '\0';
  291. X    
  292. X    sprintf (rcdir,  "%s/%s", get_val ("TINDIR", homedir), RCDIR);
  293. X    sprintf (indexdir, "%s/%s", rcdir, INDEXDIR);
  294. X    sprintf (rcfile,   "%s/%s", rcdir, RCFILE);
  295. X    sprintf (killfile, "%s/%s", rcdir, KILLFILE);
  296. X    sprintf (postfile, "%s/%s", rcdir, POSTFILE);
  297. X    sprintf (unthreadfile, "%s/%s", rcdir, UNTHREADFILE);
  298. X
  299. X    sprintf (signature, "%s/.signature", homedir);
  300. X    sprintf (sig, "%s/.Sig", homedir);
  301. X    sprintf (newsrc, "%s/.newsrc", homedir);
  302. X    sprintf (newnewsrc, "%s/.newnewsrc", homedir);
  303. X    sprintf (delgroups, "%s/.delgroups", homedir);
  304. X    sprintf (active_file, "%s/active", LIBDIR);
  305. X    sprintf (savedir, "%s/News", homedir);
  306. X    sprintf (maildir, "%s/%s", homedir, DEFAULT_MAILDIR);
  307. X    sprintf (mailbox, "%s/%s", DEFAULT_MAILBOX, userid);
  308. X    sprintf (dead_article, "%s/dead.article", homedir);
  309. X    sprintf (article, "%s/.article", homedir);
  310. X
  311. X    strcpy (mailer, DEFAULT_MAILER);
  312. X    strcpy (printer, DEFAULT_PRINTER);
  313. X    strcpy (spooldir, SPOOLDIR);
  314. X    strcpy (bug_addr, BUG_REPORT_ADDRESS);
  315. X    strcpy (redirect_output, "> /dev/null 2>&1");
  316. X
  317. X    set_real_uid_gid ();
  318. X    
  319. X    if (stat (rcdir, &sb) == -1) {
  320. X        created_rcdir = TRUE;
  321. X        mkdir (rcdir, 0755);
  322. X    }
  323. X    if (stat (indexdir, &sb) == -1) {
  324. X        mkdir (indexdir, 0755);
  325. X    }
  326. X    if (stat (postfile, &sb) == -1) {
  327. X        if ((fp = fopen (postfile, "w")) != NULL) {
  328. X            fclose (fp);
  329. X        }
  330. X    }
  331. X    if (stat (unthreadfile, &sb) == -1) {
  332. X        if ((fp = fopen (unthreadfile, "w")) != NULL) {
  333. X            fclose (fp);
  334. X        }
  335. X    }
  336. X
  337. X    read_rcfile ();
  338. X
  339. X    show_author = default_show_author;
  340. X
  341. X    if (stat (savedir, &sb) == -1) {
  342. X        mkdir (savedir, 0755);
  343. X    }
  344. X    if (stat (maildir, &sb) == -1) {
  345. X        mkdir (maildir, 0755);
  346. X    }
  347. X    if (stat (active_file, &sb) >= 0)
  348. X        goto got_active;
  349. X
  350. /*
  351. X *  I hate forgetting to define LIBDIR correctly.  Guess a
  352. X *  couple of likely places if it's not where LIBDIR says it is.
  353. X */
  354. X
  355. X    strcpy (active_file, "/usr/lib/news/active");
  356. X    if (stat (active_file, &sb) >= 0)
  357. X        goto got_active;
  358. X
  359. X    strcpy (active_file, "/usr/local/lib/news/active");
  360. X    if (stat (active_file, &sb) >= 0)
  361. X        goto got_active;
  362. X
  363. X    strcpy (active_file, "/usr/public/lib/news/active");
  364. X    if (stat (active_file, &sb) >= 0)
  365. X        goto got_active;
  366. X
  367. /*
  368. X *  Oh well. Revert to what LIBDIR says it is to produce a
  369. X *  useful error message when read_active () fails later.
  370. X */
  371. X
  372. X    sprintf (active_file, "%s/active", LIBDIR);
  373. X
  374. got_active:
  375. X
  376. /*
  377. X *  check enviroment for organization
  378. X */
  379. X    my_org[0] = '\0';
  380. X    if ((p = getenv ("ORGANIZATION")) != NULL) {
  381. X        my_strncpy (my_org, p, LEN);
  382. X        goto got_org;
  383. X    }
  384. X
  385. /*
  386. X *  check ~/.org for organization
  387. X */
  388. X    sprintf (nam, "%s/organization", rcdir);
  389. X    fp = fopen (nam, "r");
  390. X
  391. /*
  392. X *  check LIBDIR/organization for system wide organization
  393. X */
  394. X    if (fp == NULL) {
  395. X        sprintf (nam, "%s/organization", LIBDIR);
  396. X        fp = fopen (nam, "r");
  397. X    }
  398. X
  399. X    if (fp == NULL) {
  400. X        sprintf (nam, "/usr/lib/news/organization");
  401. X        fp = fopen (nam, "r");
  402. X    }
  403. X
  404. X    if (fp == NULL) {
  405. X        sprintf (nam, "/usr/local/lib/news/organization");
  406. X        fp = fopen (nam, "r");
  407. X    }
  408. X
  409. X    if (fp == NULL) {
  410. X        sprintf (nam, "/usr/public/lib/news/organization");
  411. X        fp = fopen (nam, "r");
  412. X    }
  413. X
  414. X    if (fp == NULL) {
  415. X        sprintf (nam, "/etc/organization");
  416. X        fp = fopen (nam, "r");
  417. X    }
  418. X
  419. X    if (fp != NULL) {
  420. X        if (fgets (my_org, sizeof (my_org), fp) != NULL) {
  421. X            for (p = my_org; *p && *p != '\n'; p++)
  422. X                continue;
  423. X            *p = '\0';
  424. X        }
  425. X        fclose (fp);
  426. X    }
  427. X
  428. got_org:;
  429. X
  430. /*
  431. X *  check enviroment for REPLYTO
  432. X */
  433. X    reply_to[0] = '\0';
  434. X    if ((p = getenv ("REPLYTO")) != NULL) {
  435. X        my_strncpy (reply_to, p, LEN);
  436. X        goto got_reply;
  437. X    }
  438. X
  439. X    sprintf (nam, "%s/replyto", rcdir);
  440. X    if ((fp = fopen (nam, "r")) != NULL) {
  441. X        if (fgets (reply_to, sizeof (reply_to), fp) != NULL) {
  442. X            for (p = reply_to; *p && *p != '\n'; p++)
  443. X                continue;
  444. X            *p = '\0';
  445. X        }
  446. X        fclose (fp);
  447. X    }
  448. X
  449. got_reply:;
  450. X
  451. /*
  452. X *  check enviroment for ADD_ADDRESS
  453. X */
  454. X    add_addr[0] = '\0';
  455. X    if ((p = getenv ("ADD_ADDRESS")) != NULL) {
  456. X        my_strncpy (add_addr, p, LEN);
  457. X        goto got_add_addr;
  458. X    }
  459. X
  460. X    sprintf (nam, "%s/add_address", rcdir);
  461. X    if ((fp = fopen (nam, "r")) != NULL) {
  462. X        if (fgets (add_addr, sizeof (add_addr), fp) != NULL) {
  463. X            for (p = add_addr; *p && *p != '\n'; p++)
  464. X                continue;
  465. X            *p = '\0';
  466. X        }
  467. X        fclose (fp);
  468. X    }
  469. X
  470. got_add_addr:;
  471. X
  472. /*
  473. X *  check enviroment for BUG_ADDRESS
  474. X */
  475. X    if ((p = getenv ("BUG_ADDRESS")) != NULL) {
  476. X        my_strncpy (bug_addr, p, LEN);
  477. X        goto got_bug_addr;
  478. X    }
  479. X
  480. X    sprintf (nam, "%s/bug_address", rcdir);
  481. X    if ((fp = fopen (nam, "r")) != NULL) {
  482. X        if (fgets (bug_addr, sizeof (bug_addr), fp) != NULL) {
  483. X            for (p = bug_addr; *p && *p != '\n'; p++)
  484. X                continue;
  485. X            *p = '\0';
  486. X        }
  487. X        fclose (fp);
  488. X    }
  489. X
  490. got_bug_addr:;
  491. X    sprintf (txt_help_bug_report, txt_help_bug, bug_addr);
  492. X
  493. X    set_tin_uid_gid ();
  494. }
  495. SHAR_EOF
  496. chmod 0600 init.c ||
  497. echo 'restore of init.c failed'
  498. Wc_c="`wc -c < 'init.c'`"
  499. test 9634 -eq "$Wc_c" ||
  500.     echo 'init.c: original size 9634, current size' "$Wc_c"
  501. rm -f _shar_wnt_.tmp
  502. fi
  503. # ============= kill.c ==============
  504. if test -f 'kill.c' -a X"$1" != X"-c"; then
  505.     echo 'x - skipping kill.c (File already exists)'
  506.     rm -f _shar_wnt_.tmp
  507. else
  508. > _shar_wnt_.tmp
  509. echo 'x - extracting kill.c (Text)'
  510. sed 's/^X//' << 'SHAR_EOF' > 'kill.c' &&
  511. /*
  512. X *  Project   : tin - a threaded Netnews reader
  513. X *  Module    : kill.c
  514. X *  Author    : I.Lea
  515. X *  Created   : 01-04-91
  516. X *  Updated   : 31-01-92
  517. X *  Notes     : kill articles
  518. X *  Copyright : (c) Copyright 1991-92 by Iain Lea
  519. X *              You may  freely  copy or  redistribute  this software,
  520. X *              so  long as there is no profit made from its use, sale
  521. X *              trade or  reproduction.  You may not change this copy-
  522. X *              right notice, and it must be included in any copy made
  523. X */
  524. X
  525. #include    "tin.h"
  526. X
  527. extern char index_file[LEN];
  528. X
  529. struct kill_t *killf;
  530. int kill_num = 0;
  531. int max_kill;
  532. X
  533. /*
  534. X *  read_kill_file - read ~/.tin/kill file contents into kill array
  535. X */
  536. X
  537. int read_kill_file ()
  538. {
  539. X    char buf[LEN];
  540. X    FILE *fp;
  541. X
  542. X    free_kill_array ();
  543. X    
  544. X    set_real_uid_gid ();
  545. X
  546. X    if ((fp = fopen (killfile, "r")) != NULL) {
  547. X        kill_num=0;
  548. X        while (fgets (buf, sizeof buf, fp) != NULL) {
  549. X            if (buf[0] != '#') {
  550. X                if (kill_num == max_kill-1) {
  551. X                    expand_kill ();
  552. X                }
  553. X                killf[kill_num].kill_type = (int) atoi (buf);
  554. X                if (fgets (buf, sizeof buf, fp) != NULL) {
  555. X                    killf[kill_num].kill_group = (long) atol (buf);
  556. X                } else {    
  557. X                    goto corrupt_killfile;
  558. X                }    
  559. X                switch (killf[kill_num].kill_type) {
  560. X                    case KILL_SUBJ:
  561. X                        if (fgets (buf, sizeof buf, fp) != NULL) {
  562. X                            buf[strlen (buf)-1] = '\0';
  563. X                            killf[kill_num].kill_subj = str_dup (buf);
  564. X                        }
  565. X                        break;
  566. X                    case KILL_FROM:
  567. X                        if (fgets (buf, sizeof buf, fp) != NULL) {
  568. X                            buf[strlen (buf)-1] = '\0';
  569. X                            killf[kill_num].kill_from = str_dup (buf);
  570. X                        }
  571. X                        break;
  572. X                    case KILL_BOTH:
  573. X                        if (fgets (buf, sizeof buf, fp) != NULL) {
  574. X                            buf[strlen (buf)-1] = '\0';
  575. X                            killf[kill_num].kill_subj = str_dup (buf);
  576. X                        }
  577. X                        if (fgets (buf, sizeof buf, fp) != NULL) {
  578. X                            buf[strlen (buf)-1] = '\0';
  579. X                            killf[kill_num].kill_from = str_dup (buf);
  580. X                        }
  581. X                        break;
  582. X                    default:
  583. X                        goto corrupt_killfile;
  584. X                }
  585. X                kill_num++;
  586. X            }
  587. X        }
  588. X        fclose (fp);
  589. X        set_tin_uid_gid ();
  590. X        return TRUE;        
  591. X    } else {
  592. X        set_tin_uid_gid ();
  593. X        return FALSE;
  594. X    }
  595. X
  596. corrupt_killfile:
  597. X    fclose (fp);
  598. X    killf[kill_num].kill_type = 0;
  599. X    error_message ("corrupt kill file %s", killfile);
  600. X    set_tin_uid_gid ();
  601. X    return FALSE;
  602. }
  603. X
  604. /*
  605. X *  write_kill_file - write kill strings to ~/.tin/kill
  606. X */
  607. X
  608. void write_kill_file ()
  609. {
  610. X    FILE *fp;
  611. X    int i;
  612. X    
  613. X    set_real_uid_gid ();
  614. X
  615. X    if (kill_num && (fp = fopen (killfile, "w")) != NULL) {
  616. X        wait_message (txt_saving);
  617. X        fprintf (fp, "# 1st line  1=(Subject: only)  2=(From: only)  3=(Subject: & From:)\n");
  618. X        fprintf (fp, "# 2nd line  0=(kill on all newsgroups)  >0=(kill on specific newsgroup)\n");
  619. X        for (i=0 ; i < kill_num ; i++) {
  620. X            if (killf[i].kill_type && (killf[i].kill_subj || killf[i].kill_from)) {
  621. X                fprintf (fp, "#\n# kill description %d\n", i+1);
  622. X                fprintf (fp, "%d\n", killf[i].kill_type);
  623. X                fprintf (fp, "%ld\n", killf[i].kill_group);
  624. X                switch (killf[i].kill_type) {
  625. X                    case KILL_SUBJ:
  626. X                        fprintf (fp, "%s\n", killf[i].kill_subj);
  627. X                        break;
  628. X                    case KILL_FROM:
  629. X                        fprintf (fp, "%s\n", killf[i].kill_from);
  630. X                        break;
  631. X                    case KILL_BOTH:
  632. X                        fprintf (fp, "%s\n", killf[i].kill_subj);
  633. X                        fprintf (fp, "%s\n", killf[i].kill_from);
  634. X                        break;
  635. X                }
  636. X            }
  637. X        }
  638. X        fclose (fp);
  639. X        chmod (killfile, 0600);
  640. X    }
  641. X    set_tin_uid_gid ();
  642. }
  643. X
  644. /*
  645. X *  options menu so that the user can dynamically change parameters
  646. X */
  647. int kill_art_menu (group_name, index)
  648. X    char *group_name;
  649. X    int index;
  650. {
  651. X    char text[LEN];
  652. X    char kill_from[LEN];
  653. X    char kill_subj[LEN];
  654. X    char kill_group[LEN];
  655. X    char ch_default = 's';
  656. X    char *str;    
  657. X    int ch;
  658. X    int counter;
  659. X    int killed = TRUE;
  660. X    int kill_from_ok = FALSE;
  661. X    int kill_subj_ok = FALSE;
  662. X    int kill_every_group;
  663. X
  664. #ifdef SIGTSTP
  665. X    SIGTYPE (*susp)();
  666. X
  667. X    if (do_sigtstp) {
  668. #ifdef POSIX_JOB_CONTROL
  669. X        sigemptyset (&kill_act.sa_mask);
  670. X        kill_act.sa_flags = SA_RESTART | SA_RESETHAND;
  671. X        kill_act.sa_handler = SIG_DFL;
  672. X        sigaction (SIGTSTP, &kill_act, &old_act);
  673. X        kill_act.sa_handler = SIG_IGN;
  674. X        sigaction (SIGTSTP, &kill_act, 0L);
  675. #else
  676. X        susp = signal (SIGTSTP, SIG_DFL);
  677. X        signal (SIGTSTP, SIG_IGN);
  678. #endif
  679. X    }
  680. #endif
  681. X    
  682. X    sprintf (kill_group, "%s only", group_name);
  683. X    my_strncpy (text, arts[index].subject, COLS-35);
  684. X    sprintf (kill_subj, txt_kill_subject, text);
  685. X    if (arts[index].name != (char *) 0) {
  686. X        sprintf (msg, "%s (%s)", arts[index].from, arts[index].name);
  687. X        my_strncpy (text, msg, COLS-35);
  688. X    } else {
  689. X        my_strncpy (text, arts[index].from, COLS-35);
  690. X    }
  691. X    sprintf (kill_from, txt_kill_from, text);
  692. X    text[0] = '\0';
  693. X    
  694. X    ClearScreen ();
  695. X
  696. X    center_line (0, TRUE, txt_kill_menu);
  697. X    
  698. X    MoveCursor(INDEX_TOP, 0);
  699. X    printf ("%s\r\n\r\n", txt_kill_text);
  700. X    printf ("%s\r\n\r\n\r\n", txt_kill_text_type);
  701. X    printf ("%s\r\n\r\n", kill_subj);
  702. X    printf ("%s\r\n\r\n\r\n", kill_from);
  703. X    printf ("%s%s", txt_kill_group, kill_group);
  704. X    fflush(stdout);
  705. X
  706. X    show_menu_help (txt_help_kill_text);
  707. X    if (! prompt_menu_string (INDEX_TOP, (int) strlen (txt_kill_text), text)) {
  708. X        return FALSE;
  709. X    }
  710. X
  711. X    if (text[0]) {
  712. X        show_menu_help (txt_help_kill_text_type);
  713. X        counter = 1;
  714. X        MoveCursor (INDEX_TOP+2, (int) strlen (txt_kill_text_type));
  715. X        str = "Subject: line only    ";
  716. X        printf ("%s", str);
  717. X        fflush(stdout);
  718. X        do {
  719. X            MoveCursor (INDEX_TOP+2, (int) strlen (txt_kill_text_type));
  720. X            if ((ch    = ReadCh()) == ' ') {
  721. X                counter++;
  722. X                if (counter == KILL_BOTH+1) {
  723. X                    counter = KILL_SUBJ;
  724. X                }
  725. X                switch (counter) {
  726. X                    case KILL_SUBJ:
  727. X                        str = "Subject: line only    ";
  728. X                        break;
  729. X                    case KILL_FROM:
  730. X                        str = "From: line only       ";
  731. X                        break;
  732. X                    case KILL_BOTH:
  733. X                        str = "Subject: & From: lines";
  734. X                        break;
  735. X                }
  736. X                printf ("%s", str);
  737. X                fflush(stdout);
  738. X            }
  739. X        } while (ch != CR && ch != ESC);
  740. X        if (ch == ESC) {
  741. X            return FALSE;
  742. X        }
  743. X    }
  744. X
  745. X    if (! text[0]) {
  746. X        show_menu_help (txt_help_kill_subject);
  747. X        kill_subj_ok = prompt_yn (INDEX_TOP+5, kill_subj, 'y');
  748. X
  749. X        show_menu_help (txt_help_kill_from);
  750. X        kill_from_ok = prompt_yn (INDEX_TOP+7, kill_from, 'n');
  751. X    }
  752. X
  753. X    if (text[0] || kill_subj_ok || kill_from_ok) {
  754. X        show_menu_help (txt_help_kill_group);
  755. X        kill_every_group = FALSE;
  756. X        MoveCursor (INDEX_TOP+10, (int) strlen (txt_kill_group));
  757. X        str = kill_group;
  758. X        printf ("%s", str);
  759. X        fflush (stdout);
  760. X        do {
  761. X            MoveCursor (INDEX_TOP+10, (int) strlen (txt_kill_group));
  762. X            if ((ch    = ReadCh()) == ' ') {
  763. X                kill_every_group = !kill_every_group;
  764. X                if (kill_every_group) {
  765. X                    str = "All groups";
  766. X                } else {
  767. X                    str = kill_group;
  768. X                }
  769. X                CleartoEOLN (); 
  770. X                printf ("%s", str);
  771. X                fflush(stdout);
  772. X            }
  773. X        } while (ch != CR && ch != ESC);
  774. X        if (ch == ESC) {
  775. X            return FALSE;
  776. X        }
  777. X    }
  778. X
  779. X    while (1) {
  780. X        do {
  781. X            sprintf (msg, "%s%c", txt_abort_edit_save_killfile, ch_default);
  782. X            wait_message (msg);
  783. X            MoveCursor(LINES, (int) strlen (txt_abort_edit_save_killfile));
  784. X            if ((ch = ReadCh()) == CR)
  785. X                ch = ch_default;
  786. X        } while (ch != ESC && ch != 'a' && ch != 'e' && ch != 's');
  787. X        switch (ch) {
  788. X            case 'e':
  789. X                start_line_offset = 2;
  790. X                invoke_editor (killfile);
  791. X                unkill_all_articles ();
  792. X                read_kill_file ();
  793. X                reload_index_file (group_name, FALSE);
  794. X                killed = TRUE;
  795. X                goto kill_done;
  796. X
  797. X            case 'a':
  798. X            case ESC:
  799. X                killed = FALSE;
  800. X                goto kill_done;
  801. X            
  802. X            case 's':
  803. X                if (kill_num > max_kill-1) {
  804. X                    expand_kill ();
  805. X                }
  806. X                if (text[0]) {
  807. X                    switch (counter) {
  808. X                        case KILL_SUBJ:
  809. X                            killf[kill_num].kill_subj = str_dup (text);
  810. X                            break;
  811. X                        case KILL_FROM:
  812. X                            killf[kill_num].kill_from = str_dup (text);
  813. X                            break;
  814. X                        case KILL_BOTH:
  815. X                            killf[kill_num].kill_subj = str_dup (text);
  816. X                            killf[kill_num].kill_from = str_dup (text);
  817. X                            break;
  818. X                    }
  819. X                    killf[kill_num].kill_type = counter;
  820. X                    if (kill_every_group) {
  821. X                        killf[kill_num].kill_group= 0L;
  822. X                    } else {
  823. X                        killf[kill_num].kill_group= hash_s (group_name);
  824. X                    }
  825. X                    kill_num++;
  826. X                } else {
  827. X                    if (kill_subj_ok) {
  828. X                        killf[kill_num].kill_type = KILL_SUBJ;
  829. X                        killf[kill_num].kill_subj = str_dup (arts[index].subject);
  830. X                    }
  831. X                    if (kill_from_ok) {
  832. X                        killf[kill_num].kill_type |= KILL_FROM;
  833. X                        if (arts[index].name != (char *) 0) {
  834. X                            sprintf (msg, "%s (%s)", arts[index].from, arts[index].name);
  835. X                        } else {
  836. X                            strcpy (msg, arts[index].from);
  837. X                        }
  838. X                        killf[kill_num].kill_from = str_dup (msg);
  839. X                    }
  840. X                    if (killf[kill_num].kill_type) {        
  841. X                        if (kill_every_group) {
  842. X                            killf[kill_num].kill_group= 0L;
  843. X                        } else {
  844. X                            killf[kill_num].kill_group= hash_s (group_name);
  845. X                        }
  846. X                        kill_num++;
  847. X                    }
  848. X                }
  849. X                write_kill_file ();
  850. X
  851. kill_done:
  852. X
  853. #ifdef SIGTSTP
  854. X                if (do_sigtstp) {
  855. #ifdef POSIX_JOB_CONTROL
  856. X                    sigemptyset (&kill_act.sa_mask);
  857. X                    kill_act.sa_flags = SA_RESTART | SA_RESETHAND;
  858. X                    kill_act.sa_handler = SIG_IGN;
  859. X                    sigaction (SIGTSTP, &old_act, 0L);
  860. #else
  861. X                    signal (SIGTSTP, susp);
  862. #endif
  863. X                }
  864. #endif
  865. X                return (killed);
  866. X        }    
  867. X    }
  868. X    /* NOTREACHED */
  869. }
  870. X
  871. X
  872. int unkill_all_articles ()
  873. {
  874. X    int unkilled = FALSE;
  875. X    register int i;
  876. X
  877. X    for (i=0 ; i < top ; i++) {
  878. X        if (arts[i].killed) {
  879. X            arts[i].killed = FALSE;
  880. X            unkilled = TRUE;
  881. X        }
  882. X    }
  883. X    num_of_killed_files = 0;
  884. X
  885. X    return (unkilled);
  886. }
  887. X
  888. X
  889. int kill_any_articles (group)
  890. X    char *group;
  891. {
  892. X    int killed = FALSE;
  893. X    int run_ok = FALSE;
  894. X    long group_hash;
  895. X    register int i, j;
  896. X
  897. X    if (! kill_articles) {
  898. X        return killed;
  899. X    }
  900. X
  901. X    if (kill_num) {
  902. X        group_hash = hash_s (group);
  903. X        for (i=0 ; i < kill_num ; i++) {
  904. X                if (killf[i].kill_group == 0L ||
  905. X                    killf[i].kill_group == group_hash) {
  906. X                    run_ok = TRUE;    
  907. X                }
  908. X        }
  909. X        if (! run_ok) {
  910. X            return (killed);
  911. X        }
  912. X        if (debug && ! update) {
  913. X            wait_message (txt_killing_arts);
  914. X        }
  915. X        for (i=0 ; i < top ; i++) {
  916. X            for (j=0 ; j < kill_num && ! arts[i].tagged ; j++) {
  917. X                if (killf[j].kill_group == 0L ||
  918. X                    killf[j].kill_group == group_hash) {
  919. X                    switch (killf[j].kill_type) {
  920. X                        case KILL_SUBJ:
  921. #ifdef NO_REGEX 
  922. X                            if (str_str (arts[i].subject, killf[j].kill_subj,
  923. X                                        strlen (killf[j].kill_subj)) != 0) {
  924. #else        
  925. X                            if (wildmat (arts[i].subject, killf[j].kill_subj)) {
  926. #endif        
  927. X
  928. X                                arts[i].tagged = TRUE;
  929. X                                killed = TRUE;
  930. X                            }
  931. X                            break;
  932. X                        case KILL_FROM:
  933. X                            if (arts[i].name != (char *) 0) {
  934. X                                sprintf (msg, "%s (%s)", arts[i].from, arts[i].name);
  935. X                            } else {
  936. X                                strcpy (msg, arts[i].from);
  937. X                            }
  938. #ifdef NO_REGEX 
  939. X                            if (str_str (msg, killf[j].kill_from
  940. X                                        strlen (killf[j].kill_from)) != 0) {
  941. #else        
  942. X                            if (wildmat (msg, killf[j].kill_from)) {
  943. #endif        
  944. X                                arts[i].tagged = TRUE;
  945. X                                killed = TRUE;
  946. X                            }
  947. X                            break;
  948. X                        case KILL_BOTH:
  949. #ifdef NO_REGEX 
  950. X                            if (str_str (arts[i].subject, killf[j].kill_subj,
  951. X                                        strlen (killf[j].kill_subj)) != 0) {
  952. #else        
  953. X                            if (wildmat (arts[i].subject, killf[j].kill_subj)) {
  954. #endif        
  955. X                                arts[i].tagged = TRUE;
  956. X                                killed = TRUE;
  957. X                            }
  958. X                            if (arts[i].name != (char *) 0) {
  959. X                                sprintf (msg, "%s (%s)", arts[i].from, arts[i].name);
  960. X                            } else {
  961. X                                strcpy (msg, arts[i].from);
  962. X                            }
  963. #ifdef NO_REGEX
  964. X                            if (str_str (msg, killf[j].kill_from,
  965. X                                        strlen (killf[j].kill_from)) != 0) {
  966. #else        
  967. X                            if (wildmat (msg, killf[j].kill_from)) {
  968. #endif        
  969. X                                arts[i].tagged = TRUE;
  970. X                                killed = TRUE;
  971. X                            }
  972. X                            break;
  973. X                    }
  974. X                }
  975. X            }
  976. X        }
  977. X    }
  978. X    return (killed);
  979. }
  980. SHAR_EOF
  981. chmod 0600 kill.c ||
  982. echo 'restore of kill.c failed'
  983. Wc_c="`wc -c < 'kill.c'`"
  984. test 11196 -eq "$Wc_c" ||
  985.     echo 'kill.c: original size 11196, current size' "$Wc_c"
  986. rm -f _shar_wnt_.tmp
  987. fi
  988. # ============= lang.c ==============
  989. if test -f 'lang.c' -a X"$1" != X"-c"; then
  990.     echo 'x - skipping lang.c (File already exists)'
  991.     rm -f _shar_wnt_.tmp
  992. else
  993. > _shar_wnt_.tmp
  994. echo 'x - extracting lang.c (Text)'
  995. sed 's/^X//' << 'SHAR_EOF' > 'lang.c' &&
  996. /*
  997. X *  Project   : tin - a threaded Netnews reader
  998. X *  Module    : lang.c
  999. X *  Author    : I.Lea
  1000. X *  Created   : 01-04-91
  1001. X *  Updated   : 08-02-92
  1002. X *  Notes     :
  1003. X *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1004. X *              You may  freely  copy or  redistribute  this software,
  1005. X *              so  long as there is no profit made from its use, sale
  1006. X *              trade or  reproduction.  You may not change this copy-
  1007. X *              right notice, and it must be included in any copy made
  1008. X */
  1009. X
  1010. /*
  1011. X *  art.c
  1012. X */
  1013. X
  1014. char txt_group[] = "Group %s...";
  1015. char txt_cannot_open_art[] = "can't open article %s: ";
  1016. char txt_indexing[] = "Indexing %s...";
  1017. char txt_indexing_num[] = "Indexing %s...%4d";
  1018. char txt_corrupt_index[] = "Index file %s corrupted. error %d on article %d";
  1019. char txt_checking_for_news[] = "Checking for news...";
  1020. char txt_there_is_no_news[] = "There is no news\n";
  1021. char txt_killing_arts[] = "Killing articles...";
  1022. char txt_unkilling_arts[] = "Unkilling articles...";
  1023. X
  1024. /*
  1025. X *  feed.c
  1026. X */
  1027. X
  1028. char txt_art_thread_regex_tag[] = " a)rticle, t)hread, r)egex pattern, T)agged articles, e)xit: ";
  1029. char txt_post_process_type[] = "Process n)one, s)har, u)udecode, U)udecode & zoo: ";
  1030. #ifdef NO_REGEX 
  1031. char txt_feed_pattern[] = "Enter pattern [%s]> ";
  1032. #else
  1033. char txt_feed_pattern[] = "Enter regex pattern [%s]> ";
  1034. #endif
  1035. char txt_no_command[] = "No command";
  1036. char txt_piping[] = "Piping...";
  1037. X
  1038. /*
  1039. X *  group.c
  1040. X */
  1041. X
  1042. char txt_cannot_post[] = "*** Posting not allowed ***";
  1043. char txt_tagged_art[] = "tagged article";
  1044. char txt_untagged_art[] = "untagged article";
  1045. char txt_inverse_on[] = "Inverse video enabled";
  1046. char txt_inverse_off[] = "Inverse video disabled";
  1047. char txt_subscribed_to[] = "subscribed to %s";
  1048. char txt_unsubscribed_to[] = "unsubscribed from %s";
  1049. char txt_mark_all_read[] = "Mark everything as read? (y/n): ";
  1050. char txt_no_more_groups[] = "No more groups";
  1051. char txt_no_prev_group[] = "No previous group";
  1052. char txt_no_arts[] = "*** No Articles ***";
  1053. char txt_no_groups[] = "*** No Groups ***";
  1054. char txt_end_of_thread[] = "*** End of Thread ***";
  1055. char txt_end_of_arts[] = "*** End of Articles ***";
  1056. char txt_end_of_groups[] = "*** End of Groups ***";
  1057. char txt_no_next_unread_art[] = "No next unread article";
  1058. char txt_no_prev_unread_art[] = "No previous unread article";
  1059. char txt_no_last_message[] = "No last message";
  1060. char txt_bad_command[] = "Bad command.  Type 'h' for help.";
  1061. char txt_you_have_mail[] = "    You have mail\n";
  1062. /*
  1063. char txt_type_h_for_help[] = "Type 'h' for help\n";
  1064. */
  1065. char txt_type_h_for_help[] = "           h=help\n";
  1066. char txt_read_art[] = "Read article> ";
  1067. char txt_search_forwards[] = "Search forwards [%s]> ";
  1068. char txt_search_backwards[] = "Search backwards [%s]> ";
  1069. char txt_author_search_forwards[] = "Author search forwards [%s]> ";
  1070. char txt_author_search_backwards[] = "Author search backwards [%s]> ";
  1071. char txt_no_search_string[] = "No search string";
  1072. char txt_no_match[] = "No match";
  1073. char txt_post_subject[] = "Post Subject [%s]> ";
  1074. char txt_no_subject[] = "No subject";
  1075. char txt_cannot_open[] = "can't open %s";
  1076. char txt_posting[] = "Posting...";
  1077. char txt_art_posted[] = "-- Article posted --";
  1078. char txt_art_rejected[] = "-- Article rejected (saved to %s) --";
  1079. char txt_abort_edit_post[] = "a)bort, e)dit, p)ost: ";
  1080. char txt_help_i_4[] = "4$       Goto article 4 ($=goto last article)\r\n";
  1081. char txt_help_ctrl_k[] = "^K       Kill current article\r\n";
  1082. char txt_help_ctrl_l[] = "^L       Redraw page\r\n";
  1083. char txt_help_ctrl_d[] = "^D^U     Down (^U=up) a page\r\n";
  1084. char txt_help_i_cr[] = "<CR>     Read current article\r\n";
  1085. char txt_help_i_tab[] = "<TAB>    Goto next unread article or group\r\n";
  1086. char txt_help_d[] = "d        Toggle display of subject only & subject/author\r\n";
  1087. char txt_help_l[] = "l        List articles within current thread\r\n";
  1088. char txt_help_m[] = "m        Move current group within group selection list\r\n";
  1089. char txt_help_M[] = "M        Menu of configurable options\r\n";
  1090. char txt_help_a[] = "aA       Author forward (A=backward) search\r\n";
  1091. char txt_help_sel_c[] = "cC       Mark group read (C=and goto next unread group)\r\n";
  1092. char txt_help_c[] = "c        Mark all articles as read and goto group selection menu\r\n";
  1093. char txt_help_g[] = "g        Choose a new group by name\r\n";
  1094. char txt_help_I[] = "I        Toggle inverse video\r\n";
  1095. char txt_help_K[] = "K        Mark article/thread as read & goto next unread\r\n";
  1096. char txt_help_j[] = "jk       Down (k=up) a line\r\n";
  1097. char txt_help_i_n[] = "np       Goto next (p=previous) group\r\n";
  1098. char txt_help_i_p[] = "NP       Goto next (P=previous) unread article\r\n";
  1099. char txt_help_q[] = "q        Quit\r\n";
  1100. char txt_help_s[] = "su       Subscribe (u=unsubscribe) to current group\r\n";
  1101. char txt_help_S[] = "SU       Subscribe (U=unsubscribe) to groups that match pattern\r\n";
  1102. char txt_help_t[] = "t        Return to group selection index\r\n";
  1103. char txt_help_T[] = "T        Tag current article for mailing/piping/printing/saving\r\n";
  1104. char txt_help_u[] = "u        toggle display of unthreaded & threaded articles\r\n";
  1105. char txt_help_U[] = "U        Untag all tagged articles\r\n";
  1106. char txt_help_v[] = "v        Show version information\r\n";
  1107. char txt_help_w[] = "w        Post an article to current group\r\n";
  1108. char txt_help_i_search[] = "/?       Subject forward (?=backward) search\r\n";
  1109. char txt_help_thread[] = "<>       Goto first (>=last) article in current thread";
  1110. #ifndef NO_SHELL_ESCAPE
  1111. char txt_help_shell[] = "!        Shell escape\r\n";
  1112. #endif
  1113. char txt_help_dash[] = "-        Show last message\r\n";
  1114. #ifdef NO_REGEX 
  1115. char txt_save_pattern[] = "Enter save pattern [%s]> ";
  1116. #else
  1117. char txt_save_pattern[] = "Enter regex save pattern [%s]> ";
  1118. #endif
  1119. char txt_saved_pattern_to[] = "-- Saved pattern to %s - %s --";
  1120. char txt_saved_to_mailbox[] = "-- Saved to mailbox %s --";
  1121. char txt_switch_on_kill_art_menu[] = "Kill Article Menu is switched OFF. Select Options Menu to switch it ON.";
  1122. X
  1123. /* 
  1124. X *  help.c:
  1125. X */
  1126. X
  1127. char txt_group_select_com[] = "Group Selection Commands (page %d of %d)";
  1128. char txt_index_page_com[] = "Index Page Commands (page %d of %d)";
  1129. char txt_thread_com[] = "Thread Commands (page %d of %d)";
  1130. char txt_art_pager_com[] = "Article Pager Commands (page %d of %d)";
  1131. char txt_hit_space_for_more[] = "PgDn,End,<SPACE>,^D - page down. PgUp,Home,b,^U - page up. <CR>,q - quit";
  1132. char txt_post_history_menu[] = "Posted articles history (page %d of %d)";
  1133. X
  1134. /* 
  1135. X *  kill.c:
  1136. X */
  1137. X
  1138. char txt_kill_menu[] = "Kill Article Menu";
  1139. char txt_kill_subject[] = "Kill Subject [%-45s] (y/n): ";
  1140. char txt_kill_from[] =    "Kill From    [%-45s] (y/n): ";
  1141. char txt_kill_text[] = "Kill text pattern : ";
  1142. char txt_kill_text_type[] = "Apply pattern to  : ";
  1143. char txt_kill_group[] =     "Kill pattern scope: ";
  1144. char txt_help_kill_subject[] = "Subject: line to add to kill file. Press backspace key to clear field.";
  1145. char txt_help_kill_from[] = "From: line to add to kill file. Press backspace key to clear field.";
  1146. char txt_help_kill_text[] = "Enter text pattern to kill if Subject: & From: lines are not what you want.";
  1147. char txt_help_kill_text_type[] = "Select where text pattern should be applied. <SPACE> toggles & <CR> sets.";
  1148. char txt_help_kill_group[] = "Apply kill to current group only or all groups. <SPACE> toggles & <CR> sets.";
  1149. char txt_abort_edit_save_killfile[] = "a)bort e)dit s)ave killfile: ";
  1150. X
  1151. X
  1152. /* 
  1153. X *  main.c:
  1154. X */
  1155. X
  1156. char txt_nntp_not_enabled[] = "Reading news via NNTP is not enabled. Recompile %s with -DUSE_NNTP.\n";
  1157. char txt_recompile_with_nntp_option[] = "Option not enabled. Recompile %s with -DUSE_NNTP.\n";
  1158. char txt_not_in_active_file[] = "Group %s not found in active file";
  1159. char txt_screen_init_failed[] = "%s: Screen initialization failed";
  1160. char txt_bad_active_file[] = "Active file corrupt - %s";
  1161. X
  1162. /*
  1163. X *  misc.c
  1164. X */
  1165. X
  1166. char txt_reading_active_file[] = "Reading active file...";
  1167. char txt_cannot_find_base_art[] = "Cannot find base article %s";
  1168. char txt_out_of_memory[] = "%s: out of memory";
  1169. char txt_rename_error[] = "Error: rename %s to %s";
  1170. char txt_shell_escape[] = "Enter shell command [%s]> ";
  1171. X
  1172. /*
  1173. X *  newsrc.c
  1174. X */
  1175. X
  1176. char txt_creating_newsrc[] = "Creating .newsrc...\n";
  1177. X
  1178. /*
  1179. X *  open.c
  1180. X */
  1181. char txt_connecting[] = "Connecting to %s...";
  1182. char txt_cannot_get_nntp_server_name[] = "Cannot get nntp server name\n";
  1183. char txt_server_name_in_file_env_var[] = "Either put the name in the file %s,\nor put it in the environment variable NNTPSERVER\n";
  1184. char txt_failed_to_connect_to_server[] = "failed to connect to (%s) server\n";
  1185. char txt_rejected_by_nntpserver[] = "rejected by server, nntp error %d\n";
  1186. char txt_connection_to_server_broken[] = "connection to server broken\n";
  1187. char txt_stuff_nntp_cannot_open[] = "stuff_nntp: can't open %s: ";
  1188. char txt_nntp_to_fp_cannot_reopen[] = "nntp_to_fp: can't reopen %s: ";
  1189. char txt_nntp_to_fd_cannot_reopen[] = "nntp_to_fd: can't reopen %s: ";
  1190. X
  1191. /*
  1192. X *  page.c
  1193. X */
  1194. X
  1195. char txt_quit[] = "Do you really want to quit? (y/n): ";
  1196. char txt_art_unavailable[] = "[Article %ld unvailable]\r\r";
  1197. char txt_art_marked_as_unread[] = "Article marked as unread";
  1198. char txt_thread_marked_as_unread[] = "Thread marked as unread";
  1199. char txt_begin_of_art[] = "*** Beginning of article ***";
  1200. char txt_next_resp[] = "-- Next response --";
  1201. char txt_last_resp[] = "-- Last response --";
  1202. char txt_more[] = "--More--";
  1203. char txt_more_percent[] = "--More--(%d%%) [%ld/%ld]";
  1204. char txt_thread_x_of_n[] = "%sThread %3d of %3d\r\n";
  1205. char txt_art[] = "Article %ld  ";
  1206. char txt_resp_x_of_n[] = "Respno %3d of %3d\r\n";
  1207. char txt_no_resp[] = "No responses\r\n";
  1208. char txt_1_resp[] = "1 Response\r\n";
  1209. char txt_x_resp[] = "%d Responses\r\n";
  1210. char txt_s_at_s[] = "%s at %s";
  1211. char txt_thread_resp_page[] = "Thread %d of %d, Resp %d (page %d):  %s";
  1212. char txt_thread_page[] = "Thread %d of %d (page %d):  %s";
  1213. char txt_read_resp[] = "Read response> ";
  1214. char txt_help_p_0[] = "0        Read the base article in current thread\r\n";
  1215. char txt_help_p_4[] = "4        Read response 4 in current thread\r\n";
  1216. char txt_help_p_cr[] = "<CR>     Goto to next thread\r\n";
  1217. char txt_help_p_tab[] = "<TAB>    Goto next unread article\r\n";
  1218. char txt_help_b[] = "b<SPACE> Back (<SPACE>=forward) a page\r\n";
  1219. char txt_help_bug[] = "B        Mail bug/comment to %s\r\n";
  1220. char txt_help_p_f[] = "fF       Post (F=copy text) a followup\r\n";
  1221. char txt_help_C[] = "C        Cancel current article that must have been posted by you\r\n";
  1222. char txt_help_ctrl_h[] = "^H       Show articles header\r\n";
  1223. char txt_help_h[] =      "h        Command help\r\n";
  1224. char txt_help_p_i[] = "i        Return to index page\r\n";
  1225. char txt_help_p_k[] = "kK       Mark article (K=thread) as read & advance to next unread\r\n";
  1226. char txt_help_p_m[] = "m        Mail article/thread/pattern/tagged articles to someone\r\n";
  1227. char txt_help_p_n[] = "nN       Goto to the next (N=unread) article\r\n";
  1228. char txt_help_o[] = "o        Output article/thread/pattern/tagged articles to printer\r\n";
  1229. char txt_help_p_p[] = "pP       Goto the previous (P=unread) article\r\n";
  1230. char txt_help_p_r[] = "rR       Reply through mail (R=copy text) to author\r\n";
  1231. char txt_help_p_s[] = "s        Save article/thread/pattern/tagged articles to file\r\n";
  1232. char txt_help_p_z[] = "zZ       Mark article (Z=thread) as unread\r\n";
  1233. char txt_help_p_ctrl_r[] = "^R$      Redisplay first ($=last) page of article\r\n";
  1234. char txt_help_p_g[] = "gG       Goto first (G=last) page of article\r\n";
  1235. char txt_help_p_d[] = "d        Toggle rot-13 decoding for current article\r\n";
  1236. char txt_help_pipe[] = "|        Pipe article/thread/pattern/tagged articles into command\r\n";
  1237. char txt_help_p_search[] = "/        Article forward search\r\n";
  1238. char txt_mail_art_to[] = "Mail article to [%s]> ";
  1239. char txt_no_mail_address[] = "No mail address";
  1240. char txt_abort_edit_send[] = "a)bort, e)dit, s)end";
  1241. char txt_abort_edit_cancel[] = "a)bort, e)dit, c)ancel";
  1242. char txt_cancelling[] = "Cancelling article...";
  1243. char txt_art_cancelled[] = "Article cancelled";
  1244. char txt_mailing_to[] = "Mailing to %s...";
  1245. char txt_message_sent[] = "-- Article(s) Mailed --";
  1246. char txt_command_failed_s[] = "Command failed: %s\n";
  1247. char txt_in_art_you_write[] = "In article %s you write:\n";
  1248. char txt_resp_to_poster[] = "Responses have been directed to the poster. Post anyway? (y/n): ";
  1249. char txt_resp_redirect[] = "Responses have been directed to the following newsgroups";
  1250. char txt_continue[] = "Continue? (y/n): ";
  1251. char txt_writes[] = "%s writes:\n";
  1252. char txt_writes_name[] = "%s (%s) writes:\n";
  1253. char txt_save_filename[] = "Save filename [%s]> ";
  1254. char txt_art_not_saved[] = "-- Article not saved --";
  1255. char txt_no_filename[] = "No filename";
  1256. char txt_saving[] = "Saving...";
  1257. char txt_art_saved_to[] = "-- Article saved to %s --";
  1258. char txt_thread_not_saved[] = "-- Thread not saved --";
  1259. char txt_thread_saved_to_many[] = "-- Thread saved to %s - %s --";
  1260. char txt_thread_saved_to[] = "-- Thread saved to %s --";
  1261. char txt_pipe_to_command[] = "Pipe to command [%s]: ";
  1262. char txt_printing[] = "Printing...";
  1263. char txt_printed[] = "-- Article(s) printed --";
  1264. char txt_append_to_file[] = "File %s exists. Append? (y/n): ";
  1265. char txt_toggled_rot13[] = "Toggled rot13 encoding";
  1266. X
  1267. /*
  1268. X *  post.c
  1269. X */
  1270. X
  1271. char txt_no_arts_posted[] = "No articles have been posted";
  1272. char txt_post_an_article[] = "Post an article...";
  1273. char txt_post_a_followup[] = "Post a followup...";
  1274. char txt_mail_bug_report[] = "Mail bug report...";
  1275. char txt_reply_to_author[] = "Reply to author...";
  1276. X
  1277. /*
  1278. X *  prompt.c
  1279. X */
  1280. X
  1281. char txt_hit_any_key[] = "-- Press any key to continue --";
  1282. X
  1283. /*
  1284. X *  rcfile.c
  1285. X */
  1286. char txt_opt_autosave[] = "1. Auto save       : ";
  1287. char txt_opt_save_separate[] = "2. Save separate   : ";
  1288. char txt_opt_mark_saved_read[] = "3. Mark saved read : ";
  1289. char txt_opt_kill_articles[] = "4. Kill articles   : ";
  1290. char txt_opt_draw_arrow[] = "5. Draw arrow      : ";
  1291. char txt_opt_print_header[] = "6. Print header    : ";
  1292. char txt_opt_pos_first_unread[] = "7. Goto 1st unread : ";
  1293. char txt_opt_page_scroll[] = "8. Scroll full page: ";
  1294. char txt_opt_catchup_groups[] = "9. Catchup on quit : ";
  1295. char txt_opt_thread_arts[] =   "10 Thread articles : ";
  1296. char txt_opt_show_only_unread[] = "11 Show only unread: ";
  1297. char txt_opt_show_author[] = "13 Show author     : ";
  1298. char txt_opt_process_type[] = "14 Process type    : ";
  1299. char txt_opt_sort_type[] = "15 Sort article by : ";
  1300. char txt_opt_savedir[] = "16 Save directory  : ";
  1301. char txt_opt_maildir[] = "17 Mail directory  : ";
  1302. char txt_opt_printer[] = "18 Printer         : ";
  1303. char txt_options_menu[] = "Options Menu";
  1304. char txt_show_from_none[] = "None";
  1305. char txt_show_from_addr[] = "Addr";
  1306. char txt_show_from_name[] = "Name";
  1307. char txt_show_from_both[] = "Both";
  1308. char txt_post_process_none[] = "None";
  1309. char txt_post_process_sh[] = "Shell archive";
  1310. char txt_post_process_uudecode[] = "Uudecode";
  1311. char txt_post_process_uud_lst_zoo[] = "Uudecode & list zoo archive";
  1312. char txt_post_process_uud_ext_zoo[] = "Uudecode & extract zoo archive";
  1313. char txt_sort_by_nothing[] = "Nothing";
  1314. char txt_sort_by_subj_descend[] = "Subject: field (descending)";
  1315. char txt_sort_by_subj_ascend[] = "Subject: field (ascending)";
  1316. char txt_sort_by_from_descend[] = "From: field (descending)";
  1317. char txt_sort_by_from_ascend[] = "From: field (ascending)";
  1318. char txt_sort_by_date_descend[] = "Date: field (descending)";
  1319. char txt_sort_by_date_ascend[] = "Date: field (ascending)";
  1320. char txt_help_autosave[] = "Auto save article/thread by Archive-name: header. <SPACE> toggles & <CR> sets.";
  1321. char txt_help_save_separate[] = "Save articles/threads to separate files. <SPACE> toggles & <CR> sets.";
  1322. char txt_help_print_header[] = "By printing print all/part of header. <SPACE> toggles & <CR> sets.";
  1323. char txt_help_pos_first_unread[] = "Put cursor at first/last unread art in groups. <SPACE> toggles & <CR> sets.";
  1324. char txt_help_show_author[] = "Show Subject & From (author) fields in group menu. <SPACE> toggles & <CR> sets.";
  1325. char txt_help_draw_arrow[] = "Draw -> or highlighted bar for selection. <SPACE> toggles & <CR> sets.";
  1326. char txt_help_kill_articles[] = "Kill articles that match entries in kill file. <SPACE> toggles & <CR> sets.";
  1327. char txt_help_mark_saved_read[] = "Mark saved articles/threads as read. <SPACE> toggles & <CR> sets."; 
  1328. char txt_help_page_scroll[] = "Scroll half/full page of groups/articles. <SPACE> toggles & <CR> sets."; 
  1329. char txt_help_catchup_groups[] = "Ask to mark groups read when quiting. <SPACE> toggles & <CR> sets."; 
  1330. char txt_help_thread_arts[] = "Enable/disable threading of articles in all groups. <SPACE> toggles & <CR> sets."; 
  1331. char txt_help_show_only_unread[] = "Show all articles or only unread articles. <SPACE> toggles & <CR> sets."; 
  1332. char txt_help_post_proc_type[] = "Post process (ie. unshar) saved article/thread. <SPACE> toggles & <CR> sets."; 
  1333. char txt_help_sort_type[] = "Sort articles by Subject, From or Date fields. <SPACE> toggles & <CR> sets.";
  1334. char txt_help_savedir[] = "The directory where you want articles/threads saved.";
  1335. char txt_help_maildir[] = "The directory where articles/threads are to be saved in mailbox format.";
  1336. char txt_help_printer[] = "The printer program with options that is to be used to print articles/threads.";
  1337. char txt_select_rcfile_option[] = "Select option by entering number before text. Any other key to save.";
  1338. X
  1339. /*
  1340. X *  save.c
  1341. X */
  1342. X
  1343. char txt_post_processing[] = "Post processing...";
  1344. char txt_post_processing_finished[] = "-- post processing completed --";
  1345. char txt_deleting[] = "Deleting...";
  1346. char txt_uudecoding[] = "Uudecoding...";
  1347. X
  1348. /*
  1349. X *  search.c
  1350. X */
  1351. X
  1352. char txt_searching[] = "Searching...";
  1353. X
  1354. /*
  1355. X *  select.c
  1356. X */
  1357. X
  1358. char txt_moving[] = "Moving...";
  1359. #ifdef NO_REGEX
  1360. char txt_subscribe_pattern[] = "Enter subscribe pattern> ";
  1361. char txt_unsubscribe_pattern[] = "Enter unsubscribe pattern> ";
  1362. #else
  1363. char txt_subscribe_pattern[] = "Enter regex subscribe pattern> ";
  1364. char txt_unsubscribe_pattern[] = "Enter regex unsubscribe pattern> ";
  1365. #endif
  1366. char txt_subscribing[] = "Subscribing...";
  1367. char txt_subscribing_to[] = "Subscribing to %s...";
  1368. char txt_unsubscribing[] = "Unsubscribing...";
  1369. char txt_unsubscribing_from[] = "Unsubscribing from %s...";
  1370. char txt_subscribed_num_groups[] = "subscribed to %d groups";
  1371. char txt_unsubscribed_num_groups[] = "unsubscribed from %d groups";
  1372. char txt_del_group_in_newsrc[] = "Delete %s from .newsrc? (y/n): ";
  1373. char txt_group_deleted[] = "Group %s deleted";
  1374. char txt_group_undeleted[] = "Group undeleted";
  1375. char txt_mark_group_read[] = "Mark group as read? (y/n): ";
  1376. char txt_no_groups_to_delete[] = "No groups to delete";
  1377. char txt_reset_newsrc[] = "Reset newsrc? (y/n): ";
  1378. char txt_post_newsgroup[] = "Post newsgroup> ";
  1379. char txt_yanking_all_groups[] = "Yanking in all groups...";
  1380. char txt_yanking_sub_groups[] = "Yanking in subscribed to groups...";
  1381. char txt_no_groups_to_read[] = "No more groups to read";
  1382. char txt_added_groups[] = "Added %d group%s";
  1383. char txt_plural[] = "s";
  1384. char txt_no_groups_to_yank_in[] = "No more groups to yank in";
  1385. char txt_group_selection[] = "Group Selection";
  1386. char txt_select_group[] = "Select group> ";
  1387. char txt_help_g_4[] = "4$       Select group 4 ($=select last group)\r\n";
  1388. char txt_help_g_ctrl_r[] = "^R       Reset .newsrc\r\n";
  1389. char txt_help_g_ctrl_k[] = "^KZ      Delete (Z=undelete) group from .newsrc\r\n";
  1390. char txt_help_g_cr[] = "<CR>     Read current group\r\n";
  1391. char txt_help_g_c[] = "c        Mark group as all read\r\n";
  1392. char txt_help_g_tab[] =   "n<TAB>   Goto next group with unread news and enter it\r\n";
  1393. char txt_help_n[] = "N        Goto next group with unread news\r\n";
  1394. char txt_help_W[] = "W        List articles posted by user\r\n";
  1395. char txt_help_g_z[] = "z        Mark current group as unread\r\n";
  1396. char txt_help_g_y[] = "y        Yank in unsubscribed groups that are not in .newsrc\r\n";
  1397. char txt_help_g_dollar[] = "Y        Yank in subscribed groups from .newsrc\r\n";
  1398. char txt_help_g_search[] = "/?       Group forward (?=backward) search\r\n";
  1399. char txt_newsgroup[] = "Newsgroup> ";
  1400. char txt_newsgroup_position[] = "Position %s in group list [1,2,..,$]> ";
  1401. X
  1402. /*
  1403. X *  signal.c
  1404. X */
  1405. X
  1406. char txt_resizing_window[] = "resizing window";
  1407. X
  1408. /*
  1409. X *  thread.c
  1410. X */
  1411. X
  1412. char txt_no_resps_in_thread[] = "No responses to list in current thread";
  1413. char txt_help_t_0[] = "0        Goto the base article in current thread\r\n";
  1414. char txt_help_t_4[] = "4$       Goto response 4 ($=goto last response) in current thread\r\n";
  1415. char txt_help_t_cr[] = "<CR>     Read current response\r\n";
  1416. char txt_help_t_tab[] = "<TAB>    Goto next unread response\r\n";
  1417. char txt_help_t_K[] =   "K        Mark thread as read & return\r\n";
  1418. SHAR_EOF
  1419. chmod 0600 lang.c ||
  1420. echo 'restore of lang.c failed'
  1421. Wc_c="`wc -c < 'lang.c'`"
  1422. test 20471 -eq "$Wc_c" ||
  1423.     echo 'lang.c: original size 20471, current size' "$Wc_c"
  1424. rm -f _shar_wnt_.tmp
  1425. fi
  1426. # ============= main.c ==============
  1427. if test -f 'main.c' -a X"$1" != X"-c"; then
  1428.     echo 'x - skipping main.c (File already exists)'
  1429.     rm -f _shar_wnt_.tmp
  1430. else
  1431. > _shar_wnt_.tmp
  1432. echo 'x - extracting main.c (Text)'
  1433. sed 's/^X//' << 'SHAR_EOF' > 'main.c' &&
  1434. /*
  1435. X *  Project   : tin - a threaded Netnews reader
  1436. X *  Module    : main.c
  1437. X *  Author    : R.Skrenta / I.Lea
  1438. X *  Created   : 01-04-91
  1439. X *  Updated   : 30-01-92
  1440. X *  Notes     :
  1441. X *  Copyright : (c) Copyright 1991-92 by Rich Skrenta & Iain Lea
  1442. X *                You may  freely  copy or  redistribute  this software,
  1443. X *              so  long as there is no profit made from its use, sale
  1444. X *              trade or  reproduction.  You may not change this copy-
  1445. X *              right notice, and it must be included in any copy made
  1446. X */
  1447. X
  1448. #include    "tin.h"
  1449. X
  1450. char cvers[LEN];
  1451. char nntp_server[LEN];
  1452. X
  1453. int NOTESLINES;                        /* set in set_win_size () */
  1454. int RIGHT_POS;                        /* set in set_win_size () */
  1455. int MORE_POS;                        /* set in set_win_size () */
  1456. int max_subj = 0;
  1457. int max_from = 0;
  1458. int max_active;
  1459. int group_hash[TABLE_SIZE];            /* group name --> active[] */
  1460. int num_active;                        /* one past top of active */
  1461. int group_top;                        /* one past top of my_group */
  1462. int catchup = FALSE;                /* mark all arts read in all subscribed groups */
  1463. int update = FALSE;                    /* update index files only mode */
  1464. int update_fork = FALSE;            /* update index files by forked tin -u */
  1465. int verbose = FALSE;                /* update index files only mode */
  1466. int start_line_offset;                /* used by invoke_editor for line no. */
  1467. int read_news_via_nntp = FALSE;        /* read news locally or via NNTP */
  1468. int max_art;
  1469. int top = 0;
  1470. int top_base;
  1471. int tin_uid;
  1472. int tin_gid;
  1473. int real_uid;
  1474. int real_gid;
  1475. int local_index;                    /* do private indexing? */
  1476. X
  1477. X
  1478. void main (argc, argv)
  1479. X    int argc;    
  1480. X    char *argv[];
  1481. {
  1482. X    extern int optind;
  1483. X    extern char *optarg;
  1484. X    int c, i, created;
  1485. X    int check_any_unread = FALSE;
  1486. X    int notify_new_groups = FALSE;
  1487. X    int start_any_unread = FALSE;
  1488. X    int start_groupnum = 0;
  1489. X    struct stat st;
  1490. X    
  1491. X    cmd_line = TRUE;
  1492. X    debug = FALSE;
  1493. X
  1494. X    set_signal_handlers ();
  1495. X
  1496. X    basename (argv[0], progname);
  1497. X
  1498. X    sprintf (page_header, "%s %s PL%d%s", progname, VERSION, PATCHLEVEL, is_remote ());     
  1499. X    sprintf (cvers, "%s (c) Copyright 1991-92 Iain Lea.", page_header);
  1500. X
  1501. X    if (progname[0] == 'r') {    /* rtin so read news remotely via NNTP */
  1502. #ifdef USE_NNTP            
  1503. X        read_news_via_nntp = TRUE;
  1504. #else
  1505. X        error_message (txt_nntp_not_enabled, progname);
  1506. X        exit (1);
  1507. #endif
  1508. X    }
  1509. X
  1510. X    tin_uid = geteuid ();
  1511. X    tin_gid = getegid ();
  1512. X    real_uid = getuid ();
  1513. X    real_gid = getgid ();
  1514. X
  1515. X    /*
  1516. X     * we're setuid, so index in /usr/spool/news unless user root
  1517. X     */
  1518. X    if (tin_uid != real_uid && real_uid != 0) {
  1519. X        local_index = FALSE;
  1520. X    } else {    /* index in users home directory ~/.tin/.index */
  1521. X        local_index = TRUE;
  1522. X    }
  1523. X
  1524. X    init_selfinfo ();    /* set up char *'s: homedir, newsrc, etc. */
  1525. X    init_alloc ();        /* allocate initial array sizes */
  1526. X
  1527. X    while ((c = getopt (argc, argv, "cd:Df:hHm:M:np:rRs:SuUvzZ")) != EOF) {
  1528. X        switch(c) {
  1529. X            case 'c':
  1530. X                catchup = TRUE;
  1531. X                update = TRUE;
  1532. X                break;
  1533. X                
  1534. X            case 'd':
  1535. X                my_strncpy (savedir, optarg, LEN);
  1536. X                set_real_uid_gid ();
  1537. X                if (stat (savedir, &st) == -1) {
  1538. X                    mkdir (savedir, 0755);
  1539. X                }
  1540. X                set_tin_uid_gid ();
  1541. X                break;
  1542. X
  1543. X            case 'D':        /* debug mode */
  1544. X                redirect_output[0] = '\0';
  1545. X                debug = TRUE;
  1546. X                break;
  1547. X
  1548. X            case 'f':
  1549. X                my_strncpy (newsrc, optarg, LEN);
  1550. X                break;
  1551. X
  1552. X            case 'H':
  1553. X                show_intro_page ();
  1554. X                exit (1);
  1555. X                break;
  1556. X
  1557. X            case 'm':
  1558. X                my_strncpy (maildir, optarg, LEN);
  1559. X                set_real_uid_gid ();
  1560. X                if (stat (maildir, &st) == -1) {
  1561. X                    mkdir (maildir, 0755);
  1562. X                }
  1563. X                set_tin_uid_gid ();
  1564. X                break;
  1565. X
  1566. X            case 'M':    /* mail new news to specified user */
  1567. X                my_strncpy (mail_news_user, optarg, LEN);
  1568. X                mail_news = TRUE;
  1569. X                update = TRUE;
  1570. X                catchup = TRUE;
  1571. X                break;
  1572. X
  1573. X            case 'n':
  1574. X                notify_new_groups = TRUE;
  1575. X                break;
  1576. X
  1577. X            case 'p':
  1578. X                my_strncpy (cmd_line_printer, optarg, LEN);
  1579. X                default_printer = FALSE;
  1580. X                break;
  1581. X
  1582. X            case 'r':    /* read news remotely from default NNTP server */
  1583. #ifdef USE_NNTP            
  1584. X                read_news_via_nntp = TRUE;
  1585. #else
  1586. X                error_message (txt_recompile_with_nntp_option, progname);
  1587. X                exit (1);
  1588. #endif
  1589. X                break;
  1590. X
  1591. X            case 'R':    /* read news saved by -S option */
  1592. X                error_message ("%s: -R option not yet implemented.", progname);
  1593. X                exit (1);
  1594. X                break;
  1595. X
  1596. X            case 's':
  1597. X                my_strncpy (spooldir, optarg, LEN);
  1598. X                break;
  1599. X
  1600. X            case 'S':    /* save new news to dir structure */
  1601. X                save_news = TRUE;
  1602. SHAR_EOF
  1603. true || echo 'restore of main.c failed'
  1604. fi
  1605. echo 'End of tin1.1 part 5'
  1606. echo 'File main.c is continued in part 6'
  1607. echo 6 > _shar_seq_.tmp
  1608. exit 0
  1609.  
  1610. --
  1611. NAME   Iain Lea
  1612. EMAIL  iain%estevax.uucp@unido.Informatik.Uni-Dortmund.DE
  1613. SNAIL  Bruecken Strasse 12, 8500 Nuernberg 90, Germany
  1614. PHONE  +49-911-331963 (home)  +49-911-3089-407 (work)
  1615. -- 
  1616.  Dr. med. dipl.-math Dieter Becker           Tel.: (0 / +49) 6841 - 16 3046
  1617.  Medizinische Universitaets- und Poliklinik  Fax.: (0 / +49) 6841 - 16 3369
  1618.  Innere Medizin III                         
  1619.  D - 6650 Homburg / Saar                     Email: becker@med-in.uni-sb.de
  1620. exit 0 # Just in case...
  1621.