[comp.sources.amiga] v90i180: UUCP 1.06D - UNIX compatible uucp/news/mail system, Part02/12

Amiga-Request@cs.odu.edu (Amiga Sources/Binaries Moderator) (06/28/90)

Submitted-by: Matt Dillon <@uunet.uu.net:overload!dillon>
Posting-number: Volume 90, Issue 180
Archive-name: unix/uucp-1.06d/part02

#!/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 2 (of 12)."
# Contents:  uucp2/src/README uucp2/src/anews/sendpacket.c
#   uucp2/src/dmail/DMakefile uucp2/src/dmail/DMakefile.dcc
#   uucp2/src/dmail/cond.c uucp2/src/dmail/dmkhelp.c
#   uucp2/src/dmail/globals.c uucp2/src/getty/passwd.c
#   uucp2/src/include/dnews_protos.h uucp2/src/include/ndir.h
#   uucp2/src/include/news.h uucp2/src/lib/DMakefile
#   uucp2/src/lib/DMakefile.dcc uucp2/src/lib/getfiles.c
#   uucp2/src/lib/getpwnam.c uucp2/src/lib/log.c
#   uucp2/src/sendmail/parse.c uucp2/src/unix/DMakefile
#   uucp2/src/unix/DMakefile.dcc uucp2/src/unix/uuencode.c
#   uucp2/src/util/man.c uucp2/src/util/trimfile.c
#   uucp2/src/util/trimnews.c uucp2/src/uucico/DMakefile
#   uucp2/src/uucico/DMakefile.dcc uucp2/src/uucico/gio.notes
#   uucp2/src/uucico/sysdep.h uucp2/src/uucico/time.c
#   uucp2/src/uucico/uucp.h uucp2/src/uucico/uupoll.c
#   uucp2/src/uuser/misc.c
# Wrapped by tadguy@xanth on Thu Jun 28 08:21:14 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'uucp2/src/README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/README'\"
else
echo shar: Extracting \"'uucp2/src/README'\" \(1374 characters\)
sed "s/^X//" >'uucp2/src/README' <<'END_OF_FILE'
X
X    To compile:
X
X    * You must have Lattice C 5.02 or greater (you might have to get rid
X      of the -cq option if you have <5.03.99),	OR
X
X    * If you have DICE, all files will compile under DICE.  DNews, in fact,
X      currently only has a DMakefile for DICE.
X
X    * Does not compile under Aztec yet.
X
X    * The dmake executable is required (should be in UUCP:C)
X
X    * Object directories:  (I normally put these on a different
X      partition on my HD).  Holds .O files and symbol table.
X
X		    (Lattice)
X
X    Assign LTMP: <some-place-to-hold-objs>
X
X    MakeDir LTMP:uucp
X    MakeDir LTMP:uucp/lib
X    MakeDir LTMP:uucp/anews
X    MakeDir LTMP:uucp/dnews
X    MakeDir LTMP:uucp/dmail
X
X		    (DICE)
X
X    Assign DTMP: <some-place-to-hold-objs>
X
X    MakeDir DTMP:uucp
X    MakeDir DTMP:uucp/lib
X    MakeDir DTMP:uucp/anews
X    MakeDir DTMP:uucp/dnews
X    MakeDir DTMP:uucp/dmail
X
X
X    * WARNING 1.4 beta testers:  you must use the 1.3 C:List command,
X      at least as of 1.4B2 List LFORMAT does not work.
X
X    * Make the whole shebang with the 'mkall' script in this directory,
X      or make individual directories manually by CDing into them and
X      running 'dmake'.  If the latter course is chosen be sure the
X      link library 'lib' is made first.
X
X    Warning:	I have no source to the 'Tar' executable in uucp:c,
X		be sure not to delete the executable accidently.
X
X
END_OF_FILE
if test 1374 -ne `wc -c <'uucp2/src/README'`; then
    echo shar: \"'uucp2/src/README'\" unpacked with wrong size!
fi
# end of 'uucp2/src/README'
fi
if test -f 'uucp2/src/anews/sendpacket.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/anews/sendpacket.c'\"
else
echo shar: Extracting \"'uucp2/src/anews/sendpacket.c'\" \(1959 characters\)
sed "s/^X//" >'uucp2/src/anews/sendpacket.c' <<'END_OF_FILE'
X/*
X * Sendpacket.c
X *
X * An invaluable addition to your Amiga.lib file. This code sends a packet the
X * given message port. This makes working around DOS lots easier.
X *
X * Note, I didn't write this, those wonderful folks at CBM did. I do suggest
X * however that you may wish to add it to Amiga.Lib, to do so, compile it and
X * say 'oml lib:amiga.lib -r sendpacket.o'
X */
X
X#include <exec/types.h>
X#include <exec/ports.h>
X#include <exec/memory.h>
X#include <libraries/dos.h>
X#include <libraries/dosextens.h>
X#include <protos.h>
X
X/*
X * Function - SendPacket written by Phil Lindsay, Carolyn Scheppner, and Andy
X * Finkel. This function will send a packet of the given type to the Message
X * Port supplied.
X */
X
Xlong
XSendPacket(pid, action, args, nargs)
Xstruct MsgPort	*pid;	/* process indentifier ... (handler's message port ) */
Xlong		action, /* packet type ... (what you want handler to do )   */
X		args[], /* a pointer to an argument list */
X		nargs;	/* number of arguments in list	*/
X{
X	struct MsgPort *replyport;
X	struct StandardPacket *packet;
X	long count, *pargs, res1;
X
X	replyport = CreatePort(NULL, 0L);
X	if (!replyport)
X		return (0);
X
X	/* Allocate space for a packet, make it public and clear it */
X	packet = (struct StandardPacket *)
X		AllocMem((long) sizeof(struct StandardPacket),
X			MEMF_PUBLIC | MEMF_CLEAR);
X	if (!packet) {
X		DeletePort(replyport);
X		return (0);
X	}
X	packet->sp_Msg.mn_Node.ln_Name = (char *) &(packet->sp_Pkt);
X	packet->sp_Pkt.dp_Link = &(packet->sp_Msg);
X	packet->sp_Pkt.dp_Port = replyport;
X	packet->sp_Pkt.dp_Type = action;
X
X	/* copy the args into the packet */
X	pargs = &(packet->sp_Pkt.dp_Arg1);      /* address of first argument */
X	for (count = 0; count < nargs; count++)
X		pargs[count] = args[count];
X
X	PutMsg(pid, packet);    /* send packet */
X
X	WaitPort(replyport);
X	GetMsg(replyport);
X
X	res1 = packet->sp_Pkt.dp_Res1;
X
X	FreeMem(packet, (long) sizeof(struct StandardPacket));
X	DeletePort(replyport);
X
X	return (res1);
X}
END_OF_FILE
if test 1959 -ne `wc -c <'uucp2/src/anews/sendpacket.c'`; then
    echo shar: \"'uucp2/src/anews/sendpacket.c'\" unpacked with wrong size!
fi
# end of 'uucp2/src/anews/sendpacket.c'
fi
if test -f 'uucp2/src/dmail/DMakefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/dmail/DMakefile'\"
else
echo shar: Extracting \"'uucp2/src/dmail/DMakefile'\" \(1713 characters\)
sed "s/^X//" >'uucp2/src/dmail/DMakefile' <<'END_OF_FILE'
X
X#
X#   $Header: Beta:src/uucp/src/dmail/RCS/DMakefile,v 1.1 90/02/02 12:03:27 dillon Exp Locker: dillon $
X#
X#   Written by Matthew Dillon
X#
X#   (C)Copyright 1986-89 by Matthew Dillon
X#
X#   This code is completely original.  I declare this code to be public
X#   domain.  You may redistribute this code as long as any those
X#	redistributions contain this and all other files in their entirety.
X#
X#	Ports: Anybody may port this code to any machine or OS they wish, of
X#	course.  If you do make a port, I would be grateful if you mailed
X#	a letter with: (A) OS you ported it too, and (B) version ported,
X#	so I may inform people who have mailed me wondering about ports
X#	who to contact.
X#
X#   Send bug reports and other gripes to:
X#
X#   dillon@ucbvax.berkeley.edu	       ARPA NET
X#   ..!ihnp4!ucbvax!dillon	       USENET
X#
X#   INSTRUCTIONS FOR COMPILING:
X#
X#   (1) Set DESTDIR & HELP_DIR to some global directory accessable to
X#	everybody (or whatever).  Also set HELP_CHMOD and PROG_CHMOD
X#	to the right thing if you don't like the defaults.
X#
X#   (2) Do ONE of the following:
X#	make		-defaults to internal help file
X#	make external	-external help file (executable is smaller)
X#
X#   (3) make install to install the file(s)
X#
X
XOD= ltmp:uucp/dmail/
XEXE= uucp:c/dmail
XSYMS= uucp:src/lib/all.m
XCFLAGS= -iuucp:src/include/
X
XLIBS=	ltmp:uucp/lib/uucp.lib lib:lc.lib lib:amiga.lib
X
XSRCS=	globals.c main.c do_lists.c sub.c execom.c commands.c \
X	range.c load_mail.c sendmail.c set.c help.c cond.c compat.c
X
XOBJS=	$(SRCS:"*.c":"$(OD)*.o")
X
X$(EXE): $(OBJS)
X	cd $(OD)
X	list #?.o TO T:DMAILOBJS LFORMAT %s
X	blink lib:c.o WITH T:DMAILOBJS LIB $(LIBS) TO %(left)
X	cd
X
X$(OBJS) : $(SRCS)
X	lc $(CFLAGS) -H$(SYMS) -o%(left) %(right)
X
END_OF_FILE
if test 1713 -ne `wc -c <'uucp2/src/dmail/DMakefile'`; then
    echo shar: \"'uucp2/src/dmail/DMakefile'\" unpacked with wrong size!
fi
# end of 'uucp2/src/dmail/DMakefile'
fi
if test -f 'uucp2/src/dmail/DMakefile.dcc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/dmail/DMakefile.dcc'\"
else
echo shar: Extracting \"'uucp2/src/dmail/DMakefile.dcc'\" \(1453 characters\)
sed "s/^X//" >'uucp2/src/dmail/DMakefile.dcc' <<'END_OF_FILE'
X
X#
X#   $Header: Beta:src/uucp/src/dmail/RCS/DMakefile,v 1.1 90/02/02 12:03:27 dillon Exp Locker: dillon $
X#
X#   Written by Matthew Dillon
X#
X#   (C)Copyright 1986-89 by Matthew Dillon
X#
X#   This code is completely original.  I declare this code to be public
X#   domain.  You may redistribute this code as long as any those
X#	redistributions contain this and all other files in their entirety.
X#
X#	Ports: Anybody may port this code to any machine or OS they wish, of
X#	course.  If you do make a port, I would be grateful if you mailed
X#	a letter with: (A) OS you ported it too, and (B) version ported,
X#	so I may inform people who have mailed me wondering about ports
X#	who to contact.
X#
X#   Send bug reports and other gripes to:
X#
X#   dillon@ucbvax.berkeley.edu	       ARPA NET
X#   ..!ihnp4!ucbvax!dillon	       USENET
X#
X#   INSTRUCTIONS FOR COMPILING:
X#
X#   (1) Set DESTDIR & HELP_DIR to some global directory accessable to
X#	everybody (or whatever).  Also set HELP_CHMOD and PROG_CHMOD
X#	to the right thing if you don't like the defaults.
X
XOD= dtmp:uucp/dmail/
XEXE= uucp:c/dmail
XCFLAGS= -I uucp:src/include/
X
XLIBS=	dtmp:uucp/lib/uucp.lib
X
XSRCS=	globals.c main.c do_lists.c sub.c execom.c commands.c \
X	range.c load_mail.c sendmail.c set.c help.c cond.c compat.c
X
XOBJS=	$(SRCS:"*.c":"$(OD)*.o")
XLOBJS=	$(SRCS:"*.c":"*.o")
X
X$(EXE): $(OBJS)
X	cd $(OD)
X	dcc $(LOBJS) $(LIBS) -o %(left) -s -r
X	cd
X
X$(OBJS) : $(SRCS)
X	dcc $(CFLAGS) %(right) -o %(left) -c -r
X
END_OF_FILE
if test 1453 -ne `wc -c <'uucp2/src/dmail/DMakefile.dcc'`; then
    echo shar: \"'uucp2/src/dmail/DMakefile.dcc'\" unpacked with wrong size!
fi
# end of 'uucp2/src/dmail/DMakefile.dcc'
fi
if test -f 'uucp2/src/dmail/cond.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/dmail/cond.c'\"
else
echo shar: Extracting \"'uucp2/src/dmail/cond.c'\" \(1461 characters\)
sed "s/^X//" >'uucp2/src/dmail/cond.c' <<'END_OF_FILE'
X
X/*
X * COND.C
X *
X *  $Header: Beta:src/uucp/src/dmail/RCS/cond.c,v 1.1 90/02/02 12:03:39 dillon Exp Locker: dillon $
X *
X *  (C) Copyright 1985-1990 by Matthew Dillon,  All Rights Reserved.
X *
X * Conditional routines.
X *
X * if [!]variable
X * else
X * endif
X *
X */
X
X#include <stdio.h>
X#include "dmail.h"
X
X#define MAXIF	16
X
Xstatic int Disable_if, Disable_case;
X
Xstatic int If_level;
Xstatic char If_state[MAXIF];
X
Xdo_if()
X{
X    char *str = av[1];
X    int result = 0;
X
X    if (ac != 2) {
X	puts ("if: bad args");
X	return(-1);
X    }
X    if (Disable_if) {
X	++Disable_if;
X	return (1);
X    }
X    if (If_level == MAXIF) {
X	puts ("Too many level's of IF's");
X	return (-1);
X    }
X    if (*str == '!') {
X	++str;
X	result = 1;
X    }
X    if (get_var(LEVEL_SET, str))
X	result = 1 - result;
X    if (!result)
X	++Disable_if;
X    If_state[If_level++] = result;
X    XDisable = Disable_if + Disable_case;
X    return (1);
X}
X
Xdo_else()
X{
X    if (Disable_if > 1)
X	return (1);
X    if (If_level < 1) {
X	puts ("else without if");
X	return (-1);
X    }
X    Disable_if = !(If_state[If_level - 1] = 1 - If_state[If_level - 1]);
X    XDisable = Disable_if + Disable_case;
X    return (1);
X}
X
Xdo_endif()
X{
X    if (Disable_if == 1) {
X	--If_level;
X	Disable_if = 0;
X    } else
X    if (Disable_if > 1) {
X	--Disable_if;
X    } else {
X	if (If_level == 0) {
X	    puts ("endif without if");
X	    return (-1);
X	}
X	--If_level;
X	Disable_if = 0;
X    }
X    XDisable = Disable_if + Disable_case;
X    return (1);
X}
X
X
END_OF_FILE
if test 1461 -ne `wc -c <'uucp2/src/dmail/cond.c'`; then
    echo shar: \"'uucp2/src/dmail/cond.c'\" unpacked with wrong size!
fi
# end of 'uucp2/src/dmail/cond.c'
fi
if test -f 'uucp2/src/dmail/dmkhelp.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/dmail/dmkhelp.c'\"
else
echo shar: Extracting \"'uucp2/src/dmail/dmkhelp.c'\" \(1084 characters\)
sed "s/^X//" >'uucp2/src/dmail/dmkhelp.c' <<'END_OF_FILE'
X
X/*
X * DMKHELP.C
X *
X *  $Header: Beta:src/uucp/src/dmail/RCS/dmkhelp.c,v 1.1 90/02/02 12:04:11 dillon Exp Locker: dillon $
X *
X *  (C) Copyright 1985-1990 by Matthew Dillon,  All Rights Reserved.
X *
X *  Standalone C source.
X *
X *  Takes the file DMAIL.HELP (or that specified), and puts quotes and
X * commas around each line, the output to stdout.  Used by Makefile to
X * place the help file on line (by making it a static array).  See the
X * Makefile.
X *
X */
X
X#include <stdio.h>
X#include <string.h>
X
X#define HELPC "dmail.help"
X
Xstatic char buf[1024];
X
Xmain(argc, argv)
Xchar *argv[];
X{
X    FILE *fi;
X    char *ptr;
X    int len;
X    register int i;
X
X    if (argc == 1)
X	fi = fopen (HELPC, "r");
X    else
X	fi = fopen (argv[1], "r");
X    if (fi == NULL) {
X	puts ("CANNOT OPEN");
X	exit (1);
X    }
X    while (fgets (buf, 1024, fi)) {
X	len = strlen(buf) - 1;
X	buf[len] = '\0';
X	putchar ('\"');
X	for (i = 0; i < len; ++i) {
X	    if (buf[i] == '\"') {
X		putchar ('\\');
X		putchar ('\"');
X	    } else {
X		putchar (buf[i]);
X	    }
X	}
X	puts ("\",");
X    }
X    puts ("NULL");
X    fclose (fi);
X}
X
X
END_OF_FILE
if test 1084 -ne `wc -c <'uucp2/src/dmail/dmkhelp.c'`; then
    echo shar: \"'uucp2/src/dmail/dmkhelp.c'\" unpacked with wrong size!
fi
# end of 'uucp2/src/dmail/dmkhelp.c'
fi
if test -f 'uucp2/src/dmail/globals.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/dmail/globals.c'\"
else
echo shar: Extracting \"'uucp2/src/dmail/globals.c'\" \(2012 characters\)
sed "s/^X//" >'uucp2/src/dmail/globals.c' <<'END_OF_FILE'
X
X/*
X * GLOBALS.C
X *
X *  $Header: Beta:src/uucp/src/dmail/RCS/globals.c,v 1.1 90/02/02 12:04:02 dillon Exp Locker: dillon $
X *
X *  (C) Copyright 1985-1990 by Matthew Dillon,  All Rights Reserved.
X *
X *  Declarations for most global variables.
X *
X */
X
X#include <stdio.h>
X#include "dmail.h"
X
XFILE *m_fi;			    /* open file ptr to spool file  */
Xchar *mail_file;		    /* name of from (spool) file    */
Xchar *output_file;		    /* name of out file (i.e. mbox) */
Xchar *user_name;		    /* user name from password entry*/
Xchar *home_dir; 		    /* home directory of user	    */
Xchar *visual;			    /* visual editor path	    */
Xchar Buf[MAXFIELDSIZE]; 	    /* Scratch Buffer		    */
Xchar Puf[MAXFIELDSIZE]; 	    /* Another Scratch Buffer	    */
Xjmp_buf env[LONGSTACK]; 	    /* Holds longjump (break) stack */
Xint  Did_cd;			    /* Set if user does a CD	    */
Xint  XDebug;			    /* Debug mode		    */
Xint  Longstack, Breakstack;	    /* longjump/break level stack   */
Xint  Entries, Current;		    /* #Entries and Current entry   */
Xint  XDisable;			    /* Disable non-cond comm exec.  */
Xint  ac;			    /* internal argc, from/to stat  */
Xint  No_load_mail;		    /* disable loading of mail	    */
Xint  lmessage_overide;		    /* Overide initial 'X items ... */
Xint  Silence;			    /* -s command option status     */
Xint  SelAll = 1;		    /* last select was sel all	    */
Xstruct ENTRY *Entry;		    /* Base of Entry list	    */
Xchar *av[128];			    /* internal argv[]		    */
Xchar *Nulav[3] = { "", "", NULL };
X
Xint width[MAXLIST]  = { 18, 38, 10 };	/* Default setlist params	*/
Xint header[MAXLIST] = {  0,  2,  1 };
Xint Listsize = 3;
X
X/* The following are globals variables definable from the 'set' command */
X
Xchar  *S_sendmail;		    /* sendmail program path	    */
Xint   S_page;			    /* Paging status		    */
Xint   S_novibreak;		    /* vi-break status		    */
Xint   S_verbose;		    /* sendmail verbose status	    */
Xint   S_ask;			    /* Ask what to do after mail ed */
Xint   S_archive;		    /* Archive sent mail	    */
X
END_OF_FILE
if test 2012 -ne `wc -c <'uucp2/src/dmail/globals.c'`; then
    echo shar: \"'uucp2/src/dmail/globals.c'\" unpacked with wrong size!
fi
# end of 'uucp2/src/dmail/globals.c'
fi
if test -f 'uucp2/src/getty/passwd.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/getty/passwd.c'\"
else
echo shar: Extracting \"'uucp2/src/getty/passwd.c'\" \(1795 characters\)
sed "s/^X//" >'uucp2/src/getty/passwd.c' <<'END_OF_FILE'
X
X/*
X *  PASSWD.C
X *
X *  $Header: Beta:src/uucp/src/getty/RCS/passwd.c,v 1.1 90/02/02 12:13:35 dillon Exp Locker: dillon $
X *
X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
X *
X */
X
X#include <exec/types.h>
X#include <libraries/dosextens.h>
X#include <stdio.h>
X#include <stdlib.h>
X#include <pwd.h>
X#include "protos.h"
X
X#include "log.h"
X
X#define BTOCP(bp,type)  ((type)((long)bp << 2))
X
Xextern long NullFH;
Xextern char LoginBuf[];
Xextern char PasswdBuf[];
Xextern char *DeviceName;
Xextern long DeviceUnit;
X
Xstatic struct passwd *Pas;
X
XCheckLoginAndPassword()
X{
X    Pas = getpwnam(LoginBuf);
X
X    if (Pas == NULL)
X	return(0);
X    if (strcmp(Pas->pw_passwd, "*") == 0)
X	return(1);
X    if (strcmp(PasswdBuf, Pas->pw_passwd) == 0)
X	return(1);
X    return(0);
X}
X
Xvoid
XRunPasswdEntry()
X{
X    static char buf[256];
X    static char redir[128];
X    char *arg0 = Pas->pw_shell_arg0;
X    struct Process *proc = (struct Process *)FindTask(NULL);
X    APTR oldConsoleTask = proc->pr_ConsoleTask;
X    BPTR oldDir;
X    BPTR DirLock;
X
X    strcpy(redir, " ");
X
X    if (*arg0 == '*') {
X	++arg0;
X	sprintf(redir, " >UUSER:%s/%d/R300000G1 <UUSER:%s/%d/R300000G1 ", DeviceName, DeviceUnit, DeviceName, DeviceUnit);
X    } else {
X	if (LogToStdout == 0)
X	    strcpy(redir, " >null: <null: ");
X    }
X    if (LogToStdout == 0)
X	proc->pr_ConsoleTask = (APTR)BTOCP(NullFH, struct FileHandle *)->fh_Port;
X
X    sprintf(buf, "%s%s%s -Getty -DEVICE %s -UNIT %d", arg0, redir, Pas->pw_shell_argn, DeviceName, DeviceUnit);
X
X    DirLock = (BPTR)Lock(Pas->pw_dir, SHARED_LOCK);
X    if (DirLock)
X	oldDir = (BPTR)CurrentDir(DirLock);
X
X    ulog(1, "Execute %s\n", buf);
X
X    Execute(buf, NullFH, NullFH);
X
X    proc->pr_ConsoleTask = oldConsoleTask;
X
X    if (DirLock)
X	UnLock(CurrentDir(oldDir));
X
X    ulog(1, "ran\n");
X}
X
END_OF_FILE
if test 1795 -ne `wc -c <'uucp2/src/getty/passwd.c'`; then
    echo shar: \"'uucp2/src/getty/passwd.c'\" unpacked with wrong size!
fi
# end of 'uucp2/src/getty/passwd.c'
fi
if test -f 'uucp2/src/include/dnews_protos.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/include/dnews_protos.h'\"
else
echo shar: Extracting \"'uucp2/src/include/dnews_protos.h'\" \(1838 characters\)
sed "s/^X//" >'uucp2/src/include/dnews_protos.h' <<'END_OF_FILE'
X
X/* MACHINE GENERATED */
X
X
X/* main.c               */
X
XPrototype char *FileForArticle(NGroup *, int);
X
X/* group.c              */
X
XPrototype void LoadGroups(char *);
XPrototype void UnloadGroups(char *);
XPrototype void CreateNewsrc(char *);
XPrototype void RangeAdd(Range **, short, short);
XPrototype void RangeDel(Range **, short, short);
XPrototype int  NextInRange(Range *, short);
XPrototype int  NextNotInRange(Range *, short);
XPrototype void ClearGroupCache(NGroup *);
XPrototype FNode **FindFNCache(FNode **, long);
XPrototype void AddFNCache(FNode **, long, char *);
X
X/* display.c            */
X
XPrototype int getyn(char *);
XPrototype void *OpenBrowseDisplay(char *, char *, short);
XPrototype void CloseBrowseDisplay(void *);
XPrototype void ChangeBrowseDisplay(void *, char *, char *);
XPrototype int WaitBrowseEvent(void **, int *, int *);
XPrototype void	LoadDisplayConfig(void);
XPrototype void	SaveDisplayConfig(void);
X
X/* subs.c               */
X
XPrototype void FindUser(char *, int);
XPrototype void ScanNewsDirs(void (*)(), long);
XPrototype char *FindField(FILE *, char *);
XPrototype int  FileExists(char *);
X
X/* filereq.c            */
X
XPrototype char *GetFileName(int);
X
X/* edit.c               */
X
XPrototype void ReplyArticle(short, NGroup *);
XPrototype void FollowUpArticle(short, NGroup *);
XPrototype void PostArticle(NGroup *);
X
X/* postnews.c           */
X
XPrototype void PostNews(FILE *, char *);
X
X/* refs.c               */
X
XPrototype void AddKillFile(char *, int);
XPrototype void RemKillFile(char *);
XPrototype void LoadKillFile(char *);
XPrototype void SaveKillFile(char *);
XPrototype char *ReferenceLineOf(NGroup *, int);
XPrototype char *NewsMessageIdOf(NGroup *, int);
XPrototype int FindArticleReferencing(NGroup *, char *, int);
XPrototype int ArticleRefNotKilled(NGroup *, char *, int);
XPrototype char *NextRef(char **);
END_OF_FILE
if test 1838 -ne `wc -c <'uucp2/src/include/dnews_protos.h'`; then
    echo shar: \"'uucp2/src/include/dnews_protos.h'\" unpacked with wrong size!
fi
# end of 'uucp2/src/include/dnews_protos.h'
fi
if test -f 'uucp2/src/include/ndir.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/include/ndir.h'\"
else
echo shar: Extracting \"'uucp2/src/include/ndir.h'\" \(1133 characters\)
sed "s/^X//" >'uucp2/src/include/ndir.h' <<'END_OF_FILE'
X
X/*
X *  ndir.h -- header file for the ``ndir'' directory routines.
X *
X */
X
X#ifndef _NDIR_H
X#define _NDIR_H
X
X#ifndef LIBRARIES_DOS_H
X#include <libraries/dos.h>
X#endif
X
X#ifndef DEV_BSIZE
X#define DEV_BSIZE     512
X#endif
X
X#define DIRBLKSIZ	DEV_BSIZE
X#define MAXNAMLEN	255
X
Xstruct	direct {
X    long    d_ino;		    /* inode number of entry */
X    short   d_reclen;		    /* length of this record */
X    short   d_namlen;		    /* length of string in d_name */
X    char    d_name[MAXNAMLEN + 1];  /* name must be no longer than this */
X};
X
X/*
X * The DIRSIZ macro gives the minimum record length which will hold
X * the directory entry.  This requires the amount of space in struct direct
X * without the d_name field, plus enough space for the name with a
X * terminating null byte (dp->d_namlen+1), rounded up to a 4 byte boundary.
X */
X
X#ifdef DIRSIZ
X#undef DIRSIZ
X#endif /* DIRSIZ */
X
X#define DIRSIZ(dp) \
X    ((sizeof(struct direct) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
X
X/*
X * Definitions for library routines operating on directories.
X */
X
Xtypedef struct _dirdesc {
X    long lock;
X    struct FileInfoBlock fib;
X} DIR;
X
X#endif
X
END_OF_FILE
if test 1133 -ne `wc -c <'uucp2/src/include/ndir.h'`; then
    echo shar: \"'uucp2/src/include/ndir.h'\" unpacked with wrong size!
fi
# end of 'uucp2/src/include/ndir.h'
fi
if test -f 'uucp2/src/include/news.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/include/news.h'\"
else
echo shar: Extracting \"'uucp2/src/include/news.h'\" \(1214 characters\)
sed "s/^X//" >'uucp2/src/include/news.h' <<'END_OF_FILE'
X
X#include <stdlib.h>
X#include <stdio.h>
X#include <string.h>
X#include "version.h"
X
Xextern int NumRows;
Xextern int NumCols;
X
X/* anews.c */
Xextern void initgroups(void);
Xextern char *Get_Env(char *envar, char *def);
Xextern void init(void);
Xextern char *subs(char *newsfile);
Xextern void do_quit(void);
Xextern void do_help(char **pp);
Xextern char *art2file(char *group, char *art);
Xextern int readgroup(char *group);
Xextern void scr_inverse_on(void);
Xextern void scr_inverse_off(void);
Xextern int rawch(void);
X
X/* showart.c */
Xextern void scan_subjects(char *group);
Xextern int showart(char *group, char *article);
X
X/* reply.c */
Xextern struct hdrinfo *openhdr(FILE *fp);
Xextern void closehdr(struct hdrinfo *hdr);
Xextern void reply(int, FILE *, const char *);
X
X/* mscan.c */
Xextern void free_directory(int);
Xextern int scan_directory(char *dir);
Xextern char *first_unread(void);
Xextern int unread_count(void);
Xextern char *goto_article(char *name);
Xextern char *get_next_art(void);
Xextern char *get_prev_art(void);
Xextern void rewind_arts(void);
Xextern void mark_cur_art(int flag);
Xextern void del_cur_art(int flag);
Xextern void hold_cur_art(void);
X
X/* manx.c */
Xextern int raw(FILE *f);
Xextern int cooked(FILE *f);
X
END_OF_FILE
if test 1214 -ne `wc -c <'uucp2/src/include/news.h'`; then
    echo shar: \"'uucp2/src/include/news.h'\" unpacked with wrong size!
fi
# end of 'uucp2/src/include/news.h'
fi
if test -f 'uucp2/src/lib/DMakefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/lib/DMakefile'\"
else
echo shar: Extracting \"'uucp2/src/lib/DMakefile'\" \(1177 characters\)
sed "s/^X//" >'uucp2/src/lib/DMakefile' <<'END_OF_FILE'
X
X#   DMakefile	For Lattice V5.02
X#
X#   $Header: Beta:src/uucp/src/lib/RCS/DMakefile,v 1.1 90/02/02 12:08:16 dillon Exp Locker: dillon $
X#
X#   NOTE: Lattice C users, ignore all the const warnings, they are bugs in
X#	  Lattice's header files.
X
XOD = ltmp:uucp/lib/
XEXE = $(OD)uucp.lib
XSYMS = all.m
XPROTOS= uucp:src/include/lib_protos.h
X
XSRCS = getpwnam.c serialport.c setstdin.c sleep.c validuser.c lsys.c \
X   mntreq.c security.c log.c lockfile.c tmpfile.c seq.c getenv.c \
X   config.c alias.c string.c getfiles.c ndir.c list_sort.c \
X   expand_path.c isdir.c getuser.c
X
XOBJS = $(SRCS:"*.c":"$(OD)*.o")
X
XCFLAGS= -iuucp:src/include/ -cq
X
Xall : $(PROTOS) $(EXE)
X
X$(EXE) : $(SYMS) $(OBJS)
X    list LFORMAT $(OD)%s TO $(OD)list.lst $(OD)#?.o
X    oml %(left) r @$(OD)list.lst
X    filenote %(left) NODIST
X
X$(OBJS) : $(SRCS)
X    lc $(CFLAGS) -H$(SYMS) -o%(left) %(right)
X
X$(SYMS) : syms.c
X    lc $(CFLAGS) -ph -o$(SYMS) syms.c
X    filenote %(left) NODIST
X
X$(PROTOS) : $(SRCS) $(OD)makeproto
X    $(OD)makeproto -o%(left) $(SRCS)
X
X$(OD)makeproto : makeproto.c
X    lc $(CFLAGS) -oram:makeproto.o makeproto.c
X    blink lib:c.o ram:makeproto.o to %(left) lib lib:lc.lib lib:amiga.lib SC SD
X
END_OF_FILE
if test 1177 -ne `wc -c <'uucp2/src/lib/DMakefile'`; then
    echo shar: \"'uucp2/src/lib/DMakefile'\" unpacked with wrong size!
fi
# end of 'uucp2/src/lib/DMakefile'
fi
if test -f 'uucp2/src/lib/DMakefile.dcc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/lib/DMakefile.dcc'\"
else
echo shar: Extracting \"'uucp2/src/lib/DMakefile.dcc'\" \(1266 characters\)
sed "s/^X//" >'uucp2/src/lib/DMakefile.dcc' <<'END_OF_FILE'
X
X#   DMakefile	For Lattice V5.02
X#
X#   $Header: Beta:src/uucp/src/lib/RCS/DMakefile,v 1.1 90/02/02 12:08:16 dillon Exp Locker: dillon $
X#
X#   NOTE: Lattice C users, ignore all the const warnings, they are bugs in
X#	  Lattice's header files.
X
XOD = dtmp:uucp/lib/
XEXE = $(OD)uucp.lib
XPROTOS= uucp:src/include/lib_protos.h
X
XSRC1 = getpwnam.c serialport.c setstdin.c sleep.c validuser.c lsys.c
XSRC2 = mntreq.c security.c log.c lockfile.c tmpfile.c seq.c getenv.c
XSRC3 = config.c alias.c string.c getfiles.c ndir.c list_sort.c
XSRC4 = expand_path.c isdir.c getuser.c
X
XSRCS= $(SRC1) $(SRC2) $(SRC3) $(SRC4)
X
XOBJS = $(SRCS:"*.c":"$(OD)*.o")
X
XLOBJ1= $(SRC1:"*.c":"*.o")
XLOBJ2= $(SRC2:"*.c":"*.o")
XLOBJ3= $(SRC3:"*.c":"*.o")
XLOBJ4= $(SRC4:"*.c":"*.o")
X
XCFLAGS= -I uucp:src/include/
X
Xall : $(PROTOS) $(EXE)
X
X$(EXE) : $(OBJS)
X    cd $(OD)
X    join $(LOBJ1) as ram:j1
X    join $(LOBJ2) as ram:j2
X    join $(LOBJ3) as ram:j3
X    join $(LOBJ4) as ram:j4
X    join ram:j1 ram:j2 ram:j3 ram:j4 as %(left)
X    delete ram:j1 ram:j2 ram:j3 ram:j4
X    cd
X
X$(OBJS) : $(SRCS)
X    dcc $(CFLAGS) -o %(left) %(right) -c -r
X
X$(PROTOS) : $(SRCS) $(OD)makeproto
X    $(OD)makeproto -o%(left) $(SRCS)
X
X$(OD)makeproto : makeproto.c
X    dcc $(CFLAGS) makeproto.c -o %(left)
X    delete T:makeproto.o
X
END_OF_FILE
if test 1266 -ne `wc -c <'uucp2/src/lib/DMakefile.dcc'`; then
    echo shar: \"'uucp2/src/lib/DMakefile.dcc'\" unpacked with wrong size!
fi
# end of 'uucp2/src/lib/DMakefile.dcc'
fi
if test -f 'uucp2/src/lib/getfiles.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/lib/getfiles.c'\"
else
echo shar: Extracting \"'uucp2/src/lib/getfiles.c'\" \(1487 characters\)
sed "s/^X//" >'uucp2/src/lib/getfiles.c' <<'END_OF_FILE'
X
X/*
X *  GETFILES.C
X */
X
X#include <stddef.h>
X#include <stdio.h>
X#include <stdlib.h>
X#include <string.h>
X#include "getfiles.h"
X#include "ndir.h"
X#include "version.h"
X
XIDENT(".01");
X
XPrototype dir_list *getfiles(const char *, int, int (*)(char *), int (*)(dir_list *, dir_list *));
X
Xdir_list *
Xgetfiles(dir, gap, sel, cmp)
Xconst char *dir;
Xint gap;
Xint (*sel)(char *);
Xint (*cmp)(dir_list *, dir_list *);
X{
X    register DIR *dirp;
X    register struct direct *dp;
X    register dir_list *this;
X    dir_list *first = NULL;	/*  assignment avoids warning, not reqd */
X
X    if ((dirp = opendir(dir)) == NULL)
X	return NULL;
X
X    this = (dir_list *)&first;
X    while (dp = readdir(dirp)) {
X	if (sel == NULL || (*sel)(dp->d_name)) {
X	    this->next = malloc(offsetof(dir_list, name)
X				+ gap
X				+ strlen(dp->d_name)
X				+ 1
X			       );
X	    if ((this = this->next) == NULL)
X		break;
X	    strcpy(this->name + gap, dp->d_name);
X	}
X    }
X    this->next = NULL;
X    closedir(dirp);
X
X    if (cmp == NULL)
X	return first;
X    return list_sort(first, (int (*)(void *, void *))cmp);
X}
X
X
X#ifdef TEST
X
Xsel(a)
Xchar *a;
X{
X	while (*a != '\0')
X		if (*a++ == '.' && *a == 'o')
X			return 1;
X	return 0;
X}
X
Xcmp(a, b)
Xdir_list *a, *b;
X{
X	return strcmp(a->name, b->name);
X}
X
Xmain()
X{
X	register dir_list *p, *q;
X
X	p = getfiles("", 0, (void *)NULL, (void *)NULL);
X	while (p)
X		puts(p->name), q = p->next, free(p), p = q;
X
X	p = getfiles("", sel, cmp);
X	while (p)
X		puts(p->name), q = p->next, free(p), p = q;
X}
X
X#endif
X
END_OF_FILE
if test 1487 -ne `wc -c <'uucp2/src/lib/getfiles.c'`; then
    echo shar: \"'uucp2/src/lib/getfiles.c'\" unpacked with wrong size!
fi
# end of 'uucp2/src/lib/getfiles.c'
fi
if test -f 'uucp2/src/lib/getpwnam.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/lib/getpwnam.c'\"
else
echo shar: Extracting \"'uucp2/src/lib/getpwnam.c'\" \(2071 characters\)
sed "s/^X//" >'uucp2/src/lib/getpwnam.c' <<'END_OF_FILE'
X
X/*
X *  GETPWNAM.C
X *
X *  $Header: Beta:src/uucp/src/lib/RCS/getpwnam.c,v 1.1 90/02/02 12:08:26 dillon Exp Locker: dillon $
X *
X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
X *
X *  (UUCP source support)
X */
X
X#include <stdio.h>
X#include <stdlib.h>
X#include <pwd.h>
X#include "config.h"
X
XPrototype struct passwd *getpwnam(const char *);
X
XLocal char *Breakout(char **);
X
Xchar *PasswdFile;
X
Xstruct passwd *
Xgetpwnam(name)
Xconst char *name;
X{
X    FILE *fi;
X    char *buf = malloc(256);
X    static char User[32];
X    static char Passwd[32];
X    static char Dir[128];
X    static char Shell[256];
X    static struct passwd Pas = { User, Passwd, 0, 0, 0, "", "", Dir, Shell };
X
X    if (PasswdFile)
X	fi = fopen(PasswdFile, "r");
X    else
X	fi = fopen(MakeConfigPath(UULIB, "Passwd"), "r");
X
X    if (fi == NULL)
X	return(NULL);
X
X    while (fgets(buf, 256, fi)) {
X	char *ptr = buf;
X	char *arg;
X
X	arg = Breakout(&ptr);
X	if (strcmp(name, arg) != 0)
X	    continue;
X	strcpy(Pas.pw_name, arg);
X	strcpy(Pas.pw_passwd, Breakout(&ptr));
X	Pas.pw_uid = atoi(Breakout(&ptr));
X	Pas.pw_gid = atoi(Breakout(&ptr));
X	Breakout(&ptr);     /*  finger info */
X	strcpy(Pas.pw_dir, Breakout(&ptr));
X	strcpy(Pas.pw_shell, Breakout(&ptr));
X
X	{
X	    short i = strlen(Pas.pw_dir) - 1;
X	    if (i >= 0 && Pas.pw_dir[i] != ':' && Pas.pw_dir[i] != '/') {
X		Pas.pw_dir[i++] = '/';
X		Pas.pw_dir[i] = 0;
X	    }
X	}
X
X	{
X	    char *str;
X
X	    Pas.pw_shell_arg0 = Pas.pw_shell;
X	    for (str = Pas.pw_shell; *str && *str != ' ' && *str != 9; ++str);
X	    if (*str) {
X		*str = 0;
X		++str;
X		while (*str == ' ' || *str == 9)
X		    ++str;
X		Pas.pw_shell_argn = str;
X	    } else {
X		Pas.pw_shell_argn = str;
X	    }
X	}
X
X
X	fclose(fi);
X	return(&Pas);
X    }
X    fclose(fi);
X    return(NULL);
X}
X
Xstatic
Xchar *
XBreakout(pptr)
Xchar **pptr;
X{
X    char *base;
X    char *ptr;
X
X    base = *pptr;
X    if (base == NULL)
X	return("");
X    for (ptr = base; *ptr && *ptr != '\n' && *ptr != ','; ++ptr);
X    if (*ptr == ',') {
X	*pptr = ptr + 1;
X	*ptr = 0;
X    } else {
X	*pptr = NULL;
X	*ptr = 0;
X    }
X    return(base);
X}
X
END_OF_FILE
if test 2071 -ne `wc -c <'uucp2/src/lib/getpwnam.c'`; then
    echo shar: \"'uucp2/src/lib/getpwnam.c'\" unpacked with wrong size!
fi
# end of 'uucp2/src/lib/getpwnam.c'
fi
if test -f 'uucp2/src/lib/log.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/lib/log.c'\"
else
echo shar: Extracting \"'uucp2/src/lib/log.c'\" \(1589 characters\)
sed "s/^X//" >'uucp2/src/lib/log.c' <<'END_OF_FILE'
X
X/*
X *  LOG.C
X *
X *  $Header: Beta:src/uucp/src/lib/RCS/log.c,v 1.1 90/02/02 12:08:38 dillon Exp Locker: dillon $
X *
X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
X *
X *  ulog(level, ctl, args...)
X */
X
X#include <stdio.h>
X#include <stdlib.h>
X#include <fcntl.h>
X#include <time.h>
X
X#include "log.h"
X#include "config.h"
X
XPrototype void ulog(int, const char *, ...);
X
Xint	LogLevel = -1;
Xint	LogToStdout = 0;
Xchar	*LogProgram = "-";
Xchar	*LogHost = "-";
Xchar	*LogWho = "-";
Xchar	*LogFile;
Xchar	LogBuf[512];
X
Xvoid
Xulog(level, ctl)
Xint level;
Xconst char *ctl;
X{
X    long clock;
X    struct tm *ut;
X    int logfd;
X    int len;
X    char *logFile;
X    long *args = (long *)&ctl + 1;  /*  should use varargs  */
X
X    if (LogFile)
X	logFile = LogFile;
X    else
X	logFile = MakeConfigPath(UUSPOOL, "LOGFILE");
X
X    if (level > LogLevel)
X	return;
X
X    (void)time(&clock);
X    ut = localtime(&clock);
X
X    sprintf(LogBuf, "(%02d/%02d-%02d:%02d:%02d) %s,%s,%s ",
X	ut->tm_mon+1, ut->tm_mday, ut->tm_hour, ut->tm_min, ut->tm_sec,
X	LogProgram,
X	LogHost,
X	LogWho
X    );
X    sprintf(LogBuf + strlen(LogBuf), ctl,
X	args[0], args[1], args[2],
X	args[3], args[4], args[5]
X    );
X
X    len = strlen(LogBuf);
X    LogBuf[len++] = '\n';
X    LogBuf[len] = 0;
X
X    DEBUG(0, "%s", LogBuf);
X
X    if (LogToStdout) {
X	write(1, LogBuf, len);
X	return;
X    }
X    LockFile("LOG-UPDATE");
X    logfd = open(logFile, O_CREAT|O_WRONLY|O_APPEND, 0644);
X    if (logfd >= 0) {
X	write(logfd, LogBuf, len);
X	close(logfd);
X    } else {
X	fprintf(stderr, "Can't open %s\n", logFile);
X    }
X    UnLockFile("LOG-UPDATE");
X}
X
END_OF_FILE
if test 1589 -ne `wc -c <'uucp2/src/lib/log.c'`; then
    echo shar: \"'uucp2/src/lib/log.c'\" unpacked with wrong size!
fi
# end of 'uucp2/src/lib/log.c'
fi
if test -f 'uucp2/src/sendmail/parse.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/sendmail/parse.c'\"
else
echo shar: Extracting \"'uucp2/src/sendmail/parse.c'\" \(1395 characters\)
sed "s/^X//" >'uucp2/src/sendmail/parse.c' <<'END_OF_FILE'
X
X/*
X *  PARSE.C
X *
X *  $Header: Beta:src/uucp/src/sendmail/RCS/parse.c,v 1.1 90/02/02 12:15:05 dillon Exp Locker: dillon $
X *
X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
X */
X
X#include "defs.h"
X
XPrototype int ParseAddress(char *, char *, int);
X
XLocal char *ParseAddress2(char *, char *, int);
X
X/*
X *  PARSEADDRESS()
X *
X *  Takes an address containing ! @ % : and converts it to a level 3 ! path.
X *
X *  [path]@mach 	->  mach[!path]
X *  [path]%mach 	->  mach[!path]
X *  patha:pathb 	->  patha!pathb
X *  patha:pathb:pathc	->  patha!pathb!pathc
X */
X
Xint
XParseAddress(str, buf, len)
Xchar *str;
Xchar *buf;
Xint len;
X{
X    int i;
X    int j;
X    char *base = buf;
X    char *ParseAddress2();
X
X    for (i = j = 0; i < len; ++i) {
X	if (str[i] == ':') {
X	    buf = ParseAddress2(str + j, buf, i - j);
X	    *buf++ = '!';
X	    j = i + 1;
X	}
X    }
X    buf = ParseAddress2(str + j, buf, i - j);
X    *buf = 0;
X    for (i = 0; base[i] && base[i] != '!'; ++i);
X    return((int)i);
X}
X
X/*
X *  deals with !, @, and %
X */
X
Xstatic char *
XParseAddress2(addr, buf, len)
Xchar *addr;
Xchar *buf;
Xint len;
X{
X    int i;
X
X    for (i = len - 1; i >= 0; --i) {
X	if (addr[i] == '@' || addr[i] == '%') {
X	    short j = len - i;
X	    strncpy(buf, addr + i + 1, j - 1);
X	    buf += j - 1;
X	    len -= j;
X	    if (len)
X		*buf++ = '!';
X	}
X    }
X    strncpy(buf, addr, len);
X    buf += len;
X    return(buf);
X}
X
X
END_OF_FILE
if test 1395 -ne `wc -c <'uucp2/src/sendmail/parse.c'`; then
    echo shar: \"'uucp2/src/sendmail/parse.c'\" unpacked with wrong size!
fi
# end of 'uucp2/src/sendmail/parse.c'
fi
if test -f 'uucp2/src/unix/DMakefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/unix/DMakefile'\"
else
echo shar: Extracting \"'uucp2/src/unix/DMakefile'\" \(1123 characters\)
sed "s/^X//" >'uucp2/src/unix/DMakefile' <<'END_OF_FILE'
X
X#   DMakefile
X#
X#   $Header: Beta:src/uucp/src/compress/RCS/DMakefile,v 1.1 90/02/02 11:47:54 dillon Exp Locker: dillon $
X
XOD=ltmp:uucp/
XSRCS= compress.c tarsplit.c unshar.c uudecode.c uuencode.c dcron.c
XOBJS= $(SRCS:"*.c":"$(OD)*.o")
XSYMS= uucp:src/lib/all.m
XCFLAGS= -iuucp:src/include/ -cq -v
XCFLAGS_LD= $(CFLAGS) -b0
XEXE= uucp:c/
XLIBS= ltmp:uucp/lib/uucp.lib lib:lc.lib lib:amiga.lib
X
XBLINK= blink from lib:cres.o %(right) TO %(left) SC SD LIB $(LIBS)
XBLINK_LD= blink from lib:c.o %(right) TO %(left) SC LIB $(LIBS)
X
Xall: $(EXE)compress $(EXE)tarsplit $(EXE)unshar \
X     $(EXE)uudecode $(EXE)uuencode $(EXE)dcron
X
X$(EXE)compress : $(OD)14compress.o
X    $(BLINK_LD)
X
X$(EXE)dcron : $(OD)dcron.o
X    $(BLINK)
X
X$(EXE)tarsplit : $(OD)tarsplit.o
X    $(BLINK)
X
X$(EXE)unshar : $(OD)unshar.o
X    $(BLINK)
X
X$(EXE)uudecode : $(OD)uudecode.o
X    $(BLINK)
X
X$(EXE)uuencode : $(OD)uuencode.o
X    $(BLINK)
X
X$(OBJS) : $(SRCS)
X    lc $(CFLAGS) -H$(SYMS) -o%(left) %(right)
X
X$(OD)14compress.o : compress.c
X    lc $(CFLAGS_LD) -H$(SYMS) -o%(left) %(right)
X
X$(OD)16compress.o : compress.c
X    lc $(CFLAGS_LD) -H$(SYMS) -o%(left) %(right)
X
END_OF_FILE
if test 1123 -ne `wc -c <'uucp2/src/unix/DMakefile'`; then
    echo shar: \"'uucp2/src/unix/DMakefile'\" unpacked with wrong size!
fi
# end of 'uucp2/src/unix/DMakefile'
fi
if test -f 'uucp2/src/unix/DMakefile.dcc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/unix/DMakefile.dcc'\"
else
echo shar: Extracting \"'uucp2/src/unix/DMakefile.dcc'\" \(1091 characters\)
sed "s/^X//" >'uucp2/src/unix/DMakefile.dcc' <<'END_OF_FILE'
X
X#   DMakefile
X#
X#   $Header: Beta:src/uucp/src/compress/RCS/DMakefile,v 1.1 90/02/02 11:47:54 dillon Exp Locker: dillon $
X#
X#   DCC small-data model note:	library
X#
X#   -s includes symbol table
X
XOD=dtmp:uucp/
XSRCS= compress.c tarsplit.c unshar.c uudecode.c uuencode.c dcron.c
XOBJS= $(SRCS:"*.c":"$(OD)*.o")
XCFLAGS= -I uucp:src/include/
XCFLAGS_LD= $(CFLAGS)
XEXE= uucp:c/
XLIBS= dtmp:uucp/lib/uucp.lib
X
XDLINK= dcc %(right) $(LIBS) -o %(left) -s -r
XDLINK_LD= dcc %(right) $(LIBS) -o %(left) -s
X
X
Xall: $(EXE)compress $(EXE)tarsplit $(EXE)unshar \
X     $(EXE)uudecode $(EXE)uuencode $(EXE)dcron
X
X$(EXE)compress : $(OD)14compress.o
X    $(DLINK_LD)
X
X$(EXE)dcron : $(OD)dcron.o
X    $(DLINK)
X
X$(EXE)tarsplit : $(OD)tarsplit.o
X    $(DLINK)
X
X$(EXE)unshar : $(OD)unshar.o
X    $(DLINK)
X
X$(EXE)uudecode : $(OD)uudecode.o
X    $(DLINK)
X
X$(EXE)uuencode : $(OD)uuencode.o
X    $(DLINK)
X
X$(OBJS) : $(SRCS)
X    dcc $(CFLAGS) %(right) -o %(left) -c -r
X
X$(OD)14compress.o : compress.c
X    dcc $(CFLAGS_LD) %(right) -o %(left) -c -mD
X
X$(OD)16compress.o : compress.c
X    dcc $(CFLAGS_LD) %(right) -o %(left) -c -mD
X
END_OF_FILE
if test 1091 -ne `wc -c <'uucp2/src/unix/DMakefile.dcc'`; then
    echo shar: \"'uucp2/src/unix/DMakefile.dcc'\" unpacked with wrong size!
fi
# end of 'uucp2/src/unix/DMakefile.dcc'
fi
if test -f 'uucp2/src/unix/uuencode.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/unix/uuencode.c'\"
else
echo shar: Extracting \"'uucp2/src/unix/uuencode.c'\" \(2115 characters\)
sed "s/^X//" >'uucp2/src/unix/uuencode.c' <<'END_OF_FILE'
X
X/*
X *  UUENCODE.C
X *
X *  $Header: Beta:src/uucp/src/compress/RCS/uuencode.c,v 1.1 90/02/02 11:48:04 dillon Exp Locker: dillon $
X *
X * uuencode [input] output
X *
X * Encode a file so it can be mailed to a remote system.
X */
X
X#include <stdio.h>
X#include "version.h"
X
XIDENT(".00");
X
X#ifdef UNIX
X# include <sys/types.h>
X# include <sys/stat.h>
X#endif
X
X#ifdef VMS
X# include <types.h>
X# include <stat.h>
X#endif
X
X/* ENC is the basic 1 character encoding function to make a char printing */
X#define ENC(c) (((c) & 077) + ' ')
X
Xvoid outdec();
Xvoid encode();
Xvoid xerror();
X
Xvoid
Xmain(argc, argv)
Xchar **argv;
X{
X	FILE *in;
X#ifdef UNIX | VMS
X	struct stat sbuf;
X#endif
X	int mode;
X
X	/* optional 1st argument */
X	if (argc > 2) {
X		if ((in = fopen(argv[1], "r")) == NULL) {
X			xerror(argv[1]);
X			exit(1);
X		}
X		argv++; argc--;
X	} else
X		in = stdin;
X
X	if (argc != 2) {
X		printf("Usage: uuencode [infile] remotefile\n");
X		exit(2);
X	}
X
X	/* figure out the input file mode */
X#ifdef UNIX | VMS
X	fstat(fileno(in), &sbuf);
X	mode = sbuf.st_mode & 0777;
X#endif
X
X#ifdef AMIGA
X	mode = 0777;
X#endif
X	printf("begin %o %s\n", mode, argv[1]);
X
X	encode(in, stdout);
X
X	printf("end\n");
X	exit(0);
X}
X
X/*
X * copy from in to out, encoding as you go along.
X */
X
Xvoid
Xencode(in, out)
XFILE *in;
XFILE *out;
X{
X	char buf[80];
X	int i, n;
X
X	for (;;) {
X		/* 1 (up to) 45 character line */
X		n = fr(in, buf, 45);
X		putc(ENC(n), out);
X
X		for (i=0; i<n; i += 3)
X			outdec(&buf[i], out);
X
X		putc('X', out);
X		putc('\n', out);
X
X		if (n <= 0)
X			break;
X	}
X}
X
X/*
X * output one group of 3 bytes, pointed at by p, on file f.
X */
Xvoid
Xoutdec(p, f)
Xchar *p;
XFILE *f;
X{
X	int c1, c2, c3, c4;
X
X	c1 = *p >> 2;
X	c2 = (*p << 4) & 060 | (p[1] >> 4) & 017;
X	c3 = (p[1] << 2) & 074 | (p[2] >> 6) & 03;
X	c4 = p[2] & 077;
X	putc(ENC(c1), f);
X	putc(ENC(c2), f);
X	putc(ENC(c3), f);
X	putc(ENC(c4), f);
X}
X
X/* fr: like read but stdio */
Xint
Xfr(fd, buf, cnt)
XFILE *fd;
Xchar *buf;
Xint cnt;
X{
X	int c, i;
X
X	for (i=0; i<cnt; i++) {
X		c = getc(fd);
X		if (c == EOF)
X			return(i);
X		buf[i] = c;
X	}
X	return (cnt);
X}
X
Xvoid
Xxerror(err)
Xchar *err;
X{
X    printf("Can not open file \"%s\"\n", err);
X}
END_OF_FILE
if test 2115 -ne `wc -c <'uucp2/src/unix/uuencode.c'`; then
    echo shar: \"'uucp2/src/unix/uuencode.c'\" unpacked with wrong size!
fi
# end of 'uucp2/src/unix/uuencode.c'
fi
if test -f 'uucp2/src/util/man.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/util/man.c'\"
else
echo shar: Extracting \"'uucp2/src/util/man.c'\" \(1155 characters\)
sed "s/^X//" >'uucp2/src/util/man.c' <<'END_OF_FILE'
X
X/*
X *  MAN.C
X *
X *  $Header: Beta:src/uucp/src/MUtil/RCS/man.c,v 1.3 90/04/03 20:44:52 dillon Exp Locker: dillon $
X *
X *  MAN <topic>
X *
X *  searches for UUMAN:topic or UUMAN:topic.Doc
X */
X
X#include <stdio.h>
X#include <stdlib.h>
X#include "version.h"
X
XIDENT(".00");
X
Xvoid
Xmain(ac, av)
Xchar *av[];
X{
X    short i;
X    static char Buf[256];
X
X    for (i = 1; i < ac; ++i) {
X	char *topic = av[i];
X
X	if (Man(topic) == 0) {
X	    char *manDir = MakeConfigPath(UUMAN, "");
X	    sprintf(Buf, "%s%s.Doc", manDir, topic);
X	    if (Man(Buf) == 0) {
X		sprintf(Buf, "%s%s", manDir, topic);
X		if (Man(Buf) == 0)
X		    printf("Unable to open %s[.Doc]\n", Buf);
X	    }
X	}
X    }
X}
X
XMan(file)
Xchar *file;
X{
X    FILE *fi = fopen(file, "r");
X    char *filter = FindConfig(RFILTER);
X    short rb = 1;
X    static char Cmd[256];
X
X    if (fi == NULL)
X	return(0);
X    if (filter == NULL) {
X	if ((filter = FindConfig(FILTER)) == NULL) {
X	    printf("UULIB:Config, no 'Filter' entry\n");
X	    return(0);
X	}
X	rb = 0;
X    }
X    fclose(fi);
X    if (rb)
X	sprintf(Cmd, "Run >nil: <nil: %s %s", filter, file);
X    else
X	sprintf(Cmd, "%s %s", filter, file);
X    Execute(Cmd, NULL, NULL);
X}
X
END_OF_FILE
if test 1155 -ne `wc -c <'uucp2/src/util/man.c'`; then
    echo shar: \"'uucp2/src/util/man.c'\" unpacked with wrong size!
fi
# end of 'uucp2/src/util/man.c'
fi
if test -f 'uucp2/src/util/trimfile.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/util/trimfile.c'\"
else
echo shar: Extracting \"'uucp2/src/util/trimfile.c'\" \(2057 characters\)
sed "s/^X//" >'uucp2/src/util/trimfile.c' <<'END_OF_FILE'
X
X/*
X *  TRIMFILE file1 file2 .. filen -lines
X *
X *  $Header: Beta:src/uucp/src/MUtil/RCS/trimfile.c,v 1.1 90/02/02 12:12:01 dillon Exp Locker: dillon $
X *
X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
X *
X *  Trims the specified files to the specified number of lines.  Each
X *  file is read and the last N lines written back.
X *
X *  Normally used to trim log files based on a crontab entry.  If no
X *  -lines argument is given the file is trimmed to 100 lines.
X *
X *  Each line may be up to 255 characters in length.
X */
X
X#include <stdio.h>
X#include <stdlib.h>
X#include "version.h"
X
XIDENT(".00");
X
X#define LINSIZE 256
X
Xchar	**LineBuf;
Xlong	Lines = 100;
X
XLocal void  MemErr(void);
XLocal void  TrimFile(char *);
X
Xmain(ac, av)
Xchar *av[];
X{
X    short i;
X    for (i = 1; i < ac; ++i) {
X	if (av[i][0] == '-')
X	    Lines = atol(av[i] + 1);
X    }
X    if (Lines < 0) {
X	fprintf(stderr, "Illegal line specification %d\n", Lines);
X	exit(1);
X    }
X
X    /*
X     *	Allocating one more than necessary handles the Lines == 0 case
X     *	as well as supplying a scratch buffer for the last fgets that
X     *	fails.
X     */
X
X    LineBuf = malloc(sizeof(char *) * (Lines + 1));
X    if (LineBuf == NULL)
X	MemErr();
X    for (i = 0; i <= Lines; ++i) {
X	LineBuf[i] = malloc(LINSIZE);
X	if (LineBuf[i] == NULL)
X	    MemErr();
X    }
X    for (i = 1; i < ac; ++i) {
X	char *ptr = av[i];
X
X	if (*ptr == '-')
X	    continue;
X	LockFile("LOG-UPDATE");     /*  see lib/log.c   */
X	TrimFile(ptr);
X	UnLockFile("LOG-UPDATE");
X    }
X    return(0);
X}
X
Xvoid
XMemErr()
X{
X    fprintf(stderr, "Not enough memory!\n");
X    exit(1);
X}
X
Xvoid
XTrimFile(name)
Xchar *name;
X{
X    FILE *fi = fopen(name, "r");
X    long rep;
X    long i;
X
X    if (fi == NULL)
X	return;
X
X    i = 0;
X    rep = 0;
X    while (fgets(LineBuf[i], LINSIZE, fi)) {
X	if (++i > Lines) {
X	    i = 0;
X	    rep = 1;
X	}
X    }
X    fclose(fi);
X
X    if (rep == 0)
X	return;
X
X    if (fi = fopen(name, "w")) {
X	long j;
X	for (j = Lines; j; --j) {
X	    if (++i > Lines)
X		i = 0;
X	    fputs(LineBuf[i], fi);
X	}
X	fclose(fi);
X    }
X}
X
END_OF_FILE
if test 2057 -ne `wc -c <'uucp2/src/util/trimfile.c'`; then
    echo shar: \"'uucp2/src/util/trimfile.c'\" unpacked with wrong size!
fi
# end of 'uucp2/src/util/trimfile.c'
fi
if test -f 'uucp2/src/util/trimnews.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/util/trimnews.c'\"
else
echo shar: Extracting \"'uucp2/src/util/trimnews.c'\" \(2042 characters\)
sed "s/^X//" >'uucp2/src/util/trimnews.c' <<'END_OF_FILE'
X
X/*
X *  TRIMNEWS.C
X *
X *  TRIMNEWS
X *
X *  This program scans UULIB:NewsGroups then chdir's into each news group's
X *  directory.	The second field specifies the number of days old any numerical
X *  file (ifilename beginning with 0-9) is allowed to be before it is deleted.
X *
X *  If the second field does not exist for a given line in the NewsGroups file,
X *  7 days is automatically assumed.  The number of days is referenced from
X *  when the file was created, NOT the Date: field in the article.
X *
X *  The program is meant to be run daily from a DCron entry to clear out old
X *  news.
X */
X
X#include <stdio.h>
X#include <stdlib.h>
X#include "config.h"
X#include "version.h"
X#include <libraries/dos.h>
X
Xtypedef struct FileInfoBlock	FIB;
X
XIDENT(".01");
X
Xstatic char TmpBuf[256];
X
Xvoid ScanDirectoryDeleteFiles();
X
Xint
Xbrk()
X{
X    return(0);
X}
X
Xmain(ac, av)
Xchar *av[];
X{
X    FILE *fi;
X    char *path;
X    char newsgrp[64];
X    int days;
X
X    onbreak(brk);
X    fi = openlib("NewsGroups");
X    if (fi == NULL) {
X	puts("Unable to open NewsGroups file");
X	exit(1);
X    }
X    while (fgets(TmpBuf, sizeof(TmpBuf), fi)) {
X	switch (sscanf(TmpBuf, "%s %d", newsgrp, &days)) {
X	case 1:
X	    days = 7;
X	case 2:
X	    path = MakeConfigPath(UUNEWS, newsgrp);
X	    if (days)
X		ScanDirectoryDeleteFiles(path, days);
X	}
X    }
X    fclose(fi);
X    return(0);
X}
X
Xvoid
XScanDirectoryDeleteFiles(path, days)
Xchar *path;
Xint days;
X{
X    BPTR lock;
X    BPTR oldlock;
X    FIB *fib;
X    long ds[3];
X    long tnow;
X
X    DateStamp(ds);
X    tnow = dstot(ds) - days * 1440*60;
X
X    if (lock = Lock(path, ACCESS_READ)) {
X	oldlock = CurrentDir(lock);
X	if (fib = malloc(sizeof(FIB))) {
X	    if (Examine(lock, fib)) {
X		while (ExNext(lock, fib)) {
X		    if (isdigit((unsigned char)fib->fib_FileName[0])) {
X			if (tnow > dstot(&fib->fib_Date))
X			    DeleteFile(fib->fib_FileName);
X		    }
X		}
X	    }
X	    free(fib);
X	}
X	UnLock(CurrentDir(oldlock));
X    }
X}
X
Xlong
Xdstot(date)
Xlong *date;	/*  days, mins, ticks	*/
X{
X    return(date[0] * 1440 * 60 + date[1] * 60 + date[2] / 50);
X}
X
END_OF_FILE
if test 2042 -ne `wc -c <'uucp2/src/util/trimnews.c'`; then
    echo shar: \"'uucp2/src/util/trimnews.c'\" unpacked with wrong size!
fi
# end of 'uucp2/src/util/trimnews.c'
fi
if test -f 'uucp2/src/uucico/DMakefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/uucico/DMakefile'\"
else
echo shar: Extracting \"'uucp2/src/uucico/DMakefile'\" \(1339 characters\)
sed "s/^X//" >'uucp2/src/uucico/DMakefile' <<'END_OF_FILE'
X
X#   DMakefile
X#
X#   $Header: Beta:src/uucp/src/uucico/RCS/DMakefile,v 1.1 90/02/02 11:57:52 dillon Exp $
X#
X#   Note: uucico_protos.h is program-generated from 'Prototype' lines
X#	  in individual source files.
X
XOD=ltmp:uucp/
XEXE= uucp:c/
XSYMS= uucp:src/lib/all.m
XPROTOS= uucp:src/include/uucico_protos.h
XMAKEPROTO= $(OD)lib/makeproto
X
XCFLAGS= -iuucp:src/include/ -iuucp:src/ -cq
X
XLOPTS= SC SD LIB ltmp:uucp/lib/uucp.lib lib:lc.lib lib:amiga.lib
X
XSRCS=gio.c sysdep.c uucp.c uupoll.c uuxqt.c modem.c uucico.c \
X    uuhosts.c uuname.c uux.c time.c
X
XOBJS=$(SRCS:"*.c":"$(OD)*.o")
X
Xall:	$(PROTOS) $(EXE)uucico $(EXE)uuxqt $(EXE)uupoll \
X	$(EXE)uux $(EXE)uuname $(EXE)uucp
X
X$(EXE)uucico: $(OD)gio.o $(OD)sysdep.o $(OD)modem.o $(OD)uucico.o $(OD)time.o
X    blink FROM lib:cres.o %(right) ADDSYM $(LOPTS) TO %(left)
X
X$(EXE)uuxqt: $(OD)uuxqt.o
X    blink FROM lib:cres.o %(right) $(LOPTS) TO %(left)
X
X$(EXE)uupoll: $(OD)uupoll.o
X    blink FROM lib:cres.o %(right) $(LOPTS) TO %(left)
X
X$(EXE)uux: $(OD)uux.o
X    blink FROM lib:cres.o %(right) $(LOPTS) TO %(left)
X
X$(EXE)uuname: $(OD)uuname.o
X    blink FROM lib:cres.o %(right) $(LOPTS) TO %(left)
X
X$(EXE)uucp: $(OD)uucp.o
X    blink FROM lib:cres.o %(right) $(LOPTS) TO %(left)
X
X$(OBJS) : $(SRCS)
X    lc $(CFLAGS) -H$(SYMS) -o%(left) %(right)
X
X$(PROTOS) : $(SRCS)
X    $(MAKEPROTO) -o%(left) %(right)
X
END_OF_FILE
if test 1339 -ne `wc -c <'uucp2/src/uucico/DMakefile'`; then
    echo shar: \"'uucp2/src/uucico/DMakefile'\" unpacked with wrong size!
fi
# end of 'uucp2/src/uucico/DMakefile'
fi
if test -f 'uucp2/src/uucico/DMakefile.dcc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/uucico/DMakefile.dcc'\"
else
echo shar: Extracting \"'uucp2/src/uucico/DMakefile.dcc'\" \(1196 characters\)
sed "s/^X//" >'uucp2/src/uucico/DMakefile.dcc' <<'END_OF_FILE'
X
X#   DMakefile
X#
X#   $Header: Beta:src/uucp/src/uucico/RCS/DMakefile,v 1.1 90/02/02 11:57:52 dillon Exp $
X#
X#   Note: uucico_protos.h is program-generated from 'Prototype' lines
X#	  in individual source files.
X
XOD=dtmp:uucp/
XEXE= uucp:c/
XPROTOS= uucp:src/include/uucico_protos.h
XMAKEPROTO= $(OD)lib/makeproto
X
XCFLAGS= -I uucp:src/include/ -I uucp:src/
X
XLOPTS= dtmp:uucp/lib/uucp.lib
X
XSRCS=gio.c sysdep.c uucp.c uupoll.c uuxqt.c modem.c uucico.c \
X    uuhosts.c uuname.c uux.c time.c
X
XOBJS=$(SRCS:"*.c":"$(OD)*.o")
X
Xall:	$(PROTOS) $(EXE)uucico $(EXE)uuxqt $(EXE)uupoll \
X	$(EXE)uux $(EXE)uuname $(EXE)uucp
X
X$(EXE)uucico: $(OD)gio.o $(OD)sysdep.o $(OD)modem.o $(OD)uucico.o $(OD)time.o
X    dcc %(right) $(LOPTS) -o %(left) -s -r
X
X$(EXE)uuxqt: $(OD)uuxqt.o
X    dcc %(right) $(LOPTS) -o %(left) -s -r
X
X$(EXE)uupoll: $(OD)uupoll.o
X    dcc %(right) $(LOPTS) -o %(left) -s -r
X
X$(EXE)uux: $(OD)uux.o
X    dcc %(right) $(LOPTS) -o %(left) -s -r
X
X$(EXE)uuname: $(OD)uuname.o
X    dcc %(right) $(LOPTS) -o %(left) -s -r
X
X$(EXE)uucp: $(OD)uucp.o
X    dcc %(right) $(LOPTS) -o %(left) -s -r
X
X$(OBJS) : $(SRCS)
X    dcc $(CFLAGS) %(right) -o %(left) -r -c
X
X$(PROTOS) : $(SRCS)
X    $(MAKEPROTO) -o%(left) %(right)
X
END_OF_FILE
if test 1196 -ne `wc -c <'uucp2/src/uucico/DMakefile.dcc'`; then
    echo shar: \"'uucp2/src/uucico/DMakefile.dcc'\" unpacked with wrong size!
fi
# end of 'uucp2/src/uucico/DMakefile.dcc'
fi
if test -f 'uucp2/src/uucico/gio.notes' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/uucico/gio.notes'\"
else
echo shar: Extracting \"'uucp2/src/uucico/gio.notes'\" \(2029 characters\)
sed "s/^X//" >'uucp2/src/uucico/gio.notes' <<'END_OF_FILE'
XThis documents describes changes I made to gio.c to support a larger
Xwindow size.
X
XDocumentation of the "g" protocol is sparse.  The information I have
Xcomes from various "public" implementations of UUCICO.  AmigaUUCP is
Xthe only one which supports a window greater than one. The PCMAIL2
Xsystem, distributed recently in comp.sources.misc, has fairly good
Xdocumentation of "g" included in its source, but it only supports a
Xwindow size of 1.
X
XWINDOWSIZE:
X	This was changed to 7.  Unix systems are shipped with a maximum
Xwindow size of 3, although there are patches for various systems to
Xincrease it to 7.
X
XRxSeq:
X	RxSeq was changed to reflect the last valid packet received.
XThis simplified the code in several places.
X
XGetTxBuf():
X	This function was changed to dynamically allocate up to 8
Xbuffers, allowing window sizes up to 7.  The old code should work with
Xwindow sizes up to 3.
X
XGetData():
X	The acknowledged sequence numbers from the receiver during
Xtransmits are expected to be in the range ((TxSeq - TxPend) & 7) to
XTxSeq.  Acknowledging ((TxSeq - TxPend) & 7), the packet immediately
Xpreceding the first packet in the current window, implies that none of
Xthe packets in the current window have been received.  My mail
Xconnection, a 286 based Unix-PC, handles this circumstance by sending
XRR packet after each timeout.  Previously, the protocol would loop
Xindefinitely in this case.  I fixed the code to treat a repeated RR
Xacknowledgement as a rejection.
X	When a packet gets rejected, the entire window following the
Xpacket must be retransmitted as well, since the receiver does not
Xhandle packets out of sequence.  In the rejection code, the entire
Xwindow is resent without checking for acknowledgements.
X	I eliminated a window size dependent test in the code for
Xhandling data packet reception.  I have never seen the code exercised,
Xbut the change only allows extra RJ packets to be sent.
X
XRecvdAck():
X	Some simplification of the code.  Also, I eliminated the message
Xwhich occured when a packet was re-acknowledged.
END_OF_FILE
if test 2029 -ne `wc -c <'uucp2/src/uucico/gio.notes'`; then
    echo shar: \"'uucp2/src/uucico/gio.notes'\" unpacked with wrong size!
fi
# end of 'uucp2/src/uucico/gio.notes'
fi
if test -f 'uucp2/src/uucico/sysdep.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/uucico/sysdep.h'\"
else
echo shar: Extracting \"'uucp2/src/uucico/sysdep.h'\" \(1995 characters\)
sed "s/^X//" >'uucp2/src/uucico/sysdep.h' <<'END_OF_FILE'
X
X/*
X *  SYSDEP.H
X *
X *  $Header: Beta:src/uucp/src/uucico/RCS/sysdep.h,v 1.1 90/02/02 11:55:55 dillon Exp Locker: dillon $
X *
X * Amiga Port by William Loftus
X * Changes are Copyright 1988 by William Loftus. All rights reserved.
X *
X * Declarations of gnuucp's system-dependent routines, which
X * are in the file sysdep.c (a link to one of many system dependent
X * implementations).
X */
X
Xvoid	munge_filename();
X
X/*
X * Basement level I/O routines
X *
X * xwrite() writes a character string to the serial port
X * xgetc() returns a character from the serial port, or an EOF for timeout.
X * sigint() restores the state of the serial port on exit.
X * openline() opens a serial port for an incoming call, waiting for carrier.
X * openout() opens a serial port for an outgoing call.
X */
Xint xwrite();           /* filedesc, buffer, count */
Xint xgetc();            /* No arg */
Xint sigint();          /* No arg */
Xvoid openline();        /* ttyname */
Xint openout();          /* ttyname */
Xvoid amiga_setup();     /* No arg */
X
X
X/*
X * Uucp work queue scan.
X *
X * gotsome = work_scan(hostname);
X *
X * Result is 1 if there is work, 0 if none.  If result is 1, and work_scan
X * is called a second time without an intervening work_done, it won't
X * rescan the directory but simply returns a 1.
X *
X * workfile = work_next();
X *
X * Result is char * to static filename; or NULL if no more.
X * We only read the directory once.  If callers want more to rescan it
X * in case more work is here, they should call work_scan again.
X *
X * void work_done();
X * Clean up a work scan.  No need to call this if work_next returned NULL;
X * it has cleaned up.
X */
Xextern int work_scan();
Xextern char *work_next();
Xextern void work_done();
X
X/* SERIAL PORT DELARATIONS ALSO TIMER */
Xextern struct MsgPort *CreatePort();
Xextern struct IOExtSer *Read_Request;
Xextern unsigned char rs_in[2];
Xextern struct IOExtSer *Write_Request;
Xextern unsigned char rs_out[2];
Xextern struct timerequest Timer;
Xextern struct MsgPort *Timer_Port;
X
X
END_OF_FILE
if test 1995 -ne `wc -c <'uucp2/src/uucico/sysdep.h'`; then
    echo shar: \"'uucp2/src/uucico/sysdep.h'\" unpacked with wrong size!
fi
# end of 'uucp2/src/uucico/sysdep.h'
fi
if test -f 'uucp2/src/uucico/time.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/uucico/time.c'\"
else
echo shar: Extracting \"'uucp2/src/uucico/time.c'\" \(1987 characters\)
sed "s/^X//" >'uucp2/src/uucico/time.c' <<'END_OF_FILE'
X
X/*
X *  TIME.C
X *
X *  By Christopher A. Wichura
X *
X *  Note: cannot use strtok() due to parent level's use of it.
X */
X
X#include "includes.h"           /* System include files, system dependent */
X#include "uucp.h"               /* Uucp definitions and parameters */
X#include <log.h>
X#include "version.h"
X
Xtypedef struct tm   Time;
X
Xchar Days[7][3] = {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"};
X
Xint
XCheckTimeRestrictions(timeStr)
Xchar *timeStr;
X{
X    Time *tm;
X    char *ptr;
X    int work1;
X    int work2;
X    int starth, startm;
X    int endh,	endm;
X    char Hours[24];
X    int result;
X    int day;
X
X    if (strnicmp("Any", timeStr, 3) == 0)
X	return (SUCCESS);
X
X    if (strnicmp("Never", timeStr, 5) == 0)
X	return (FAIL);
X
X    {
X	time_t t;
X	time (&t);
X	tm = localtime(&t);
X    }
X
X    result = FAIL;
X
X    for (ptr = timeStr; ptr; ptr = strpbrk(ptr, ",")) {
X	if (*ptr == ',')
X	    ++ptr;
X
X	day = 0;
X
X	while (isalpha(*ptr)) {
X	    for (work1 = 0; work1 < 7; ++work1) {
X		if (strnicmp(ptr, Days[work1], 2) == 0) {
X		    day |= 1L << work1;
X		    ptr += 2;
X		    break;
X		}
X	    }
X	    if (work1 == 7) {
X		ulog(-1, "Illegal DOW Field (L.Sys): %s", timeStr);
X		return(FAIL);
X	    }
X	}
X
X	if (day == 0)
X	    day = -1;
X
X	if (sscanf(ptr, "%d:%d-%d:%d", &starth, &startm, &endh, &endm) != 4) {
X	    ulog(-1, "Illegal Time Range Field (L.Sys): %s", timeStr);
X	    return(FAIL);
X	}
X
X	/*
X	 * at this point we have start and end times.  check them against
X	 * current system time
X	 */
X
X	setmem(Hours, sizeof(Hours), 0);
X
X	work1 = endh - starth;
X	if (work1 < 0)
X	    work1 += 24;
X
X	work1 = starth + work1;
X	work2 = starth;
X
X	while (work2 <= work1) {
X	    Hours[work2++] = 1;
X
X	    if (work2 == 24)
X		work1 -= 24, work2 -=24;
X	}
X
X	for (;;) {
X	    if (!(day & 1L << tm->tm_wday))
X		break;
X	    if (!Hours[tm->tm_hour])
X		break;
X	    if (tm->tm_hour == starth && tm->tm_min < startm)
X		break;
X	    if (tm->tm_hour == endh && tm->tm_min > endm)
X		break;
X	    return(SUCCESS);
X	}
X    }
X    return (FAIL);
X}
X
END_OF_FILE
if test 1987 -ne `wc -c <'uucp2/src/uucico/time.c'`; then
    echo shar: \"'uucp2/src/uucico/time.c'\" unpacked with wrong size!
fi
# end of 'uucp2/src/uucico/time.c'
fi
if test -f 'uucp2/src/uucico/uucp.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/uucico/uucp.h'\"
else
echo shar: Extracting \"'uucp2/src/uucico/uucp.h'\" \(1405 characters\)
sed "s/^X//" >'uucp2/src/uucico/uucp.h' <<'END_OF_FILE'
X/*
X *  UUCP.H
X *
X *  $Header: Beta:src/uucp/src/uucico/RCS/uucp.h,v 1.1 90/02/02 11:56:18 dillon Exp Locker: dillon $
X *
X * Header file for gnuucp.
X *
X * Pieces that look like they might be taken from Unix uucp are
X * cribbed with the aid of public domain uucp modules (like the F-protocol)
X * that use that interface.
X *
X * Ported to Amiga by William Loftus
X * Changes Copyright 1988 by William Loftus.  All rights reserved.
X */
X
X#define Ifn	FOO	/* file descriptor of the "phone line" */
X
X#define ASSERT(cond, msg, moremsg, huh) /**/
X
X/* I may have these flipped from what Unix uses... */
X/* BUT: my code depends on these values in if (foo()) statements, sigh */
X#define SUCCESS 0
X#define FAIL	1
X
X#define LOG
X
X#define MAXMSGLEN	((NAMESIZE*4)+SLOP)     /* ?>?? FIXME */
X#define MAXMSGTIME	60	/* Timeout period for rdmsg */
X#define MAX_HOST	20	/* Host name length (uucp does 7) */
X#define MAX_LSYS	500	/* Max length of an L.sys line in chars */
X#define MAX_CTLLINE	100	/* Max length of a usenet.ctl line */
X
X#define CTL_DELIM	" \t\n\r"       /* Delimiters for usenet.ctl */
X
Xextern int debug;		/* Debugging level */
X
X/*
X * Timeout for raw characters -- if we don't hear a char within BYTE_TIMEOUT
X * seconds, we assume the other side has gone away.  Has nothing to do with
X * retransmission timeouts (if any!).
X */
X#define BYTE_TIMEOUT	40
X#define BYTE_TO 	40
X
X#define SLOP		10		/* Slop space on arrays */
X
END_OF_FILE
if test 1405 -ne `wc -c <'uucp2/src/uucico/uucp.h'`; then
    echo shar: \"'uucp2/src/uucico/uucp.h'\" unpacked with wrong size!
fi
# end of 'uucp2/src/uucico/uucp.h'
fi
if test -f 'uucp2/src/uucico/uupoll.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/uucico/uupoll.c'\"
else
echo shar: Extracting \"'uucp2/src/uucico/uupoll.c'\" \(1088 characters\)
sed "s/^X//" >'uucp2/src/uucico/uupoll.c' <<'END_OF_FILE'
X
X/*
X * UUPOLL  -- call a UUCP connect site
X *
X *  $Header: Beta:src/uucp/src/uucico/RCS/uupoll.c,v 1.1 90/02/02 11:56:15 dillon Exp Locker: dillon $
X *
X * Usage: UUPOLL <system-name>
X *
X * Copyright 1988 by William Loftus.  All rights reserved.
X *
X * ARPA: wpl@prc.unisys.com
X * UUCP: wpl@burdvax.UUCP
X * USMAIL: Unisys/Paoli Research Center;PO BOX 517;Paoli, PA 19301-0517
X *
X */
X
X#include <stdio.h>
X#include <stdlib.h>
X#include <string.h>
X#include "version.h"
X
X#define LOCK_FILE "t:UUCP.LCK"
X
X#define TRUE 1
X#define FALSE 0
X
XIDENT(".03");
X
XCXBRK()
X{
X    return(0);
X}
X
Xvoid
Xmain (argc, argv)
Xint argc;
Xchar ** argv;
X{
X  static  char buf[256];
X
X  if (argc != 2) {
X     printf("Usage: UUPOLL <system-name>\n");
X     exit(1);
X  }
X
X  if (access(LOCK_FILE,0) != -1) {
X     printf("UUCP is locked.\n");
X     exit(0);
X  }
X
X    if (is_in_L_sys_file(argv[1])) {
X	sprintf(buf, "run >nil: <nil: UUCICO -s%s\n", argv[1]);
X	if (system(buf) == -1) {
X	    printf("Error spawning task to call system \"%s\"\n", argv[1]);
X	}
X    } else {
X	printf("System \"%s\" not in L.sys file.\n", argv[1]);
X    }
X}
X
X
END_OF_FILE
if test 1088 -ne `wc -c <'uucp2/src/uucico/uupoll.c'`; then
    echo shar: \"'uucp2/src/uucico/uupoll.c'\" unpacked with wrong size!
fi
# end of 'uucp2/src/uucico/uupoll.c'
fi
if test -f 'uucp2/src/uuser/misc.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uucp2/src/uuser/misc.c'\"
else
echo shar: Extracting \"'uucp2/src/uuser/misc.c'\" \(1980 characters\)
sed "s/^X//" >'uucp2/src/uuser/misc.c' <<'END_OF_FILE'
X
X/*
X *  MISC.C  - support routines - Phillip Lindsay (C) Commodore 1986
X *  You may freely distribute this source and use it for Amiga Development -
X *  as long as the Copyright notice is left intact.
X *
X *  $Header: Beta:src/uucp/src/uuser/RCS/misc.c,v 1.1 90/02/02 12:10:13 dillon Exp Locker: dillon $
X *
X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
X *
X * 30-SEP-86
X *
X *  major modifications by Matthew Dillon for my PIPE: and other devices,
X *  but basic theorem still Phil's.
X */
X
X#include <exec/types.h>
X#include <exec/nodes.h>
X#include <exec/lists.h>
X#include <exec/ports.h>
X#include <libraries/dos.h>
X#include <libraries/dosextens.h>
X#include "protos.h"
X
Xtypedef struct Node NODE;
X
Xextern void returnpkt();
X
Xvoid
Xreturnpktplain(packet, myproc)
Xstruct DosPacket *packet;
Xstruct Process *myproc;
X{
X    returnpkt(packet, myproc, packet->dp_Res1, packet->dp_Res2);
X}
X
X
Xvoid
Xreturnpkt(packet, myproc, res1, res2)
Xregister struct DosPacket *packet;
Xstruct Process *myproc;
Xlong res1, res2;
X{
X    struct Message *mess;
X    struct MsgPort *replyport;
X
X    packet->dp_Res1	     = res1;
X    packet->dp_Res2	     = res2;
X    replyport		     = packet->dp_Port;
X    mess		     = packet->dp_Link;
X    packet->dp_Port	     = &myproc->pr_MsgPort;
X    mess->mn_Node.ln_Name    = (char *)packet;
X    mess->mn_Node.ln_Succ    = NULL;
X    mess->mn_Node.ln_Pred    = NULL;
X    PutMsg(replyport, mess);
X}
X
X
X/*
X * taskwait() ... Waits for a message to arrive at your port and
X *   extracts the packet address which is returned to you.
X */
X
Xstruct DosPacket *
Xtaskwait(myproc)
Xstruct Process *myproc;
X{
X    struct MsgPort *myport;
X    struct Message *mymess;
X
X    myport = &myproc->pr_MsgPort;
X    WaitPort(myport);
X    mymess = (struct Message *)GetMsg(myport);
X    return((struct DosPacket *)mymess->mn_Node.ln_Name);
X}
X
Xtaskpktrdy(myproc)
Xstruct Process *myproc;
X{
X    if (((NODE *)myproc->pr_MsgPort.mp_MsgList.lh_Head)->ln_Succ == NULL)
X	return(0);
X    return(1);
X}
X
END_OF_FILE
if test 1980 -ne `wc -c <'uucp2/src/uuser/misc.c'`; then
    echo shar: \"'uucp2/src/uuser/misc.c'\" unpacked with wrong size!
fi
# end of 'uucp2/src/uuser/misc.c'
fi
echo shar: End of archive 2 \(of 12\).
cp /dev/null ark2isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 12 archives.
    rm -f ark[1-9]isdone ark[1-9][0-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@cs.odu.edu>.
Mail comments to the moderator at <amiga-request@cs.odu.edu>.
Post requests for sources, and general discussion to comp.sys.amiga.