home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume23
/
tin
/
part08
< prev
next >
Wrap
Text File
|
1991-09-25
|
51KB
|
2,151 lines
Newsgroups: comp.sources.misc
From: iain@estevax.uucp (Iain J. Lea)
Subject: v23i022: tin - threaded full screen newsreader v1.0 PL2, Part08/09
Message-ID: <1991Sep25.205334.2266@sparky.imd.sterling.com>
X-Md4-Signature: 14f65fd5d9549ea44667c8d0f317c5b7
Date: Wed, 25 Sep 1991 20:53:34 GMT
Approved: kent@sparky.imd.sterling.com
Submitted-by: iain@estevax.uucp (Iain J. Lea)
Posting-number: Volume 23, Issue 22
Archive-name: tin/part08
Environment: BSD, SCO, ISC, SUNOS, SYSVR3, SYSVR4, ULTRIX, XENIX
#!/bin/sh
# this is tin.shar.08 (part 8 of tin1.02)
# do not concatenate these parts, unpack them in order with /bin/sh
# file select.c continued
#
if touch 2>&1 | fgrep '[-amc]' > /dev/null
then TOUCH=touch
else TOUCH=true
fi
if test ! -r shar3_seq_.tmp; then
echo "Please unpack part 1 first!"
exit 1
fi
(read Scheck
if test "$Scheck" != 8; then
echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < shar3_seq_.tmp || exit 1
echo "x - Continuing file select.c"
sed 's/^X//' << 'SHAR_EOF' >> select.c &&
X#endif
X if (active[my_group[i]].flag == SUBS) {
X#ifndef SLOW_SCREEN_UPDATE
X sprintf (msg, txt_unsubscribing_from, active[my_group[i]].name);
X wait_message (msg);
X#endif
X subscribe (active[my_group[i]].name,
X '!', my_group[i], FALSE);
X }
X subscribe_num++;
X }
X }
X if (subscribe_num) {
X group_selection_page ();
X sprintf (buf, txt_unsubscribed_num_groups, subscribe_num);
X info_message (buf);
X } else {
X info_message (txt_no_match);
X }
X } else {
X clear_message ();
X }
X break;
X
X case 'v': /* show tin version */
X info_message (cvers);
X break;
X
X case 'w': /* post a basenote */
X if (post_base (active[my_group[cur_groupnum]].name)) {
X group_selection_page ();
X }
X break;
X
X case 'W': /* display messages posted by user */
X if (user_posted_messages ()) {
X group_selection_page ();
X }
X break;
X
X case 'y': /* pull in rest of groups from active */
X if (reread_active_file) {
X n = local_top;
X for (i = 0; i < num_active; i++) {
X active[i].flag = NOTGOT;
X }
X read_newsrc (FALSE);
X for (i = 0; i < num_active; i++) {
X if (active[i].flag & NOTGOT) {
X active[i].flag &= ~NOTGOT;
X my_group[local_top] = i;
X unread[local_top] = -1;
X local_top++;
X }
X }
X if (n < local_top) {
X sprintf(buf, txt_added_groups, local_top - n,
X local_top - n == 1 ? "" : txt_plural);
X group_selection_page();
X info_message(buf);
X } else {
X info_message(txt_no_groups_to_yank_in);
X }
X reread_active_file = FALSE;
X } else {
X read_newsrc (TRUE);
X cur_groupnum = local_top - 1;
X group_selection_page();
X reread_active_file = TRUE;
X }
X break;
X
X case 'Y': /* reread .newsrc, no unsub groups */
X cur_groupnum = 0;
X local_top = 0;
X for (i = 0; i < num_active; i++)
X active[i].flag = NOTGOT;
X read_newsrc (TRUE);
X group_selection_page ();
X break;
X
X case 'z': /* mark group unread */
X n = cur_groupnum;
X update_newsrc (active[my_group[n]].name, my_group[n], TRUE);
X cur_groupnum = 0;
X local_top = 0;
X read_newsrc (TRUE);
X cur_groupnum = n;
X group_selection_page ();
X break;
X
X case 'Z': /* undelete groups deleted by ctrl-K */
X if (undel_group ()) {
X group_selection_page ();
X info_message (txt_group_undeleted);
X }
X break;
X
X default:
X info_message(txt_bad_command);
X }
X }
X}
X
X
Xvoid group_selection_page ()
X{
X char buf[LEN];
X char new[10];
X char subs;
X int col, i, j, n;
X
X#ifdef SIGTSTP
X if (do_sigtstp) {
X#ifdef POSIX_JOB_CONTROL
X sigemptyset (&select_act.sa_mask);
X select_act.sa_flags = SA_RESTART | SA_RESETHAND;
X select_act.sa_handler = select_suspend;
X sigaction (SIGTSTP, &select_act, 0L);
X#else
X signal (SIGTSTP, select_suspend);
X#endif
X }
X#endif
X
X#ifdef SIGWINCH
X signal (SIGWINCH, select_resize);
X#endif
X
X#ifdef USE_CLEARSCREEN
X ClearScreen ();
X#else
X MoveCursor (0, 0); /* top left corner */
X CleartoEOLN ();
X#endif
X
X sprintf (buf, "%s (%d)", txt_group_selection, local_top);
X center_line (0, TRUE, buf);
X
X if (col = (COLS - (int) strlen (txt_type_h_for_help))+1) {
X MoveCursor (0, 0); /* in upper middle */
X if (kill_articles) { /* display KILL on screen */
X printf ("KILL ON");
X }
X
X MoveCursor (0, col); /* in upper middle */
X if (mail_check ()) { /* you have mail message */
X printf (txt_you_have_mail);
X } else {
X printf (txt_type_h_for_help);
X }
X }
X
X#ifndef USE_CLEARSCREEN
X MoveCursor (1, 0);
X CleartoEOLN ();
X#endif
X
X MoveCursor (INDEX_TOP, 0);
X
X first_group_on_screen = (cur_groupnum / NOTESLINES) * NOTESLINES;
X
X last_group_on_screen = first_group_on_screen + NOTESLINES;
X if (last_group_on_screen >= local_top)
X last_group_on_screen = local_top;
X
X for (j=0, i = first_group_on_screen; i < last_group_on_screen; i++,j++) {
X switch (unread[i]) {
X case -2:
X sprintf (new, "? ");
X break;
X
X case -1:
X sprintf (new, "- ");
X break;
X
X case 0:
X sprintf (new, " ");
X break;
X
X default:
X sprintf (new, "%-4d", unread[i]);
X }
X
X n = my_group[i];
X if (active[n].flag & SUBS) /* subscribed? */
X subs = ' ';
X else
X subs = 'u'; /* u next to unsubscribed groups */
X
X if (draw_arrow_mark) {
X printf (" %c %4d %-40s %s\r\n",
X subs, i+1, active[n].name, new);
X } else {
X sprintf (screen[j].col, " %c %4d %-40s %s%*s\r\n",
X subs, i+1, active[n].name, new, COLS-BLANK_SELECT_COLS, " ");
X printf ("%s", screen[j].col);
X }
X }
X#ifndef USE_CLEARSCREEN
X CleartoEOS ();
X#endif
X
X if (local_top <= 0) {
X info_message (txt_no_groups);
X return;
X } else if (last_group_on_screen == local_top) {
X info_message (txt_end_of_groups);
X }
X
X draw_group_arrow ();
X}
X
X
Xint prompt_group_num (ch)
X char ch;
X{
X int num;
X
X clear_message ();
X
X if ((num = parse_num (ch, txt_select_group)) == -1) {
X clear_message ();
X return FALSE;
X }
X num--; /* index from 0 (internal) vs. 1 (user) */
X
X if (num >= local_top)
X num = local_top - 1;
X
X if (num >= first_group_on_screen
X && num < last_group_on_screen) {
X erase_group_arrow ();
X cur_groupnum = num;
X draw_group_arrow ();
X } else {
X#ifndef USE_CLEARSCREEN
X erase_group_arrow ();
X#endif
X cur_groupnum = num;
X group_selection_page ();
X }
X
X return TRUE;
X}
X
X
Xvoid erase_group_arrow ()
X{
X erase_arrow (INDEX_TOP + (cur_groupnum-first_group_on_screen) );
X}
X
X
Xvoid draw_group_arrow()
X{
X draw_arrow (INDEX_TOP + (cur_groupnum-first_group_on_screen) );
X}
X
X
Xint choose_new_group ()
X{
X char buf[LEN+1];
X char *p;
X int ret;
X
X if (! parse_string (txt_newsgroup, buf))
X return -1;
X
X for (p = buf; *p && (*p == ' ' || *p == '\t'); p++)
X continue;
X if (*p == '\0')
X return -1;
X
X clear_message ();
X
X if ((ret = add_group (p, TRUE)) < 0) {
X sprintf (msg, txt_not_in_active_file, p);
X info_message (msg);
X }
X
X return ret;
X}
X
X
X/*
X * Add a group to the selection list (my_group[])
X * Return the index of my_group[] if group is added or was already
X * there. Return -1 if named group is not in active[].
X */
X
Xint add_group (s, get_unread)
X char *s;
X int get_unread; /* look in .newsrc for sequencer unread info? */
X{
X long h;
X int i, j;
X
X h = hash_groupname (s);
X
X for (i = group_hash[h]; i >= 0; i = active[i].next) {
X if (strcmp (s, active[i].name) == 0) {
X for (j = 0; j < local_top; j++) {
X if (my_group[j] == i) {
X return j;
X }
X }
X
X active[i].flag &= ~NOTGOT; /* mark that we got it */
X my_group[local_top] = i;
X
X if (get_unread)
X unread[local_top] = get_line_unread (s, i);
X else
X unread[local_top] = -2;
X
X local_top++;
X return local_top - 1;
X }
X }
X
X return -1;
X}
X
X/*
X * Find the next unread response in this group
X */
X
Xint next_unread(n)
X int n;
X{
X while (n >= 0) {
X if (arts[n].unread == ART_UNREAD)
X return n;
X n = next_response (n);
X }
X
X return -1;
X}
X
X
X/*
X * Find the previous unread response in this thread
X */
X
Xint prev_unread(n)
X int n;
X{
X while (n >= 0) {
X if (arts[n].unread == ART_UNREAD)
X return n;
X n = prev_response(n);
X }
X
X return -1;
X}
X
X
Xint reposition_group (group, default_num)
X char *group;
X int default_num;
X{
X char buf[LEN+1];
X char pos[LEN+1];
X int pos_num = 0;
X
X sprintf (buf, txt_newsgroup_position, group);
X
X if (! parse_string (buf, pos))
X return default_num;
X
X if (pos[0] == '\0')
X return default_num;
X
X if (pos[0] == '$') {
X pos_num = local_top;
X } else {
X pos_num = atoi (pos);
X if (pos_num > local_top) {
X pos_num = local_top;
X } else if (pos_num <= 0) {
X pos_num = 1;
X }
X }
X
X wait_message (txt_moving);
X
X if (pos_group_in_newsrc (group, pos_num)) {
X read_newsrc (TRUE);
X return (pos_num-1);
X } else {
X return (default_num);
X }
X}
X
X
Xvoid catchup_group (goto_next_unread_group)
X int goto_next_unread_group;
X{
X int i;
X
X if (prompt_yn (LINES, txt_mark_group_read, 'y')) {
X unread[cur_groupnum] = 0;
X mark_group_read (active[my_group[cur_groupnum]].name,
X my_group[cur_groupnum]);
X if (draw_arrow_mark) {
X MoveCursor (INDEX_TOP+(cur_groupnum - first_group_on_screen), 51);
X printf (" ");
X MoveCursor (LINES, 0);
X fflush (stdout);
X } else {
X i = cur_groupnum - first_group_on_screen;
X screen[i].col[51] = ' ';
X screen[i].col[52] = ' ';
X screen[i].col[53] = ' ';
X screen[i].col[54] = ' ';
X screen[i].col[55] = ' ';
X }
X erase_group_arrow ();
X if (cur_groupnum+1 < last_group_on_screen) {
X cur_groupnum++;
X }
X draw_group_arrow ();
X
X if (goto_next_unread_group) {
X next_unread_group (FALSE);
X }
X }
X}
X
X
Xvoid next_unread_group (enter_group)
X int enter_group;
X{
X int i;
X
X for (i = cur_groupnum; i < local_top; i++) {
X if (unread[i] != 0) {
X break;
X }
X }
X if (i >= local_top) {
X info_message (txt_no_groups_to_read);
X return;
X }
X
X erase_group_arrow ();
X cur_groupnum = i;
X if (cur_groupnum >= last_group_on_screen) {
X group_selection_page ();
X } else {
X draw_group_arrow ();
X }
X space_mode = pos_first_unread;
X
X if (enter_group) {
X clear_message ();
X index_point = -1;
X do {
X group_page (active[my_group[cur_groupnum]].name);
X } while (index_point == -3);
X group_selection_page ();
X }
X}
X
X#ifdef TEST
X do {
X n = my_group[cur_groupnum];
X if (active[n].min <= active[n].max) {
X group_page (active[n].name);
X } else {
X if (cur_groupnum > n) { /* next group */
X n = my_group[cur_groupnum];
X while (active[n].min <= active[n].max) {
X cur_groupnum++;
X if (cur_groupnum >= local_top) {
X cur_groupnum = local_top - 1;
X index_point = -1;
X break;
X }
X n = my_group[cur_groupnum];
X }
X } else { /* previous group */
X n = my_group[cur_groupnum];
X while (active[n].min <= active[n].max) {
X cur_groupnum--;
X if (cur_groupnum < 0) {
X cur_groupnum = 0;
X index_point = -1;
X break;
X }
X n = my_group[cur_groupnum];
X }
X }
X }
X } while (index_point == -3);
X#endif
SHAR_EOF
echo "File select.c is complete" &&
$TOUCH -am 0923175591 select.c &&
chmod 0600 select.c ||
echo "restore of select.c failed"
set `wc -c select.c`;Wc_c=$1
if test "$Wc_c" != "19579"; then
echo original size 19579, current size $Wc_c
fi
# ============= signal.c ==============
echo "x - extracting signal.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > signal.c &&
X/*
X * Project : tin - a visual threaded usenet newsreader
X * Module : signal.c
X * Author : R.Skrenta / I.Lea
X * Created : 01-04-91
X * Updated : 10-09-91
X * Release : 1.0
X * Notes : signal handlers for different modes and window resizing
X * Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
X * You may freely copy or redistribute this software,
X * so long as there is no profit made from its use, sale
X * trade or reproduction. You may not change this copy-
X * right notice, and it must be included in any copy made
X */
X
X#include "tin.h"
X
Xextern char *glob_art_group;
Xextern char *glob_group;
Xextern int glob_respnum;
Xextern char *glob_page_group;
X
X#ifdef SIGTSTP
Xint do_sigtstp = 0;
X#endif
X
X#ifdef POSIX_JOB_CONTROL
Xstruct sigaction art_act;
Xstruct sigaction group_act;
Xstruct sigaction main_act;
Xstruct sigaction page_act;
Xstruct sigaction rcfile_act;
Xstruct sigaction select_act;
Xstruct sigaction old_act;
X#endif
X
X
Xvoid set_signal_handlers ()
X{
X signal (SIGINT, signal_handler); /* ctrl-C */
X signal (SIGQUIT, signal_handler); /* ctrl-\ */
X signal (SIGILL, signal_handler);
X signal (SIGBUS, signal_handler);
X signal (SIGSEGV, signal_handler);
X
X signal (SIGPIPE, SIG_IGN);
X
X#ifdef SIGTSTP
X {
X void (*ptr)();
X ptr = signal (SIGTSTP, SIG_DFL);
X signal (SIGTSTP, ptr);
X if (ptr != SIG_IGN) {
X /*
X * SIGTSTP is ignored when starting from shells
X * without job-control
X */
X do_sigtstp = 1;
X signal (SIGTSTP, main_suspend);
X }
X }
X#endif
X
X#ifdef SIGWINCH
X signal (SIGWINCH, main_resize);
X#endif
X}
X
X
Xvoid signal_handler (sig)
X int sig;
X{
X switch (sig) {
X case SIGINT:
X signal (SIGINT, signal_handler);
X break;
X default:
X Raw (FALSE);
X printf ("\n%s: signal handler caught signal %d\n", progname,sig);
X exit (1);
X }
X}
X
X
Xvoid set_win_size (num_lines, num_cols)
X int *num_lines;
X int *num_cols;
X{
X#ifdef TIOCGWINSZ
X char buf[64];
X int old_lines, old_cols;
X struct winsize win;
X
X if (debug) {
X old_lines = *num_lines;
X old_cols = *num_cols;
X }
X#endif
X
X init_screen_array (FALSE); /* deallocate screen array */
X
X#ifdef TIOCGWINSZ
X if (ioctl (0, TIOCGWINSZ, &win) == 0) {
X if (win.ws_row != 0) {
X *num_lines = win.ws_row - 1;
X }
X if (win.ws_col != 0) {
X *num_cols = win.ws_col;
X }
X }
X
X if (debug) {
X sprintf (buf, "RESIZED lines %d to %d cols %d to %d",
X old_lines, *num_lines, old_cols, *num_cols);
X info_message (buf);
X }
X#endif
X
X init_screen_array (TRUE); /* allocate screen array for resize */
X
X max_subj = (*num_cols / 2) - 2;
X max_from = (*num_cols - max_subj) - 17;
X RIGHT_POS = *num_cols - 18;
X MORE_POS = *num_cols - 15;
X NOTESLINES = *num_lines - INDEX_TOP - 1;
X if (NOTESLINES <= 0) {
X NOTESLINES = 1;
X }
X}
X
X
X#ifdef SIGTSTP
X
X/* ARGSUSED0 */
Xvoid art_suspend (sig)
X int sig;
X{
X char buf[LEN];
X
X Raw (FALSE);
X putchar ('\n');
X
X#ifdef POSIX_JOB_CONTROL
X sigsetmask(0);
X#else
X signal(SIGTSTP, SIG_DFL);
X#ifdef BSD
X sigsetmask (sigblock(0) & ~(1 << (SIGTSTP -1)));
X#endif
X#endif
X
X kill (0, SIGTSTP);
X
X#ifdef POSIX_JOB_CONTROL
X sigemptyset (&art_act.sa_mask);
X art_act.sa_flags = SA_RESTART | SA_RESETHAND;
X art_act.sa_handler = art_suspend;
X sigaction (SIGTSTP, &art_act, 0L);
X#else
X signal (SIGTSTP, art_suspend);
X#endif
X
X if (! update) {
X mail_setup ();
X
X Raw (TRUE);
X
X ClearScreen ();
X sprintf (buf, txt_group, glob_art_group);
X wait_message (buf);
X }
X}
X
X
X/* ARGSUSED0 */
Xvoid main_suspend (sig)
X int sig;
X{
X Raw (FALSE);
X putchar ('\n');
X
X#ifdef POSIX_JOB_CONTROL
X sigsetmask(0);
X#else
X signal(SIGTSTP, SIG_DFL);
X#ifdef BSD
X sigsetmask (sigblock(0) & ~(1 << (SIGTSTP -1)));
X#endif
X#endif
X
X kill (0, SIGTSTP);
X
X#ifdef POSIX_JOB_CONTROL
X sigemptyset (&main_act.sa_mask);
X main_act.sa_flags = SA_RESTART | SA_RESETHAND;
X main_act.sa_handler = main_suspend;
X sigaction (SIGTSTP, &main_act, 0L);
X#else
X signal (SIGTSTP, main_suspend);
X#endif
X
X mail_setup ();
X if (! update) {
X Raw (TRUE);
X }
X}
X
X
X/* ARGSUSED0 */
Xvoid select_suspend (sig)
X int sig;
X{
X
X Raw (FALSE);
X putchar ('\n');
X
X#ifdef POSIX_JOB_CONTROL
X sigsetmask(0);
X#else
X signal(SIGTSTP, SIG_DFL);
X#ifdef BSD
X sigsetmask (sigblock(0) & ~(1 << (SIGTSTP -1)));
X#endif
X#endif
X
X kill (0, SIGTSTP);
X
X#ifdef POSIX_JOB_CONTROL
X sigemptyset (&select_act.sa_mask);
X select_act.sa_flags = SA_RESTART | SA_RESETHAND;
X select_act.sa_handler = select_suspend;
X sigaction (SIGTSTP, &select_act, 0L);
X#else
X signal (SIGTSTP, select_suspend);
X#endif
X
X if (! update) {
X Raw (TRUE);
X }
X
X#ifndef USE_CLEARSCREEN
X ClearScreen ();
X#endif
X mail_setup ();
X group_selection_page ();
X}
X
X
X/* ARGSUSED0 */
Xvoid group_suspend (sig)
X int sig;
X{
X Raw (FALSE);
X putchar ('\n');
X
X#ifdef POSIX_JOB_CONTROL
X sigsetmask(0);
X#else
X signal(SIGTSTP, SIG_DFL);
X#ifdef BSD
X sigsetmask (sigblock(0) & ~(1 << (SIGTSTP -1)));
X#endif
X#endif
X
X kill (0, SIGTSTP);
X
X#ifdef POSIX_JOB_CONTROL
X sigemptyset (&group_act.sa_mask);
X group_act.sa_flags = SA_RESTART | SA_RESETHAND;
X group_act.sa_handler = group_suspend;
X sigaction (SIGTSTP, &group_act, 0L);
X#else
X signal (SIGTSTP, group_suspend);
X#endif
X
X if (! update) {
X Raw (TRUE);
X }
X
X#ifndef USE_CLEARSCREEN
X ClearScreen ();
X#endif
X mail_setup ();
X show_group_page (glob_group);
X}
X
X
X/* ARGSUSED0 */
Xvoid page_suspend (sig)
X int sig;
X{
X
X Raw (FALSE);
X putchar ('\n');
X
X#ifdef POSIX_JOB_CONTROL
X sigsetmask(0);
X#else
X signal(SIGTSTP, SIG_DFL);
X#ifdef BSD
X sigsetmask (sigblock(0) & ~(1 << (SIGTSTP -1)));
X#endif
X#endif
X
X kill (0, SIGTSTP);
X
X#ifdef POSIX_JOB_CONTROL
X sigemptyset (&page_act.sa_mask);
X page_act.sa_flags = SA_RESTART | SA_RESETHAND;
X page_act.sa_handler = page_suspend;
X sigaction (SIGTSTP, &page_act, 0L);
X#else
X signal (SIGTSTP, page_suspend);
X#endif
X
X mail_setup ();
X
X if (! update) {
X Raw (TRUE);
X }
X
X#ifndef USE_CLEARSCREEN
X ClearScreen ();
X#endif
X redraw_page (glob_respnum, glob_page_group);
X}
X
X
X/* ARGSUSED0 */
Xvoid rcfile_suspend (sig)
X int sig;
X{
X Raw (FALSE);
X putchar ('\n');
X
X#ifdef POSIX_JOB_CONTROL
X sigsetmask(0);
X#else
X signal(SIGTSTP, SIG_DFL);
X#ifdef BSD
X sigsetmask (sigblock(0) & ~(1 << (SIGTSTP -1)));
X#endif
X#endif
X
X kill (0, SIGTSTP);
X
X#ifdef POSIX_JOB_CONTROL
X sigemptyset (&rcfile_act.sa_mask);
X rcfile_act.sa_flags = SA_RESTART | SA_RESETHAND;
X rcfile_act.sa_handler = rcfile_suspend;
X sigaction (SIGTSTP, &rcfile_act, 0L);
X#else
X signal (SIGTSTP, rcfile_suspend);
X#endif
X
X Raw (TRUE);
X show_rcfile_menu ();
X}
X
X#endif /* SIGTSTP */
X
X
X#ifdef SIGWINCH
X
X/* ARGSUSED0 */
Xvoid art_resize (sig)
X int sig;
X{
X char buf[LEN];
X
X info_message (txt_resizing_window);
X set_win_size (&LINES, &COLS);
X signal (SIGWINCH, art_resize);
X
X ClearScreen ();
X sprintf (buf, txt_group, glob_art_group);
X wait_message (buf);
X}
X
X
X/* ARGSUSED0 */
Xvoid main_resize (sig)
X int sig;
X{
X info_message (txt_resizing_window);
X set_win_size (&LINES, &COLS);
X signal (SIGWINCH, main_resize);
X}
X
X
X/* ARGSUSED0 */
Xvoid select_resize (sig)
X int sig;
X{
X info_message (txt_resizing_window);
X set_win_size (&LINES, &COLS);
X signal (SIGWINCH, select_resize);
X
X#ifndef USE_CLEARSCREEN
X ClearScreen ();
X#endif
X group_selection_page ();
X}
X
X
X/* ARGSUSED0 */
Xvoid group_resize (sig)
X int sig;
X{
X info_message (txt_resizing_window);
X set_win_size (&LINES, &COLS);
X signal (SIGWINCH, group_resize);
X
X#ifndef USE_CLEARSCREEN
X ClearScreen ();
X#endif
X show_group_page (glob_group);
X}
X
X
X/* ARGSUSED0 */
Xvoid page_resize (sig)
X int sig;
X{
X info_message (txt_resizing_window);
X set_win_size (&LINES, &COLS);
X signal (SIGWINCH, page_resize);
X
X#ifndef USE_CLEARSCREEN
X ClearScreen ();
X#endif
X redraw_page (glob_respnum, glob_page_group);
X}
X
X#endif /* SIGWINCH */
X
SHAR_EOF
$TOUCH -am 0923175591 signal.c &&
chmod 0600 signal.c ||
echo "restore of signal.c failed"
set `wc -c signal.c`;Wc_c=$1
if test "$Wc_c" != "7569"; then
echo original size 7569, current size $Wc_c
fi
# ============= wildmat.c ==============
echo "x - extracting wildmat.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > wildmat.c &&
X/* $Revision: 1.5 $
X**
X** Do shell-style pattern matching for ?, \, [], and * characters.
X** Might not be robust in face of malformed patterns; e.g., "foo[a-"
X** could cause a segmentation violation. It is 8bit clean.
X**
X** Written by Rich $alz, mirror!rs, Wed Nov 26 19:03:17 EST 1986.
X** Rich $alz is now <rsalz@bbn.com>.
X** April, 1991: Replaced mutually-recursive calls with in-line code
X** for the star character.
X**
X** Special thanks to Lars Mathiesen <thorinn@diku.dk> for the ABORT code.
X** This can greatly speed up failing wildcard patterns. For example:
X** pattern: -*-*-*-*-*-*-12-*-*-*-m-*-*-*
X** text 1: -adobe-courier-bold-o-normal--12-120-75-75-m-70-iso8859-1
X** text 2: -adobe-courier-bold-o-normal--12-120-75-75-X-70-iso8859-1
X** Text 1 matches with 51 calls, while text 2 fails with 54 calls. Without
X** the ABORT, then it takes 22310 calls to fail. Ugh. The following
X** explanation is from Lars:
X** The precondition that must be fulfilled is that DoMatch will consume
X** at least one character in text. This is true if *p is neither '*' nor
X** '\0'.) The last return has ABORT instead of FALSE to avoid quadratic
X** behaviour in cases like pattern "*a*b*c*d" with text "abcxxxxx". With
X** FALSE, each star-loop has to run to the end of the text; with ABORT
X** only the last one does.
X**
X** Once the control of one instance of DoMatch enters the star-loop, that
X** instance will return either TRUE or ABORT, and any calling instance
X** will therefore return immediately after (without calling recursively
X** again). In effect, only one star-loop is ever active. It would be
X** possible to modify the code to maintain this context explicitly,
X** eliminating all recursive calls at the cost of some complication and
X** loss of clarity (and the ABORT stuff seems to be unclear enough by
X** itself). I think it would be unwise to try to get this into a
X** released version unless you have a good test data base to try it out
X** on.
X*/
X
X#define TRUE 1
X#define FALSE 0
X#define ABORT -1
X
X
X /* What character marks an inverted character class? */
X#define NEGATE_CLASS '^'
X /* Is "*" a common pattern? */
X#define OPTIMIZE_JUST_STAR
X /* Do tar(1) matching rules, which ignore a trailing slash? */
X#undef MATCH_TAR_PATTERN
X
X
X/*
X** Match text and p, return TRUE, FALSE, or ABORT.
X*/
Xstatic int
XDoMatch(text, p)
X register char *text;
X register char *p;
X{
X register int last;
X register int matched;
X register int reverse;
X
X for ( ; *p; text++, p++) {
X if (*text == '\0' && *p != '*')
X return ABORT;
X switch (*p) {
X case '\\':
X /* Literal match with following character. */
X p++;
X /* FALLTHROUGH */
X default:
X if (*text != *p)
X return FALSE;
X continue;
X case '?':
X /* Match anything. */
X continue;
X case '*':
X while (*++p == '*')
X /* Consecutive stars act just like one. */
X continue;
X if (*p == '\0')
X /* Trailing star matches everything. */
X return TRUE;
X while (*text)
X if ((matched = DoMatch(text++, p)) != FALSE)
X return matched;
X return ABORT;
X case '[':
X reverse = p[1] == NEGATE_CLASS ? TRUE : FALSE;
X if (reverse)
X /* Inverted character class. */
X p++;
X matched = FALSE;
X if (p[1] == ']' || p[1] == '-')
X if (*++p == *text)
X matched = TRUE;
X for (last = *p; *++p && *p != ']'; last = *p)
X /* This next line requires a good C compiler. */
X if (*p == '-' && p[1] != ']'
X ? *text <= *++p && *text >= last : *text == *p)
X matched = TRUE;
X if (matched == reverse)
X return FALSE;
X continue;
X }
X }
X
X#ifdef MATCH_TAR_PATTERN
X if (*text == '/')
X return TRUE;
X#endif /* MATCH_TAR_ATTERN */
X return *text == '\0';
X}
X
X
X/*
X** User-level routine. Returns TRUE or FALSE.
X*/
Xint
Xwildmat(text, p)
X char *text;
X char *p;
X{
X#ifdef OPTIMIZE_JUST_STAR
X if (p[0] == '*' && p[1] == '\0')
X return TRUE;
X#endif /* OPTIMIZE_JUST_STAR */
X return DoMatch(text, p) == TRUE;
X}
X
X
X
X#ifdef TEST
X#include <stdio.h>
X
X/* Yes, we use gets not fgets. Sue me. */
Xextern char *gets();
X
X
Xmain()
X{
X char p[80];
X char text[80];
X
X printf("Wildmat tester. Enter pattern, then strings to test.\n");
X printf("A blank line gets prompts for a new pattern; a blank pattern\n");
X printf("exits the program.\n");
X
X for ( ; ; ) {
X printf("\nEnter pattern: ");
X (void)fflush(stdout);
X if (gets(p) == NULL || p[0] == '\0')
X break;
X for ( ; ; ) {
X printf("Enter text: ");
X (void)fflush(stdout);
X if (gets(text) == NULL)
X exit(0);
X if (text[0] == '\0')
X /* Blank line; go back and get a new pattern. */
X break;
X printf(" %s\n", wildmat(text, p) ? "YES" : "NO");
X }
X }
X
X exit(0);
X /* NOTREACHED */
X}
X#endif /* TEST */
SHAR_EOF
$TOUCH -am 0923175591 wildmat.c &&
chmod 0600 wildmat.c ||
echo "restore of wildmat.c failed"
set `wc -c wildmat.c`;Wc_c=$1
if test "$Wc_c" != "4749"; then
echo original size 4749, current size $Wc_c
fi
# ============= tin.h ==============
echo "x - extracting tin.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > tin.h &&
X/*
X * Project : tin - a visual threaded usenet newsreader
X * Module : tin.h
X * Author : R.Skrenta / I.Lea
X * Created : 01-04-91
X * Updated : 24-09-91
X * Release : 1.0
X * Notes :
X * Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
X * You may freely copy or redistribute this software,
X * so long as there is no profit made from its use, sale
X * trade or reproduction. You may not change this copy-
X * right notice, and it must be included in any copy made
X */
X
X#include <stdio.h>
X#include <signal.h>
X#include <pwd.h>
X#include <sys/types.h>
X#include <memory.h>
X#include <ctype.h>
X#include <time.h>
X#include <sys/stat.h>
X
X#ifdef BSD
X#include <strings.h>
X#else
X#include <string.h>
X#include <malloc.h>
X#endif
X
X#ifdef SCO_UNIX
X#include <sys/streams.h>
X#include <sys/ptem.h>
X#endif
X
X#ifdef SIGWINCH
X#include <sys/ioctl.h>
X#ifdef AUTO_RESIZE
X#include <sys/ttold.h> /* needed for resizing under an xterm */
X#endif
X#endif
X
X#include "patchlevel.h"
X
X
X#define BUG_REPORT_ADDRESS "iain@estevax.uucp"
X
X#ifndef SPOOLDIR
X#define SPOOLDIR "/usr/spool/news"
X#endif
X#ifndef LIBDIR
X#define LIBDIR "/usr/lib/news"
X#endif
X#ifndef INEWSDIR
X#define INEWSDIR LIBDIR
X#endif
X
X#define RCDIR ".tin"
X#define RCFILE "tinrc"
X#define INDEXDIR ".index"
X#define KILLFILE "kill"
X#define POSTFILE "posted"
X
X#define DEFAULT_SHELL "/bin/sh"
X#define DEFAULT_MAILDIR "Mail"
X
X#ifdef BSD
X#define DEFAULT_EDITOR "/usr/ucb/vi"
X#define DEFAULT_MAILER "/bin/rmail"
X#define DEFAULT_MAILBOX "/usr/spool/mail"
X#define DEFAULT_PRINTER "/usr/ucb/lpr"
X#define DEFAULT_SUM "sum"
X#ifndef USE_LONG_FILENAMES
X#define USE_LONG_FILENAMES
X#endif
X#else
X#ifdef M_XENIX
X#define DEFAULT_EDITOR "/bin/vi"
X#define DEFAULT_MAILBOX "/usr/spool/mail"
X#else
X#define DEFAULT_EDITOR "/usr/bin/vi"
X#define DEFAULT_MAILBOX "/usr/mail"
X#endif
X#define DEFAULT_MAILER "/usr/bin/rmail"
X/*
X#define DEFAULT_MAILER "/usr/lib/sendmail -t"
X*/
X#define DEFAULT_PRINTER "/usr/bin/lp"
X#define DEFAULT_SUM "sum -r"
X#endif
X
X#define DEFAULT_ACTIVE_NUM 100 /* initial size of active array */
X#define DEFAULT_ARTICLE_NUM 400 /* initial size of art array */
X#define DEFAULT_KILL_NUM 10 /* initial size of kill array */
X#define DEFAULT_SAVE_NUM 10 /* initial size of save array */
X
X#define TRUE 1
X#define FALSE 0
X
X#define LEN 200
X
X#ifdef USE_LONG_FILENAMES
X#define LONG_PATH_PART "part"
X#define LONG_PATH_PATCH "patch"
X#else
X#define LONG_PATH_PART ""
X#define LONG_PATH_PATCH "p"
X#endif
X
X#define DEFAULT_COMMENT ": " /* used when by follow-ups & replys */
X
X/*
X * used by feed.c - feed_articles()
X */
X
X#define SELECT_LEVEL 1
X#define GROUP_LEVEL 2
X#define PAGE_LEVEL 3
X
X#define FEED_MAIL 1
X#define FEED_PIPE 2
X#define FEED_PRINT 3
X#define FEED_SAVE 4
X
X
X#ifdef USE_INVERSE_HACK
X#define BLANK_SELECT_COLS 59
X#define BLANK_GROUP_COLS 2
X#define BLANK_PAGE_COLS 2
X#else
X#define BLANK_SELECT_COLS 57
X#define BLANK_GROUP_COLS 0
X#define BLANK_PAGE_COLS 0
X#endif
X
X#define SCREEN_READ_UNREAD 6 /* position for " +" / " " */
X#define DEFAULT_COLS 132 /* used when updating indexes */
X#define INDEX_TOP 2
X
X#define SORT_BY_NOTHING 0 /* sort types on arts[] array */
X#define SORT_BY_SUBJ_DESCEND 1
X#define SORT_BY_SUBJ_ASCEND 2
X#define SORT_BY_FROM_DESCEND 3
X#define SORT_BY_FROM_ASCEND 4
X#define SORT_BY_DATE_DESCEND 5
X#define SORT_BY_DATE_ASCEND 6
X
X#define HELP_INFO 0
X#define POST_INFO 1
X
Xextern int sort_art_type;
X
Xextern int NOTESLINES;
Xextern int RIGHT_POS;
Xextern int MORE_POS;
X
Xextern int max_subj;
Xextern int max_from;
X
X#define TABLE_SIZE 1409
X#define MAX_PAGES 1000
X
X#ifdef BSD
X#define CR '\r'
X#else
X#define CR 10
X#endif
X
X/*
X * return codes for change_rcfile ()
X */
X
X#define NO_KILLING 0
X#define KILLING 1
X
X/*
X * art.thread
X */
X
X#define ART_NORMAL -1
X#define ART_EXPIRED -2
X
X/*
X * art.unread
X */
X
X#define ART_READ 0
X#define ART_UNREAD 1
X#define ART_WILL_RETURN 2
X
Xstruct header {
X long artnum;
X char *subject; /* Subject: line from mail header */
X char *from; /* From: line from mail header */
X int thread;
X int inthread;
X int unread; /* 0 = read, 1 = unread, 2 = will return */
X char date[16]; /* Date: line from mail header */
X char *archive; /* Archive-name: line from mail header */
X char *part; /* part no. of archive */
X char *patch; /* patch no. of archive */
X int tagged; /* 0 = not killed/tagged, 1 = killed/tagged */
X};
X
X/*
X * header.artnum:
X * article number in spool directory for group
X *
X * header.thread:
X * initially -1
X * points to another arts[] (struct header): zero and up
X * -2 means article has expired (wasn't found in file search
X * of spool directory for the group)
X *
X * header.inthread:
X * FALSE for the first article in a thread, TRUE for all
X * following articles in thread
X *
X * header.read:
X * boolean, has this article been read or not
X *
X * header.date
X * date: line used for sorting articles by date order
X *
X * header.archive:
X * archive name used in *source* groups
X *
X * header.part:
X * part no. of archive
X *
X * header.patch:
X * patch no. of archive
X *
X * header.tagged:
X * boolean, has this article been killed/tagged for saving or not
X */
X
Xstruct group_ent {
X char *name;
X long max;
X long min;
X int next; /* next active entry in hash chain */
X int flag;
X};
X
X#define NOTGOT 0x01 /* haven't put in my_group yet */
X#define SUBS 0x02 /* subscribed to */
X
X#define KILL_SUBJ 1
X#define KILL_FROM 2
X#define KILL_BOTH 3
X
Xstruct kill_t {
X int kill_type;
X long kill_group;
X char *kill_subj;
X char *kill_from;
X};
X
Xextern struct kill_t *killf;
Xextern int kill_num;
Xextern int max_kill;
X
X#define POST_PROC_NONE 0
X#define POST_PROC_SHAR 1
X#define POST_PROC_UUDECODE 2
X#define POST_PROC_UUD_LST_ZOO 3
X#define POST_PROC_UUD_EXT_ZOO 4
X#define POST_PROC_PATCH 5
X
Xstruct save_t {
X char *subject;
X char *dir;
X char *file;
X char *archive;
X char *part;
X char *patch;
X int index;
X int saved;
X int is_mailbox;
X};
X
Xextern struct save_t *save;
Xextern int save_num;
Xextern int max_save;
X
Xstruct screen_t {
X char *col;
X};
X
Xextern struct screen_t *screen;
X
Xstruct posted_t {
X char date[LEN];
X char group[LEN];
X char subj[LEN];
X};
X
Xextern struct posted_t *posted;
X
X#ifdef POSIX_JOB_CONTROL
Xextern struct sigaction art_act;
Xextern struct sigaction group_act;
Xextern struct sigaction main_act;
Xextern struct sigaction page_act;
Xextern struct sigaction select_act;
Xextern struct sigaction rcfile_act;
Xextern struct sigaction old_act;
X#endif
X
Xextern int debug;
Xextern int active_num;
Xextern int article_num;
Xextern int start_line_offset;
X
Xextern int read_news_via_nntp;
Xextern char nntp_server[LEN+1];
Xextern int top;
Xextern struct header *arts;
Xextern long *base;
Xextern int max_art;
X
Xextern int index_file_killed;
Xextern int save_separate;
Xextern int save_archive_name;
Xextern int show_author;
Xextern int draw_arrow_mark;
Xextern int kill_articles;
Xextern int mark_saved_read;
Xextern int post_proc_type;
Xextern int default_printer;
Xextern int print_header;
Xextern int pos_first_unread;
Xextern int num_of_tagged_files;
Xextern int compiled_with_nntp;
Xextern int save_news;
X
Xextern char rcdir[LEN+1];
Xextern char rcfile[LEN+1];
Xextern char indexdir[LEN+1];
Xextern char killfile[LEN+1];
Xextern char postfile[LEN+1];
X
Xextern char msg[LEN+1];
Xextern char userid[LEN+1];
Xextern char homedir[LEN+1];
Xextern char add_addr[LEN+1];
Xextern char bug_addr[LEN+1];
Xextern char txt_help_bug_report[LEN+1];
Xextern char reply_to[LEN+1];
Xextern char my_org[LEN+1];
Xextern char active_file[LEN+1];
Xextern char newsrc[LEN+1];
Xextern char newnewsrc[LEN+1];
Xextern char delgroups[LEN+1];
X
Xextern char *version;
Xextern char cvers[LEN+1];
Xextern char progname[LEN+1];
Xextern char article[LEN+1];
Xextern char dead_article[LEN+1];
Xextern char mailer[LEN+1];
Xextern char printer[LEN+1];
Xextern char spooldir[LEN+1];
Xextern char savedir[LEN+1];
Xextern char maildir[LEN+1];
Xextern char mailbox[LEN+1];
Xextern char page_header[LEN+1];
Xextern char signature[LEN+1];
Xextern char sig[LEN+1];
Xextern char killsubj[LEN+1];
Xextern char killfrom[LEN+1];
Xextern char author_search_string[LEN+1];
Xextern char group_search_string[LEN+1];
Xextern char subject_search_string[LEN+1];
Xextern char art_search_string[LEN+1];
Xextern char default_mail_address[LEN];
Xextern char default_pipe_command[LEN];
Xextern char default_regex_pattern[LEN];
Xextern char default_save_file[LEN];
Xextern char proc_ch_default; /* set in change_rcfile () */
X
Xextern char *help_select[];
Xextern char *help_group[];
Xextern char *help_page[];
X
Xextern int top_base;
Xextern int LINES, COLS;
Xextern int group_hash[TABLE_SIZE];
Xextern int num_active;
Xextern struct group_ent *active;
Xextern int *my_group;
Xextern int *unread;
Xextern int max_active;
X
Xextern int local_top;
Xextern int catchup;
Xextern int update;
Xextern int verbose;
Xextern int inverse_okay;
X
Xextern int tin_uid;
Xextern int tin_gid;
Xextern int real_uid;
Xextern int real_gid;
Xextern int local_index;
X
X#ifdef SIGTSTP
Xextern int do_sigtstp;
X#endif
X
X#define ctrl(c) ((c) & 0x1F)
X
X/*
X * Assertion verifier
X */
X
X#ifdef __STDC__
X#define assert(p) if(! (p)) asfail(__FILE__, __LINE__, #p); else
X#else
X#define assert(p) if(! (p)) asfail(__FILE__, __LINE__, "p"); else
X#endif
X
X/*
X * function prototypes & language definitions
X */
X
X#include "proto.h"
X#include "lang.h"
SHAR_EOF
$TOUCH -am 0924140291 tin.h &&
chmod 0600 tin.h ||
echo "restore of tin.h failed"
set `wc -c tin.h`;Wc_c=$1
if test "$Wc_c" != "9348"; then
echo original size 9348, current size $Wc_c
fi
# ============= lang.h ==============
echo "x - extracting lang.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > lang.h &&
X/*
X * Project : tin - a visual threaded usenet newsreader
X * Module : lang.h
X * Author : I.Lea
X * Created : 01-04-91
X * Updated : 24-09-91
X * Release : 1.0
X * Notes :
X * Copyright : (c) Copyright 1991 by Iain Lea
X * You may freely copy or redistribute this software,
X * so long as there is no profit made from its use, sale
X * trade or reproduction. You may not change this copy-
X * right notice, and it must be included in any copy made
X */
X
X/*
X * art.c
X */
X
Xextern char txt_group[];
Xextern char txt_cannot_open_art[];
Xextern char txt_indexing[];
Xextern char txt_corrupt_index[];
X
X/*
X * feed.c
X */
X
Xextern char txt_art_thread_regex_tag[];
Xextern char txt_post_procees_type[];
Xextern char txt_feed_pattern[];
Xextern char txt_no_command[];
X
X/*
X * group.c
X */
X
Xextern char txt_tagged_art[];
Xextern char txt_untagged_art[];
Xextern char txt_inverse_on[];
Xextern char txt_inverse_off[];
Xextern char txt_subscribed_to[];
Xextern char txt_unsubscribed_to[];
Xextern char txt_mark_all_read[];
Xextern char txt_marked_as_read[];
Xextern char txt_no_more_groups[];
Xextern char txt_no_prev_group[];
Xextern char txt_no_arts[];
Xextern char txt_no_groups[];
Xextern char txt_end_of_arts[];
Xextern char txt_end_of_groups[];
Xextern char txt_no_next_unread_art[];
Xextern char txt_no_prev_unread_art[];
Xextern char txt_no_last_message[];
Xextern char txt_bad_command[];
Xextern char txt_you_have_mail[];
Xextern char txt_type_h_for_help[];
Xextern char txt_read_art[];
Xextern char txt_author_search_forwards[];
Xextern char txt_author_search_backwards[];
Xextern char txt_search_forwards[];
Xextern char txt_search_backwards[];
Xextern char txt_no_search_string[];
Xextern char txt_no_match[];
Xextern char txt_post_subject[];
Xextern char txt_no_subject[];
Xextern char txt_cannot_open[];
Xextern char txt_posting[];
Xextern char txt_art_posted[];
Xextern char txt_art_rejected[];
Xextern char txt_abort_edit_post[];
Xextern char txt_index_page_com[];
Xextern char txt_help_i_4[];
Xextern char txt_help_ctrl_k[];
Xextern char txt_help_ctrl_l[];
Xextern char txt_help_ctrl_d[];
Xextern char txt_help_i_cr[];
Xextern char txt_help_i_tab[];
Xextern char txt_help_m[];
Xextern char txt_help_M[];
Xextern char txt_help_a[];
Xextern char txt_help_sel_c[];
Xextern char txt_help_c[];
Xextern char txt_help_g[];
Xextern char txt_help_I[];
Xextern char txt_help_K[];
Xextern char txt_help_j[];
Xextern char txt_help_i_n[];
Xextern char txt_help_i_p[];
Xextern char txt_help_q[];
Xextern char txt_help_s[];
Xextern char txt_help_S[];
Xextern char txt_help_t[];
Xextern char txt_help_T[];
Xextern char txt_help_U[];
Xextern char txt_help_v[];
Xextern char txt_help_i_u[];
Xextern char txt_help_w[];
Xextern char txt_help_i_search[];
Xextern char txt_help_thread[];
Xextern char txt_help_dash[];
Xextern char txt_save_pattern[];
Xextern char txt_base_subdir[];
Xextern char txt_saved_pattern_to[];
Xextern char txt_saved_to_mailbox[];
Xextern char txt_switch_on_kill_art_menu[];
X
X/*
X * help.c:
X */
X
Xextern char txt_post_history_menu[];
Xextern char txt_hit_space_for_more[];
X
X/*
X * kill.c:
X */
X
Xextern char txt_kill_menu[];
Xextern char txt_kill_subject[];
Xextern char txt_kill_from[];
Xextern char txt_kill_text[];
Xextern char txt_kill_text_type[];
Xextern char txt_kill_group[];
Xextern char txt_help_kill_subject[];
Xextern char txt_help_kill_from[];
Xextern char txt_help_kill_text[];
Xextern char txt_help_kill_text_type[];
Xextern char txt_help_kill_group[];
Xextern char txt_abort_edit_save_killfile[];
X
X/*
X * page.c
X */
X
Xextern char txt_quit[];
Xextern char txt_art_unavailable[];
Xextern char txt_art_marked_as_unread[];
Xextern char txt_thread_marked_as_unread[];
Xextern char txt_begin_of_art[];
Xextern char txt_next_resp[];
Xextern char txt_last_resp[];
Xextern char txt_more_percent[];
Xextern char txt_more[];
Xextern char txt_thread_x_of_n[];
Xextern char txt_art[];
Xextern char txt_resp_x_of_n[];
Xextern char txt_no_resp[];
Xextern char txt_1_resp[];
Xextern char txt_x_resp[];
Xextern char txt_s_at_s[];
Xextern char txt_thread_resp_page[];
Xextern char txt_thread_page[];
Xextern char txt_read_resp[];
Xextern char txt_art_pager_com[];
Xextern char txt_help_p_0[];
Xextern char txt_help_p_4[];
Xextern char txt_help_p_cr[];
Xextern char txt_help_p_tab[];
Xextern char txt_help_b[];
Xextern char txt_help_C[];
Xextern char txt_help_bug[];
Xextern char txt_help_p_f[];
Xextern char txt_help_ctrl_h[];
Xextern char txt_help_h[];
Xextern char txt_help_p_i[];
Xextern char txt_help_p_k[];
Xextern char txt_help_p_m[];
Xextern char txt_help_p_n[];
Xextern char txt_help_o[];
Xextern char txt_help_p_p[];
Xextern char txt_help_p_r[];
Xextern char txt_help_p_s[];
Xextern char txt_help_p_z[];
Xextern char txt_help_p_ctrl_r[];
Xextern char txt_help_p_g[];
Xextern char txt_help_p_d[];
Xextern char txt_help_pipe[];
Xextern char txt_help_p_search[];
Xextern char txt_mail_art_to[];
Xextern char txt_no_mail_address[];
Xextern char txt_abort_edit_send[];
Xextern char txt_abort_edit_cancel[];
Xextern char txt_cancelling[];
Xextern char txt_art_cancelled[];
Xextern char txt_mailing_to[];
Xextern char txt_message_sent[];
Xextern char txt_command_failed_s[];
Xextern char txt_in_art_you_write[];
Xextern char txt_resp_to_poster[];
Xextern char txt_resp_redirect[];
Xextern char txt_continue[];
Xextern char txt_writes[];
Xextern char txt_save_filename[];
Xextern char txt_art_not_saved[];
Xextern char txt_no_filename[];
Xextern char txt_saving[];
Xextern char txt_art_saved_to[];
Xextern char txt_thread_not_saved[];
Xextern char txt_thread_saved_to_many[];
Xextern char txt_thread_saved_to[];
Xextern char txt_pipe_to_command[];
Xextern char txt_command_failed[];
Xextern char txt_error_printing_art[];
Xextern char txt_printing[];
Xextern char txt_printed[];
Xextern char txt_append_to_file[];
X
X/*
X * prompt.c
X */
X
Xextern char txt_hit_any_key[];
X
X/*
X * main.c:
X */
X
Xextern char txt_not_in_active_file[];
Xextern char txt_screen_init_failed[];
Xextern char txt_bad_active_file[];
X
X/*
X * misc.c
X */
X
Xextern char txt_cannot_find_base_art[];
Xextern char txt_out_of_memory[];
Xextern char txt_rename_error[];
Xextern char txt_shell_escape[];
X
X/*
X * nntp.c
X */
X
Xextern char txt_cannot_get_nntp_server_name[];
Xextern char txt_server_name_in_file_env_var[];
Xextern char txt_failed_to_connect_to_server[];
Xextern char txt_rejected_by_nntpserver[];
Xextern char txt_connection_to_server_broken[];
Xextern char txt_stuff_nntp_cannot_open[];
Xextern char txt_nntp_to_fp_cannot_reopen[];
Xextern char txt_nntp_to_fd_cannot_reopen[];
Xextern char txt_toggled_rot13[];
X
X/*
X * post.c
X */
X
Xextern char txt_no_arts_posted[];
X
X/*
X * rcfile.c
X */
X
Xextern char txt_opt_autosave[];
Xextern char txt_opt_save_separate[];
Xextern char txt_opt_mark_saved_read[];
Xextern char txt_opt_kill_articles[];
Xextern char txt_opt_show_author[];
Xextern char txt_opt_draw_arrow[];
Xextern char txt_opt_post_process[];
Xextern char txt_opt_print_header[];
Xextern char txt_opt_pos_first_unread[];
Xextern char txt_opt_process_type[];
Xextern char txt_opt_sort_type[];
Xextern char txt_post_process_none[];
Xextern char txt_post_process_sh[];
Xextern char txt_post_process_uudecode[];
Xextern char txt_post_process_uud_lst_zoo[];
Xextern char txt_post_process_uud_ext_zoo[];
Xextern char txt_post_process_patch[];
Xextern char txt_sort_by_nothing[];
Xextern char txt_sort_by_subj_descend[];
Xextern char txt_sort_by_subj_ascend[];
Xextern char txt_sort_by_from_descend[];
Xextern char txt_sort_by_from_ascend[];
Xextern char txt_sort_by_date_descend[];
Xextern char txt_sort_by_date_ascend[];
Xextern char txt_opt_savedir[];
Xextern char txt_opt_maildir[];
Xextern char txt_opt_printer[];
Xextern char txt_opt_kill_subj[];
Xextern char txt_opt_kill_from[];
Xextern char txt_options_menu[];
Xextern char txt_help_autosave[];
Xextern char txt_help_save_separate[];
Xextern char txt_help_print_header[];
Xextern char txt_help_pos_first_unread[];
Xextern char txt_help_show_author[];
Xextern char txt_help_draw_arrow[];
Xextern char txt_help_kill_articles[];
Xextern char txt_help_post_process[];
Xextern char txt_help_mark_saved_read[];
Xextern char txt_help_post_proc_type[];
Xextern char txt_help_sort_type[];
Xextern char txt_help_savedir[];
Xextern char txt_help_maildir[];
Xextern char txt_help_printer[];
Xextern char txt_select_rcfile_option[];
Xextern char txt_save_options[];
X
X/*
X * save.c
X */
X
Xextern char txt_post_processing[];
Xextern char txt_post_processing_finished[];
Xextern char txt_deleting[];
X
X/*
X * search.c
X */
X
Xextern char txt_searching[];
X
X/*
X * select.c
X */
X
Xextern char txt_moving[];
Xextern char txt_subscribe_pattern[];
Xextern char txt_unsubscribe_pattern[];
Xextern char txt_subscribing[];
Xextern char txt_subscribing_to[];
Xextern char txt_unsubscribing[];
Xextern char txt_unsubscribing_from[];
Xextern char txt_subscribed_num_groups[];
Xextern char txt_unsubscribed_num_groups[];
Xextern char txt_del_group_in_newsrc[];
Xextern char txt_group_deleted[];
Xextern char txt_group_undeleted[];
Xextern char txt_mark_group_read[];
Xextern char txt_no_groups_to_delete[];
Xextern char txt_reset_newsrc[];
Xextern char txt_no_groups_to_read[];
Xextern char txt_added_groups[];
Xextern char txt_rewriting_newsrc_file[];
Xextern char txt_plural[];
Xextern char txt_no_groups_to_yank_in[];
Xextern char txt_group_selection[];
Xextern char txt_select_group[];
Xextern char txt_group_select_com[];
Xextern char txt_help_g_4[];
Xextern char txt_help_g_ctrl_r[];
Xextern char txt_help_g_ctrl_k[];
Xextern char txt_help_g_cr[];
Xextern char txt_help_g_tab[];
Xextern char txt_help_g_c[];
Xextern char txt_help_W[];
Xextern char txt_help_g_y[];
Xextern char txt_help_g_z[];
Xextern char txt_help_g_dollar[];
Xextern char txt_help_g_search[];
Xextern char txt_newsgroup[];
Xextern char txt_newsgroup_position[];
X
X/*
X * signal.c
X */
X
Xextern char txt_resizing_window[];
SHAR_EOF
$TOUCH -am 0924083791 lang.h &&
chmod 0600 lang.h ||
echo "restore of lang.h failed"
set `wc -c lang.h`;Wc_c=$1
if test "$Wc_c" != "9707"; then
echo original size 9707, current size $Wc_c
fi
# ============= nntp.h ==============
echo "x - extracting nntp.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > nntp.h &&
X/*
X * Project : tin - a visual threaded usenet newsreader
X * Module : nntp.h
X * Author : R.Skrenta
X * Created : 01-04-91
X * Updated : 10-08-91
X * Release : 1.0
X * Notes : Changed a bit so nntp knows about Tass
X * This file is originally from the nntp 1.5 source.
X * Copyright : (c) Copyright 1991 by Rich Skrenta
X * You may freely copy or redistribute this software,
X * so long as there is no profit made from its use, sale
X * trade or reproduction. You may not change this copy-
X * right notice, and it must be included in any copy made
X */
X
X#define NNTP_SERVER_FILE "/etc/nntpserver"
X
X/*
X * External routine declarations
X */
X
Xextern char *getserverbyfile();
Xextern int server_init();
Xextern int get_tcp_socket();
Xextern int handle_server_response();
Xextern void put_server();
Xextern int get_server();
Xextern void close_server();
X
X/*
X * External file descriptors for the server connection
X */
X
Xextern FILE *ser_wr_fp;
Xextern FILE *ser_wr_fp;
X
X
X/*
X * Response codes for NNTP server
X *
X * @(#)nntp.h 1.7 (Berkeley) 1/11/88
X *
X * First digit:
X *
X * 1xx Informative message
X * 2xx Command ok
X * 3xx Command ok so far, continue
X * 4xx Command was correct, but couldn't be performed
X * for some specified reason.
X * 5xx Command unimplemented, incorrect, or a
X * program error has occured.
X *
X * Second digit:
X *
X * x0x Connection, setup, miscellaneous
X * x1x Newsgroup selection
X * x2x Article selection
X * x3x Distribution
X * x4x Posting
X */
X
X#define CHAR_INF '1'
X#define CHAR_OK '2'
X#define CHAR_CONT '3'
X#define CHAR_ERR '4'
X#define CHAR_FATAL '5'
X
X#define INF_HELP 100 /* Help text on way */
X#define INF_DEBUG 199 /* Debug output */
X
X#define OK_CANPOST 200 /* Hello; you can post */
X#define OK_NOPOST 201 /* Hello; you can't post */
X#define OK_SLAVE 202 /* Slave status noted */
X#define OK_GOODBYE 205 /* Closing connection */
X#define OK_GROUP 211 /* Group selected */
X#define OK_GROUPS 215 /* Newsgroups follow */
X
X#define OK_TASSINDEX 218 /* Tass index follows */
X
X#define OK_ARTICLE 220 /* Article (head & body) follows */
X#define OK_HEAD 221 /* Head follows */
X#define OK_BODY 222 /* Body follows */
X#define OK_NOTEXT 223 /* No text sent -- stat, next, last */
X#define OK_NEWNEWS 230 /* New articles by message-id follow */
X#define OK_NEWGROUPS 231 /* New newsgroups follow */
X#define OK_XFERED 235 /* Article transferred successfully */
X#define OK_POSTED 240 /* Article posted successfully */
X
X#define CONT_XFER 335 /* Continue to send article */
X#define CONT_POST 340 /* Continue to post article */
X
X#define ERR_GOODBYE 400 /* Have to hang up for some reason */
X#define ERR_NOGROUP 411 /* No such newsgroup */
X#define ERR_NCING 412 /* Not currently in newsgroup */
X
X#define ERR_NOTASS 418 /* No tin index for this group */
X
X#define ERR_NOCRNT 420 /* No current article selected */
X#define ERR_NONEXT 421 /* No next article in this group */
X#define ERR_NOPREV 422 /* No previous article in this group */
X#define ERR_NOARTIG 423 /* No such article in this group */
X#define ERR_NOART 430 /* No such article at all */
X#define ERR_GOTIT 435 /* Already got that article, don't send */
X#define ERR_XFERFAIL 436 /* Transfer failed */
X#define ERR_XFERRJCT 437 /* Article rejected, don't resend */
X#define ERR_NOPOST 440 /* Posting not allowed */
X#define ERR_POSTFAIL 441 /* Posting failed */
X
X#define ERR_COMMAND 500 /* Command not recognized */
X#define ERR_CMDSYN 501 /* Command syntax error */
X#define ERR_ACCESS 502 /* Access to server denied */
X#define ERR_FAULT 503 /* Program fault, command not performed */
X
X/* RFC 977 defines this; don't change it. */
X
X#define NNTP_STRLEN 512
SHAR_EOF
$TOUCH -am 0923175591 nntp.h &&
chmod 0600 nntp.h ||
echo "restore of nntp.h failed"
set `wc -c nntp.h`;Wc_c=$1
if test "$Wc_c" != "3688"; then
echo original size 3688, current size $Wc_c
fi
# ============= proto.h ==============
echo "x - extracting proto.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > proto.h &&
X#ifdef __STDC__
X
X/* art.c */
Xlong my_atol(char *s, int n);
Xvoid find_base(void);
Xint num_of_arts(void);
Xint valid_artnum(long art);
Xint purge_needed(void);
Xvoid index_group(char *group, char *group_path);
Xint read_group(char *group, char *group_path);
Xvoid make_threads(int rethread);
Xchar *eat_re(char *s);
Xlong hash_s(char *s);
Xint parse_headers(int fd, struct header *h);
Xvoid dump_index(char *group, int killed);
Xvoid my_strncpy(char *p, char *q, int n);
Xint load_index(void);
Xvoid find_local_index(char *group);
Xvoid do_update(void);
Xvoid save_any_news(void);
Xvoid reload_index_file(char *group, int killed);
Xchar *parse_date(char *date, char *str);
Xint artnum_comp(char *p1, char *p2);
SHAR_EOF
echo "End of tin1.02 part 8"
echo "File proto.h is continued in part 9"
echo "9" > shar3_seq_.tmp
exit 0
exit 0 # Just in case...
--
Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM
Sterling Software, IMD UUCP: uunet!sparky!kent
Phone: (402) 291-8300 FAX: (402) 291-4362
Please send comp.sources.misc-related mail to kent@uunet.uu.net.