[comp.sources.amiga] v91i021: VN res1.1 - vn news reader, Part01/06

amiga-request@ab20.larc.nasa.gov (Amiga Sources/Binaries Moderator) (02/27/91)

Submitted-by: eyal@echo.canberra.edu.au (Eyal Lebedinsky)
Posting-number: Volume 91, Issue 021
Archive-name: news/vn-res1.1/part01

vn is a newsreader, similar to rn, vnews or nn. It requires less memory
than Arn 0.67 (Arn failed to run on my 1 meg amiga due to lack of
memory) and comes with full source (executable was created with DICE
V2.02). All that is required to run it is access to usenet messages (on
a floppy from a friend is how I get usenet!).

vn presents you with a list of articles and allows you to select which ones 
to read based on the subject and from lines. This allows you to quickly
pass over news threads that are not of interest to you. Of course nn does 
this and also organised the news in threads whereas vn presents the news
in chronological order (this means that sometimes the original message
appears after a reply - due to the order/direction the news filters through
to your site). This is a vast improvement over the way rn and vnews allow you
to read news. (NOTE: I do not know how Arn works as I could not run it on my
1meg A500).

updact : reads the NEWS:active file and updates it with the latest news
	article number. (attempts to find the last article by continuing
	from the number in the active file and scanning ahead a file at a
	time for a 1000 files, if none are found then it leaves the number
	alone).

gettoc: prints the subject lines to stdout. takes as input the file
	names of news articles.

umbox and rnumbox: the rn and nn newsreaders will package news articles
	into a mailbox format. these can then be archived. these programs
	extract the articles into the correct directories.

getren: renames the article to the Vnn??? form as with comp.sources etc

Michael Taylor 
Canberra

#!/bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 1 (of 6)."
# Contents:  active ansi.h brk.h config_s.h dfiles envir_se.c getch.c
#   getenv.c getren.c gettoc.c hash.c head.h lib.h mktemp.c msdos.c
#   msdos.h newdisp.c node.h page.h printex.c pwd.h rand.c reader.h
#   reg.c regcompa.c regexp.h server.h stat.h stat2.c std.h storage.c
#   strings.c strtok.c termcap termcap.h tmpnam.c tty.h tty_set.c
#   tune.h updact.c userlist.c vn.h vnglob.c
# Wrapped by tadguy@ab20 on Tue Feb 26 19:28:41 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'active' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'active'\"
else
echo shar: Extracting \"'active'\" \(174 characters\)
sed "s/^X//" >'active' <<'END_OF_FILE'
Xcomp.sources.amiga 350
Xcomp.binaries.amiga 420
Xcomp.sys.amiga.tech 12887
Xcomp.sys.amiga.games 2181
Xcomp.sys.amiga.hardware 4442
Xaus.computers.amiga 1330
Xcomp.sys.amiga 31578
END_OF_FILE
if test 174 -ne `wc -c <'active'`; then
    echo shar: \"'active'\" unpacked with wrong size!
fi
# end of 'active'
fi
if test -f 'ansi.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ansi.h'\"
else
echo shar: Extracting \"'ansi.h'\" \(40 characters\)
sed "s/^X//" >'ansi.h' <<'END_OF_FILE'
X#define _PROTOTYPE(pgm,parms)	pgm parms
END_OF_FILE
if test 40 -ne `wc -c <'ansi.h'`; then
    echo shar: \"'ansi.h'\" unpacked with wrong size!
fi
# end of 'ansi.h'
fi
if test -f 'brk.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'brk.h'\"
else
echo shar: Extracting \"'brk.h'\" \(810 characters\)
sed "s/^X//" >'brk.h' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** brk.h - codes for sig_set routine
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X
X/*
X	state flags for handling breaks / values for sig_set calls.
X	BRK_IN, BRK_SESS, BRK_READ and BRK_OUT are the states.  All
X	but BRK_INIT are used as calls to sig_set.  BRK_RFIN indicates
X	a return from BRK_READ to BRK_SESS (no jump location passed),
X*/
X#define BRK_INIT 0		/* initial value, indicating uncaught signals */
X#define BRK_IN 1		/* in NEWSRC / article scanning phase */
X#define BRK_SESS 2		/* in page interactive session */
X#define BRK_READ 3		/* reading articles */
X#define BRK_RFIN 4		/* finished reading, return to old mode */
X#define BRK_OUT 5		/* NEWSRC updating phase */
X
X#define BRK_PR "really quit ? "
X
X#ifdef amiga
X#undef putchar
X#define putchar ttputc
X#endif
X
END_OF_FILE
if test 810 -ne `wc -c <'brk.h'`; then
    echo shar: \"'brk.h'\" unpacked with wrong size!
fi
# end of 'brk.h'
fi
if test -f 'config_s.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'config_s.h'\"
else
echo shar: Extracting \"'config_s.h'\" \(2898 characters\)
sed "s/^X//" >'config_s.h' <<'END_OF_FILE'
X/*
X** default news poster
X*/
X#define DEF_POST "/usr/lib/news/inews -h"
X
X/*
X** default user .newsrc file
X*/
X#ifdef	MSDOS
X#define DEF_NEWSRC "_newsrc"
X#else
X#define DEF_NEWSRC ".newsrc"
X#endif
X
X/*
X** If INLETTER is defined, the address line will be placed into the
X** file editted by the user, and the mailer is assumed smart enough
X** to understand about header lines in the file.  Otherwise the
X** address is part of the mailer's command line.
X**
X** if MAILSMART is defined, The From: line will be used for mail replies,
X** or overridden by a "Reply-to:" line if present - "Path:" will be used
X** as a last resort.  If MAILSMART is not defined, "Path:" will simply be
X** used.
X**
X** if MAILCHOOSE is defined, the user is prompted before edit with all
X** of the address lines to choose from, or to input a new one.  MAILCHOOSE
X** makes MAILSMART irrelevant, but the two are independent of INLETTER.
X**
X*/
X#define MAILSMART
X#define INLETTER
X
X/*
X** default mail sender.  If INLETTER, will be done as
X** cat <file> | DEF_MAIL,  Otherwise, cat <file> | DEF_MAIL <address>
X** user's MAILER variable will have to conform, too.
X*/
X#ifdef INLETTER
X#define DEF_MAIL "/usr/lib/sendmail -t"
X#else
X#define DEF_MAIL "/bin/mail"
X#endif
X
X/* OLDRC defined for an apparently earlier news version which took unnamed
X** command line options as synonyms for -n, and did not take ranges in
X** the .newsrc file.  Probably useless, but kept in for historical reasons.
X**
X**#define OLDRC
X*/
X
X/*
X** article spool directory
X*/
X#define SPOOLDIR "news:"
X
X/*
X** active file
X*/
X#define ACTFILE "news:active"
X
X/*
X** maximum number of option lines in .newsrc
X*/
X#define OPTLINES 20
X
X/*
X** maximum number of filter options
X*/
X#define NUMFILTER 30
X
X/*
X** maximum number of file lines to search looking for header lines.
X*/
X#define HDR_LINES 36
X
X/*
X** When a newsgroup is scanned, we ignore articles less than <high spool> -
X** MAXARTRANGE.  This is intended to prevent ridiculous numbers of article
X** opening attempts the first time a user reads a new newsgroup which has a
X** huge difference between the high and low spool numbers, perhaps due to
X** some articles not getting expired.
X*/
X#define MAXARTRANGE 1600	/* about 2 weeks of soc.singles */
X
X/*
X** If we detect that the user has a higher number in .newsrc than the
X** high article number, obviously the active file is out of synch with the
X** .newsrc.  We set the user's number back to the low article number in
X** this case, on the theory that it's better to repeat stuff than miss
X** articles.  On such setbacks, we won't backdate the user by more than
X** SYN_SETBACK articles, preventing floods of articles on large newsgroups
X** if you don't define SYN_CHECK, the user's number won't be adjusted in
X** this case, choosing to lose articles rather than show old ones.
X*/
X#define SYN_CHECK
X#define SYN_SETBACK 60
X
X#ifdef amiga
X#undef putchar
X#define putchar ttputc
X#endif
X
END_OF_FILE
if test 2898 -ne `wc -c <'config_s.h'`; then
    echo shar: \"'config_s.h'\" unpacked with wrong size!
fi
# end of 'config_s.h'
fi
if test -f 'dfiles' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'dfiles'\"
else
echo shar: Extracting \"'dfiles'\" \(328 characters\)
sed "s/^X//" >'dfiles' <<'END_OF_FILE'
Xdlib:c.o
Xamiga.o
Xdigest.o
Xenvir_set.o
Xgetch.o
Xhash.o
Xhelp.o
Xnewdisp.o
Xpagefile.o
Xprintex.o
Xreader.o
Xreg.o
Xregcompat.o
Xregexp.o
Xsession.o
Xsig_set.o
Xstat.o
Xstd.o
Xstorage.o
Xstrings.o
Xsvart.o
Xtermcap.o
Xterm_set.o
Xtty_set.o
Xuserlist.o 
Xvn.o
Xvnglob.o
Xstat2.o
Xgetenv.o
Xrand.o
Xmktemp.o
Xdlib:c.lib dlib:amiga.lib dlib:auto.lib
Xdlib:x.o
X
END_OF_FILE
if test 328 -ne `wc -c <'dfiles'`; then
    echo shar: \"'dfiles'\" unpacked with wrong size!
fi
# end of 'dfiles'
fi
if test -f 'envir_se.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'envir_se.c'\"
else
echo shar: Extracting \"'envir_se.c'\" \(3204 characters\)
sed "s/^X//" >'envir_se.c' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** envir_set.c - routine to obtain pertinent environment variable settings
X**		and set up file / directory names
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X
X#include <stdio.h>
X#include <pwd.h>
X
X#ifndef MINIX
X#ifndef MSDOS
X#ifndef amiga
X/* minix does not have this */
X#include <sys/param.h>
X#endif
X#endif
X#endif
X
X#include "tune.h"
X#include "config.h"
X#include "vn.h"
X
Xextern char *Editor, *Ps1, *Printer;
Xextern char *Orgdir, *Savedir, *Ccfile;	/* path names */
Xextern char Cxitop[], Cxitor[], Cxrtoi[], Cxptoi[];
Xextern char *Home;
Xextern int More;
X
X#ifdef SYSV
Xextern char *getcwd();
X#define getwd(a) getcwd(a,sizeof(a))
X#define	MAXPATHLEN 240
X#else
Xextern char *getwd();
X#endif
X
Xstatic set_kxln ();
Xstatic char xln_str ();
X
X/*
X	environment variable, original directory string setup.
X*/
X
Xenvir_set ()
X{
X	char dbuf [MAXPATHLEN], *ccname, *keyxln;
X	char *vn_env(), *getcwd(), *str_store();
X	struct passwd *ptr, *getpwuid();
X
X	vns_envir();
X	More = 0;
X
X	Ps1 = vn_env("PS1",DEF_PS1);
X	Editor = vn_env("EDITOR",DEF_ED);
X	Printer = vn_env("PRINTER",DEF_PRINT);
X	ccname = vn_env("CCFILE",DEF_CCFILE);
X	keyxln = vn_env("VNKEY",DEF_KEYXLN);
X	Savedir = vn_env("VNSAVE",NULL);
X	More = (strcmp(vn_env("MORE",""), "-c") == 0 ? TRUE : FALSE);
X
X	/*
X		set original directory strings.
X	*/
X
X	if ((ptr = getpwuid(getuid())) == NULL)
X		printex("Cannot obtain /etc/passwd entry");
X	Home = str_store(ptr->pw_dir);
X	if ((Orgdir = getwd(dbuf)) == NULL)
X		printex ("cannot stat pwd");
X	Orgdir = str_store (Orgdir);
X	if (Savedir == NULL)
X		Savedir = Orgdir;
X	if (*ccname != DIRSEP)
X	{
X#ifdef amiga
X		sprintf (dbuf, "%s%s",Home,ccname);
X#else
X		sprintf (dbuf, "%s%c%s",Home,DIRSEP,ccname);
X#endif
X		Ccfile = str_store (dbuf);
X	}
X	else
X		Ccfile = str_store (ccname);
X#ifdef amiga
X	sprintf (dbuf, "%s%s%s",Home,"vn","XXXXXX");
X#else
X	sprintf (dbuf, "%s%c%s%s",Home,DIRSEP,"vn","XXXXXX");
X#endif
X
X	if (*keyxln != DIRSEP)
X	{
X#ifdef amiga
X		sprintf(dbuf, "%s%s",Home,keyxln);
X#else
X		sprintf(dbuf, "%s%c%s",Home,DIRSEP,keyxln);
X#endif
X		set_kxln(dbuf);
X	}
X	else
X		set_kxln(keyxln);
X}
X
Xchar *
Xvn_env(var,def)
Xchar *var;
Xchar *def;
X{
X	char pfx[RECLEN];
X	char *res;
X	char *getenv();
X
X	if (var[0] != 'V' || var[1] != 'N')
X	{
X		sprintf(pfx,"VN%s",var);
X		if ((res = getenv(pfx)) != NULL)
X			return(res);
X	}
X
X	if ((res = getenv(var)) != NULL)
X		return(res);
X
X	return(def);
X}
X
Xstatic
Xset_kxln(fname)
Xchar *fname;
X{
X	FILE *fp;
X	int i;
X	char bufr[80];
X	char in,out,*ptr;
X	char *index();
X
X	for (i=0; i < CHMASK+1; ++i)
X		Cxitop[i] = Cxitor[i] = Cxptoi[i] = Cxrtoi[i] = i;
X
X	if ((fp = fopen(fname,"r")) != NULL)
X	{
X		while(fgets(bufr,79,fp) != NULL)
X		{
X			if (strncmp(bufr+1,"==",2) == 0)
X				ptr = bufr+2;
X			else
X				ptr = index(bufr+1,'=');
X			if (ptr == NULL)
X				continue;
X			*ptr = '\0';
X			++ptr;
X			in = xln_str(bufr+1);
X			out = xln_str(ptr);
X			switch(bufr[0])
X			{
X			case 'r':
X			case 'R':
X				Cxrtoi[out] = in;
X				Cxitor[in] = out;
X				break;
X			case 'p':
X			case 'P':
X				Cxptoi[out] = in;
X				Cxitop[in] = out;
X			default:
X				break;
X			}
X		}
X		fclose(fp);
X	}
X}
X
Xstatic char
Xxln_str(s)
Xchar *s;
X{
X	if (*s < '0' || *s > '9')
X		return(*s & CHMASK);
X	return((char)(atoi(s) & CHMASK));
X}
END_OF_FILE
if test 3204 -ne `wc -c <'envir_se.c'`; then
    echo shar: \"'envir_se.c'\" unpacked with wrong size!
fi
# end of 'envir_se.c'
fi
if test -f 'getch.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'getch.c'\"
else
echo shar: Extracting \"'getch.c'\" \(2120 characters\)
sed "s/^X//" >'getch.c' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** getch.c - character i/o routines
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X#include <stdio.h>
X#include <setjmp.h>
X#include <ctype.h>
X#include "config.h"
X#include "vn.h"
X
Xextern char Cxitop[];
Xextern char *Ku, *Kd, *Kr, *Kl;
X
X#ifdef	MSDOS
X#undef	getc
X#define	getc(x)	getraw()
X#endif
X
X#ifdef	amiga
X#undef	getc
X#define	getc(x)	ttgetc()
X#endif
X
X/*
X	getkey obtains user keystroke with count from leading
X	numerics, if any.  Picks up arrow key sequences and maps
X	them to other keys.  Also translates character through
X	Cxitop array since this routine is only used in session
X	loop.  Saves untranslating arrow keys.
X*/
Xgetkey (c)
Xchar *c;
X{
X	int i, j;
X	static char	ckseq[32];
X
X#ifdef	MINIX
X	fflush(stdout);
X#endif
X
X	/* Check for leading count */
X	for (i = 0; isdigit(*c = getc(stdin) & CHMASK); i = i * 10 + *c - '0')
X		;
X
X	/* @#$!!! flakey front ends that won't map newlines in raw mode */
X	if (*c == '\012' || *c == '\015')
X		*c = '\n';
X
X	/* @#$!!! flakey terminals which send control sequences for cursors! */
X	if( *c == '\033' )
X	{
X		/*
X		** Check if part of cursor key input sequence
X		** (pitch unknown escape sequences)
X		*/
X		j = 0;
X		ckseq[j] = *c; ckseq[j+1] = '\0';
X		while(*c == Ku[j] || *c == Kd[j] || *c == Kl[j] || *c == Kr[j])
X		{
X			if( strcmp(ckseq, Ku) == 0 ) { *c = UP; break; }
X			if( strcmp(ckseq, Kd) == 0 ) { *c = DOWN; break; }
X#ifdef PAGEARROW
X			if( strcmp(ckseq, Kl) == 0 ) { *c = BACK; break; }
X			if( strcmp(ckseq, Kr) == 0 ) { *c = FORWARD; break; }
X#else
X			if( strcmp(ckseq, Kl) == 0 ) { *c = UP; break; }
X			if( strcmp(ckseq, Kr) == 0 ) { *c = DOWN; break; }
X#endif
X			*c = (getc(stdin) & CHMASK);
X			ckseq[++j] = *c; ckseq[j+1] = '\0';
X		}
X	}
X	else
X		*c = Cxitop[*c];
X
X	if (i <= 0)
X		i = 1;
X	return (i);
X}
X
X/*
X	get user key ignoring most controls.  Used from reader and other
X	non-screen interactions.
X*/
Xgetnoctl ()
X{
X	char c;
X
X#ifdef	MINIX
X	fflush(stdout);
X#endif
X	while (iscntrl(c = getc(stdin) & CHMASK))
X	{
X		if (c == '\015' || c == '\012')
X			c = '\n';
X		if (c == '\n' || c == '\b' || c == '\t')
X			return (c);
X	}
X	return ((int) c);
X}
END_OF_FILE
if test 2120 -ne `wc -c <'getch.c'`; then
    echo shar: \"'getch.c'\" unpacked with wrong size!
fi
# end of 'getch.c'
fi
if test -f 'getenv.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'getenv.c'\"
else
echo shar: Extracting \"'getenv.c'\" \(815 characters\)
sed "s/^X//" >'getenv.c' <<'END_OF_FILE'
X
X/*
X *  GETENV.C
X *
X *  Lattice's screws up.
X *
X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
X */
X
X#include <stdio.h>
X
Xchar *
Xgettmpenv(id)
Xchar *id;
X{
X    static char *buf;
X    static char *res = NULL;
X    long fh;
X    long len;
X
X    buf = (char *)malloc(strlen(id) + 8);
X    sprintf(buf, "ENV:%s", id);
X    fh = Open(buf, 1005);
X    free(buf);
X    if (fh) {
X	Seek(fh, 0L, 1);
X	len = Seek(fh, 0L, -1);
X	if (len < 0) {
X	    Close(fh);
X	    return(NULL);
X	}
X	if (res)
X	    free(res);
X	res = (char *)malloc(len + 1);
X	Read(fh, res, len);
X	Close(fh);
X	res[len] = 0;
X	return(res);
X    }
X    return(NULL);
X}
X
Xchar *
Xgetenv(id)
Xchar *id;
X{
X    char *res = gettmpenv(id);
X    char *perm = NULL;
X
X    if (res) {
X	perm = (char *)malloc(strlen(res) + 1);
X	strcpy(perm, res);
X    }
X    return(perm);
X}
X
END_OF_FILE
if test 815 -ne `wc -c <'getenv.c'`; then
    echo shar: \"'getenv.c'\" unpacked with wrong size!
fi
# end of 'getenv.c'
fi
if test -f 'getren.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'getren.c'\"
else
echo shar: Extracting \"'getren.c'\" \(1870 characters\)
sed "s/^X//" >'getren.c' <<'END_OF_FILE'
X/*--------------------------------------------------------------------- */
X/* getren.c								*/
X/*	Read each input file (a news article) and output a command to	*/
X/*	rename it to the VnnIxxx from the Subject: line.		*/
X/*									*/
X/* History:								*/
X/*	6 Jan 1991	v1.0						*/
X/*									*/
X/* Author:								*/
X/*	Eyal Lebedinsky							*/
X/*	Canberra, AUSTRALIA						*/
X/*--------------------------------------------------------------------- */
X
X#include <stdio.h>
X#include <stdlib.h>
X#include <string.h>
X#include <ctype.h>
X
X#define	VBUF
X
Xtypedef unsigned char	uchar;
X
Xstatic uchar	line[4096];
X
Xmain (argc, argv)
Xint	argc;
Xuchar	*argv[];
X{
X	FILE	*fin = NULL;
X	uchar	*q;
X	int	nopened = 0,
X		nrenamed = 0;
X#ifdef	VBUF
X	uchar	*p;
X#endif
X
X#ifdef	VBUF
X#define	BSIZE	1024	/* we do not expect to read much */
X	if ((p = malloc (BSIZE)) == NULL) {
X		fprintf (stderr, "Out of memory\n");
X		exit (1);
X	}
X#endif
X
X	for (; argc-- > 1;) {
X		fin = fopen (*++argv, "rt");
X		if (fin == NULL) {
X			fprintf (stderr, "could not open %s\n", *argv);
X			continue;
X		}
X#ifdef	VBUF
X		if (setvbuf (fin, p, _IOFBF, BSIZE)) {
X			fprintf (stderr, "setvbuf failed!\n");
X			exit (1);
X		}
X#endif
X		++nopened;
X		while (fgets (line, sizeof (line), fin) != NULL) {
X		    if (!memcmp (line, "Subject: ", 9)) {
X			q = line + 9;
X			if ((q[0] == 'v' || q[0] == 'V') &&
X			    isdigit (q[1]) &&
X			    isdigit (q[2]) &&
X			    (q[3] == 'i' || q[3] == 'I') &&
X			    (q[4] == 'n' || q[4] == 'N' || isdigit (q[4])) &&
X			    (q[5] == 'f' || q[5] == 'F' || isdigit (q[5])) &&
X			    isdigit (q[6]) &&
X			    (q[7] == ':' || isdigit (q[7]) && q[8] == ':')) {
X				printf ("ren %s ", *argv);
X				for (; isalnum (*q); ++q)
X					 putchar (*q);
X				putchar ('\n');
X				++nrenamed;
X			}
X			break;
X		    }
X		}
X		fclose (fin);
X	}
X	fprintf (stderr, "%u files found, %u renamed\n",
X		nopened, nrenamed);
X	exit (0);
X}
END_OF_FILE
if test 1870 -ne `wc -c <'getren.c'`; then
    echo shar: \"'getren.c'\" unpacked with wrong size!
fi
# end of 'getren.c'
fi
if test -f 'gettoc.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'gettoc.c'\"
else
echo shar: Extracting \"'gettoc.c'\" \(1394 characters\)
sed "s/^X//" >'gettoc.c' <<'END_OF_FILE'
X/*--------------------------------------------------------------------- */
X/* gettoc.c								*/
X/*	Reach each input file (an mbox format) and output some header	*/
X/*	lines to be used as a Table Of Contents.			*/
X/*									*/
X/* History:								*/
X/*	6 Oct 1990	v1.0						*/
X/*									*/
X/* Author:								*/
X/*	Eyal Lebedinsky							*/
X/*	Canberra, AUSTRALIA						*/
X/*--------------------------------------------------------------------- */
X
X#include <stdio.h>
X#include <stdlib.h>
X#include <string.h>
X
Xtypedef unsigned char	uchar;
X
Xstatic uchar	line[4096];
X
Xmain (argc, argv)
Xint	argc;
Xuchar	*argv[];
X{
X	FILE	*fin = NULL;
X#ifdef	VBUF
X	uchar	*p;
X#endif
X
X#ifdef	VBUF
X#define	BSIZE	20480
X	if ((p = (uchar *)malloc (BSIZE)) == NULL) {
X		fprintf (stderr, "Out of memory\n");
X		exit (1);
X	}
X#endif
X
X	for (; argc-- > 1;) {
X		fin = fopen (*++argv, "rt");
X		if (fin == NULL)
X			continue;
X#ifdef	VBUF
X		if (setvbuf (fin, p, _IOFBF, BSIZE)) {
X			fprintf (stderr, "setvbuf failed!\n");
X			exit (1);
X		}
X#endif
X		while (fgets (line, sizeof (line), fin) != NULL) {
X			if (!memcmp (line, "Keywords: ", 10) ||
X			    !memcmp (line, "Subject: ", 9) ||
X			    !memcmp (line, "Article ", 8) ||
X			    !memcmp (line, ">From: ", 7) ||
X			    !memcmp (line, "Lines: ", 7) ||
X			    !memcmp (line, "From: ", 6) ||
X			    !memcmp (line, "Date: ", 6))
X				fputs (line, stdout);
X		}
X		fclose (fin);
X	}
X	exit (0);
X}
END_OF_FILE
if test 1394 -ne `wc -c <'gettoc.c'`; then
    echo shar: \"'gettoc.c'\" unpacked with wrong size!
fi
# end of 'gettoc.c'
fi
if test -f 'hash.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'hash.c'\"
else
echo shar: Extracting \"'hash.c'\" \(1909 characters\)
sed "s/^X//" >'hash.c' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** hash.c - hash table routines
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X
X#include <stdio.h>
X#include "config.h"
X#include "tune.h"
X#include "node.h"
X
X/*
X** hash table manipulation routines:
X*/
X
Xextern int Ncount;
Xextern NODE **Newsorder;
X
Xstatic NODE *Tab [HASHSIZE];	/* hash Table */
X
Xstatic unsigned hash ();
X
Xhashinit ()
X{
X	int i;
X	for (i=0; i < HASHSIZE; ++i)
X		Tab[i] = NULL;
X	Ncount = 0;
X}
X
X/*
X	enter new node (name s, articles n, low l) in hash Table, 
X	initial flags = 0.  Set order to -1.
X*/
XNODE *hashenter(s,n,l)
Xchar *s;
Xint n;
Xint l;
X{
X	char *str_store();
X	NODE *ptr,*node_store();
X	NODE *hashfind();
X	int i;
X
X	if ((ptr = hashfind(s)) != NULL)
X	{
X		fgprintf ("Warning: group %s encountered twice",s);
X		return (ptr);
X	}
X
X	i=hash(s);
X	ptr = node_store();
X	ptr->next = Tab[i];
X	Tab[i] = ptr;
X	if (l > n)
X		l = n;
X	++Ncount;
X	ptr->lownum = l;
X	ptr->state = 0;
X	ptr->data = NULL;
X	ptr->flags = 0;
X	ptr->highnum = n;
X	ptr->nd_name = str_store(s);
X	ptr->pgshwn = 0;
X	ptr->order = -1;
X	return (ptr);
X}
X
XNODE *hashfind(s)
Xchar *s;
X{
X	NODE *ptr;
X
X	for (ptr = Tab[hash(s)]; ptr != NULL && strcmp(ptr->nd_name,s) != 0;
X					ptr = ptr->next)
X		    ;
X	return (ptr);
X}
X
Xmake_newsorder()
X{
X	char *malloc();
X	int i;
X	NODE *ptr;
X
X	if ((Newsorder = (NODE **) malloc(Ncount * sizeof(NODE *))) == NULL)
X		printex("Memory allocation failure - newsorder array");
X	for (i=0; i < Ncount; ++i)
X		Newsorder[i] = NULL;
X	for (i=0; i < HASHSIZE; ++i)
X	{
X		for (ptr = Tab[i]; ptr != NULL; ptr = ptr->next)
X		{
X			if (ptr->order < 0 || ptr->order >= Ncount)
X				printex("News order range error");
X			Newsorder[ptr->order] = ptr;
X		}
X	}
X	for (i=0; i < Ncount; ++i)
X		if (Newsorder[i] == NULL)
X			printex("News order duplication error");
X}
X
Xstatic
Xunsigned
Xhash (s)
Xchar *s;
X{
X	unsigned rem;
X	for (rem=0; *s != '\0'; ++s)
X		rem = (rem*128 + (*s&0x7f)) % HASHSIZE;
X	return (rem);
X}
END_OF_FILE
if test 1909 -ne `wc -c <'hash.c'`; then
    echo shar: \"'hash.c'\" unpacked with wrong size!
fi
# end of 'hash.c'
fi
if test -f 'head.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'head.h'\"
else
echo shar: Extracting \"'head.h'\" \(2590 characters\)
sed "s/^X//" >'head.h' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** head.h - header line structure
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X
X/*
X** How this thing works:
X**
X** this structure is filled in by vns_aopen when opening an article.
X** lines & hlines items will be used in providing percentage read prompts
X**
X** show_num & show are the article information lines presented for the user
X** when the "show headers" flag is turned off.
X**
X** from and artid are used for mail salutations, etc.
X**
X** The items used for mail replies, FOLLOWING the call to the mail massager
X** if there is one, are mailcmd, mail_num, and mail.  These are the items
X** the massager should fill in.  If no massager exists, vns_aopen will
X** fill these in directly.  If mail_err is non-null, the user won't be
X** able to mail a reply to the article, and the item should be an error
X** message explaining why.  If there is a mailer function, the mailcmd
X** item is not used.
X**
X** The priv and priv_num items are for sole use of the server layer in
X** the mail massager, mailer and poster functions.
X**
X** The postcmd, post_num, and post arguments are used in treatment of
X** followups.  If post_err is non-null, followup won't be allowed, for
X** the reason described therein.  If there is a poster function, the
X** postcmd item isn't used.
X**
X** The header lines for inclusion in mail / followup files will open
X** the file, and will be followed by one blank line.  The lines are literal -
X** all appropriate headers should be prepended, etc.
X**
X** postcmd / mailcmd are used as format strings which are assumed to have a
X** single %s in them some place for the placement of the users editted file.
X** The result will be spawned as a command.
X*/
X
Xtypedef struct
X{
X	int lines;		/* number of lines in article */
X	int hlines;		/* number of header lines in article */
X	char *from;		/* authors name */
X	char *artid;		/* article id */
X	int show_num;		/* number of extra lines for reader display */
X	char **show;		/* extra header lines */
X	int priv_num;		/* number of private arguments */
X	char **priv;		/* private server arguments */
X	char *mail_err;		/* mail reply error message */
X	char *mailcmd;		/* command line for mailer */
X	int mail_num;		/* number of header lines in mail reply file */
X	char **mail;		/* mail reply header lines */
X	char *post_err;		/* follow-up posting error message */
X	char *postcmd;		/* command line for followup poster */
X	int post_num;		/* number of header lines for followup file */
X	char **post;		/* followup header lines */
X} ARTHEADER;
X
X#ifdef amiga
X#undef putchar
X#define putchar ttputc
X#endif
X
END_OF_FILE
if test 2590 -ne `wc -c <'head.h'`; then
    echo shar: \"'head.h'\" unpacked with wrong size!
fi
# end of 'head.h'
fi
if test -f 'lib.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'lib.h'\"
else
echo shar: Extracting \"'lib.h'\" \(23 characters\)
sed "s/^X//" >'lib.h' <<'END_OF_FILE'
X#define	PRIVATE	static
END_OF_FILE
if test 23 -ne `wc -c <'lib.h'`; then
    echo shar: \"'lib.h'\" unpacked with wrong size!
fi
# end of 'lib.h'
fi
if test -f 'mktemp.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mktemp.c'\"
else
echo shar: Extracting \"'mktemp.c'\" \(548 characters\)
sed "s/^X//" >'mktemp.c' <<'END_OF_FILE'
X/* mktemp - make a name for a temporary file */
X
X#include <stdio.h>
X#include <time.h>
X
Xchar *mktemp(template)
Xchar *template;
X{
X  int pid, k;
X  char *p;
X
X/*  pid = getpid();*/		/* get process id as semi-unique number */
X  srand (time (NULL));		/* get a random number using time as seed */
X  pid = rand ();
X  p = template;
X  while (*p++) ;		/* find end of string */
X  p--;				/* backup to last character */
X
X  /* Replace XXXXXX at end of template with pid. */
X  while (*--p == 'X') {
X	*p = '0' + (pid % 10);
X	pid = pid/10;
X  }
X  return(template);
X}
END_OF_FILE
if test 548 -ne `wc -c <'mktemp.c'`; then
    echo shar: \"'mktemp.c'\" unpacked with wrong size!
fi
# end of 'mktemp.c'
fi
if test -f 'msdos.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'msdos.c'\"
else
echo shar: Extracting \"'msdos.c'\" \(2463 characters\)
sed "s/^X//" >'msdos.c' <<'END_OF_FILE'
X#include <stdio.h>
X#include <string.h>
X#include <pwd.h>
X
X#ifdef	MSDOS
X
X#include <dos.h>
X#include "vn.h"
X
X#define K_F1	+59
X#define K_F2	+60
X#define K_F3	+61
X#define K_F4	+62
X#define K_F5	+63
X#define K_F6	+64
X#define K_F7	+65
X#define K_F8	+66
X#define K_F9	+67
X#define K_F10	+68
X#define K_SF1	+84
X#define K_SF2	+85
X#define K_SF3	+86
X#define K_SF4	+87
X#define K_SF5	+88
X#define K_SF6	+89
X#define K_SF7	+90
X#define K_SF8	+91
X#define K_SF9	+92
X#define K_SF10	+93
X#define K_CF1	+94
X#define K_CF2	+95
X#define K_CF3	+96
X#define K_CF4	+97
X#define K_CF5	+98
X#define K_CF6	+99
X#define K_CF7	+100
X#define K_CF8	+101
X#define K_CF9	+102
X#define K_CF10	+103
X#define K_AF1	+104
X#define K_AF2	+105
X#define K_AF3	+106
X#define K_AF4	+107
X#define K_AF5	+108
X#define K_AF6	+109
X#define K_AF7	+110
X#define K_AF8	+111
X#define K_AF9	+112
X#define K_AF10	+113
X#define K_LEFT	+75
X#define K_RIGHT	+77
X#define K_UP	+72
X#define K_DOWN	+80
X#define K_PGUP	+73
X#define K_PGDN	+81
X#define K_HOME	+71
X#define K_END	+79
X#define K_CPGUP	+132
X#define K_CPGDN	+118
X#define K_CHOME	+119
X#define K_CEND	+117
X#define K_CLEFT	+115
X#define K_CRIGHT +116
X#define K_INS	+82
X#define K_DEL	+83
X
Xstruct passwd *
Xgetpwuid (uid)
Xint	uid;
X{
X	static struct passwd passwd;
X
X	passwd.pw_dir = "f:\\home";
X	passwd.pw_name = "User";
X
X	return (&passwd);
X}
X
Xstruct passwd *
Xgetpwnam (name)
Xchar	*name;
X{
X	static struct passwd passwd;
X	static char	pw_name[20];
X
X	passwd.pw_dir = "f:\\home";
X	passwd.pw_name = pw_name;
X	strncpy (pw_name, name, sizeof (pw_name));
X
X	return (&passwd);
X}
X
Xint
Xgetuid ()
X{
X	return (0);
X}
X
Xint
Xlink (from, to)
Xchar	*from, *to;
X{
X	char	command[128];
X
X	strcpy (command, "copy ");
X	strcat (command, from);
X	strcat (command, " ");
X	strcat (command, to);
X	strcat (command, " >nul \n");
X
X	return (system (command));
X}
X
Xint
Xgetraw ()
X{
X	int	c;
X
X	while (!(c = getch ()))	{	/* no funnies... */
X		switch (c = getch ()) {
X		case K_UP:
X			c = UP;
X			break;
X		case K_DOWN:
X			c = DOWN;
X			break;
X		case K_PGDN:
X			c = FORWARD;
X			break;
X		case K_PGUP:
X			c = BACK;
X			break;
X		default:
X			continue;	/* ignore */
X		}
X		break;
X	}
X	return (c);
X}
X
X#undef	chdir
X
Xstatic char abc[] = " ABCDEFGHIJKLMNOPQRSTUVWXYZ";
X
Xint
Xdoschdir (dir)
Xchar	*dir;
X{
X	int	a, b;
X	char	*p;
X
X	if (dir[1] == ':') {
X		if ((p = index (abc, toupper (dir[0]))) == NULL ||
X		    *p == '\0')
X			return (1);
X		a = p - abc;
X		_dos_setdrive (a, &b);
X		_dos_getdrive (&b);
X		if (a != b)
X			return (1);
X		dir += 2;
X	}
X	return (chdir (dir));
X}
X
X#endif
END_OF_FILE
if test 2463 -ne `wc -c <'msdos.c'`; then
    echo shar: \"'msdos.c'\" unpacked with wrong size!
fi
# end of 'msdos.c'
fi
if test -f 'msdos.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'msdos.h'\"
else
echo shar: Extracting \"'msdos.h'\" \(51 characters\)
sed "s/^X//" >'msdos.h' <<'END_OF_FILE'
Xstruct passwd {
X	char	*pw_dir;
X	char	*pw_name;
X};
X
END_OF_FILE
if test 51 -ne `wc -c <'msdos.h'`; then
    echo shar: \"'msdos.h'\" unpacked with wrong size!
fi
# end of 'msdos.h'
fi
if test -f 'newdisp.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'newdisp.c'\"
else
echo shar: Extracting \"'newdisp.c'\" \(1175 characters\)
sed "s/^X//" >'newdisp.c' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** newgroups.c - display list of new groups since user's last ession.
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X
X#include <stdio.h>
X#include "config.h"
X#include "tty.h"
X#include "node.h"
X
Xextern NODE **Newsorder;
Xextern int Ncount, Lrec, C_allow;
X
X#ifdef amiga
Xextern char pr_buf[];
Xvoid ttputc ();
X#endif
X
Xnew_groups ()
X{
X	int i,wrem,w;
X	int max;
X	char fs[24],c_end;
X
X	max = 0;
X	for (i=0; i < Ncount; ++i)
X		if (((Newsorder[i])->flags & FLG_NEW) != 0 &&
X				(w = strlen((Newsorder[i])->nd_name)) > max)
X			max = w;
X	sprintf (fs,"%%-%ds%%c",max);
X
X	if (max <= 0)
X		return (0);
X
X	term_set (ERASE);
X#ifdef amiga
X	sprintf (pr_buf,"New newsgroups:\n");
X	tputs(pr_buf,1,ttputc);
X#else
X	printf ("New newsgroups:\n");
X#endif
X
X
X	wrem = C_allow;
X	for (i=0; i < Ncount; ++i)
X	{
X		if (((Newsorder[i])->flags & FLG_NEW) == 0)
X			continue;
X		if ((wrem -= max) < max)
X		{
X			wrem = C_allow;
X			c_end = '\n';
X		}
X		else
X			c_end = ' ';
X#ifdef amiga
X		sprintf (pr_buf,fs,(Newsorder[i])->nd_name,c_end);
X		tputs(pr_buf,1,ttputc);
X#else
X		printf (fs,(Newsorder[i])->nd_name,c_end);
X#endif
X	}
X	if (c_end != '\n')
X		putchar ('\n');
X
X	return (1);
X}
END_OF_FILE
if test 1175 -ne `wc -c <'newdisp.c'`; then
    echo shar: \"'newdisp.c'\" unpacked with wrong size!
fi
# end of 'newdisp.c'
fi
if test -f 'node.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'node.h'\"
else
echo shar: Extracting \"'node.h'\" \(1640 characters\)
sed "s/^X//" >'node.h' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** node.h - NODE structure
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X
X/* newsgroup status flags */
X#define FLG_SUB 1	/* user subscribed to newsgroup */
X#define FLG_PAGE 2	/* a page exists to display */
X#define FLG_NEW 4	/* new newsgroup */
X#define FLG_ECHG 8	/* edit change by user */
X#define FLG_SEARCH 16	/* newsgroup was searched */
X#define FLG_ACC 32	/* newsgroup had articles accessed */
X#define FLG_STAT 64	/* stat's written */
X
X/*
X	newsgroup information (hash table node)
X
X	items unaccessed by server interface:
X		next - hashtable link
X		pnum - page number
X		pages - number of pages for news display
X		pgshwn - pages shown mask
X		pgrd - article number on highest conecutively shown page
X		order - order of appearance in Newsorder array.
X		orgrd - original articles read number
X
X	may be read following hashfind by server interface, but not written:
X		nd_name - name of newsgroup (key to reach node by)
X			this will be a permanent copy of the name.
X		highnum - high article number in group
X		lownum - low article number in group
X
X	legal for vns_write to read, but not written by server interface:
X		flags - bit mask of FLG_xxxx flags.
X		rdnum - articles read.
X
X	unused by vn user interface, intended for use by server interface:
X		state - state variable.  initted 0.
X		data - arbitrary data pointer.  initted NULL.
X*/
Xtypedef struct _node
X{
X	struct _node *next;
X	char *nd_name;
X	int highnum, lownum;
X	int pnum, pages, rdnum, orgrd, pgrd;
X	unsigned long pgshwn;
X	unsigned flags;
X	int order;
X	unsigned state;
X	char *data;
X} NODE;
X
X#ifdef amiga
X#undef putchar
X#define putchar ttputc
X#endif
X
END_OF_FILE
if test 1640 -ne `wc -c <'node.h'`; then
    echo shar: \"'node.h'\" unpacked with wrong size!
fi
# end of 'node.h'
fi
if test -f 'page.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'page.h'\"
else
echo shar: Extracting \"'page.h'\" \(1212 characters\)
sed "s/^X//" >'page.h' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** page.h - display page structure
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X
X/*
X	page display format and dependent parameters
X*/
X#define HFORMAT "\n%s (page %d of %d):"
X#define DHFORMAT "\n%s (DIGEST EXTRACTION):"
X#define TFORMAT "%s ~ %s %s"
X#define AFORMAT "\n%c%c%d) "	/* begin with newline - see show routine */
X#define AFLEN 5		/* min. char. in article id - depends on AFORMAT */
X#define CFORMAT "page %d of %d (%d shown), newsgroup %d of %d"
X#define RECBIAS 2	/* lines before articles - depends on HFORMAT */
X#define WRCOL 1		/* column of written mark.  depends on AFORMAT */
X#define INFOLINE 0	/* HFORMAT TFORMAT leaves for use */
X#define REQLINES 7	/* required terminal lines for display, incl. help */
X
X/*
X	newsgroup information for page display
X	name - of group
X	group - pointer to table entry
X	artnum - number of articles
X*/
Xtypedef struct
X{
X	char *name;
X	NODE *group;
X	int artnum;
X} HEAD;
X
X/*
X	article information - id (spool) number, title string, mark, written.
X*/
Xtypedef struct
X{
X	int art_id;
X	char art_mark;
X	char art_t[MAX_C-AFLEN];
X} BODY;
X
Xtypedef struct
X{
X	HEAD h;
X	BODY *b;
X} PAGE;
X
X#ifdef amiga
X#undef putchar
X#define putchar ttputc
X#endif
X
END_OF_FILE
if test 1212 -ne `wc -c <'page.h'`; then
    echo shar: \"'page.h'\" unpacked with wrong size!
fi
# end of 'page.h'
fi
if test -f 'printex.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'printex.c'\"
else
echo shar: Extracting \"'printex.c'\" \(800 characters\)
sed "s/^X//" >'printex.c' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** printex.c - print fatal error message and exit.
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X#include <stdio.h>
X#include <setjmp.h>
X#include "config.h"
X#include "tty.h"
X
Xextern int errno;	/* unix error number */
X
X/*
X	error/abnormal condition cleanup and abort routine
X	pass stack to printf
X*/
Xprintex (s,a,b,c,d,e,f)
Xchar *s;
Xlong a,b,c,d,e,f;
X{
X	static int topflag=0;
X	if (topflag == 0)
X	{
X		++topflag;
X		term_set (STOP);
X#ifndef	MINIX
X		tty_set (COOKED);
X#else
X/* COOKED is defined in Minix! */
X		tty_set (XCOOKED);
X#endif
X#ifdef amiga
X		ttflush ();
X#else
X		fflush (stdout);
X#endif
X		fprintf (stderr,s,a,b,c,d,e,f);
X		fprintf (stderr," (error code %d)\n",errno);
X		vns_exit(1);
X		stat_end(-1);
X		exit (1);
X	}
X	else
X		fprintf (stderr,s,a,b,c,d,e,f);
X}
END_OF_FILE
if test 800 -ne `wc -c <'printex.c'`; then
    echo shar: \"'printex.c'\" unpacked with wrong size!
fi
# end of 'printex.c'
fi
if test -f 'pwd.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pwd.h'\"
else
echo shar: Extracting \"'pwd.h'\" \(51 characters\)
sed "s/^X//" >'pwd.h' <<'END_OF_FILE'
Xstruct passwd {
X	char	*pw_dir;
X	char	*pw_name;
X};
X
END_OF_FILE
if test 51 -ne `wc -c <'pwd.h'`; then
    echo shar: \"'pwd.h'\" unpacked with wrong size!
fi
# end of 'pwd.h'
fi
if test -f 'rand.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rand.c'\"
else
echo shar: Extracting \"'rand.c'\" \(328 characters\)
sed "s/^X//" >'rand.c' <<'END_OF_FILE'
X/*
X *	In environments where the operating system doesn't provide
X *	a random number generator, the following code may be useful.
X */
X
Xstatic unsigned long _seed = 1;
X
Xint rand()
X{
X	_seed = (_seed * 1103515245) + 12345;
X	return((unsigned int) ((_seed / 65536) % 32768));
X}
X
Xvoid srand(seed)
Xunsigned int seed;
X{
X	_seed = seed;
X}
END_OF_FILE
if test 328 -ne `wc -c <'rand.c'`; then
    echo shar: \"'rand.c'\" unpacked with wrong size!
fi
# end of 'rand.c'
fi
if test -f 'reader.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'reader.h'\"
else
echo shar: Extracting \"'reader.h'\" \(1597 characters\)
sed "s/^X//" >'reader.h' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** reader.h - article reading interface definitions
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X
X#define PAGE_MID ":more (%2d%%):"
X#define PAGE_NEXT ":next article:"
X#define PAGE_END ":end:"
X#define PAGE_NO ":?:"
X#define PPR_MAX 18	/* maximum length of PAGE prompts */
X
X/*
X	reading commands: no control chars, add help message to helppg
X	SAVE, PRINT, HEADTOG and SETROT are also recognized
X*/
X#define HPG_HEAD "toggle header print flag"
X#define HPG_ROT "toggle rotation"
X#define HPG_SAVE "save article in a file"
X#define HPG_PRINT "print article"
X#define PG_NEXT 'n'
X#define HPG_NEXT "next article, if any"
X#define PG_QUIT 'q'
X#define HPG_QUIT "quit reading articles, if any more to read"
X#define PG_FLIP 'Q'
X#define HPG_FLIP "quit reading, and turn to next page of articles"
X#define PG_FOLLOW 'f'
X#define HPG_FOLLOW "post followup to article"
X#define PG_REPLY 'm'
X#define HPG_REPLY "send mail to author of article"
X#define PG_HELP '?'
X#define HPG_HELP "see this help menu"
X#define PG_REWIND 'r'
X#define HPG_REWIND "rewind article to beginning"
X#define PG_WIND 'e'
X#define HPG_WIND "seek to end of article (to next/end prompt)"
X#define PG_STEP '\n'
X#define HPG_STEP "next line"
X#define PG_SEARCH '/'
X#define HPG_SEARCH "search for regular expression in remainder of article"
X#define SEARCHFORM "search pattern (%s) ? "
X#define HPG_DEF "\n anything else to continue normal reading"
X#define HPG_EDEF "\n anything else to try reading next article, if any"
X
X#define ANFORM ":%s - %c for help:\n"
X
X#ifdef amiga
X#undef putchar
X#define putchar ttputc
X#endif
X
END_OF_FILE
if test 1597 -ne `wc -c <'reader.h'`; then
    echo shar: \"'reader.h'\" unpacked with wrong size!
fi
# end of 'reader.h'
fi
if test -f 'reg.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'reg.c'\"
else
echo shar: Extracting \"'reg.c'\" \(1681 characters\)
sed "s/^X//" >'reg.c' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** reg.c - implementation of regex / regcmp on top of UCB library
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X
X#include <stdio.h>
X
X#define RGBLKSIZE 20
X
Xstruct _regtab
X{
X	struct _regtab *link;
X	char *regstr;
X};
X
Xtypedef struct _regtab REGTAB;
X
Xstatic REGTAB *Chain = NULL;
Xstatic REGTAB *Free = NULL;
Xstatic REGTAB *Compiled = NULL;
X
Xextern char *malloc ();
X
Xregfree(s)
Xchar *s;
X{
X	REGTAB *ptr,*cmp,*old;
X
X	cmp = (REGTAB *) s;
X	old = NULL;
X
X	for (ptr = Chain; ptr != NULL; ptr = (old = ptr)->link)
X	{
X		if (ptr == cmp)
X		{
X			if (old == NULL)
X				Chain = Chain->link;
X			else
X				old->link = ptr->link;
X			ptr->link = Free;
X			Free = ptr;
X			break;
X		}
X	}
X}
X
Xchar *regcmp(str)
Xchar *str;
X{
X	int i;
X	char *str_store();
X	char *re_comp();
X
X	if (re_comp(str) != NULL)
X	{
X		Compiled = NULL;	/* make sure we're OK */
X		return(NULL);
X	}
X
X	if (Free == NULL)
X	{
X		Free = (REGTAB *) malloc(RGBLKSIZE * sizeof(REGTAB));
X		if (Free == NULL)
X			printex ("regcmp: memory allocation failure");
X		for (i = 0; i < RGBLKSIZE - 1; ++i)
X			Free[i].link = Free + i + 1;
X		Free[i].link = NULL;
X	}
X
X	Compiled = Free;
X	Free = Free->link;
X
X	Compiled->link = Chain;
X	Chain = Compiled;
X	Compiled->regstr = str_store(str);
X
X	return ((char *) Compiled);
X}
X
Xchar *regex(reg,str)
Xchar *reg,*str;
X{
X	REGTAB *cmp;
X
X	cmp = (REGTAB *) reg;
X
X	if (cmp == Compiled)
X	{
X		if (re_exec(str))
X			return(str);
X		return (NULL);
X	}
X
X	for (Compiled = Chain; Compiled != NULL; Compiled = Compiled->link)
X	{
X		if (Compiled == cmp)
X			break;
X	}
X
X	if (Compiled == NULL)
X		printex ("regex: bad pointer");
X
X	re_comp(Compiled->regstr);
X
X	if (re_exec(str))
X		return(str);
X
X	return(NULL);
X}
END_OF_FILE
if test 1681 -ne `wc -c <'reg.c'`; then
    echo shar: \"'reg.c'\" unpacked with wrong size!
fi
# end of 'reg.c'
fi
if test -f 'regcompa.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'regcompa.c'\"
else
echo shar: Extracting \"'regcompa.c'\" \(1117 characters\)
sed "s/^X//" >'regcompa.c' <<'END_OF_FILE'
X/* regcompat.c */
X/* file: regcompat.c
X** author: Peter S. Housel 11/21/88
X** Compatibility routines for regular expressions. more.c uses the
X** re_comp() and re_exec() routines, while Minix only has regcomp() and
X** regexec() (from Henry Spencer's freely redistributable regexp package).
X** Note that the third argument to regexec() is a beginning-of-line flag
X** and was probably added by Andrew Tannenbaum. It will probably be ignored
X** if your copy of the regexp routines only expects two args.
X**/
X
X#include <regexp.h>
X/* following just for debugging #define NULL	0 */
X#include <stdio.h>
X
Xextern char *malloc();
X
Xstatic regexp *re_exp = NULL;	/* currently compiled regular expression */
Xstatic char *re_err = NULL;	/* current regexp error */
X
Xchar *re_comp(str)
Xchar *str;
X{
X if(str == NULL)
X    return NULL;
X
X if(re_exp != NULL)
X    free(re_exp);
X
X if((re_exp = regcomp(str)) != NULL)
X    return NULL;
X
X return re_err != NULL ? re_err : "string didn't compile";
X}
X
Xint re_exec(str)
Xchar *str;
X{
X if(re_exp == NULL)
X    return -1;
X return regexec(re_exp, str, 1);
X}
X
Xregerror(str)
Xchar *str;
X{
X re_err = str;
X}
END_OF_FILE
if test 1117 -ne `wc -c <'regcompa.c'`; then
    echo shar: \"'regcompa.c'\" unpacked with wrong size!
fi
# end of 'regcompa.c'
fi
if test -f 'regexp.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'regexp.h'\"
else
echo shar: Extracting \"'regexp.h'\" \(673 characters\)
sed "s/^X//" >'regexp.h' <<'END_OF_FILE'
X/*
X * Definitions etc. for regexp(3) routines.
X *
X * Caveat:  this is V8 regexp(3) [actually, a reimplementation thereof],
X * not the System V one.
X */
X#define void int
X#define CHARBITS 0377
X#define NSUBEXP  10
Xtypedef struct regexp {
X	char *startp[NSUBEXP];
X	char *endp[NSUBEXP];
X	char regstart;		/* Internal use only. */
X	char reganch;		/* Internal use only. */
X	char *regmust;		/* Internal use only. */
X	int regmlen;		/* Internal use only. */
X	char program[1];	/* Unwarranted chumminess with compiler. */
X} regexp;
X
Xextern regexp *regcomp();
Xextern int regexec();
Xextern void regsub();
Xextern void regerror();
X
X#ifdef amiga
X#undef putchar
X#define putchar ttputc
X#endif
X
END_OF_FILE
if test 673 -ne `wc -c <'regexp.h'`; then
    echo shar: \"'regexp.h'\" unpacked with wrong size!
fi
# end of 'regexp.h'
fi
if test -f 'server.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server.h'\"
else
echo shar: Extracting \"'server.h'\" \(151 characters\)
sed "s/^X//" >'server.h' <<'END_OF_FILE'
X
X/*
X**	header files shared between vn and vns_xxxx server interface routines
X*/
X#include "tune.h"
X#include "tty.h"
X#include "node.h"
X#include "head.h"
END_OF_FILE
if test 151 -ne `wc -c <'server.h'`; then
    echo shar: \"'server.h'\" unpacked with wrong size!
fi
# end of 'server.h'
fi
if test -f 'stat.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'stat.h'\"
else
echo shar: Extracting \"'stat.h'\" \(1496 characters\)
sed "s/^X//" >'stat.h' <<'END_OF_FILE'
X/*
X *  Normally found in <sys/stat.h>
X */
X#ifndef STAT_H
X#define STAT_H
X
X#define S_IFMT		0170000		/* Mask for file type */
X#define S_IEXEC		0000100		/* Owner Execute/search permission */
X#define S_IWRITE	0000200		/* Owner Write permission */
X#define S_IREAD		0000400		/* Owner Read permission */
X#define S_ISVTX		0001000		/* Save swapped text after use */
X#define S_ISGID		0002000		/* Set group id on execution */
X#define S_ISUID		0004000		/* Set user id on execution */
X#define S_IFIFO		0010000		/* A fifo */
X#define S_IFCHR		0020000		/* A character special file */
X#define S_IFDIR		0040000		/* A directory file */
X#define S_IFBLK		0060000		/* A block special file */
X#define S_IFREG		0100000		/* A a regular file */
X#define S_IFLNK		0120000		/* A symbolic link (BSD) */
X
Xstruct stat {
X    unsigned short st_mode;	/* File mode as used by mknod */
X    long   st_ino;	/* Inode number */
X    unsigned char st_dev;	/* Major device number of device containing file */
X    unsigned char st_rdev;	/* Minor device number of device containing file */
X    short st_nlink;	/* Number of links */
X    unsigned short st_uid;	/* File owner's user ID number */
X    unsigned short st_gid;	/* File owner's group ID number */
X    long  st_size;	/* File size in bytes */
X    unsigned long st_atime;	/* Timestamp of last access to file's contents */
X    unsigned long st_mtime;	/* Timestamp of last modification of file */
X    unsigned long st_ctime;    /* Timestamp of file creation */
X};
X#define fstat stat
X#endif
END_OF_FILE
if test 1496 -ne `wc -c <'stat.h'`; then
    echo shar: \"'stat.h'\" unpacked with wrong size!
fi
# end of 'stat.h'
fi
if test -f 'stat2.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'stat2.c'\"
else
echo shar: Extracting \"'stat2.c'\" \(1613 characters\)
sed "s/^X//" >'stat2.c' <<'END_OF_FILE'
X#include <libraries/dos.h>      /* For FileInfo struct */
X#include <exec/memory.h>        /* For MEMF defines ... */
X#include "sys/types.h"
X#include "stat.h"
X#define ERROR	-1
X
X/*
X *  Manx stat() currently isn't very unix compatible, so we roll our
X *  own...
X */
X
Xtypedef struct stat STAT;
X
Xstat (path, buf)
Xchar *path;
Xregister STAT *buf;
X{
X    long lck;
X    struct FileInfoBlock *fp;
X    register long prot;
X    register long ftime;
X    extern long Lock ();
X    extern void *AllocMem ();
X
X    if ((lck = Lock (path, ACCESS_READ)) == 0) {
X        return (-1);
X    }
X    fp = (struct FileInfoBlock *)
X        AllocMem ((long) sizeof (struct FileInfoBlock),
X        (long) (MEMF_CLEAR | MEMF_CHIP));
X    Examine (lck, fp);
X    if (fp -> fib_DirEntryType > 0) {
X        buf -> st_mode = S_IFDIR;
X    } else {
X        buf -> st_mode = S_IFREG;
X    }
X    prot = ~(fp -> fib_Protection >> 1);
X    prot &= 0x7;
X    buf -> st_mode |= (prot << 6 | prot << 3 | prot);
X    buf -> st_nlink = 1;
X    buf -> st_size = fp -> fib_Size;
X    ftime = fp -> fib_Date.ds_Days * (60L * 60L * 24L);
X    ftime += fp -> fib_Date.ds_Minute * 60;
X    ftime += fp -> fib_Date.ds_Tick / TICKS_PER_SECOND;
X    buf -> st_atime = ftime;
X    buf -> st_mtime = ftime;
X    buf -> st_ctime = ftime;
X    buf -> st_ino = 0;
X    buf -> st_dev = 0;
X    buf -> st_rdev = 0;
X    buf -> st_uid = 0;
X    buf -> st_gid = 0;
X    FreeMem (fp, (long) sizeof (struct FileInfoBlock));
X    UnLock (lck);
X    return (0);
X}
X
Xlong fsize(name)
Xchar *name;
X{
X	STAT	data;
X
X	if(!access(name, 0x00)){
X		stat( name, &data );
X		return(data.st_size);
X	}
X
X	return(ERROR);
X}
X
END_OF_FILE
if test 1613 -ne `wc -c <'stat2.c'`; then
    echo shar: \"'stat2.c'\" unpacked with wrong size!
fi
# end of 'stat2.c'
fi
if test -f 'std.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'std.h'\"
else
echo shar: Extracting \"'std.h'\" \(946 characters\)
sed "s/^X//" >'std.h' <<'END_OF_FILE'
X/*
X	newsrc states
X*/
X#define NEWS_ON ':'
X#define NEWS_OFF '!'
X
X#define SFLG_SCAN 1
X#define SFLG_SPEC 2
X
X#define FPFIX "Re: "
X#define FPFLEN 4
X
X#define FIL_AUTHOR 'w'
X#define FIL_TITLE 't'
X
X/*
X	header lines and associated lengths.  Strings should
X	actually be used only once.
X*/ 
X#define RHEAD "References: "
X#define RHDLEN 12
X#define MHEAD "Message-ID: "
X#define MHDLEN 12
X#define PHEAD "Path: "
X#define PHDLEN 6
X#define DHEAD "Date: "
X#define DHDLEN 6
X#define RTHEAD "Reply-To: "
X#define RTHDLEN 10
X#define TOHEAD "To: "
X#define TOHDLEN 4
X#define FHEAD "From: "
X#define FHDLEN 6
X#define FTHEAD "Followup-To: "
X#define FTHDLEN 13
X#define DISHEAD "Distribution: "
X#define DISHDLEN 14
X#define THEAD "Subject: "
X#define THDLEN 9
X#define LHEAD "Lines: "
X#define LHDLEN 7
X#define NHEAD "Newsgroups: "
X#define NHDLEN 12
X
X#define CHFIRST "FSL"	/* first char's of those used in page display */
X
X#ifdef amiga
X#undef putchar
X#define putchar ttputc
X#endif
X
END_OF_FILE
if test 946 -ne `wc -c <'std.h'`; then
    echo shar: \"'std.h'\" unpacked with wrong size!
fi
# end of 'std.h'
fi
if test -f 'storage.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'storage.c'\"
else
echo shar: Extracting \"'storage.c'\" \(2261 characters\)
sed "s/^X//" >'storage.c' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** storage.c - storage allocation routines
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X
X#include <stdio.h>
X#include "tune.h"
X#include "node.h"
X#include "page.h"
X
Xextern char *malloc();
X
Xextern int L_allow;
X
Xextern PAGE Page;
X/*
X	Storage allocaters.
X*/
X
Xchar *str_store (s)
Xchar *s;
X{
X	static unsigned av_len = 0;	/* current storage available */
X	static char *avail;
X	int len;
X
X	if (s == NULL)
X		s = "";
X
X	if ((len = strlen(s)+1) > av_len)
X	{
X		if (len > STRBLKSIZE)
X			av_len = len;
X		else
X			av_len = STRBLKSIZE;
X		if ((avail = malloc(av_len)) == NULL)
X			printex ("can't allocate memory for string storage");
X	}
X	strcpy (avail,s);
X	s = avail;
X	avail += len;
X	av_len -= len;
X	return (s);
X}
X
X/*
X** called after number of terminal lines (L_allow) is known, to set
X** up storage for Page.
X*/
Xpage_alloc ()
X{
X	char *body;
X
X	if ((body = malloc(L_allow*sizeof(BODY))) == NULL)
X		printex ("can't allocate memory for display storage");
X
X	Page.b = (BODY *) body;
X}
X
XNODE
X*node_store()
X{
X	static int nd_avail = 0;
X	static NODE *nd;
X	NODE *ret;
X
X	if (nd_avail <= 0)
X	{
X		if ((nd = (NODE *) malloc(sizeof(NODE)*NDBLKSIZE)) == NULL)
X			printex ("can't allocate memory for newsgroup table");
X		nd_avail = NDBLKSIZE;
X	}
X	--nd_avail;
X	ret = nd;
X	++nd;
X	return(ret);
X}
X
X/*
X** temp string storage
X*/
X
Xtypedef struct
X{
X	int len;
X	int idx;
X	char **ptr;
X} STRINGPOOL;
X
Xchar *
Xstr_tpool(n)
Xint n;
X{
X	int size;
X	STRINGPOOL *p;
X
X	size = sizeof(STRINGPOOL) + n * sizeof(char **);
X
X	if ((p = (STRINGPOOL *) malloc(size)) == NULL)
X		printex("Cannot allocate temporary string storage");
X
X	p->ptr = (char **)(p+1);
X	p->len = n;
X	p->idx = 0;
X
X	return((char *) p);
X}
X
Xchar *
Xstr_tstore(cp,s)
Xchar *cp;
Xchar *s;
X{
X	STRINGPOOL *p;
X	int len;
X
X	p = (STRINGPOOL *) cp;
X	if (p->idx >= p->len)
X		printex("Temporary string storage overflow");
X	len = strlen(s)+1;
X	if ((cp = malloc(len)) == NULL)
X		printex("Cannot allocate copy of string");
X	strcpy(cp,s);
X	(p->ptr)[p->idx] = cp;
X	++(p->idx);
X
X	return(cp);
X}
X
Xchar **
Xstr_taptr(cp)
Xchar *cp;
X{
X	STRINGPOOL *p;
X
X	p = (STRINGPOOL *) cp;
X
X	return (p->ptr + p->idx);
X}
X
Xstr_tfree(cp)
Xchar *cp;
X{
X	STRINGPOOL *p;
X	int i;
X
X	p = (STRINGPOOL *) cp;
X	for (i=0; i < p->idx; ++i)
X		free((p->ptr)[i]);
X	free (cp);
X}
END_OF_FILE
if test 2261 -ne `wc -c <'storage.c'`; then
    echo shar: \"'storage.c'\" unpacked with wrong size!
fi
# end of 'storage.c'
fi
if test -f 'strings.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'strings.c'\"
else
echo shar: Extracting \"'strings.c'\" \(537 characters\)
sed "s/^X//" >'strings.c' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** strings.c - read only character strings
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X
X#include "tune.h"
X#include "node.h"
X#include "page.h"
X
Xchar *Version = "4/88";
X
Xchar *No_msg = "No articles";
Xchar *Hdon_msg = "Headers being printed";
Xchar *Hdoff_msg = "Headers being suppressed";
Xchar *Roton_msg = "ROT 13";
Xchar *Rotoff_msg = "NO ROT";
X
Xchar *Aformat = AFORMAT;
X
Xchar *Contstr = "  ******** any key to continue ********";
X
Xchar *Brk_fmt = "QUIT (signal %d)";
X
Xchar *List_sep = " \t,";
END_OF_FILE
if test 537 -ne `wc -c <'strings.c'`; then
    echo shar: \"'strings.c'\" unpacked with wrong size!
fi
# end of 'strings.c'
fi
if test -f 'strtok.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'strtok.c'\"
else
echo shar: Extracting \"'strtok.c'\" \(1082 characters\)
sed "s/^X//" >'strtok.c' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** strtok.c - strtok() and strpbrk() string routines using UCB index().
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X
X#include <stdio.h>
X
Xchar *strpbrk (s,del)
Xchar *s, *del;
X{
X	char *ptr,*index();
X	if (s == NULL)
X		return (NULL);
X	for (; *del != '\0'; ++del)
X		if ((ptr = index(s,*del)) != NULL)
X			return (ptr);
X	return (NULL);
X}
X
Xchar *strtok(str,delim)
Xchar *str, *delim;
X{
X	char *tokstart, *tokend, *first_ch (), *last_ch();
X	static char *save=NULL;
X
X	if (str != NULL)
X		save = str;
X
X	if (save == NULL)
X		return (NULL);
X
X	tokstart = first_ch (save, delim);
X	tokend = last_ch (tokstart, delim);
X	save = first_ch (tokend, delim);
X	*tokend = '\0';
X
X	if (*tokstart == '\0')
X		return (NULL);
X
X	return (tokstart);
X}
X
Xstatic char *first_ch (str,delim)
Xchar *str,*delim;
X{
X	char *index ();
X	char *f;
X
X	for (f = str; *f != '\0' && index(delim,*f) != NULL; ++f)
X		;
X
X	return (f);
X}
X
Xstatic char *last_ch (str,delim)
Xchar *str,*delim;
X{
X	char *index ();
X	char *f;
X
X	for (f = str; *f != '\0' && index(delim,*f) == NULL; ++f)
X		;
X
X	return (f);
X}
END_OF_FILE
if test 1082 -ne `wc -c <'strtok.c'`; then
    echo shar: \"'strtok.c'\" unpacked with wrong size!
fi
# end of 'strtok.c'
fi
if test -f 'termcap' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'termcap'\"
else
echo shar: Extracting \"'termcap'\" \(653 characters\)
sed "s/^X//" >'termcap' <<'END_OF_FILE'
XAP|amiga-p|Amiga ANSI for PAL:\
X        :co#78:li#30:am:bs:do=\E[B:ce=\E[K:cd=\E[J:\
X        :cl=\E[H\E[J:ku=\E[A:kd=\E[B:kl=\E[D:kr=\E[C:kb=^H:\
X        :al=\E[L:dl=\E[M:le=^H:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A:\
X        :ce=\E[K:ho=\E[H:dc=\E[P:ic=\E[@:\
X        :so=\E[2m:se=\E[m:us=\E[4m:ue=\E[m:mr=\E[7m:mb=\E[7;2m:me=\FE[m:
XAN|amiga-n|Amiga ANSI for NTSC:\
X        :co#78:li#23:am:bs:do=\E[B:ce=\E[K:cd=\E[J:\
X        :cl=\E[H\E[J:ku=\E[A:kd=\E[B:kl=\E[D:kr=\E[C:kb=^H:\
X        :al=\E[L:dl=\E[M:le=^H:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A:\
X        :ce=\E[K:ho=\E[H:dc=\E[P:ic=\E[@:\
X        :so=\E[2m:se=\E[m:us=\E[4m:ue=\E[m:mr=\E[7m:mb=\E[7;2m:me=\FE[m:
END_OF_FILE
if test 653 -ne `wc -c <'termcap'`; then
    echo shar: \"'termcap'\" unpacked with wrong size!
fi
# end of 'termcap'
fi
if test -f 'termcap.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'termcap.h'\"
else
echo shar: Extracting \"'termcap.h'\" \(508 characters\)
sed "s/^X//" >'termcap.h' <<'END_OF_FILE'
X#ifndef _TERMCAP_H
X#define _TERMCAP_H
X
X#ifndef LATTICE
X#include <ansi.h>
X
X_PROTOTYPE( int tgetent, (char *_bp, char *_name)			);
X_PROTOTYPE( int tgetflag, (char *_id)					);
X_PROTOTYPE( int tgetnum, (char *_id)					);
X_PROTOTYPE( char *tgetstr, (char *_id, char **_area)			);
X_PROTOTYPE( char *tgoto, (char *_cm, int _destcol, int _destline)	);
X_PROTOTYPE( int tputs, (char *_cp, int _affcnt, void (*_outc)(int))	);
X
X#endif
X
X#ifdef amiga
X#undef putchar
X#define putchar ttputc
X#endif
X
X#endif /* _TERMCAP_H */
END_OF_FILE
if test 508 -ne `wc -c <'termcap.h'`; then
    echo shar: \"'termcap.h'\" unpacked with wrong size!
fi
# end of 'termcap.h'
fi
if test -f 'tmpnam.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'tmpnam.c'\"
else
echo shar: Extracting \"'tmpnam.c'\" \(420 characters\)
sed "s/^X//" >'tmpnam.c' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** tmpnam.c - tmpnam() replacement for UCB, also uses non-generic name.
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X
X#include <stdio.h>
X#include "config.h"
X
Xchar *tmpnam (buf)
Xchar *buf;
X{
X	static char *ptr = VNTEMPNAME;
X
X	/* depends on string initialized above */
X	sprintf (ptr+TMP_XOFFSET,"XXXXXX");
X
X	mktemp (ptr);
X
X	if (buf != NULL)
X		strcpy (buf,ptr);
X
X	return (ptr);
X}
END_OF_FILE
if test 420 -ne `wc -c <'tmpnam.c'`; then
    echo shar: \"'tmpnam.c'\" unpacked with wrong size!
fi
# end of 'tmpnam.c'
fi
if test -f 'tty.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'tty.h'\"
else
echo shar: Extracting \"'tty.h'\" \(511 characters\)
sed "s/^X//" >'tty.h' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** tty.h - codes for tty_set and term_set
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X
X#define MOVE 100
X#define ERASE 101
X#define START 102
X#define STOP 103
X#define RUBSEQ 104
X#define ZAP 105
X#define ONREVERSE 106
X#define OFFREVERSE 107
X#define RESTART 108
X
X#define RAWMODE 200
X#ifndef	MINIX
X#define COOKED 201
X#else
X#define XCOOKED 201
X#endif
X#define SAVEMODE 202
X#define RESTORE 203
X#define BACKSTOP 204
X
X#ifdef amiga
X#undef putchar
X#define putchar ttputc
X#endif
X
END_OF_FILE
if test 511 -ne `wc -c <'tty.h'`; then
    echo shar: \"'tty.h'\" unpacked with wrong size!
fi
# end of 'tty.h'
fi
if test -f 'tty_set.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'tty_set.c'\"
else
echo shar: Extracting \"'tty_set.c'\" \(3855 characters\)
sed "s/^X//" >'tty_set.c' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** tty_set.c - interface to ioctl (system tty interface)
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X
X#ifdef MSDOS
Xtty_set(cmd)
Xint cmd;
X{
X	return;
X}
X#else
X
X#ifdef amiga
X
X#include "tty.h"
X
Xextern char Erasekey,Killkey;
X
X
Xstatic unsigned S_flag=0;
Xstatic int R_ignore=0;	/* up/down counter of reset calls to ignore */
X
X#define IO_GOT 1	/* have polled for original terminal mode */
X#define IO_RAW 2	/* in RAW (CBREAK actually) mode */
X
Xtty_set(cmd)
Xint cmd;
X{
X	int rc;
X	unsigned mask;
X
X	rc = 0;
X	switch (cmd)
X	{
X	case BACKSTOP:
X		rc = 0;
X		break;
X	case RAWMODE:
X		if ((S_flag & IO_RAW) != 0)
X		{
X			rc = 0;
X			break;
X		}
X		if ((S_flag & IO_GOT) == 0)
X		{
X			/* Save original modes, get erase / kill */
X			Erasekey = 8;
X			Killkey = 12;
X		}
X		S_flag = IO_GOT|IO_RAW;
X		break;
X	case COOKED:
X		if ((S_flag & IO_RAW) != 0)
X		{
X			S_flag &= ~IO_RAW;
X		}
X		else
X			rc = 0;
X		break;
X	case SAVEMODE:
X		if ((S_flag & IO_RAW) != 0)
X		{
X			tty_set(COOKED);
X			R_ignore = 0;
X		}
X		else
X			++R_ignore;
X		rc = 0;
X		break;
X	case RESTORE:
X		if (R_ignore <= 0)
X		{
X			tty_set(RAWMODE);
X		}
X		else
X			--R_ignore;
X		rc = 0;
X		break;
X	default:
X		rc = -1;
X	}
X	if (rc < 0)
X		printex ("ioctl failure, tty_set: %d",cmd);
X}
X#else
X
X#ifdef	MINIX
X/* Minix uses non-SysV type ioctls */
X#undef	SYSV
X#endif
X
X#ifdef SYSV
X#include <termio.h>
X#else
X#include <sgtty.h>
X#endif
X
X#include "tty.h"
X
Xextern char Erasekey,Killkey;
X
X#ifdef SYSV
Xstatic struct termio C_tp, O_tp;
X#else
Xstatic struct sgttyb C_tp;
Xstatic unsigned short O_lflag;
X#endif
X
Xstatic unsigned S_flag=0;
Xstatic int R_ignore=0;	/* up/down counter of reset calls to ignore */
X
X#define IO_GOT 1	/* have polled for original terminal mode */
X#define IO_RAW 2	/* in RAW (CBREAK actually) mode */
X
X/*
X	tty_set handles ioctl calls.  SAVEMODE, RESTORE are used around
X	system calls and interrupts to assure cooked mode, and restore
X	raw if raw on SAVEMODE.  The pair results in no calls to ioctl
X	if we are cooked already when SAVEMODE is called, and may be nested,
X	provided we desire no "restore" of cooked mode after restoring raw.
X
X	When we get the original terminal mode, we also save erase and kill.
X
X	sig_set makes an ioctl call to get process group leader.  Otherwise
X	ioctl calls should come through here.
X*/
Xtty_set(cmd)
Xint cmd;
X{
X	int rc;
X	unsigned mask;
X
X	switch (cmd)
X	{
X	case BACKSTOP:
X#ifdef JOBCONTROL
X		if ((rc = ioctl(1,TIOCLGET,&mask)) != 0)
X			break;
X		mask |= LTOSTOP;
X		rc = ioctl(1,TIOCLSET,&mask);
X#else
X		rc = 0;
X#endif
X		break;
X	case RAWMODE:
X		if ((S_flag & IO_RAW) != 0)
X		{
X			rc = 0;
X			break;
X		}
X		if ((S_flag & IO_GOT) == 0)
X		{
X			/* Save original modes, get erase / kill */
X#ifdef SYSV
X			rc = ioctl(0,TCGETA,&C_tp);
X			O_tp = C_tp;
X			Erasekey = C_tp.c_cc[VERASE];
X			Killkey = C_tp.c_cc[VKILL];
X#else
X			rc = ioctl(0,TIOCGETP,&C_tp);
X			O_lflag = C_tp.sg_flags;
X			Erasekey = C_tp.sg_erase;
X			Killkey = C_tp.sg_kill;
X#endif
X		}
X#ifdef SYSV
X		C_tp.c_lflag &= ~(ECHO | ICANON);
X		C_tp.c_cc[VMIN] = 1;
X		rc = ioctl(0,TCSETAW,&C_tp);
X#else
X		C_tp.sg_flags |= CBREAK;
X		C_tp.sg_flags &= ~ECHO;
X		rc = ioctl(0,TIOCSETP,&C_tp);
X#endif
X		S_flag = IO_GOT|IO_RAW;
X		break;
X#ifndef	MINIX
X	case COOKED:
X#else
X	case XCOOKED:
X#endif
X		if ((S_flag & IO_RAW) != 0)
X		{
X#ifdef SYSV
X			C_tp = O_tp;
X			rc = ioctl(0,TCSETAW,&C_tp);
X#else
X			C_tp.sg_flags = O_lflag;
X			rc = ioctl(0,TIOCSETP,&C_tp);
X#endif
X			S_flag &= ~IO_RAW;
X		}
X		else
X			rc = 0;
X		break;
X	case SAVEMODE:
X		if ((S_flag & IO_RAW) != 0)
X		{
X#ifndef	MINIX
X			tty_set(COOKED);
X#else
X			tty_set(XCOOKED);
X#endif
X			R_ignore = 0;
X		}
X		else
X			++R_ignore;
X		rc = 0;
X		break;
X	case RESTORE:
X		if (R_ignore <= 0)
X		{
X			tty_set(RAWMODE);
X		}
X		else
X			--R_ignore;
X		rc = 0;
X		break;
X	default:
X		rc = -1;
X	}
X	if (rc < 0)
X		printex ("ioctl failure, tty_set: %d",cmd);
X}
X#endif	/* !MSDOS */
X#endif	/* !amiga */
X
END_OF_FILE
if test 3855 -ne `wc -c <'tty_set.c'`; then
    echo shar: \"'tty_set.c'\" unpacked with wrong size!
fi
# end of 'tty_set.c'
fi
if test -f 'tune.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'tune.h'\"
else
echo shar: Extracting \"'tune.h'\" \(2258 characters\)
sed "s/^X//" >'tune.h' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** tune.h - system tuning parameters
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X
X/*
X**	buffer size needed for tmpnam()
X*/
X#ifndef L_tmpnam
X#define L_tmpnam 48
X#endif
X
X/*
X** hash table size.  linked list type of table which can expand to
X** arbitrary density, including densities > 100%.  Number of entries
X** will be number of newsgroups in active list.  This should be a prime
X** number ("long division" of string modulo table size hash function).
X*/
X#define HASHSIZE 809
X
X/*
X**	maximum number of columns on terminal.  If made smaller, there
X**	will be a savings in the size of the temporary file used
X**	for holding displays, at the penalty of not being able to use
X**	the entire screen width on terminals actually possessing more
X**	columns than this.  A block roughly on the order of this value
X**	times the number of lines the terminal has is maintained per page in
X**	the temp file, and read / written as displays are interacted
X**	with.  MIN_C put here because MAX_C > MIN_C.  MIN_C is the minumum
X**	number of columns for which a "reasonable" display can be produced.
X**	before making it smaller, look at all uses of C_allow and variable
X**	to see that a setting that small won't screw up array bounds.
X*/
X#define MAX_C 132
X#define MIN_C 36
X
X/*
X**	large size for general purpose local buffers.  only used in automatic
X**	variable declarations.  Used with fgets for buffer size when reading
X**	file records, to hold pathnames, commands, etc.  Reduce if you blow
X**	out stack storage.  If reduced too far, may eventually show up
X**	as syntax errors on interacting with vns_ routines, or command line
X**	botches.
X*/
X#define RECLEN 1200
X
X/* block sizes for allocation routines */
X#define STRBLKSIZE 1800	/* string storage allocation block */
X#define NDBLKSIZE 50	/* NODE structures to allocate at a time */
X
X/*
X** maximum number of articles to allow for processing in a single user
X** list.  Used only to declare an array of pointers on the stack, so it
X** can be fair sized without much problem.  In practicality, there is
X** no use for it being larger than the greatest line length available
X** on the CRT's being used.
X*/
X#define MAXARTLIST 200
X
X#ifdef amiga
X#undef putchar
X#define putchar ttputc
X#endif
X
END_OF_FILE
if test 2258 -ne `wc -c <'tune.h'`; then
    echo shar: \"'tune.h'\" unpacked with wrong size!
fi
# end of 'tune.h'
fi
if test -f 'updact.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'updact.c'\"
else
echo shar: Extracting \"'updact.c'\" \(2824 characters\)
sed "s/^X//" >'updact.c' <<'END_OF_FILE'
X/*--------------------------------------------------------------------- */
X/* updact.c								*/
X/*	Reads in "news:active" and for each news group finds the last   */
X/*	article. Writes out the updated active file			*/
X/*									*/
X/* History:								*/
X/*	2 Nov 1990	v1.0    Unreleased 				*/
X/*     23 Nov 1990	v2.0	Unreleased				*/
X/*     17 Feb 1991	v2.1	          				*/
X/*									*/
X/* TODO:								*/
X/*									*/
X/*	Make the logic quicker 						*/
X/*									*/
X/* Author:								*/
X/*	Michael Taylor 							*/
X/*	Canberra, AUSTRALIA						*/
X/*--------------------------------------------------------------------- */
X
X#include <stdio.h>
X#include <stdlib.h>
X#include <string.h>
X#include <sys/types.h>
X#ifdef DICE
X#include "stat.h"
X#else
X#include <sys/stat.h>
X#endif
X#ifdef DICE
Xtypedef unsigned char uchar;
X#endif
X
Xstatic uchar	line[257];
X#define MAXGRPS 100
Xstatic uchar    act_lines[MAXGRPS][257];
X
X#define MAXSKIP 1000
X
Xmain (argc, argv)
Xint	argc;
Xuchar	*argv[];
X{
X	FILE	*active;
X	uchar	*p, fname[80], newsdir[256], artfile[80], *q;
X	long    article, art2;
X	int     i, j, limit, fin, found;
X	struct stat	statbuf;
X	
X	active = fopen ("news:active", "rt");
X	if (active == NULL) {
X		fprintf (stderr, "active file not found\n");
X		exit (EXIT_FAILURE);
X	}
X
X	i = 0;
X	while (fgets (line, 80, active) != NULL) {
X		if (sscanf (line, "%s %s", newsdir, fname) != 2)
X			break; /* syntax error on line */
X
X		for (q = newsdir; *q != '\0'; ++q)
X			if (*q == '.')
X				*q = '/';
X
X		found = 1;
X		for (article = atol(fname), limit = MAXSKIP;; ++article) {
X			strcpy (artfile, "news:");
X			strcat (artfile, newsdir);
X			strcat (artfile, "/");
X			strcat (artfile, ltoa (article, fname, 10));
X
X			fin = stat (artfile, &statbuf);
X			if (fin == -1) {
X				for (art2 = article + 1, j = 0;;
X				     ++art2, ++j) {
X					strcpy (artfile, "news:");
X					strcat (artfile, newsdir);
X					strcat (artfile, "/");
X					strcat (artfile,
X						ltoa (art2, fname, 10));
X
X					fin = stat (artfile, &statbuf);
X					if (fin != -1) {
X						article = art2;
X						break;
X					} else
X						if (j >= limit)
X							break;
X				}
X				if (art2 != article)
X					break;
X
X				found = 0;
X			} else {
X				limit = 25; /* reset limit for missing art's */
X				found = 0;
X			}
X		}
X		sscanf (line, "%s", newsdir);
X		strcpy (act_lines[i], newsdir);
X		strcat (act_lines[i], " ");
X		strcat (act_lines[i], ltoa (article-1+found, fname, 10));
X		++i;
X		if (i >= MAXGRPS) {
X			fprintf (stderr,
X				"Maximum number of groups read: %d \n",
X				MAXGRPS);
X			break;
X		}
X	}
X
X	act_lines[i][0] = ' ';
X	fclose (active);
X	active = fopen ("news:active", "wt");
X	if (active == NULL) {
X		fprintf (stderr, "could not open active file\n");
X		exit (EXIT_FAILURE);
X	}
X	for (i = 0; act_lines[i][0] != ' '; ++i)
X		fprintf (active, "%s\n", act_lines[i]);
X	fclose (active);
X	exit (EXIT_SUCCESS);
X}
END_OF_FILE
if test 2824 -ne `wc -c <'updact.c'`; then
    echo shar: \"'updact.c'\" unpacked with wrong size!
fi
# end of 'updact.c'
fi
if test -f 'userlist.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'userlist.c'\"
else
echo shar: Extracting \"'userlist.c'\" \(2262 characters\)
sed "s/^X//" >'userlist.c' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** userlist.c - generate user's list of articles
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X
X#include <stdio.h>
X#include "tune.h"
X#include "node.h"
X#include "page.h"
X#include "vn.h"
X
Xextern PAGE Page;
Xextern char *List_sep;
X
X#ifndef	MINIX
Xstatic char Pattern[MAX_C] = "";
X#else
X/* Minix, in its C compiler wisdom(?), only defines 1 word for the above */
Xstatic char Pattern[MAX_C] = {0};
X#endif
X
X/*
X	generate user list of articles - either article numbers
X	are input directly (numeric list), or input is a search
X	string - invoke regular expression library and examine titles
X	search string "*" reserved for marked articles.  Strings may
X	be prefixed with '!' for negation.
X*/
Xuserlist (list)
Xchar *list;
X{
X	int i,j,anum[RECLEN/2],acount;
X	char neg, *s, sbuf[MAX_C+1], *reg, *regex(), *regcmp(), *index(), *strtok();
X
X	user_str (sbuf,"Articles or title search string : ",1,Pattern);
X	if (sbuf[0] == '!')
X	{
X		neg = '!';
X		s = sbuf+1;
X	}
X	else
X	{
X		neg = '\0';
X		s = sbuf;
X	}
X	for (i=0; s[i] != '\0'; ++i)
X	{
X		if (index(List_sep,s[i]) == NULL)
X		{
X			if (s[i] < '0' || s[i] > '9')
X				break;
X		}
X	}
X	acount = 0;
X
X	if (s[i] == '\0')
X	{
X		for (s = strtok(s,List_sep); s != NULL; s = strtok(NULL,List_sep))
X		{
X			anum[acount] = atoi(s);
X			++acount;
X		}
X	}
X	else
X	{
X		/* we save old input only if NOT a list of article numbers */
X		strcpy(Pattern,sbuf);
X		if (s[0] == ART_MARK)
X		{
X			for (i=0; i < Page.h.artnum; ++i)
X			{
X				if (Page.b[i].art_mark != ' ')
X				{
X					anum[acount] = Page.b[i].art_id;
X					++acount;
X				}
X			}
X		}
X		else
X		{
X			reg = regcmp(s,(char *) 0);
X			if (reg != NULL)
X			{
X				for (i=0; i < Page.h.artnum; ++i)
X				{
X					if (regex(reg,Page.b[i].art_t) != NULL)
X					{
X						anum[acount] = Page.b[i].art_id;
X						++acount;
X					}
X				}
X				regfree (reg);
X			}
X			else
X				preinfo ("bad regular expression syntax");
X		}
X	}
X
X	/* algorithm is inefficient, but we're only handling a few numbers */
X	*list = '\0';
X	for (i=0; i < Page.h.artnum; ++i)
X	{
X		for (j=0; j < acount && anum[j] != Page.b[i].art_id; ++j)
X			;
X		if (neg == '!')
X		{
X			if (j < acount)
X				continue;
X		}
X		else
X		{
X			if (j >= acount)
X				continue;
X		}
X		sprintf (list,"%d ",Page.b[i].art_id);
X		list += strlen(list);
X	}
X}
END_OF_FILE
if test 2262 -ne `wc -c <'userlist.c'`; then
    echo shar: \"'userlist.c'\" unpacked with wrong size!
fi
# end of 'userlist.c'
fi
if test -f 'vn.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'vn.h'\"
else
echo shar: Extracting \"'vn.h'\" \(1423 characters\)
sed "s/^X//" >'vn.h' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** vn.h - general parameters
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X
X#define TRUE 1
X#define FALSE 0
X
X#define ED_MARK '>'
X#define ART_MARK '*'
X#define ART_WRITTEN '_'
X#define ART_UNWRITTEN ' '
X
X
X#define ANFLINES 1
X#define UDKFORM "undefined key - %c for help"
X#define HELPFORM "%c for help"
X
X/*
X	command characters - don't use numerics or <ESC>
X	ALTSAVE is a hack to avoid having to use ctl-s - XON/XOFF.
X	Wanted to preserve "s" pneumonic and lower / control /cap
X	convention.
X*/
X#define DIGEST 'd'
X#define UP 'k'
X#define DOWN 'j'
X#define FORWARD '\012'
X#define BACK '\010'
X#define GRPFORWARD '>'
X#define GRPBACK '<'
X#define READ 'r'
X#define ALTREAD ' '
X#define READALL 'R'
X#define READSTRING '\022'
X#define SAVE 's'
X#define SAVEALL 'S'
X#define SAVESTRING '\023'
X#define ALTSAVE '\024'
X#define PRINT 'p'
X#define PRINTALL 'P'
X#define PRINTSTRING '\020'
X#define MARK 'x'
X#define UNMARK 'X'
X#define MARKSTRING '\030'
X#define REDRAW '\014'
X#define QUIT 'q'
X#define SSTAT '#'
X#define GRPLIST '%'
X#define ORGGRP 'o'
X#define ORGSTAT 'O'
X#define UPDATE 'w'
X#define UNSUBSCRIBE 'u'
X#define UPALL 'W'
X#define UPSEEN '\027'
X#define UNESC '!'
X#define NEWGROUP 'n'
X#define HEADTOG 'h'
X#define SETROT 'z'
X#define HELP '?'
X#define TOPMOVE 'H'
X#define BOTMOVE 'L'
X#define ALTBOTTOM 'G'
X#define MIDMOVE 'M'
X#define PRTVERSION '"'
X
X#ifdef amiga
X#undef putchar
X#define putchar ttputc
X#endif
X
END_OF_FILE
if test 1423 -ne `wc -c <'vn.h'`; then
    echo shar: \"'vn.h'\" unpacked with wrong size!
fi
# end of 'vn.h'
fi
if test -f 'vnglob.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'vnglob.c'\"
else
echo shar: Extracting \"'vnglob.c'\" \(1600 characters\)
sed "s/^X//" >'vnglob.c' <<'END_OF_FILE'
X/*
X** vn news reader.
X**
X** vnglob.c - global variables - see string.c also
X**
X** see copyright disclaimer / history in vn.c source file
X*/
X
X#include <stdio.h>
X#include "config.h"
X#include "head.h"
X#include "tune.h"
X#include "node.h"
X#include "page.h"
X
X/*
X	global data structure
X*/
XNODE **Newsorder = NULL;	/* in order of fw_group calls */
X
Xchar *Editor, *Ps1, *Printer;
X
Xint (*Massage)() = NULL;
Xint (*Postfunc)() = NULL;
Xint (*Mailfunc)() = NULL;
Xchar (*Marker)() = NULL;
Xint (*Hookfunc)() = NULL;
Xchar *(*Hookhelp)() = NULL;
XFILE *(*Saveopen)() = NULL;
Xint (*Digsaver)() = NULL;
X
Xchar Erasekey, Killkey;		/* user keys from stty */
Xchar *Orgdir;			/* .newsrc file, and original pwd */
Xchar *Savefile = DEF_SAVE;	/* file in which to save articles */
Xchar *Savedir;			/* default directory for saved articles */
Xchar *Ccfile;			/* author_copy file, stored /bin/mail fmt */
Xchar *Home;			/* user's home */
X
Xint Rot;	/* rotation */
Xint Headflag;	/* header printing flag */
Xint Digest;	/* if non-zero, digest article */
Xint More;	/* if non-zero, clear screen between each page.  Set by */
X		/* user's MORE environment variable; if `-c', then set true */
X
Xchar *Ku, *Kd, *Kl, *Kr;	/* Cursor movement capabilities */
X
X/* character translation arrays for commands */
Xchar Cxitop[CHMASK+1], Cxitor[CHMASK+1], Cxrtoi[CHMASK+1], Cxptoi[CHMASK+1];
X
X/*
X	cur_page - current page displayed;
X	lrec - last record
X	l_allow - lines allowed for article display
X	c_allow - columns allowed
X	ncount = newsorder index
X*/
Xint Cur_page, Lrec, L_allow, C_allow, Ncount;
X
Xint Nounsub, Listfirst;
X/*
X	current page
X*/
XPAGE Page;
END_OF_FILE
if test 1600 -ne `wc -c <'vnglob.c'`; then
    echo shar: \"'vnglob.c'\" unpacked with wrong size!
fi
# end of 'vnglob.c'
fi
echo shar: End of archive 1 \(of 6\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 4 5 6 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 6 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
-- 
Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
Mail comments to the moderator at <amiga-request@uunet.uu.net>.
Post requests for sources, and general discussion to comp.sys.amiga.misc.