home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume28 / tin / part10 < prev    next >
Text File  |  1992-02-23  |  52KB  |  2,262 lines

  1. Newsgroups: comp.sources.misc
  2. From: iain%estevax.uucp@unido.Informatik.Uni-Dortmund.DE (Iain Lea)
  3. Subject:  v28i054:  tin - threaded full screen newsreader v1.1, Part10/11
  4. Message-ID: <1992Feb18.043951.13475@sparky.imd.sterling.com>
  5. X-Md4-Signature: b0824f74a338be8f8333cce08accf43b
  6. Date: Tue, 18 Feb 1992 04:39:51 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 54
  11. Archive-name: tin/part10
  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.10 (part 10 of tin1.1)
  17. # do not concatenate these parts, unpack them in order with /bin/sh
  18. # file signal.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" != 10; 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 signal.c'
  34. else
  35. echo 'x - continuing file signal.c'
  36. sed 's/^X//' << 'SHAR_EOF' >> 'signal.c' &&
  37. X        fprintf (stderr, "%s: send a bug report to %s\n",
  38. X            progname, BUG_REPORT_ADDRESS);
  39. X    }
  40. X    fflush (stderr);
  41. X    exit (1);
  42. }
  43. X
  44. X
  45. void set_win_size (num_lines, num_cols)
  46. X    int *num_lines;
  47. X    int *num_cols;
  48. {
  49. #ifdef TIOCGWINSZ
  50. X    char buf[64];
  51. X    int old_lines, old_cols;
  52. X    struct winsize win;
  53. X
  54. X    if (debug) {
  55. X        old_lines = *num_lines;
  56. X        old_cols = *num_cols;
  57. X    }
  58. #endif
  59. X
  60. X    init_screen_array (FALSE);        /* deallocate screen array */
  61. X
  62. #ifdef TIOCGWINSZ
  63. X    if (ioctl (0, TIOCGWINSZ, &win) == 0) {
  64. X        if (win.ws_row != 0) {
  65. X            *num_lines = win.ws_row - 1;
  66. X        }
  67. X        if (win.ws_col != 0) {
  68. X            *num_cols = win.ws_col;
  69. X        }
  70. X    }
  71. X
  72. X    if (debug) {
  73. X        sprintf (buf, "RESIZED lines %d to %d  cols %d to %d",
  74. X            old_lines, *num_lines, old_cols, *num_cols);
  75. X        info_message (buf);
  76. X    }
  77. #endif
  78. X
  79. X    init_screen_array (TRUE);        /* allocate screen array for resize */
  80. X
  81. X    if (show_author == SHOW_FROM_BOTH) {
  82. X        max_subj = (*num_cols / 2) - 2;
  83. X    } else {
  84. X        max_subj = (*num_cols / 2) + 5;
  85. X    }
  86. X    max_from = (*num_cols - max_subj) - 17;
  87. X    RIGHT_POS = *num_cols - 18;
  88. X    MORE_POS  = *num_cols - 15;
  89. X    NOTESLINES = *num_lines - INDEX_TOP - 1;
  90. X    if (NOTESLINES <= 0) {
  91. X        NOTESLINES = 1;
  92. X    }
  93. }
  94. X
  95. X
  96. void set_signals_art ()
  97. {
  98. #ifdef SIGTSTP
  99. X    if (do_sigtstp) {
  100. #ifdef POSIX_JOB_CONTROL
  101. X        sigemptyset (&art_act.sa_mask);
  102. X        art_act.sa_flags = SA_RESTART | SA_RESETHAND;
  103. X        art_act.sa_handler = art_suspend;
  104. X        sigaction (SIGTSTP, &art_act, 0L);
  105. #else
  106. X        signal (SIGTSTP, art_suspend);
  107. #endif
  108. X    }
  109. #endif
  110. X
  111. #ifdef SIGWINCH
  112. X    signal (SIGWINCH, art_resize);
  113. #endif
  114. }
  115. X
  116. X
  117. void set_signals_group ()
  118. {
  119. #ifdef SIGTSTP
  120. X    if (do_sigtstp) {
  121. #ifdef POSIX_JOB_CONTROL
  122. X        sigemptyset (&group_act.sa_mask);
  123. X        group_act.sa_flags = SA_RESTART | SA_RESETHAND;
  124. X        group_act.sa_handler = group_suspend;
  125. X        sigaction (SIGTSTP, &group_act, 0L);
  126. #else
  127. X        signal (SIGTSTP, group_suspend);
  128. #endif
  129. X    }
  130. #endif
  131. X
  132. #ifdef SIGWINCH
  133. X    signal (SIGWINCH, group_resize);
  134. #endif
  135. }
  136. X
  137. X
  138. void set_signals_page ()
  139. {
  140. #ifdef SIGTSTP
  141. X    if (do_sigtstp) {
  142. #ifdef POSIX_JOB_CONTROL
  143. X        sigemptyset (&page_act.sa_mask);
  144. X        page_act.sa_flags = SA_RESTART | SA_RESETHAND;
  145. X        page_act.sa_handler = page_suspend;
  146. X        sigaction (SIGTSTP, &page_act, 0L);
  147. #else
  148. X        signal (SIGTSTP, page_suspend);
  149. #endif
  150. X    }
  151. #endif
  152. X
  153. #ifdef SIGWINCH
  154. X    signal (SIGWINCH, page_resize);
  155. #endif
  156. }
  157. X
  158. X
  159. void set_signals_select ()
  160. {
  161. #ifdef SIGTSTP
  162. X    if (do_sigtstp) {
  163. #ifdef POSIX_JOB_CONTROL
  164. X        sigemptyset (&select_act.sa_mask);
  165. X        select_act.sa_flags = SA_RESTART | SA_RESETHAND;
  166. X        select_act.sa_handler = select_suspend;
  167. X        sigaction (SIGTSTP, &select_act, 0L);
  168. #else
  169. X        signal (SIGTSTP, select_suspend);
  170. #endif
  171. X    }
  172. #endif
  173. X
  174. #ifdef SIGWINCH
  175. X    signal (SIGWINCH, select_resize);
  176. #endif
  177. }
  178. X
  179. X
  180. void set_signals_thread ()
  181. {
  182. #ifdef SIGTSTP
  183. X    if (do_sigtstp) {
  184. #ifdef POSIX_JOB_CONTROL
  185. X        sigemptyset (&thread_act.sa_mask);
  186. X        thread_act.sa_flags = SA_RESTART | SA_RESETHAND;
  187. X        thread_act.sa_handler = thread_suspend;
  188. X        sigaction (SIGTSTP, &thread_act, 0L);
  189. #else
  190. X        signal (SIGTSTP, thread_suspend);
  191. #endif
  192. X    }
  193. #endif
  194. X
  195. #ifdef SIGWINCH
  196. X    signal (SIGWINCH, thread_resize);
  197. #endif
  198. }
  199. X
  200. X
  201. #ifdef SIGTSTP
  202. X
  203. /* ARGSUSED0 */
  204. void art_suspend (sig)
  205. X    int sig;
  206. {
  207. X    char buf[LEN];
  208. X    
  209. X    Raw (FALSE);
  210. X    putchar ('\n');
  211. X
  212. #ifdef POSIX_JOB_CONTROL
  213. X    sigsetmask(0);
  214. #else
  215. X    signal(SIGTSTP, SIG_DFL);
  216. #ifdef BSD
  217. X    sigsetmask (sigblock(0) & ~(1 << (SIGTSTP -1)));
  218. #endif
  219. #endif
  220. X
  221. X    kill (0, SIGTSTP);
  222. X
  223. #ifdef POSIX_JOB_CONTROL
  224. X    sigemptyset (&art_act.sa_mask);
  225. X    art_act.sa_flags = SA_RESTART | SA_RESETHAND;
  226. X    art_act.sa_handler = art_suspend;
  227. X    sigaction (SIGTSTP, &art_act, 0L);
  228. #else
  229. X    signal (SIGTSTP, art_suspend);
  230. #endif
  231. X
  232. X    if (! update) {
  233. X        mail_setup ();
  234. X    
  235. X        Raw (TRUE);
  236. X
  237. X        ClearScreen ();
  238. X        sprintf (buf, txt_group, glob_art_group);
  239. X        wait_message (buf);
  240. X    }
  241. }
  242. X
  243. X
  244. /* ARGSUSED0 */
  245. void main_suspend (sig)
  246. X    int sig;
  247. {
  248. X    Raw (FALSE);
  249. X    putchar ('\n');
  250. X
  251. #ifdef POSIX_JOB_CONTROL
  252. X    sigsetmask(0);
  253. #else
  254. X    signal(SIGTSTP, SIG_DFL);
  255. #ifdef BSD
  256. X    sigsetmask (sigblock(0) & ~(1 << (SIGTSTP -1)));
  257. #endif
  258. #endif
  259. X
  260. X    kill (0, SIGTSTP);
  261. X
  262. #ifdef POSIX_JOB_CONTROL
  263. X    sigemptyset (&main_act.sa_mask);
  264. X    main_act.sa_flags = SA_RESTART | SA_RESETHAND;
  265. X    main_act.sa_handler = main_suspend;
  266. X    sigaction (SIGTSTP, &main_act, 0L);
  267. #else
  268. X    signal (SIGTSTP, main_suspend);
  269. #endif
  270. X
  271. X    mail_setup ();
  272. X    if (! update) {
  273. X        Raw (TRUE);
  274. X    }
  275. }
  276. X
  277. X
  278. /* ARGSUSED0 */
  279. void select_suspend (sig)
  280. X    int sig;
  281. {
  282. X
  283. X    Raw (FALSE);
  284. X
  285. #ifdef POSIX_JOB_CONTROL
  286. X    sigsetmask(0);
  287. #else
  288. X    signal(SIGTSTP, SIG_DFL);
  289. #ifdef BSD
  290. X    sigsetmask (sigblock(0) & ~(1 << (SIGTSTP -1)));
  291. #endif
  292. #endif
  293. X
  294. X    kill (0, SIGTSTP);
  295. X
  296. #ifdef POSIX_JOB_CONTROL
  297. X    sigemptyset (&select_act.sa_mask);
  298. X    select_act.sa_flags = SA_RESTART | SA_RESETHAND;
  299. X    select_act.sa_handler = select_suspend;
  300. X    sigaction (SIGTSTP, &select_act, 0L);
  301. #else
  302. X    signal (SIGTSTP, select_suspend);
  303. #endif
  304. X
  305. X    if (! update) {
  306. X        Raw (TRUE);
  307. X    }
  308. X
  309. #ifndef USE_CLEARSCREEN
  310. X    ClearScreen ();
  311. #endif
  312. X    mail_setup ();
  313. X    group_selection_page ();
  314. }
  315. X
  316. X
  317. /* ARGSUSED0 */
  318. void group_suspend (sig)
  319. X    int sig;
  320. {
  321. X    Raw (FALSE);
  322. X    putchar ('\n');
  323. X
  324. #ifdef POSIX_JOB_CONTROL
  325. X    sigsetmask(0);
  326. #else
  327. X    signal(SIGTSTP, SIG_DFL);
  328. #ifdef BSD
  329. X    sigsetmask (sigblock(0) & ~(1 << (SIGTSTP -1)));
  330. #endif
  331. #endif
  332. X
  333. X    kill (0, SIGTSTP);
  334. X
  335. #ifdef POSIX_JOB_CONTROL
  336. X    sigemptyset (&group_act.sa_mask);
  337. X    group_act.sa_flags = SA_RESTART | SA_RESETHAND;
  338. X    group_act.sa_handler = group_suspend;
  339. X    sigaction (SIGTSTP, &group_act, 0L);
  340. #else
  341. X    signal (SIGTSTP, group_suspend);
  342. #endif
  343. X
  344. X    if (! update) {
  345. X        Raw (TRUE);
  346. X    }
  347. X    
  348. #ifndef USE_CLEARSCREEN
  349. X    ClearScreen ();
  350. #endif
  351. X    mail_setup ();
  352. X    show_group_page (glob_group);
  353. }
  354. X
  355. X
  356. /* ARGSUSED0 */
  357. void page_suspend (sig)
  358. X    int sig;
  359. {
  360. X
  361. X    Raw (FALSE);
  362. X    putchar ('\n');
  363. X
  364. #ifdef POSIX_JOB_CONTROL
  365. X    sigsetmask(0);
  366. #else
  367. X    signal(SIGTSTP, SIG_DFL);
  368. #ifdef BSD
  369. X    sigsetmask (sigblock(0) & ~(1 << (SIGTSTP -1)));
  370. #endif
  371. #endif
  372. X
  373. X    kill (0, SIGTSTP);
  374. X
  375. #ifdef POSIX_JOB_CONTROL
  376. X    sigemptyset (&page_act.sa_mask);
  377. X    page_act.sa_flags = SA_RESTART | SA_RESETHAND;
  378. X    page_act.sa_handler = page_suspend;
  379. X    sigaction (SIGTSTP, &page_act, 0L);
  380. #else
  381. X    signal (SIGTSTP, page_suspend);
  382. #endif
  383. X
  384. X    mail_setup ();
  385. X
  386. X    if (! update) {
  387. X        Raw (TRUE);
  388. X    }
  389. X    
  390. #ifndef USE_CLEARSCREEN
  391. X    ClearScreen ();
  392. #endif
  393. X    redraw_page (glob_respnum, glob_page_group);
  394. }
  395. X
  396. X
  397. /* ARGSUSED0 */
  398. void thread_suspend (sig)
  399. X    int sig;
  400. {
  401. X    Raw (FALSE);
  402. X    putchar ('\n');
  403. X
  404. #ifdef POSIX_JOB_CONTROL
  405. X    sigsetmask (0);
  406. #else
  407. X    signal (SIGTSTP, SIG_DFL);
  408. #ifdef BSD
  409. X    sigsetmask (sigblock(0) & ~(1 << (SIGTSTP -1)));
  410. #endif
  411. #endif
  412. X
  413. X    kill (0, SIGTSTP);
  414. X
  415. #ifdef POSIX_JOB_CONTROL
  416. X    sigemptyset (&thread_act.sa_mask);
  417. X    thread_act.sa_flags = SA_RESTART | SA_RESETHAND;
  418. X    thread_act.sa_handler = thread_suspend;
  419. X    sigaction (SIGTSTP, &thread_act, 0L);
  420. #else
  421. X    signal (SIGTSTP, thread_suspend);
  422. #endif
  423. X
  424. X    if (! update) {
  425. X        Raw (TRUE);
  426. X    }
  427. X    
  428. #ifndef USE_CLEARSCREEN
  429. X    ClearScreen ();
  430. #endif
  431. X    mail_setup ();
  432. X    show_thread_page ();
  433. }
  434. X
  435. X
  436. /* ARGSUSED0 */
  437. void rcfile_suspend (sig)
  438. X    int sig;
  439. {
  440. X    Raw (FALSE);
  441. X    putchar ('\n');
  442. X
  443. #ifdef POSIX_JOB_CONTROL
  444. X    sigsetmask(0);
  445. #else
  446. X    signal(SIGTSTP, SIG_DFL);
  447. #ifdef BSD
  448. X    sigsetmask (sigblock(0) & ~(1 << (SIGTSTP -1)));
  449. #endif
  450. #endif
  451. X
  452. X    kill (0, SIGTSTP);
  453. X
  454. #ifdef POSIX_JOB_CONTROL
  455. X    sigemptyset (&rcfile_act.sa_mask);
  456. X    rcfile_act.sa_flags = SA_RESTART | SA_RESETHAND;
  457. X    rcfile_act.sa_handler = rcfile_suspend;
  458. X    sigaction (SIGTSTP, &rcfile_act, 0L);
  459. #else
  460. X    signal (SIGTSTP, rcfile_suspend);
  461. #endif
  462. X
  463. X    Raw (TRUE);
  464. X    show_rcfile_menu ();    
  465. }
  466. X
  467. #endif /* SIGTSTP */    
  468. X
  469. X
  470. #ifdef SIGWINCH
  471. X
  472. /* ARGSUSED0 */
  473. void art_resize (sig)
  474. X    int sig;
  475. {
  476. X    char buf[LEN];
  477. X
  478. X    info_message (txt_resizing_window);
  479. X    set_win_size (&LINES, &COLS);
  480. X    signal (SIGWINCH, art_resize);
  481. X
  482. X    ClearScreen ();
  483. X    sprintf (buf, txt_group, glob_art_group);
  484. X    wait_message (buf);
  485. }
  486. X
  487. X
  488. /* ARGSUSED0 */
  489. void main_resize (sig)
  490. X    int sig;
  491. {
  492. X    info_message (txt_resizing_window);
  493. X    set_win_size (&LINES, &COLS);
  494. X    signal (SIGWINCH, main_resize);
  495. }
  496. X
  497. X
  498. /* ARGSUSED0 */
  499. void select_resize (sig)
  500. X    int sig;
  501. {
  502. X    info_message (txt_resizing_window);
  503. X    set_win_size (&LINES, &COLS);
  504. X    signal (SIGWINCH, select_resize);
  505. X    
  506. #ifndef USE_CLEARSCREEN
  507. X    ClearScreen ();
  508. #endif
  509. X    group_selection_page ();
  510. }
  511. X
  512. X
  513. /* ARGSUSED0 */
  514. void group_resize (sig)
  515. X    int sig;
  516. {
  517. X    info_message (txt_resizing_window);
  518. X    set_win_size (&LINES, &COLS);
  519. X    signal (SIGWINCH, group_resize);
  520. X    
  521. #ifndef USE_CLEARSCREEN
  522. X    ClearScreen ();
  523. #endif
  524. X    show_group_page (glob_group);
  525. }
  526. X
  527. X
  528. /* ARGSUSED0 */
  529. void page_resize (sig)
  530. X    int sig;
  531. {
  532. X    info_message (txt_resizing_window);
  533. X    set_win_size (&LINES, &COLS);
  534. X    signal (SIGWINCH, page_resize);
  535. X    
  536. #ifndef USE_CLEARSCREEN
  537. X    ClearScreen ();
  538. #endif
  539. X    redraw_page (glob_respnum, glob_page_group);
  540. }
  541. X
  542. X
  543. /* ARGSUSED0 */
  544. void thread_resize (sig)
  545. X    int sig;
  546. {
  547. X    info_message (txt_resizing_window);
  548. X    set_win_size (&LINES, &COLS);
  549. X    signal (SIGWINCH, thread_resize);
  550. X    
  551. #ifndef USE_CLEARSCREEN
  552. X    ClearScreen ();
  553. #endif
  554. X    show_thread_page ();
  555. }
  556. X
  557. #endif /* SIGWINCH */    
  558. X
  559. SHAR_EOF
  560. echo 'File signal.c is complete' &&
  561. chmod 0600 signal.c ||
  562. echo 'restore of signal.c failed'
  563. Wc_c="`wc -c < 'signal.c'`"
  564. test 10822 -eq "$Wc_c" ||
  565.     echo 'signal.c: original size 10822, current size' "$Wc_c"
  566. rm -f _shar_wnt_.tmp
  567. fi
  568. # ============= thread.c ==============
  569. if test -f 'thread.c' -a X"$1" != X"-c"; then
  570.     echo 'x - skipping thread.c (File already exists)'
  571.     rm -f _shar_wnt_.tmp
  572. else
  573. > _shar_wnt_.tmp
  574. echo 'x - extracting thread.c (Text)'
  575. sed 's/^X//' << 'SHAR_EOF' > 'thread.c' &&
  576. /*
  577. X *  Project   : tin - a threaded Netnews reader
  578. X *  Module    : thread.c
  579. X *  Author    : I.Lea
  580. X *  Created   : 01-04-91
  581. X *  Updated   : 08-02-92
  582. X *  Notes     :
  583. X *  Copyright : (c) Copyright 1991-92 by Iain Lea
  584. X *                You may  freely  copy or  redistribute  this software,
  585. X *              so  long as there is no profit made from its use, sale
  586. X *              trade or  reproduction.  You may not change this copy-
  587. X *              right notice, and it must be included in any copy made
  588. X */
  589. X
  590. #include    "tin.h"
  591. X
  592. extern int index_point;
  593. int threaded_on_subject;
  594. static int top_thread = 0;
  595. static int thread_index_point = 0;
  596. static int thread_basenote = 0;
  597. static int thread_respnum = 0;
  598. static int first_thread_on_screen = 0;
  599. static int last_thread_on_screen = 0;
  600. X
  601. X
  602. /*
  603. X * show current thread. If threaded on Subject: show
  604. X *   <respnum> <name>    <respnum> <name>
  605. X * If threaded on Archive-name: show
  606. X *   <respnum> <subject> <name>
  607. X */
  608. int show_thread (respnum, group, group_path)
  609. X    int respnum;
  610. X    char *group;
  611. X    char *group_path;
  612. {
  613. X    int ch;
  614. X    int flag, i, index, n;
  615. X    int scroll_lines;
  616. X    int    thread_marked_unread;
  617. X
  618. X    thread_respnum = respnum;
  619. X    thread_basenote = which_thread (thread_respnum);
  620. X    top_thread = num_of_responses (thread_basenote);
  621. X
  622. X    if (debug) {
  623. X        sprintf (msg, "THREAD respnum=[%d]  basenote=[%d]  num=[%d]",
  624. X            thread_respnum, thread_basenote, top_thread);
  625. X        info_message (msg);
  626. X        sleep (2);
  627. X    }
  628. X
  629. X    if (top_thread <= 0) {
  630. X        info_message (txt_no_resps_in_thread);
  631. X        return FALSE;
  632. X    }
  633. X
  634. X    if (arts[thread_respnum].archive != (char *) 0) {
  635. X        threaded_on_subject = FALSE;
  636. X    } else {
  637. X        threaded_on_subject = TRUE;
  638. X    }
  639. X
  640. X    if (space_mode) {
  641. X        if (i = new_responses (thread_basenote)) {
  642. X            for (n=0, i = thread_basenote; i >= 0 ; i = arts[i].thread, n++) {
  643. X                if (arts[i].unread == ART_UNREAD) {
  644. X                    thread_index_point = n;
  645. X                    break;
  646. X                }
  647. X            }
  648. X        } else {
  649. X            thread_index_point = top_thread;
  650. X        }
  651. X    } else {
  652. X        thread_index_point = top_thread;
  653. X    }
  654. X
  655. X    if (thread_index_point < 0) {
  656. X        thread_index_point = 0;
  657. X    }
  658. X
  659. X    show_thread_page ();
  660. X
  661. X    while (TRUE) {
  662. X        ch = (char) ReadCh();
  663. X
  664. X        if (ch >= '0' && ch <= '9') {    /* 0 goes to basenote */
  665. X            prompt_thread_num (ch);
  666. X        } else switch (ch) {
  667. X            case ESC:    /* common arrow keys */
  668. X                switch (get_arrow_key ()) {
  669. X                    case KEYMAP_UP:
  670. X                        goto thread_up;
  671. X
  672. X                    case KEYMAP_DOWN:
  673. X                        goto thread_down;
  674. X
  675. X                    case KEYMAP_PAGE_UP:
  676. X                        goto thread_page_up;
  677. X
  678. X                    case KEYMAP_PAGE_DOWN:
  679. X                        goto thread_page_down;
  680. X
  681. X                    case KEYMAP_HOME:
  682. X                        if (thread_index_point != 0) {
  683. X                            thread_index_point = 0;
  684. X                            show_thread_page ();
  685. X                        }
  686. X                        break;
  687. X                    
  688. X                    case KEYMAP_END:
  689. X                        goto end_of_thread;
  690. X                }
  691. X                break;
  692. X
  693. X            case '$':    /* show last page of threads */
  694. end_of_thread:            
  695. X                if (thread_index_point != top_thread) {
  696. X                    thread_index_point = top_thread;
  697. X                    show_thread_page ();
  698. X                }
  699. X                break;
  700. X                
  701. X            case '\r':
  702. X            case '\n':    /* read current article within thread */
  703. X                n = choose_response (thread_basenote, thread_index_point);
  704. X                n = show_page (n, group, group_path);
  705. X                if (n == thread_basenote) {
  706. X                    show_thread_page ();
  707. X                } else {
  708. X                    index_point = n;    
  709. X                    goto thread_done;
  710. X                }
  711. X                break;
  712. X
  713. X            case '\t':
  714. X                 space_mode = TRUE;
  715. X                if (thread_index_point == 0) {
  716. X                    n = thread_respnum;
  717. X                } else {
  718. X                    n = choose_response (thread_basenote, thread_index_point);
  719. X                }
  720. X                index = thread_index_point;
  721. X                for (i = n ; i != -1 ; i = arts[i].thread) {
  722. X                    if (arts[i].unread == ART_UNREAD) {
  723. X                        n = show_page (i, group, group_path);
  724. X                        break;
  725. X                    }
  726. X                    index++;
  727. X                }
  728. X                if (n == thread_basenote) {
  729. X                    thread_index_point = index;
  730. X                    show_thread_page ();
  731. X                } else {
  732. X                    index_point = which_thread (n);    
  733. X                    goto thread_done;
  734. X                }
  735. X                break;
  736. X    
  737. X            case ' ':            /* page down */
  738. X            case ctrl('D'):        /* vi style */
  739. X            case ctrl('V'):        /* emacs style */
  740. thread_page_down:
  741. X                if (thread_index_point == top_thread)
  742. X                    break;
  743. X
  744. X                erase_thread_arrow ();
  745. X                scroll_lines = (full_page_scroll ? NOTESLINES : NOTESLINES / 2);
  746. X                thread_index_point = ((thread_index_point + scroll_lines) /
  747. X                                    scroll_lines) * scroll_lines;
  748. X                if (thread_index_point > top_thread) {
  749. X                    thread_index_point = (top_thread / scroll_lines) * scroll_lines;
  750. X                    if (thread_index_point < top_thread) {
  751. X                        thread_index_point = top_thread;
  752. X                    }
  753. X                }
  754. X                if (thread_index_point < first_thread_on_screen ||
  755. X                    thread_index_point >= last_thread_on_screen) {
  756. X                    show_thread_page ();
  757. X                } else {
  758. X                    draw_thread_arrow ();
  759. X                }
  760. X                break;
  761. X
  762. X            case ctrl('L'):        /* redraw screen */
  763. X            case ctrl('R'):
  764. X            case ctrl('W'):
  765. #ifndef USE_CLEARSCREEN
  766. X                ClearScreen ();
  767. #endif
  768. X                show_thread_page ();
  769. X                break;
  770. X
  771. X            case ctrl('N'):
  772. X            case 'j':        /* line down */
  773. thread_down:
  774. X                if (thread_index_point + 1 > top_thread)
  775. X                    break;
  776. /*
  777. X                if (thread_index_point + 1 >= top_thread)
  778. X                    break;
  779. */
  780. X
  781. X                if (thread_index_point + 1 > last_thread_on_screen) {
  782. /*
  783. X                if (thread_index_point + 1 >= last_thread_on_screen) {
  784. */
  785. #ifndef USE_CLEARSCREEN
  786. X                    erase_thread_arrow ();
  787. #endif                    
  788. X                    thread_index_point++;
  789. X                    show_thread_page ();
  790. X                } else {
  791. X                    erase_thread_arrow ();
  792. X                    thread_index_point++;
  793. X                    draw_thread_arrow ();
  794. X                }
  795. X                break;
  796. X
  797. X            case ctrl('P'):
  798. X            case 'k':        /* line up */
  799. thread_up:
  800. X                if (! thread_index_point)
  801. X                    break;
  802. X
  803. X                if (thread_index_point <= first_thread_on_screen) {
  804. X                    thread_index_point--;
  805. X                    show_thread_page ();
  806. X                } else {
  807. X                    erase_thread_arrow ();
  808. X                    thread_index_point--;
  809. X                    draw_thread_arrow ();
  810. X                }
  811. X                break;
  812. X
  813. X            case ctrl('U'):        /* page up */
  814. X            case 'b':
  815. thread_page_up:
  816. #ifndef USE_CLEARSCREEN
  817. X                clear_message ();
  818. #endif
  819. X                erase_thread_arrow ();
  820. X                scroll_lines = (full_page_scroll ? NOTESLINES : NOTESLINES / 2);
  821. X                if ((n = thread_index_point % scroll_lines) > 0) {
  822. X                    thread_index_point = thread_index_point - n;
  823. X                } else {
  824. X                    thread_index_point = ((thread_index_point - scroll_lines) / scroll_lines) * scroll_lines;
  825. X                }
  826. X                if (thread_index_point < 0) {
  827. X                    thread_index_point = 0;
  828. X                }
  829. X                if (thread_index_point < first_thread_on_screen
  830. X                || thread_index_point >= last_thread_on_screen)
  831. X                    show_thread_page ();
  832. X                else
  833. X                    draw_thread_arrow ();
  834. X                break;
  835. X
  836. X            case 'h':    /* help */
  837. X                show_info_page (HELP_INFO, help_thread, txt_thread_com);
  838. X                show_thread_page ();
  839. X                break;
  840. X
  841. X            case 'I':    /* toggle inverse video */
  842. X                toggle_inverse_video ();
  843. X                show_thread_page ();
  844. X                break;
  845. X
  846. X            case 'i':    /* return */
  847. X            case 'q':
  848. X            case 't':
  849. X                goto thread_done;
  850. X
  851. X            case 'K':    /* mark thread as read */
  852. X                for (i = (int) base[thread_basenote] ; i != -1 ; i = arts[i].thread) {
  853. X                    arts[i].unread = ART_READ;
  854. X                }
  855. X                goto thread_done;
  856. X                break;
  857. X
  858. X            case 'v':    /* version */
  859. X                info_message (cvers);
  860. X                break;
  861. X
  862. X            case 'z':    /* mark article as unread */
  863. X                if (thread_index_point == 0) {
  864. X                    n = thread_respnum;
  865. X                } else {
  866. X                    n = choose_response (thread_basenote, thread_index_point);
  867. X                }
  868. X                if (n >= 0) {
  869. X                    arts[n].unread = ART_UNREAD;
  870. X                    show_thread_page ();
  871. X                    info_message (txt_art_marked_as_unread);
  872. X                }
  873. X                break;
  874. X
  875. X            case 'Z':    /* mark thread as unread */
  876. X                for (i = (int) base[thread_basenote] ; i != -1 ; i = arts[i].thread) {
  877. X                    arts[i].unread = ART_UNREAD;
  878. X                }
  879. X                show_thread_page ();
  880. X                info_message (txt_thread_marked_as_unread);
  881. X                break;
  882. X                
  883. X            default:
  884. X                info_message (txt_bad_command);
  885. X        }
  886. X    }
  887. X
  888. thread_done:
  889. /*
  890. X    fix_new_highest (sav_groupnum);
  891. X    update_newsrc (group, my_group[sav_groupnum], FALSE);
  892. */
  893. X    clear_note_area ();
  894. X    return TRUE;
  895. }
  896. X
  897. X
  898. void show_thread_page ()
  899. {
  900. X    extern int index_point;
  901. X    char buf[LEN];
  902. X    char new_resps[8];
  903. X    char resps[8];
  904. X    char from[LEN];
  905. X    char subject[LEN];
  906. X    int col, i, j, n;
  907. X    static int index = 0;
  908. X    int len_from;
  909. X    int len_subj;
  910. X
  911. X    set_signals_thread ();
  912. X    
  913. X    ClearScreen ();
  914. X
  915. X    if (threaded_on_subject) {
  916. X        sprintf (msg, "Thread (%s)", arts[thread_respnum].subject);
  917. X    } else {
  918. X        sprintf (msg, "List Thread (%d of %d)", index_point+1, top_base);
  919. X    }
  920. X    show_title (msg);
  921. X
  922. X    MoveCursor (INDEX_TOP, 0);
  923. X    if (thread_index_point > top_thread) {
  924. X        thread_index_point = top_thread - 1;
  925. X    }
  926. X
  927. X    if (NOTESLINES <= 0) {
  928. X        first_thread_on_screen = 0;
  929. X    } else {
  930. X        first_thread_on_screen = (thread_index_point / NOTESLINES) * NOTESLINES;
  931. X        if (first_thread_on_screen < 0) {
  932. X            first_thread_on_screen = 0;
  933. X        }
  934. X    }
  935. X
  936. X    last_thread_on_screen = first_thread_on_screen + NOTESLINES;
  937. X
  938. X    if (last_thread_on_screen >= top_thread) {
  939. X        last_thread_on_screen = top_thread;
  940. X        first_thread_on_screen = (top_thread / NOTESLINES) * NOTESLINES;
  941. X
  942. X        if (first_thread_on_screen == last_thread_on_screen ||
  943. X            first_thread_on_screen < 0) {
  944. X            if (first_thread_on_screen < 0) {
  945. X                first_thread_on_screen = 0;
  946. X            } else {
  947. X                first_thread_on_screen = last_thread_on_screen - NOTESLINES;
  948. X            }
  949. X        }
  950. X    }
  951. X
  952. X    if (top_thread == 0) {
  953. X        first_thread_on_screen = 0;
  954. X        last_thread_on_screen = 0;
  955. X    }
  956. X
  957. X    index = choose_response (thread_basenote, thread_index_point);
  958. X
  959. if (debug) {
  960. sprintf (msg, "first=[%d] last=[%d] index=[%d] thread_index_point=[%d]",
  961. X    first_thread_on_screen, last_thread_on_screen,
  962. X    index, thread_index_point);
  963. info_message (msg);
  964. sleep (2);
  965. MoveCursor (INDEX_TOP, 0);
  966. }
  967. X
  968. X    for (j=0, i = first_thread_on_screen; j < NOTESLINES && i <= last_thread_on_screen; i++, j++) {
  969. X        if (i == 0) {
  970. X            index = thread_respnum;
  971. X        } else {
  972. X            if ((index = next_response (index)) == -1) {
  973. X                break;
  974. X            }
  975. X        }
  976. X
  977. X        if (arts[index].tagged) {
  978. X            sprintf (new_resps, "%3d", arts[index].tagged);
  979. X        } else if (arts[index].unread == ART_UNREAD) {
  980. X            sprintf (new_resps, "  %c", UNREAD_ART_MARK);
  981. X        } else {
  982. X            strcpy (new_resps, "   ");
  983. X        }
  984. X
  985. X        get_author (TRUE, index, from);
  986. X
  987. X        if (draw_arrow_mark) {
  988. X            if (threaded_on_subject) {
  989. X                printf ("  %4d%3s  %s\r\n", i, new_resps, from);
  990. X            } else {
  991. X                my_strncpy (subject, arts[index].subject, max_subj);
  992. X                printf ("  %4d%3s  %-*s   %-*s\r\n",
  993. X                    i, new_resps, max_subj, subject, max_from, from);
  994. X            }
  995. X        } else {
  996. X            if (threaded_on_subject) {
  997. X                sprintf (screen[j].col, "  %4d%3s  %-*s\r\n", i, new_resps, max_subj+max_from+5, from);
  998. X            } else {
  999. X                my_strncpy (subject, arts[index].subject, max_subj+2);
  1000. X                sprintf (screen[j].col, "  %4d%3s  %-*s   %-*s\r\n",
  1001. X                    i, new_resps, max_subj+2, subject, max_from, from);
  1002. X            }
  1003. X            printf ("%s", screen[j].col);
  1004. X        }
  1005. X    }
  1006. X
  1007. #ifndef USE_CLEARSCREEN
  1008. X    CleartoEOS ();
  1009. #endif
  1010. X
  1011. X    if (last_thread_on_screen == top_thread) {
  1012. X        info_message (txt_end_of_thread);
  1013. X    }
  1014. X
  1015. X    draw_thread_arrow ();
  1016. }
  1017. X
  1018. X
  1019. void draw_thread_arrow ()
  1020. {
  1021. X    draw_arrow (INDEX_TOP + (thread_index_point-first_thread_on_screen));
  1022. }
  1023. X
  1024. X
  1025. void erase_thread_arrow ()
  1026. {
  1027. X    erase_arrow (INDEX_TOP + (thread_index_point-first_thread_on_screen));
  1028. }
  1029. X
  1030. X
  1031. int prompt_thread_num (ch)
  1032. X    char ch;
  1033. {
  1034. X    int num;
  1035. X
  1036. X    clear_message ();
  1037. X
  1038. X    if ((num = prompt_num (ch, txt_read_art)) == -1) {
  1039. X        clear_message ();
  1040. X        return FALSE;
  1041. X    }
  1042. X
  1043. X    if (num >= top_thread)
  1044. X        num = top_thread - 1;
  1045. X
  1046. X    if (num >= first_thread_on_screen
  1047. X    &&  num < last_thread_on_screen) {
  1048. X        erase_thread_arrow ();
  1049. X        thread_index_point = num;
  1050. X        draw_thread_arrow ();
  1051. X    } else {
  1052. #ifndef USE_CLEARSCREEN
  1053. X        erase_thread_arrow ();
  1054. #endif        
  1055. X        thread_index_point = num;
  1056. X        show_thread_page ();
  1057. X    }
  1058. X    return TRUE;
  1059. }
  1060. X
  1061. /*
  1062. X *  Return the number of unread articles there are within a thread
  1063. X */
  1064. X
  1065. int new_responses (thread)
  1066. X    int thread;
  1067. {
  1068. X    int i;
  1069. X    int sum = 0;
  1070. X
  1071. X    for (i = (int) base[thread]; i >= 0; i = arts[i].thread) {
  1072. X        if (arts[i].unread) {
  1073. X            sum++;
  1074. X        }
  1075. X    }
  1076. X    
  1077. X    return sum;
  1078. }
  1079. X
  1080. /*
  1081. X *  Which base note (an index into base[]) does a respnum
  1082. X *  (an index into arts[]) corresponsd to?
  1083. X *
  1084. X *  In other words, base[] points to an entry in arts[] which is
  1085. X *  the head of a thread, linked with arts[].thread.  For any q: arts[q],
  1086. X *  find i such that base[i]->arts[n]->arts[o]->...->arts[q]
  1087. X */
  1088. X
  1089. int which_thread (n)
  1090. X    int n;
  1091. {
  1092. X    register int i, j;
  1093. X
  1094. X    for (i = 0; i < top_base; i++) {
  1095. X        for (j = (int) base[i] ; j >= 0 ; j = arts[j].thread) {
  1096. X            if (j == n) {
  1097. X                return i;
  1098. X            }
  1099. X        }
  1100. X    }
  1101. X
  1102. X    sprintf (msg, "%d", n);
  1103. X    error_message (txt_cannot_find_base_art, msg);
  1104. X    return -1;
  1105. }
  1106. X
  1107. /*
  1108. X *  Find how deep in a thread a response is.  Start counting at zero
  1109. X */
  1110. X
  1111. int which_response (n)
  1112. X    int n;
  1113. {
  1114. X    int i, j;
  1115. X    int num = 0;
  1116. X
  1117. X    i = which_thread (n);
  1118. X
  1119. X    for (j = (int) base[i]; j != -1; j = arts[j].thread)
  1120. X        if (j == n)
  1121. X            break;
  1122. X        else
  1123. X            num++;
  1124. X
  1125. X    return num;
  1126. }
  1127. X
  1128. /*
  1129. X *  Given an index into base[], find the number of responses for
  1130. X *  that basenote
  1131. X */
  1132. X
  1133. int num_of_responses (n)
  1134. X    int n;
  1135. {
  1136. X    int i;
  1137. X    int oldi = -3;
  1138. X    int sum = 0;
  1139. X
  1140. X    assert (n < top_base);
  1141. X
  1142. X    for (i = (int) base[n]; i != -1; i = arts[i].thread) {
  1143. X        assert (i != -2);
  1144. X        assert (i != oldi);
  1145. X        oldi = i;
  1146. X        sum++;
  1147. X    }
  1148. X
  1149. X    return sum - 1;
  1150. }
  1151. X
  1152. /*
  1153. X *  Find the next response.  Go to the next basenote if there
  1154. X *  are no more responses in this thread
  1155. X */
  1156. X
  1157. int next_response (n)
  1158. X    int n;
  1159. {
  1160. X    int i;
  1161. X
  1162. X    if (arts[n].thread >= 0)
  1163. X        return arts[n].thread;
  1164. X
  1165. X    i = which_thread (n) + 1;
  1166. X
  1167. X    if (i >= top_base)
  1168. X        return -1;
  1169. X
  1170. X    return (int) base[i];
  1171. }
  1172. X
  1173. /*
  1174. X *  Given a respnum (index into arts[]), find the respnum of the
  1175. X *  next basenote
  1176. X */
  1177. X
  1178. int next_thread (n)
  1179. X    int n;
  1180. {
  1181. X    int i;
  1182. X
  1183. X    i = which_thread (n) + 1;
  1184. X    if (i >= top_base)
  1185. X        return -1;
  1186. X
  1187. X    return (int) base[i];
  1188. }
  1189. X
  1190. /*
  1191. X *  Find the previous response.  Go to the last response in the previous
  1192. X *  thread if we go past the beginning of this thread.
  1193. X */
  1194. X
  1195. int prev_response (n)
  1196. X    int n;
  1197. {
  1198. X    int resp;
  1199. X    int i;
  1200. X
  1201. X    resp = which_response (n);
  1202. X
  1203. X    if (resp > 0)
  1204. X        return choose_response (which_thread (n), resp-1);
  1205. X
  1206. X    i = which_thread (n) - 1;
  1207. X
  1208. X    if (i < 0)
  1209. X        return -1;
  1210. X
  1211. X    return choose_response (i, num_of_responses (i));
  1212. }
  1213. X
  1214. /*
  1215. X *  return response number n from thread i
  1216. X */
  1217. X
  1218. int choose_response (i, n)
  1219. X    int i;
  1220. X    int n;
  1221. {
  1222. X    int j;
  1223. X
  1224. X    j = (int) base[i];
  1225. X
  1226. X    while (n-- && arts[j].thread >= 0) {
  1227. X        j = arts[j].thread;
  1228. X    }
  1229. X
  1230. X    return j;
  1231. }
  1232. X
  1233. /*
  1234. X *  Find the next unread response in this group 
  1235. X */
  1236. X
  1237. int next_unread (n)
  1238. X    int n;
  1239. {
  1240. X    while (n >= 0) {
  1241. X        if (arts[n].unread == ART_UNREAD) {
  1242. X            return n;
  1243. X        }
  1244. X        n = next_response (n);
  1245. X    }
  1246. X
  1247. X    return -1;
  1248. }
  1249. X
  1250. X
  1251. /*
  1252. X *  Find the previous unread response in this thread
  1253. X */
  1254. X
  1255. int prev_unread (n)
  1256. X    int n;
  1257. {
  1258. X    while (n >= 0) {
  1259. X        if (arts[n].unread == ART_UNREAD) {
  1260. X            return n;
  1261. X        }
  1262. X        n = prev_response (n);
  1263. X    }
  1264. X
  1265. X    return -1;
  1266. }
  1267. SHAR_EOF
  1268. chmod 0600 thread.c ||
  1269. echo 'restore of thread.c failed'
  1270. Wc_c="`wc -c < 'thread.c'`"
  1271. test 14120 -eq "$Wc_c" ||
  1272.     echo 'thread.c: original size 14120, current size' "$Wc_c"
  1273. rm -f _shar_wnt_.tmp
  1274. fi
  1275. # ============= wildmat.c ==============
  1276. if test -f 'wildmat.c' -a X"$1" != X"-c"; then
  1277.     echo 'x - skipping wildmat.c (File already exists)'
  1278.     rm -f _shar_wnt_.tmp
  1279. else
  1280. > _shar_wnt_.tmp
  1281. echo 'x - extracting wildmat.c (Text)'
  1282. sed 's/^X//' << 'SHAR_EOF' > 'wildmat.c' &&
  1283. /*  $Revision: 1.5 $
  1284. **
  1285. **  Do shell-style pattern matching for ?, \, [], and * characters.
  1286. **  Might not be robust in face of malformed patterns; e.g., "foo[a-"
  1287. **  could cause a segmentation violation.  It is 8bit clean.
  1288. **
  1289. **  Written by Rich $alz, mirror!rs, Wed Nov 26 19:03:17 EST 1986.
  1290. **  Rich $alz is now <rsalz@bbn.com>.
  1291. **  April, 1991:  Replaced mutually-recursive calls with in-line code
  1292. **  for the star character.
  1293. **
  1294. **  Special thanks to Lars Mathiesen <thorinn@diku.dk> for the ABORT code.
  1295. **  This can greatly speed up failing wildcard patterns.  For example:
  1296. **    pattern: -*-*-*-*-*-*-12-*-*-*-m-*-*-*
  1297. **    text 1:     -adobe-courier-bold-o-normal--12-120-75-75-m-70-iso8859-1
  1298. **    text 2:     -adobe-courier-bold-o-normal--12-120-75-75-X-70-iso8859-1
  1299. **  Text 1 matches with 51 calls, while text 2 fails with 54 calls.  Without
  1300. **  the ABORT, then it takes 22310 calls to fail.  Ugh.  The following
  1301. **  explanation is from Lars:
  1302. **  The precondition that must be fulfilled is that DoMatch will consume
  1303. **  at least one character in text.  This is true if *p is neither '*' nor
  1304. **  '\0'.)  The last return has ABORT instead of FALSE to avoid quadratic
  1305. **  behaviour in cases like pattern "*a*b*c*d" with text "abcxxxxx".  With
  1306. **  FALSE, each star-loop has to run to the end of the text; with ABORT
  1307. **  only the last one does.
  1308. **
  1309. **  Once the control of one instance of DoMatch enters the star-loop, that
  1310. **  instance will return either TRUE or ABORT, and any calling instance
  1311. **  will therefore return immediately after (without calling recursively
  1312. **  again).  In effect, only one star-loop is ever active.  It would be
  1313. **  possible to modify the code to maintain this context explicitly,
  1314. **  eliminating all recursive calls at the cost of some complication and
  1315. **  loss of clarity (and the ABORT stuff seems to be unclear enough by
  1316. **  itself).  I think it would be unwise to try to get this into a
  1317. **  released version unless you have a good test data base to try it out
  1318. **  on.
  1319. */
  1320. X
  1321. #define TRUE            1
  1322. #define FALSE            0
  1323. #define ABORT            -1
  1324. X
  1325. X
  1326. X    /* What character marks an inverted character class? */
  1327. #define NEGATE_CLASS        '^'
  1328. X    /* Is "*" a common pattern? */
  1329. #define OPTIMIZE_JUST_STAR
  1330. X    /* Do tar(1) matching rules, which ignore a trailing slash? */
  1331. #undef MATCH_TAR_PATTERN
  1332. X
  1333. X
  1334. /*
  1335. **  Match text and p, return TRUE, FALSE, or ABORT.
  1336. */
  1337. static int
  1338. DoMatch(text, p)
  1339. X    register char    *text;
  1340. X    register char    *p;
  1341. {
  1342. X    register int    last;
  1343. X    register int    matched;
  1344. X    register int    reverse;
  1345. X
  1346. X    for ( ; *p; text++, p++) {
  1347. X    if (*text == '\0' && *p != '*')
  1348. X        return ABORT;
  1349. X    switch (*p) {
  1350. X    case '\\':
  1351. X        /* Literal match with following character. */
  1352. X        p++;
  1353. X        /* FALLTHROUGH */
  1354. X    default:
  1355. X        if (*text != *p)
  1356. X        return FALSE;
  1357. X        continue;
  1358. X    case '?':
  1359. X        /* Match anything. */
  1360. X        continue;
  1361. X    case '*':
  1362. X        while (*++p == '*')
  1363. X        /* Consecutive stars act just like one. */
  1364. X        continue;
  1365. X        if (*p == '\0')
  1366. X        /* Trailing star matches everything. */
  1367. X        return TRUE;
  1368. X        while (*text)
  1369. X        if ((matched = DoMatch(text++, p)) != FALSE)
  1370. X            return matched;
  1371. X        return ABORT;
  1372. X    case '[':
  1373. X        reverse = p[1] == NEGATE_CLASS ? TRUE : FALSE;
  1374. X        if (reverse)
  1375. X        /* Inverted character class. */
  1376. X        p++;
  1377. X        matched = FALSE;
  1378. X        if (p[1] == ']' || p[1] == '-')
  1379. X        if (*++p == *text)
  1380. X            matched = TRUE;
  1381. X        for (last = *p; *++p && *p != ']'; last = *p)
  1382. X        /* This next line requires a good C compiler. */
  1383. X        if (*p == '-' && p[1] != ']'
  1384. X            ? *text <= *++p && *text >= last : *text == *p)
  1385. X            matched = TRUE;
  1386. X        if (matched == reverse)
  1387. X        return FALSE;
  1388. X        continue;
  1389. X    }
  1390. X    }
  1391. X
  1392. #ifdef    MATCH_TAR_PATTERN
  1393. X    if (*text == '/')
  1394. X    return TRUE;
  1395. #endif    /* MATCH_TAR_ATTERN */
  1396. X    return *text == '\0';
  1397. }
  1398. X
  1399. X
  1400. /*
  1401. **  User-level routine.  Returns TRUE or FALSE.
  1402. */
  1403. int
  1404. wildmat(text, p)
  1405. X    char    *text;
  1406. X    char    *p;
  1407. {
  1408. #ifdef    OPTIMIZE_JUST_STAR
  1409. X    if (p[0] == '*' && p[1] == '\0')
  1410. X    return TRUE;
  1411. #endif    /* OPTIMIZE_JUST_STAR */
  1412. X    return DoMatch(text, p) == TRUE;
  1413. }
  1414. X
  1415. X
  1416. X
  1417. #ifdef    TEST
  1418. #include <stdio.h>
  1419. X
  1420. /* Yes, we use gets not fgets.  Sue me. */
  1421. extern char    *gets();
  1422. X
  1423. X
  1424. main()
  1425. {
  1426. X    char     p[80];
  1427. X    char     text[80];
  1428. X
  1429. X    printf("Wildmat tester.  Enter pattern, then strings to test.\n");
  1430. X    printf("A blank line gets prompts for a new pattern; a blank pattern\n");
  1431. X    printf("exits the program.\n");
  1432. X
  1433. X    for ( ; ; ) {
  1434. X    printf("\nEnter pattern:  ");
  1435. X    (void)fflush(stdout);
  1436. X    if (gets(p) == NULL || p[0] == '\0')
  1437. X        break;
  1438. X    for ( ; ; ) {
  1439. X        printf("Enter text:  ");
  1440. X        (void)fflush(stdout);
  1441. X        if (gets(text) == NULL)
  1442. X        exit(0);
  1443. X        if (text[0] == '\0')
  1444. X        /* Blank line; go back and get a new pattern. */
  1445. X        break;
  1446. X        printf("      %s\n", wildmat(text, p) ? "YES" : "NO");
  1447. X    }
  1448. X    }
  1449. X
  1450. X    exit(0);
  1451. X    /* NOTREACHED */
  1452. }
  1453. #endif    /* TEST */
  1454. SHAR_EOF
  1455. chmod 0600 wildmat.c ||
  1456. echo 'restore of wildmat.c failed'
  1457. Wc_c="`wc -c < 'wildmat.c'`"
  1458. test 4749 -eq "$Wc_c" ||
  1459.     echo 'wildmat.c: original size 4749, current size' "$Wc_c"
  1460. rm -f _shar_wnt_.tmp
  1461. fi
  1462. # ============= tin.h ==============
  1463. if test -f 'tin.h' -a X"$1" != X"-c"; then
  1464.     echo 'x - skipping tin.h (File already exists)'
  1465.     rm -f _shar_wnt_.tmp
  1466. else
  1467. > _shar_wnt_.tmp
  1468. echo 'x - extracting tin.h (Text)'
  1469. sed 's/^X//' << 'SHAR_EOF' > 'tin.h' &&
  1470. /*
  1471. X *  Project   : tin - a threaded Netnews reader
  1472. X *  Module    : tin.h
  1473. X *  Author    : R.Skrenta / I.Lea
  1474. X *  Created   : 01-04-91
  1475. X *  Updated   : 21-01-92
  1476. X *  Notes     : #include files, #defines & struct's
  1477. X *  Copyright : (c) Copyright 1991-92 by Rich Skrenta & Iain Lea
  1478. X *              You may  freely  copy or  redistribute  this software,
  1479. X *              so  long as there is no profit made from its use, sale
  1480. X *              trade or  reproduction.  You may not change this copy-
  1481. X *              right notice, and it must be included in any copy made
  1482. X */
  1483. X
  1484. #include    <stdio.h>
  1485. #include    <signal.h>
  1486. #include    <sys/types.h>
  1487. #include    <pwd.h>
  1488. #ifndef MINIX
  1489. #    include    <memory.h>
  1490. #endif
  1491. #include    <ctype.h>
  1492. #include    <time.h>
  1493. #include    <sys/stat.h>
  1494. X
  1495. #ifdef BSD
  1496. #    include    <strings.h>
  1497. #else
  1498. #    include    <string.h>
  1499. #    ifndef MINIX
  1500. #        include    <malloc.h>
  1501. #    else
  1502. #        include    <stdlib.h>
  1503. #    endif
  1504. #endif
  1505. X
  1506. #ifdef SCO_UNIX
  1507. #    include    <sys/streams.h>
  1508. #    include    <sys/ptem.h>
  1509. #endif
  1510. X
  1511. #ifdef M_XENIX
  1512. #    include    <prototypes.h>
  1513. #endif
  1514. X
  1515. #if defined(SIGWINCH) || defined(SINIX)
  1516. #    include    <sys/ioctl.h>
  1517. #    ifdef AUTO_RESIZE
  1518. #        include    <sys/ttold.h>        /* needed for resizing under an xterm */
  1519. #    endif
  1520. #endif
  1521. X
  1522. #if __STDC__
  1523. #    define    SIGTYPE    void
  1524. #else
  1525. #    define    SIGTYPE    int
  1526. #endif
  1527. X
  1528. #ifndef SPOOLDIR
  1529. #    define        SPOOLDIR    "/usr/spool/news"
  1530. #endif
  1531. #ifndef LIBDIR
  1532. #    define        LIBDIR        "/usr/lib/news"
  1533. #endif
  1534. #ifndef INEWSDIR
  1535. #    define        INEWSDIR    LIBDIR
  1536. #endif
  1537. X
  1538. #define        DEFAULT_SHELL    "/bin/sh"
  1539. X
  1540. #ifdef BSD
  1541. #    define        DEFAULT_EDITOR    "/usr/ucb/vi"
  1542. #    define        DEFAULT_MAILER    "/bin/rmail"
  1543. #    define        DEFAULT_MAILBOX    "/usr/spool/mail"
  1544. #    define        DEFAULT_PRINTER    "/usr/ucb/lpr"
  1545. #    define        DEFAULT_SUM        "sum"
  1546. #    ifndef USE_LONG_FILENAMES
  1547. #        define USE_LONG_FILENAMES
  1548. #    endif
  1549. #    define        DEFAULT_ACTIVE_NUM    1600    /* initial size of active array */
  1550. #    define        DEFAULT_ARTICLE_NUM    400        /* initial size of art array */ 
  1551. #else
  1552. #    ifdef M_XENIX
  1553. #        define        DEFAULT_EDITOR    "/bin/vi"
  1554. #        define        DEFAULT_MAILBOX    "/usr/spool/mail"
  1555. #    else
  1556. #        define        DEFAULT_EDITOR    "/usr/bin/vi"
  1557. #        define        DEFAULT_MAILBOX    "/usr/mail"
  1558. #    endif
  1559. #    ifdef NCR
  1560. #        define        DEFAULT_MAILER    "/usr/bin/mailx"
  1561. #    endif
  1562. #    ifdef RS6000
  1563. #        define        DEFAULT_PRINTER    "/bin/lp"
  1564. #    endif
  1565. #    ifdef UNIXPC
  1566. #        define        DEFAULT_MAILER    "/bin/rmail"
  1567. #    endif
  1568. #    ifdef SINIX
  1569. #        define        DEFAULT_MAILER    "/bin/rmail"
  1570. #        define        DEFAULT_PRINTER    "/bin/lpr"
  1571. #        ifndef USE_LONG_FILENAMES
  1572. #            define USE_LONG_FILENAMES
  1573. #        endif
  1574. #    endif
  1575. #    ifndef DEFAULT_MAILER
  1576. #        define        DEFAULT_MAILER    "/usr/bin/mail"
  1577. #    endif
  1578. #    ifndef DEFAULT_PRINTER
  1579. #        define        DEFAULT_PRINTER    "/usr/bin/lp"
  1580. #    endif
  1581. #    define        DEFAULT_SUM        "sum -r"
  1582. #    define        DEFAULT_ACTIVE_NUM    400        /* initial size of active array */
  1583. #    define        DEFAULT_ARTICLE_NUM    200        /* initial size of art array */ 
  1584. #endif
  1585. X
  1586. #ifdef USE_LONG_FILENAMES
  1587. #    define        LONG_PATH_PART    "part"
  1588. #    define        LONG_PATH_PATCH    "patch"
  1589. #else
  1590. #    define        LONG_PATH_PART    ""
  1591. #    define        LONG_PATH_PATCH    "p"
  1592. #endif
  1593. X
  1594. #ifdef LOG_USER
  1595. #    define        LOG_USER_FILE    "/tmp/.tin_log" 
  1596. #endif
  1597. X
  1598. #define        DEFAULT_KILL_NUM    10        /* initial size of kill array */ 
  1599. #define        DEFAULT_SAVE_NUM    10        /* initial size of save array */ 
  1600. X
  1601. #define        RCDIR            ".tin"
  1602. #define        RCFILE            "tinrc"
  1603. #define        INDEXDIR        ".index"
  1604. #define        KILLFILE        "kill"
  1605. #define        POSTFILE        "posted"
  1606. #define        UNTHREADFILE    "unthread"
  1607. #define        DEFAULT_MAILDIR    "Mail"
  1608. X
  1609. /*
  1610. #define BUG_REPORT_ADDRESS    "iain@estevax.uucp"
  1611. */
  1612. #define BUG_REPORT_ADDRESS    "iain%estevax.uucp@unido.Informatik.Uni-Dortmund.DE"
  1613. X
  1614. #ifdef TRUE
  1615. #    undef TRUE
  1616. #    define        TRUE        1
  1617. #else    
  1618. #    define        TRUE        1
  1619. #endif
  1620. X
  1621. #ifdef FALSE
  1622. #    undef FALSE
  1623. #    define        FALSE        0
  1624. #else    
  1625. #    define        FALSE        0
  1626. #endif
  1627. X
  1628. #define        LEN                1024
  1629. #define        MODULO_COUNT_NUM    5
  1630. #define        HEADER_LEN        1024
  1631. #define        TABLE_SIZE        1409
  1632. #define        MAX_PAGES        1000
  1633. #define        ctrl(c)            ((c) & 0x1F)
  1634. X
  1635. #define        DEFAULT_COMMENT    ": "    /* used when by follow-ups & replys */
  1636. #ifndef UNREAD_ART_MARK
  1637. #    define        UNREAD_ART_MARK    '+'        /* used to show that an art is unread */
  1638. #endif
  1639. X
  1640. #ifdef USE_INVERSE_HACK
  1641. #    define        BLANK_SELECT_COLS        60
  1642. #    define        BLANK_GROUP_COLS        2
  1643. #    define        BLANK_PAGE_COLS            2
  1644. #else
  1645. #    define        BLANK_SELECT_COLS        58
  1646. #    define        BLANK_GROUP_COLS        0
  1647. #    define        BLANK_PAGE_COLS            0
  1648. #endif
  1649. X
  1650. #define        SCREEN_READ_UNREAD        6        /* position for "  +" / "   " */
  1651. #define        DEFAULT_COLS            132        /* used when updating indexes */
  1652. #define        INDEX_TOP                2
  1653. X
  1654. /*
  1655. X *  used by get_arrow_key()
  1656. X */
  1657. X
  1658. #define        KEYMAP_UNKNOWN            0
  1659. #define        KEYMAP_UP                1
  1660. #define        KEYMAP_DOWN                2
  1661. #define        KEYMAP_PAGE_UP            3
  1662. #define        KEYMAP_PAGE_DOWN        4
  1663. #define        KEYMAP_HOME                5
  1664. #define        KEYMAP_END                6
  1665. X
  1666. /*
  1667. X *  used by feed.c - feed_articles()
  1668. X */
  1669. #define        SELECT_LEVEL            1
  1670. #define        GROUP_LEVEL                2
  1671. #define        PAGE_LEVEL                3
  1672. X
  1673. #define        FEED_MAIL                1
  1674. #define        FEED_PIPE                2
  1675. #define        FEED_PRINT                3
  1676. #define        FEED_SAVE                4
  1677. X
  1678. /*
  1679. X *  used in art.c & rcfile.c
  1680. X */
  1681. #define        SORT_BY_NOTHING            0        /* sort types on arts[] array */
  1682. #define        SORT_BY_SUBJ_DESCEND    1
  1683. #define        SORT_BY_SUBJ_ASCEND        2
  1684. #define        SORT_BY_FROM_DESCEND    3
  1685. #define        SORT_BY_FROM_ASCEND        4
  1686. #define        SORT_BY_DATE_DESCEND    5
  1687. #define        SORT_BY_DATE_ASCEND        6
  1688. X
  1689. #define        SHOW_FROM_NONE            0
  1690. #define        SHOW_FROM_ADDR            1
  1691. #define        SHOW_FROM_NAME            2
  1692. #define        SHOW_FROM_BOTH            3
  1693. X
  1694. /*
  1695. X *  used in help.c
  1696. X */
  1697. X
  1698. #define        HELP_INFO                0
  1699. #define        POST_INFO                1
  1700. X
  1701. /*
  1702. X *  used in save.c
  1703. X */
  1704. X
  1705. #define        CHECK_ANY_NEWS            0
  1706. #define        START_ANY_NEWS            1
  1707. #define        MAIL_ANY_NEWS            2
  1708. #define        SAVE_ANY_NEWS            3
  1709. X
  1710. /*
  1711. X *  used in help.c
  1712. X */
  1713. X
  1714. #define        HEADER_TO                0
  1715. #define        HEADER_SUBJECT            1
  1716. X
  1717. /*
  1718. X *  used in page.c & post.c
  1719. X */
  1720. X
  1721. #define        POSTED_NONE            0
  1722. #define        POSTED_REDRAW            1
  1723. #define        POSTED_OK            2
  1724. X
  1725. /*
  1726. X *  Assertion verifier
  1727. X */
  1728. X
  1729. #if __STDC__
  1730. #    define    assert(p)    if(! (p)) asfail(__FILE__, __LINE__, #p); else
  1731. #else
  1732. #    define    assert(p)    if(! (p)) asfail(__FILE__, __LINE__, "p"); else
  1733. #endif
  1734. X
  1735. #define        ESC        27
  1736. #if defined(BSD) || defined(MINIX)
  1737. #    define        CR        '\r'
  1738. #else
  1739. #    define        CR        10
  1740. #endif
  1741. X
  1742. /*
  1743. X * return codes for change_rcfile ()
  1744. X */
  1745. X
  1746. #define        NO_KILLING        0
  1747. #define        KILLING            1
  1748. X
  1749. /*
  1750. X *  art.thread
  1751. X */
  1752. X
  1753. #define        ART_NORMAL        -1
  1754. #define        ART_EXPIRED        -2
  1755. X
  1756. /*
  1757. X *  art.unread
  1758. X */
  1759. X
  1760. #define        ART_READ        0
  1761. #define        ART_UNREAD        1
  1762. #define        ART_WILL_RETURN    2
  1763. X
  1764. /*
  1765. X * used by group_t & my_group[]
  1766. X */
  1767. #define        UNSUBSCRIBED    0x01    /* haven't put in my_group[] yet */
  1768. #define        SUBSCRIBED        0x02    /* subscribed to */
  1769. X
  1770. /*
  1771. X * kill_type used in struct kill_t
  1772. X */
  1773. #define KILL_SUBJ    1
  1774. #define KILL_FROM    2
  1775. #define KILL_BOTH    3
  1776. X
  1777. /*
  1778. X * used in feed.c & save.c
  1779. X */
  1780. #define POST_PROC_NONE            0
  1781. #define POST_PROC_SHAR            1
  1782. #define POST_PROC_UUDECODE        2
  1783. #define POST_PROC_UUD_LST_ZOO    3
  1784. #define POST_PROC_UUD_EXT_ZOO    4
  1785. X
  1786. /*
  1787. X *  struct article_t - article header
  1788. X *
  1789. X *  article.artnum:
  1790. X *    article number in spool directory for group
  1791. X *
  1792. X *  article.thread:
  1793. X *    initially -1
  1794. X *    points to another arts[] (struct article_t): zero and up
  1795. X *    -2 means article has expired (wasn't found in file search
  1796. X *    of spool directory for the group)
  1797. X *
  1798. X *  article.inthread:
  1799. X *    FALSE for the first article in a thread, TRUE for all
  1800. X *    following articles in thread
  1801. X *
  1802. X *  article.unread:
  1803. X *    boolean, has this article been read or not
  1804. X *
  1805. X *  article.date
  1806. X *  date: line used for sorting articles by date order
  1807. X *
  1808. X *  article.archive:
  1809. X *    archive name used in *source* groups
  1810. X *
  1811. X *  article.part:
  1812. X *    part no. of archive
  1813. X *
  1814. X *  article.patch:
  1815. X *    patch no. of archive
  1816. X *
  1817. X *  article.killed:
  1818. X *    boolean, has this article been killed
  1819. X *
  1820. X *  article.tagged:
  1821. X *    boolean, has this article been tagged for saving or not
  1822. X */
  1823. X
  1824. struct article_t {
  1825. X    long artnum;
  1826. X    char *subject;    /* Subject: line from mail header */
  1827. X    char *from;        /* From: line from mail header (address) */
  1828. X    char *name;        /* From: line from mail header (full name) */
  1829. X    int thread;
  1830. X    int inthread;
  1831. X    int unread;        /* 0 = read, 1 = unread, 2 = will return */
  1832. X    char date[16];    /* Date: line from mail header */
  1833. X    char *archive;    /* Archive-name: line from mail header */
  1834. X    char *part;        /* part no. of archive */
  1835. X    char *patch;    /* patch no. of archive */
  1836. X    int killed;        /* 0 = not killed, 1 = killed */
  1837. X    int tagged;        /* 0 = not tagged, 1 = tagged */
  1838. };
  1839. X
  1840. /*
  1841. X *  struct group_t - newsgroup info from active file
  1842. X */
  1843. X
  1844. struct group_t {
  1845. X    char *name;
  1846. X    long max;
  1847. X    long min;
  1848. X    char moderated;
  1849. X    int next;        /* next active entry in hash chain */
  1850. X    int flag;
  1851. X    int read;        /* marked TRUE if group was entered during session */
  1852. X    int thread;        /* marked FALSE if group is not to be threaded */
  1853. };
  1854. X
  1855. /*
  1856. X *  used in hashstr.c
  1857. X */
  1858. struct hashnode {
  1859. X    char *s;                        /* the string we're saving */
  1860. X    struct hashnode *next;            /* chain for spillover */
  1861. };
  1862. X
  1863. /*
  1864. X *  used in kill.c
  1865. X */
  1866. struct kill_t {
  1867. X    int kill_type;
  1868. X    long kill_group;
  1869. X    char *kill_subj;
  1870. X    char *kill_from;
  1871. };
  1872. X
  1873. struct save_t {
  1874. X    char *subject;
  1875. X    char *dir;
  1876. X    char *file;
  1877. X    char *archive;
  1878. X    char *part;
  1879. X    char *patch;
  1880. X    int index;    
  1881. X    int saved;    
  1882. X    int is_mailbox;    
  1883. };
  1884. X
  1885. struct screen_t {
  1886. X    char *col;
  1887. };
  1888. X
  1889. struct posted_t {
  1890. X    char date[10];
  1891. X    char group[80];
  1892. X    char subj[120];
  1893. };
  1894. X
  1895. /*
  1896. X *  function prototypes    & extern definitions    
  1897. X */ 
  1898. X
  1899. #include    "patchlev.h"
  1900. #include    "extern.h"
  1901. #include    "proto.h"
  1902. SHAR_EOF
  1903. chmod 0600 tin.h ||
  1904. echo 'restore of tin.h failed'
  1905. Wc_c="`wc -c < 'tin.h'`"
  1906. test 8937 -eq "$Wc_c" ||
  1907.     echo 'tin.h: original size 8937, current size' "$Wc_c"
  1908. rm -f _shar_wnt_.tmp
  1909. fi
  1910. # ============= extern.h ==============
  1911. if test -f 'extern.h' -a X"$1" != X"-c"; then
  1912.     echo 'x - skipping extern.h (File already exists)'
  1913.     rm -f _shar_wnt_.tmp
  1914. else
  1915. > _shar_wnt_.tmp
  1916. echo 'x - extracting extern.h (Text)'
  1917. sed 's/^X//' << 'SHAR_EOF' > 'extern.h' &&
  1918. /*
  1919. X *  Project   : tin - a threaded Netnews reader
  1920. X *  Module    : lang.h
  1921. X *  Author    : I.Lea
  1922. X *  Created   : 01-04-91
  1923. X *  Updated   : 08-02-92
  1924. X *  Notes     :
  1925. X *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1926. X *              You may  freely  copy or  redistribute  this software,
  1927. X *              so  long as there is no profit made from its use, sale
  1928. X *              trade or  reproduction.  You may not change this copy-
  1929. X *              right notice, and it must be included in any copy made
  1930. X */
  1931. X
  1932. extern char *help_group[];
  1933. extern char *help_page[];
  1934. extern char *help_select[];
  1935. extern char *help_thread[];
  1936. extern char active_file[LEN];
  1937. extern char add_addr[LEN];
  1938. extern char art_search_string[LEN];
  1939. extern char article[LEN];
  1940. extern char author_search_string[LEN];
  1941. extern char bug_addr[LEN];
  1942. extern char cvers[LEN];
  1943. extern char dead_article[LEN];
  1944. extern char default_mail_address[LEN];
  1945. extern char default_pipe_command[LEN];
  1946. extern char default_post_subject[LEN];
  1947. extern char default_regex_pattern[LEN];
  1948. extern char default_save_file[LEN];
  1949. extern char default_shell_command[LEN];
  1950. extern char delgroups[LEN];
  1951. extern char group_search_string[LEN];
  1952. extern char homedir[LEN];
  1953. extern char indexdir[LEN];
  1954. extern char killfile[LEN];
  1955. extern char killfrom[LEN];
  1956. extern char killsubj[LEN];
  1957. extern char mail_news_user[LEN];
  1958. extern char mailbox[LEN];
  1959. extern char maildir[LEN];
  1960. extern char mailer[LEN];
  1961. extern char msg[LEN];
  1962. extern char my_org[LEN];
  1963. extern char newnewsrc[LEN];
  1964. extern char newsrc[LEN];
  1965. extern char nntp_server[LEN];
  1966. extern char page_header[LEN];
  1967. extern char postfile[LEN];
  1968. extern char printer[LEN];
  1969. extern char cmd_line_printer[LEN];
  1970. extern char proc_ch_default;                /* set in change_rcfile () */
  1971. extern char progname[LEN];
  1972. extern char rcdir[LEN];
  1973. extern char rcfile[LEN];
  1974. extern char redirect_output[LEN];
  1975. extern char reply_to[LEN];
  1976. extern char savedir[LEN];
  1977. extern char sig[LEN];
  1978. extern char signature[LEN];
  1979. extern char spooldir[LEN];
  1980. extern char subject_search_string[LEN];
  1981. extern char txt_help_bug_report[LEN];
  1982. extern char unthreadfile[LEN];
  1983. extern char userid[LEN];
  1984. X
  1985. extern char txt_group[];
  1986. extern char txt_cannot_open_art[];
  1987. extern char txt_indexing[];
  1988. extern char txt_indexing_num[];
  1989. extern char txt_corrupt_index[];
  1990. extern char txt_checking_for_news[];
  1991. extern char txt_there_is_no_news[];
  1992. extern char txt_killing_arts[];
  1993. extern char txt_unkilling_arts[];
  1994. extern char txt_art_thread_regex_tag[];
  1995. extern char txt_post_process_type[];
  1996. extern char txt_feed_pattern[];
  1997. extern char txt_no_command[];
  1998. extern char txt_piping[];
  1999. extern char txt_cannot_post[];
  2000. extern char txt_tagged_art[];
  2001. extern char txt_untagged_art[];
  2002. extern char txt_inverse_on[];
  2003. extern char txt_inverse_off[];
  2004. extern char txt_subscribed_to[];
  2005. extern char txt_unsubscribed_to[];
  2006. extern char txt_mark_all_read[];
  2007. extern char txt_no_more_groups[];
  2008. extern char txt_no_prev_group[];
  2009. extern char txt_no_arts[];
  2010. extern char txt_no_groups[];
  2011. extern char txt_end_of_thread[];
  2012. extern char txt_end_of_arts[];
  2013. extern char txt_end_of_groups[];
  2014. extern char txt_no_next_unread_art[];
  2015. extern char txt_no_prev_unread_art[];
  2016. extern char txt_no_last_message[];
  2017. extern char txt_bad_command[];
  2018. extern char txt_you_have_mail[];
  2019. extern char txt_type_h_for_help[];
  2020. extern char txt_read_art[];
  2021. extern char txt_author_search_forwards[];
  2022. extern char txt_author_search_backwards[];
  2023. extern char txt_search_forwards[];
  2024. extern char txt_search_backwards[];
  2025. extern char txt_no_search_string[];
  2026. extern char txt_no_match[];
  2027. extern char txt_post_subject[];
  2028. extern char txt_no_subject[];
  2029. extern char txt_cannot_open[];
  2030. extern char txt_posting[];
  2031. extern char txt_art_posted[];
  2032. extern char txt_art_rejected[];
  2033. extern char txt_abort_edit_post[];
  2034. extern char txt_index_page_com[];
  2035. extern char txt_thread_com[];
  2036. extern char txt_help_i_4[];
  2037. extern char txt_help_ctrl_k[];
  2038. extern char txt_help_ctrl_l[];
  2039. extern char txt_help_ctrl_d[];
  2040. extern char txt_help_i_cr[];
  2041. extern char txt_help_i_tab[];
  2042. extern char txt_help_d[];
  2043. extern char txt_help_l[];
  2044. extern char txt_help_m[];
  2045. extern char txt_help_M[];
  2046. extern char txt_help_a[];
  2047. extern char txt_help_sel_c[];
  2048. extern char txt_help_c[];
  2049. extern char txt_help_g[];
  2050. extern char txt_help_I[];
  2051. extern char txt_help_K[];
  2052. extern char txt_help_t_K[];
  2053. extern char txt_help_j[];
  2054. extern char txt_help_i_n[];
  2055. extern char txt_help_i_p[];
  2056. extern char txt_help_q[];
  2057. extern char txt_help_s[];
  2058. extern char txt_help_S[];
  2059. extern char txt_help_t[];
  2060. extern char txt_help_T[];
  2061. extern char txt_help_u[];
  2062. extern char txt_help_U[];
  2063. extern char txt_help_v[];
  2064. extern char txt_help_w[];
  2065. extern char txt_help_i_search[];
  2066. extern char txt_help_thread[];
  2067. #ifndef NO_SHELL_ESCAPE
  2068. extern char txt_help_shell[];
  2069. #endif
  2070. extern char txt_help_dash[];
  2071. extern char txt_save_pattern[];
  2072. extern char txt_saved_pattern_to[];
  2073. extern char txt_saved_to_mailbox[];
  2074. extern char txt_switch_on_kill_art_menu[];
  2075. extern char txt_post_history_menu[];
  2076. extern char txt_hit_space_for_more[];
  2077. extern char txt_kill_menu[];
  2078. extern char txt_kill_subject[];
  2079. extern char txt_kill_from[];
  2080. extern char txt_kill_text[];
  2081. extern char txt_kill_text_type[];
  2082. extern char txt_kill_group[];
  2083. extern char txt_help_kill_subject[];
  2084. extern char txt_help_kill_from[];
  2085. extern char txt_help_kill_text[];
  2086. extern char txt_help_kill_text_type[];
  2087. extern char txt_help_kill_group[];
  2088. extern char txt_abort_edit_save_killfile[];
  2089. extern char txt_quit[];
  2090. extern char txt_art_unavailable[];
  2091. extern char txt_art_marked_as_unread[];
  2092. extern char txt_thread_marked_as_unread[];
  2093. extern char txt_begin_of_art[];
  2094. extern char txt_next_resp[];
  2095. extern char txt_last_resp[];
  2096. extern char txt_more_percent[];
  2097. extern char txt_more[];
  2098. extern char txt_thread_x_of_n[];
  2099. extern char txt_art[];
  2100. extern char txt_resp_x_of_n[];
  2101. extern char txt_no_resp[];
  2102. extern char txt_1_resp[];
  2103. extern char txt_x_resp[];
  2104. extern char txt_s_at_s[];
  2105. extern char txt_thread_resp_page[];
  2106. extern char txt_thread_page[];
  2107. extern char txt_read_resp[];
  2108. extern char txt_art_pager_com[];
  2109. extern char txt_help_p_0[];
  2110. extern char txt_help_p_4[];
  2111. extern char txt_help_p_cr[];
  2112. extern char txt_help_p_tab[];
  2113. extern char txt_help_b[];
  2114. extern char txt_help_C[];
  2115. extern char txt_help_bug[];
  2116. extern char txt_help_p_f[];
  2117. extern char txt_help_ctrl_h[];
  2118. extern char txt_help_h[];
  2119. extern char txt_help_p_i[];
  2120. extern char txt_help_p_k[];
  2121. extern char txt_help_p_m[];
  2122. extern char txt_help_p_n[];
  2123. extern char txt_help_o[];
  2124. extern char txt_help_p_p[];
  2125. extern char txt_help_p_r[];
  2126. extern char txt_help_p_s[];
  2127. extern char txt_help_p_z[];
  2128. extern char txt_help_p_ctrl_r[];
  2129. extern char txt_help_p_g[];
  2130. extern char txt_help_p_d[];
  2131. extern char txt_help_pipe[];
  2132. extern char txt_help_p_search[];
  2133. extern char txt_mail_art_to[];
  2134. extern char txt_no_mail_address[];
  2135. extern char txt_abort_edit_send[];
  2136. extern char txt_abort_edit_cancel[];
  2137. extern char txt_cancelling[];
  2138. extern char txt_art_cancelled[];
  2139. extern char txt_mailing_to[];
  2140. extern char txt_message_sent[];
  2141. extern char txt_command_failed_s[];
  2142. extern char txt_in_art_you_write[];
  2143. extern char txt_resp_to_poster[];
  2144. extern char txt_resp_redirect[];
  2145. extern char txt_continue[];
  2146. extern char txt_writes[];
  2147. extern char txt_writes_name[];
  2148. extern char txt_save_filename[];
  2149. extern char txt_art_not_saved[];
  2150. extern char txt_no_filename[];
  2151. extern char txt_saving[];
  2152. extern char txt_art_saved_to[];
  2153. extern char txt_thread_not_saved[];
  2154. extern char txt_thread_saved_to_many[];
  2155. extern char txt_thread_saved_to[];
  2156. extern char txt_pipe_to_command[];
  2157. extern char txt_command_failed[];
  2158. extern char txt_printing[];
  2159. extern char txt_printed[];
  2160. extern char txt_append_to_file[];
  2161. extern char txt_hit_any_key[];
  2162. extern char txt_nntp_not_enabled[];
  2163. extern char txt_recompile_with_nntp_option[];
  2164. extern char txt_not_in_active_file[];
  2165. extern char txt_screen_init_failed[];
  2166. extern char txt_bad_active_file[];
  2167. extern char txt_creating_newsrc[];
  2168. extern char txt_reading_active_file[];
  2169. extern char txt_cannot_find_base_art[];
  2170. extern char txt_out_of_memory[];
  2171. extern char txt_rename_error[];
  2172. extern char txt_shell_escape[];
  2173. extern char txt_connecting[];
  2174. extern char txt_cannot_get_nntp_server_name[];
  2175. extern char txt_server_name_in_file_env_var[];
  2176. extern char txt_failed_to_connect_to_server[];
  2177. extern char txt_rejected_by_nntpserver[];
  2178. extern char txt_connection_to_server_broken[];
  2179. extern char txt_stuff_nntp_cannot_open[];
  2180. extern char txt_nntp_to_fp_cannot_reopen[];
  2181. extern char txt_nntp_to_fd_cannot_reopen[];
  2182. extern char txt_toggled_rot13[];
  2183. extern char txt_no_arts_posted[];
  2184. extern char txt_post_an_article[];
  2185. extern char txt_post_a_followup[];
  2186. extern char txt_mail_bug_report[];
  2187. extern char txt_reply_to_author[];
  2188. extern char txt_opt_autosave[];
  2189. extern char txt_opt_save_separate[];
  2190. extern char txt_opt_mark_saved_read[];
  2191. extern char txt_opt_kill_articles[];
  2192. extern char txt_opt_show_author[];
  2193. extern char txt_opt_draw_arrow[];
  2194. extern char txt_opt_post_process[];
  2195. extern char txt_opt_print_header[];
  2196. extern char txt_opt_pos_first_unread[];
  2197. extern char txt_opt_page_scroll[];
  2198. extern char txt_opt_catchup_groups[];
  2199. extern char txt_opt_thread_arts[];
  2200. extern char txt_opt_show_only_unread[];
  2201. extern char txt_opt_process_type[];
  2202. extern char txt_opt_sort_type[];
  2203. extern char txt_show_from_none[];
  2204. extern char txt_show_from_addr[];
  2205. extern char txt_show_from_name[];
  2206. extern char txt_show_from_both[];
  2207. extern char txt_post_process_none[];
  2208. extern char txt_post_process_sh[];
  2209. extern char txt_post_process_uudecode[];
  2210. extern char txt_post_process_uud_lst_zoo[];
  2211. extern char txt_post_process_uud_ext_zoo[];
  2212. extern char txt_sort_by_nothing[];
  2213. extern char txt_sort_by_subj_descend[];
  2214. extern char txt_sort_by_subj_ascend[];
  2215. extern char txt_sort_by_from_descend[];
  2216. extern char txt_sort_by_from_ascend[];
  2217. extern char txt_sort_by_date_descend[];
  2218. extern char txt_sort_by_date_ascend[];
  2219. extern char txt_opt_savedir[];
  2220. extern char txt_opt_maildir[];
  2221. extern char txt_opt_printer[];
  2222. extern char txt_options_menu[];
  2223. extern char txt_help_autosave[];
  2224. extern char txt_help_save_separate[];
  2225. extern char txt_help_print_header[];
  2226. extern char txt_help_pos_first_unread[];
  2227. extern char txt_help_show_author[];
  2228. extern char txt_help_draw_arrow[];
  2229. extern char txt_help_kill_articles[];
  2230. extern char txt_help_mark_saved_read[];
  2231. extern char txt_help_page_scroll[];
  2232. extern char txt_help_catchup_groups[];
  2233. extern char txt_help_thread_arts[];
  2234. extern char txt_help_show_only_unread[];
  2235. SHAR_EOF
  2236. true || echo 'restore of extern.h failed'
  2237. fi
  2238. echo 'End of tin1.1 part 10'
  2239. echo 'File extern.h is continued in part 11'
  2240. echo 11 > _shar_seq_.tmp
  2241. exit 0
  2242.  
  2243. --
  2244. NAME   Iain Lea
  2245. EMAIL  iain%estevax.uucp@unido.Informatik.Uni-Dortmund.DE
  2246. SNAIL  Bruecken Strasse 12, 8500 Nuernberg 90, Germany
  2247. PHONE  +49-911-331963 (home)  +49-911-3089-407 (work)
  2248. -- 
  2249.  Dr. med. dipl.-math Dieter Becker           Tel.: (0 / +49) 6841 - 16 3046
  2250.  Medizinische Universitaets- und Poliklinik  Fax.: (0 / +49) 6841 - 16 3369
  2251.  Innere Medizin III                         
  2252.  D - 6650 Homburg / Saar                     Email: becker@med-in.uni-sb.de
  2253. exit 0 # Just in case...
  2254.