[comp.sources.amiga] v90i046: uucp 1.03D - unix compatible uucp/mail/news system, Part02/16

Amiga-Request@cs.odu.edu (Amiga Sources/Binaries Moderator) (02/04/90)

Submitted-by: overload!dillon (Matt Dillon)
Posting-number: Volume 90, Issue 046
Archive-name: unix/uucp-1.03d/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 16)."
# Contents:  VERSION.DOC lib/.dmailrc lib/Aliases man/Aliases
#   man/Assigns man/Security man/UPDATES man/UUClean man/UUSer
#   man/UUdecode man/UUencode man/man s/.edrc src/MUtil/man.c
#   src/MUtil/trimfile.c src/News060/Anews/mscan.c
#   src/compress/uuencode.c src/dmail/DMakefile src/dmail/cond.c
#   src/dmail/globals.c src/getty/passwd.c src/include/config.h
#   src/lib/config.c src/lib/getpwnam.c src/lib/log.c
#   src/sendmail/parse.c src/uucico/DMakefile src/uucico/sysdep.h
#   src/uucico/uucp.h src/uucico/version.doc src/uuser/misc.c
#   src/uuser/uuser.doc
# Wrapped by tadguy@xanth on Sat Feb  3 20:50:58 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'VERSION.DOC' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'VERSION.DOC'\"
else
echo shar: Extracting \"'VERSION.DOC'\" \(1265 characters\)
sed "s/^X//" >'VERSION.DOC' <<'END_OF_FILE'
X
X
X			    VERSION.DOC
X
X			    Matthew Dillon
X			    891 Regal Rd.
X			    Berkeley, Ca. 94708
X
X			    pacbell.PacBell.COM!sorinc!overload!dillon
X
X    The version and sub version of most executables in the distribution may
X    be retrieved by running the 'uident' program on the executable(s).
X    Source directories contain (sporatically) Version.DOC files with
X    remarks on sub-versions for specific executables.  This file contains
X    overall remarks on the main version id.
X
X1.03D
X
X	slight changes to postnews (now uses DomainName)
X
X	Domains fixed (effects only people who use UULIB:Domain)
X
X	sendmail more intelligent about checking argv[0] to see
X	if it is rmail (now works with WShell)
X
X	UUCP:LIB paths changed to UULIB:
X
X	uupoll no longer needs 'brun'
X
X	Problems.DOC file added
X
X1.02D
X	stack warning in SlowSetup.DOC added (stack should be at least
X	8192).	'Stack 8192' added to sample startup sequence.  RNews
X	warning (RNews takes a huge amount of RAM currently) added.
X
X1.01D
X	UUCP:LIB paths fixed to use UULIB:
X
X1.00D
X	Initial Release 'D' series by Matthew Dillon, based on
X	0.40, 0.50 and 0.60WPL series by William Loftus.
X
X0.60WPL
X0.50WPL
X0.40WPL
X	UUCP release series for the Amiga by William Loftus, sub
X	version changes not listed in this file.
X
X
X
X
END_OF_FILE
if test 1265 -ne `wc -c <'VERSION.DOC'`; then
    echo shar: \"'VERSION.DOC'\" unpacked with wrong size!
fi
# end of 'VERSION.DOC'
fi
if test -f 'lib/.dmailrc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'lib/.dmailrc'\"
else
echo shar: Extracting \"'lib/.dmailrc'\" \(1027 characters\)
sed "s/^X//" >'lib/.dmailrc' <<'END_OF_FILE'
X
X#   .DMAILRC file
X#
X#   not very user friendly.  Some aliases may not apply, quick port
X#   from UNIX.
X
Xset header  uulib:.signature
Xset replyfields "Reply-To: Return-Path:"
Xset _headchar :
X
X#   mail you send is archived by dmail
Xset archive	uumail:mbox
Xif !comlinemail
Xalias qdt	"dt"
X#   Warning: page mode doesn't work on Amiga's
Xalias qdb	"db"
Xalias noarch	"unset archive"
Xalias arch	"set archive uumail:mbox"
Xalias ls	"! ls"
Xalias normal	"setlist -s 7 From 25 Subject 9 To 0 Cc 10 Date"
Xalias page	set page more -p
Xalias nopage	unset page
Xalias spool	"g uumail:dillon uumail:mbox"
Xalias mbox	"g uumail:mbox"
Xalias g 	"qswitch"
Xalias kill	"%var sel Sub $var;d all;sel all"
Xalias rem	"%var nobreak;_spage;set page remember $var;type;_rpage;breakok"
Xalias _spage	"if page;set _page $page;endif"
Xalias _rpage	"if _page;set page $_page;unset _page;else;unset page;endif"
Xalias tech	"qswitch tech; sel News comp.sys.amiga.tech,comp.sys.amiga comp.sys.amiga,comp.sys.amiga.tech; d all; sel all"
Xnormal
X#page
X#cd uucp:mail
Xendif
X
END_OF_FILE
if test 1027 -ne `wc -c <'lib/.dmailrc'`; then
    echo shar: \"'lib/.dmailrc'\" unpacked with wrong size!
fi
# end of 'lib/.dmailrc'
fi
if test -f 'lib/Aliases' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'lib/Aliases'\"
else
echo shar: Extracting \"'lib/Aliases'\" \(1273 characters\)
sed "s/^X//" >'lib/Aliases' <<'END_OF_FILE'
X
X#   SENDMAIL ALIASES.
X#
X# Alias for mailer daemon.  REFER TO MAN:Aliases for more information.
X#
X#   #	comment character (must be first char on line)
X#   name: addr, addr, addr, addr,
X#	  addr, addr, addr, addr
X#
X#   addr can be (1) any path
X#		(2) >file   (append to said file)
X#		(3) <file   (include addresses from file, one per line)
X#		(4) "|command"  (pipe through a command)
X#		(5) \user   (if user is an alias this ignores the alias)
X#
X#   note that each addr must be comma delimited, and line continuation
X#   depends on whether the last addr on the line has a comma after it.
X
XMAILER-DAEMON: postmaster
X
X# Following alias is required by the new mail protocol, RFC 822
Xpostmaster: foo
X
X# Aliases to handle mail to msgs and news
X
X# Alias for uucp maintenance
Xuucplist: root
Xuucp: uucplist
X
X# System
Xmanager: foo
Xoperator: manager
Xstaff: foo
Xnobody:
X
X#
X# smart-aleck aliases
X#
Xdaemon: manager
Xlp: manager
Xusrlimit: manager
X
X#
X#   User
X#
X#   send mail for foo to foo and also archive it.
X
Xfoo: \foo, >uumail:mbox
X
Xfriend: fubar!friend
X
X# William P. Loftus
Xwpl: PRC.Unisys.COM!wpl
X
X# Matt Dillon
Xdillon: pacbell.PacBell.COM!sorinc!overload!dillon
X
X# Fred Fish, 1835 East Belmont Dr, Tempe, Arizona 85284
X# 1-602-491-0048
Xfish:	cs.utexas.edu!asuvax!mcdphx!estinc!fnf
X
END_OF_FILE
if test 1273 -ne `wc -c <'lib/Aliases'`; then
    echo shar: \"'lib/Aliases'\" unpacked with wrong size!
fi
# end of 'lib/Aliases'
fi
if test -f 'man/Aliases' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'man/Aliases'\"
else
echo shar: Extracting \"'man/Aliases'\" \(1960 characters\)
sed "s/^X//" >'man/Aliases' <<'END_OF_FILE'
X
XNAME
X	UULIB:Aliases
X
XDESCRIPTION
X    UULIB:Aliases is a text file containing mail aliases.  There
X    is no need to run newaliases after modifying this file (there
X    is no newaliases program).	This file is scanned by sendmail
X    for each item of incomming and outgoing email.
X
X    Each line in UULIB:Aliases may be either blank, have a '#'
X    as the first character to indicate a comment, or begin an
X    alias.  An alias consists of a name, colon, and list of
X    items.  For example:
X
X	comiclovers:	charlie, ben, lucy, james
X
X    Multi-line aliases may be specified by a comma at the end of
X    each line to be continued:
X
X	comiclovers:	charlie, ben,
X			lucy, james
X
X    Note that the last line has no comma.  Each item in an alias
X    may be:
X
X	(1) user        a local user name
X	(2) \user       forces a local user name if the name is aliased
X	(3) alias       another alias
X	(4) path        some path
X	(5) >file       append the mail item to some file
X	(6) <file       load a further list of destinations from a
X			file (one item per line)
X	(7) |command    pipe mail item to a command with optional args
X	(8) "|command args"
X
X    For example, if I want incomming mail to be posted to my mail box
X    AND automatically appended to some archive file (and note here
X    that I must use '\' to prevent an alias loop):
X
X	dillon: \dillon, >uumail:archive
X
X    items may point to other aliases (dillon is already an alias):
X
X	comiclovers:	dillon, fred
X
X    mail may be piped to a command, such as an automated vacation-response
X    program:
X
X	dillon: \dillon, >uumail:archive, |vacation
X
XNEWSGROUPS
X
X    Newsgroups are difficult to implement with this Aliases
X    implementation because the sender's address is NOT removed
X    from the item list.
X
X    we hope to implement news propogation via a separate file and
X    the rnews program.	When this is done, an alias will usually
X    be required:
X
X	news:	|rnews
X
XFILES
X
X    uulib:Aliases
X    uucp:c/sendmail
X
X
END_OF_FILE
if test 1960 -ne `wc -c <'man/Aliases'`; then
    echo shar: \"'man/Aliases'\" unpacked with wrong size!
fi
# end of 'man/Aliases'
fi
if test -f 'man/Assigns' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'man/Assigns'\"
else
echo shar: Extracting \"'man/Assigns'\" \(1990 characters\)
sed "s/^X//" >'man/Assigns' <<'END_OF_FILE'
X
X			    ASSIGNMENTS
X
X    Startup-Sequence Assignments (examples).  Note, UUPUB: will in the
X    future be used for 'public' uucp transfers.
X
X    Assign UUCP:	DF0:
X    Assign UUSPOOL:	UUCP:Spool
X    Assign UULIB:	UUCP:Lib
X    Assign UUMAIL:	UUCP:Mail
X    Assign UUNEWS:	UUCP:Mail/News
X    Assign UUPUB:	UUCP:Pub
X
X    Assign Getty:	UUCP:Lib
X
X    UULIB:Config entries:
X
X	NodeName	    The name by which you want to call your
X			    machine.  Suggested 7 chars max.
X
X	UserName	    Your 'user' name. e.g. dillon.  This is
X			    where Mail, DMail, and From use as a
X			    default for your user name.
X
X	RealName	    Your full name. e.g. Matthew Dillon.  Used
X			    by sendmail (which is run from Mail or
X			    DMail)
X
X	NewsFeed	    Which remote machine should outgoing
X			    news be sent to?
X
X	Organization	    Your organization, if any (for News)
X
X	Filter		    Foreground filter program (to display a
X			    file).  Output expected to go through
X			    stdout.  Used by MAN if RFilter does not
X			    exist.
X
X	RFilter 	    Background filter program (that can be
X			    RUNd to display a file)
X
X	MailEditor	    The editor DMail uses.
X
X	NewsEditor	    The editor postnews uses
X
X	DomainName	    The domain of your machine, usually .UUCP
X			    This is automatically tacked on to the
X			    mail headers when you mail out or mail
X			    is routed through your machine.
X
X	TimeZone	    PST,PDT, etc... Currently only US timezones
X			    are implemented.  Used to calculate GMT
X			    time from local time for use in mail headers.
X
X	DefaultNode	    Normally set to an immediately adjacent
X			    USENET node.  IF YOU CAN CONNECT TO MORE
X			    THAN ONE OTHER USENET NODE REFER TO
X			    MAN:DOMAINS FOR INFORMATION ON SELECTING
X			    WHICH NODE AN ADDRESS GETS ROUTED THROUGH.
X
X			    Example:	'sorinc.UUCP' if I talk
X			    directly to sorinc.
X
X			    You may also specify explicit paths
X			    as long as the very first machine is
X			    directly adjacent to you (you can call
X			    directly).
X
END_OF_FILE
if test 1990 -ne `wc -c <'man/Assigns'`; then
    echo shar: \"'man/Assigns'\" unpacked with wrong size!
fi
# end of 'man/Assigns'
fi
if test -f 'man/Security' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'man/Security'\"
else
echo shar: Extracting \"'man/Security'\" \(1178 characters\)
sed "s/^X//" >'man/Security' <<'END_OF_FILE'
X
X
XNAME
X	UULIB:Security
X
XSYNOPSIS
X	-
X
XDESCRIPTION
X	The UULIB:Security file governs readability and writability
X	of directories relative to remote uucp requests.  The UUSPOOL:
X	directory is always readable and writable.
X
X	This prevents other nodes from examining or overwriting
X	arbitrary files in your system.
X
X	The UUCICO program, which does the actual work downloading
X	and uploading files, will check remote-requested paths
X	against this file by comparing inodes (DOS Locks) and not
X	by name.  The reason for this is simply that, on the Amiga,
X	several different paths may refer to the same directory.
X
X		    ---- Example Security file (this line not included) ---
X
X#   This file is used by UUCICO to determine the validity of requests.
X#
X#   The directories listed here are *allowed* directories for uucp
X#   transfers.	The permissions field lists permissions
X#		    r	-readable
X#		    w	-writable
X
Xtmp:	    rw
Xuucp:c	    r
Xuucp:man    r
XUUPUB:	    rw
X
X# If you have a UUPUBW: assign that is *different* from UUPUB: then
X# you might want to make UUPUB: readable only and UUPUBW: read-write.
X
X		    ---- End of Example (this line not included) ---
X
XREFERENCES:
X	UUCP, UUCICO
X
END_OF_FILE
if test 1178 -ne `wc -c <'man/Security'`; then
    echo shar: \"'man/Security'\" unpacked with wrong size!
fi
# end of 'man/Security'
fi
if test -f 'man/UPDATES' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'man/UPDATES'\"
else
echo shar: Extracting \"'man/UPDATES'\" \(1441 characters\)
sed "s/^X//" >'man/UPDATES' <<'END_OF_FILE'
X
X This file is a listing of all the changes & fixes to UUCP & UseNet that are
X *NOT* covered by the README file. For more details on changes please read
X the source code(s).
X
X
XDate         Programmer       Details
X--------     ------------     --------------------------------------------------
X09/22/88     Sneakers         Added a tail option to UULOG "-t".
X
X09/24/88     Sneakers         Tail option of UULOG was broken. It is now fixed.
X
X09/24/88     Sneakers         Rewrote 'MAIL' command.
X                              Removed message header from user editable message.
X                              Now gives a warning on ZERO byte messages & exits.
X
X09/30/88     Sneakers         Rewrote 'Pnews-x' commands.
X                              Fixed the broken CopyMessage() routine.
X                              Added Include() routine.    File to include [None]
X                              Added CheckUser() routine.  [Send|List|Edit|Abort]
X
X10/04/88     Sneakers         Mail command was brain dead on multi addresses.
X                              Fixed it, and it works great :-)
X
X10/07/88     Sneakers         Tail option of UULOG was 'still' broken when the
X                              LOGFILE was < 10 lines. UULOG is now fixed. And
X                              you have Joe Isuzu's word on it :-)
X
X10/02/88     Mike Schultz     Added support for nonbatched news articles to the
X                              Rnews command.
END_OF_FILE
if test 1441 -ne `wc -c <'man/UPDATES'`; then
    echo shar: \"'man/UPDATES'\" unpacked with wrong size!
fi
# end of 'man/UPDATES'
fi
if test -f 'man/UUClean' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'man/UUClean'\"
else
echo shar: Extracting \"'man/UUClean'\" \(1592 characters\)
sed "s/^X//" >'man/UUClean' <<'END_OF_FILE'
X
XNAME
X     uuclean - uucp spool directory clean-up
X
XSYNTAX
X     uuclean [ option ] ...
X
XDESCRIPTION
X     The uuclean command scans the spool directory for files with
X     the specified prefix and deletes all those which are older
X     than the specified number of hours.
X
XOPTIONS
X     -ppre   Scan for files with pre as the file prefix.  Up to
X             10 -p arguments may be specified.  A -p without any
X             pre following will cause all files older than the
X             specified time to be deleted.
X
X     -ntime  Delete all files whose age is more than time
X             (default is 72 hours) and that have the specified
X             pre as their file prefix.
X
X     -m      Send mail to the owner of the file when it is
X             deleted.
X
X     -ssystem
X             Delete files in all directories that are subdirec-
X             tories of the per system spool directory that exists
X             for system. If ALL is specified, then all system
X             directories are processed.
X
X     -ddirectory
X             Delete files that reside in the named directory. The
X             -s option over rides the -d option.
X
X     This program will typically be started by cron. In earlier
X     versions, a deleted work file (C.file) would result in
X     mail to the owner of the work file, regardless of the -m
X     option.  Now, notification of deleted work files is sent to
X     the user ID "uucp".  If the -m option is used, mail is also
X     sent to the owner.
X
XFILES
X     UUCP:lib/uucp         directory with commands used by
X                           uuclean internally
X
END_OF_FILE
if test 1592 -ne `wc -c <'man/UUClean'`; then
    echo shar: \"'man/UUClean'\" unpacked with wrong size!
fi
# end of 'man/UUClean'
fi
if test -f 'man/UUSer' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'man/UUSer'\"
else
echo shar: Extracting \"'man/UUSer'\" \(1492 characters\)
sed "s/^X//" >'man/UUSer' <<'END_OF_FILE'
X
X
XNAME
X	UUser	(AmigaDOS Handler)
X
XSYNOPSIS
X	Mount uuser:
X
X	Open Format:	uuser:devicename/unit/options
X	Example:	uuser:serial.device/0/R1000
X
XDESCRIPTION
X	Options:    Rn	Set read timeout when no data available (millisecs)
X		    C0	Ignore carrier detect
X
X	The UUSER: handler allows arbitrary programs to talk to any
X	serial.device and unit uses Read() and Write() calls.
X
X	Consequently, stdio may be used as well.
X
X	UUSER: IS NORMALLY SETUP BY GETTY WHEN IT RUNS A PROGRAM.  See
X	GETTY.MAN for more info.  Essentially, if a '*' appears before
X	the command-to-run in the passwd file Getty will setup UUSER:
X	on the stdin and stdout of the command it runs after a valid
X	login sequence.
X
XDIFFERENCES FROM NORMAL HANDLERS:
X
X	To avoid a gets() or getc() or read() or Read() (or whatever
X	call you use to read data from stdin), UUSER: times out after
X	1 second if no characters have been received.
X
X	If you are using stdio, you get an EOF when this occurs.  You
X	can clear the EOF state by calling clrerr(stdin).
X
X	UUSER: will return immediately when at least one character is
X	ready.	Thus, if you do:
X
X	    n = read(0, Buf, 256)
X
X	n will return:
X
X	    -1	=   Lost Carrier
X	    0	=   Timeout (loop retry?)
X	 1-256	=   Anywhere from 1 to 256 bytes have been recevied
X
X	UUSER: checks carrier and if it detects carrier is lost, will
X	return an error for both read and write calls.
X
X	If using stdio for writing, be sure to call fflush(stdout) when
X	you want to flush stdio's buffer to the serial port.
X
END_OF_FILE
if test 1492 -ne `wc -c <'man/UUSer'`; then
    echo shar: \"'man/UUSer'\" unpacked with wrong size!
fi
# end of 'man/UUSer'
fi
if test -f 'man/UUdecode' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'man/UUdecode'\"
else
echo shar: Extracting \"'man/UUdecode'\" \(1736 characters\)
sed "s/^X//" >'man/UUdecode' <<'END_OF_FILE'
X
XNAME
X     uuencode, uudecode - encode/decode a binary file for
X     transmission via mail
X
XSYNTAX
X     uuencode <infilename >outfilename filename
X     uudecode filename.uu
X
XDESCRIPTION
X     The uuencode and uudecode commands are used to send a binary
X     file via uucp (or other) mail.
X
X     The uuencode command takes the named source file (default
X     standard input) and produces an encoded version on the stan-
X     dard output.  The encoding uses only printing ASCII charac-
X     ters, and includes the mode of the file and the remotedest
X     for recreation on the remote system.
X
X     The uudecode command reads an encoded file, strips off any
X     leading and trailing lines added by mailers, and recreates
X     the original file with the specified mode and name.
X
X     The intent is that all mail to the user ``decode'' should be
X     filtered through the uudecode program.  This way the file is
X     created automatically without human intervention.  This is
X     possible on the uucp network by either using sendmail or by
X     making rmail be a link to Mail instead of mail. In each
X     case, an alias must be created in a master file to get the
X     automatic invocation of uudecode.
X
X     If these facilities are not available, the file can be sent
X     to a user on the remote machine who can uudecode it manu-
X     ally.
X
X     The encode file has an ordinary text form and can be edited
X     by any text editor to change the mode or remote name.
X
XRESTRICTIONS
X     The file is expanded by 35% (3 bytes become 4 plus control
X     information) causing it to take longer to transmit.
X
X     The user on the remote system who is invoking uudecode
X     (often uucp) must have write permission on the specified
X     file.
X
END_OF_FILE
if test 1736 -ne `wc -c <'man/UUdecode'`; then
    echo shar: \"'man/UUdecode'\" unpacked with wrong size!
fi
# end of 'man/UUdecode'
fi
if test -f 'man/UUencode' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'man/UUencode'\"
else
echo shar: Extracting \"'man/UUencode'\" \(1736 characters\)
sed "s/^X//" >'man/UUencode' <<'END_OF_FILE'
X
XNAME
X     uuencode, uudecode - encode/decode a binary file for
X     transmission via mail
X
XSYNTAX
X     uuencode <infilename >outfilename filename
X     uudecode filename.uu
X
XDESCRIPTION
X     The uuencode and uudecode commands are used to send a binary
X     file via uucp (or other) mail.
X
X     The uuencode command takes the named source file (default
X     standard input) and produces an encoded version on the stan-
X     dard output.  The encoding uses only printing ASCII charac-
X     ters, and includes the mode of the file and the remotedest
X     for recreation on the remote system.
X
X     The uudecode command reads an encoded file, strips off any
X     leading and trailing lines added by mailers, and recreates
X     the original file with the specified mode and name.
X
X     The intent is that all mail to the user ``decode'' should be
X     filtered through the uudecode program.  This way the file is
X     created automatically without human intervention.  This is
X     possible on the uucp network by either using sendmail or by
X     making rmail be a link to Mail instead of mail. In each
X     case, an alias must be created in a master file to get the
X     automatic invocation of uudecode.
X
X     If these facilities are not available, the file can be sent
X     to a user on the remote machine who can uudecode it manu-
X     ally.
X
X     The encode file has an ordinary text form and can be edited
X     by any text editor to change the mode or remote name.
X
XRESTRICTIONS
X     The file is expanded by 35% (3 bytes become 4 plus control
X     information) causing it to take longer to transmit.
X
X     The user on the remote system who is invoking uudecode
X     (often uucp) must have write permission on the specified
X     file.
X
END_OF_FILE
if test 1736 -ne `wc -c <'man/UUencode'`; then
    echo shar: \"'man/UUencode'\" unpacked with wrong size!
fi
# end of 'man/UUencode'
fi
if test -f 'man/man' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'man/man'\"
else
echo shar: Extracting \"'man/man'\" \(1168 characters\)
sed "s/^X//" >'man/man' <<'END_OF_FILE'
X
XNAME
X
X    man - look up documentation on a command
X
XSYNOPSIS
X
X    man command_1 command_2 ... command_N
X
XDESCRIPTION
X
X    "Man" looks in the volume or directory "MAN:" for information
X    about the given commands, and then displays it on the screen.
X
X    Here is exactly how "Man" works.  If you type "Man myCommand",
X    "Man" looks in the directory MAN: for a file called "myCommand".
X    If it finds the file, it displays it on the screen using the
X    file viewing program "more".  ("More" is on the Commodore-Amiga
X    V1.2 Extras disk.)	If no such file is found, you are told.
X
X    So... for any program that you have, put its documentation file
X    in MAN:.  Name the documentation file the same as the program
X    itself.  Instead of searching for that documentation next time,
X    all you have to do is type "Man command-name".
X
X
XFILES
X
X    UULIB:Config  , RFilter or Filter entry sets command Man uses
X		    to display a manual page.
X
X    MAN:    Manual directory.
X
X    More    File viewing program, must be in your search path and
X	    named "MORE" but does not have to be CBM's more program.
X
X    Assign  For "Assign MAN: some-directory-of-your-choice".
X
END_OF_FILE
if test 1168 -ne `wc -c <'man/man'`; then
    echo shar: \"'man/man'\" unpacked with wrong size!
fi
# end of 'man/man'
fi
if test -f 's/.edrc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'s/.edrc'\"
else
echo shar: Extracting \"'s/.edrc'\" \(1379 characters\)
sed "s/^X//" >'s/.edrc' <<'END_OF_FILE'
X
Xignorecase on
Xsavetabs on
Xmap c-tab   (ping 0 while c=32 right repeat tr (( ) left) pong 0 down)
Xmap cs-tab  `del del del del down'
Xmap a-tab   `goto block while cb `c-tab down''
Xmap as-tab  `goto block while cb `cs-tab down''
Xmap s-f9    `saveas ram:\$filename'
Xmap a-/     (escimm (findstr ) escimm (repstr ) repeat -1 nextr)
Xmap c-m     menuon
Xmap c-right (repeat 8 tab)
Xmap c-left  (repeat 8 backtab)
Xmap s-return return
Xmap (a- )   (( ))
X
Xmap c-f1    (scanf %s bottom insfile \$scanf)
Xmap c-f2    (scanf %s newfile \$scanf)
Xmap c-f3    (scanf %s newwindow newfile \$scanf)
Xmap s-f7    (setfont topaz.font 7)
Xmap c-[     (ping 1 iconify ctags)
X
X#   DIFF / old version support.  The following macros automatically
X#   diff the file being saved with the old version and save the diff
X#
X#   s-f3 will retrieve the 'old' version.  Aweesome.
X
Xmap s-f3  (set old (\$filename) execute (undiff >T:dme_temp \$filename tmp:diff/\$(fname).D) newwindow newfile T:dme_temp chfilename \$old unset old)
X
Xmap cs-d  (execute (copy \$filename T:dme_temp) saveold execute (diff >tmp:diff/\$(fname).D T:dme_temp \$filename))
X#map f8    (cs-d escimm (newfile ))
X#map f9    (cs-d )
X#map f10   (cs-d quit)
Xmap s-f8  (saveold escimm (newfile ))
Xmap s-f9  (saveold)
Xmap s-f10 (saveold quit)
X
Xaddpath autodocs:
Xaddpath autoincs:
Xaddpath src:suplib/doc
Xaddpath src:dres/doc
Xaddpath src:commonlib/doc
X
END_OF_FILE
if test 1379 -ne `wc -c <'s/.edrc'`; then
    echo shar: \"'s/.edrc'\" unpacked with wrong size!
fi
# end of 's/.edrc'
fi
if test -f 'src/MUtil/man.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/MUtil/man.c'\"
else
echo shar: Extracting \"'src/MUtil/man.c'\" \(1032 characters\)
sed "s/^X//" >'src/MUtil/man.c' <<'END_OF_FILE'
X
X/*
X *  MAN.C
X *
X *  MAN <topic>
X *
X *  searches for MAN:topic or MAN:topic.Doc
X */
X
X#include <stdio.h>
X#include <stdlib.h>
X#include <config.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	    sprintf(Buf, "MAN:%s", topic);
X	    if (Man(Buf) == 0) {
X		sprintf(Buf, "MAN:%s.Doc", topic);
X		if (Man(Buf) == 0)
X		    printf("Unable to open MAN:%s or MAN:%s.Doc\n", topic, topic);
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 1032 -ne `wc -c <'src/MUtil/man.c'`; then
    echo shar: \"'src/MUtil/man.c'\" unpacked with wrong size!
fi
# end of 'src/MUtil/man.c'
fi
if test -f 'src/MUtil/trimfile.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/MUtil/trimfile.c'\"
else
echo shar: Extracting \"'src/MUtil/trimfile.c'\" \(1801 characters\)
sed "s/^X//" >'src/MUtil/trimfile.c' <<'END_OF_FILE'
X
X/*
X *  TRIMFILE file1 file2 .. filen -lines
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
X#define LINSIZE 256
X
Xchar	**LineBuf;
Xlong	Lines = 100;
X
Xvoid	MemErr();
Xvoid	TrimFile();
X
Xvoid
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	TrimFile(ptr);
X    }
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 1801 -ne `wc -c <'src/MUtil/trimfile.c'`; then
    echo shar: \"'src/MUtil/trimfile.c'\" unpacked with wrong size!
fi
# end of 'src/MUtil/trimfile.c'
fi
if test -f 'src/News060/Anews/mscan.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/News060/Anews/mscan.c'\"
else
echo shar: Extracting \"'src/News060/Anews/mscan.c'\" \(1607 characters\)
sed "s/^X//" >'src/News060/Anews/mscan.c' <<'END_OF_FILE'
X
X/*
X * mscan - Scan directories and return a sorted list of file names,
X *	    one at a time.
X *
X *  This code originally taken from sysdep.c:
X *
X *  (C) Copyright 1987 by John Gilmore
X *  Copying and use of this program are controlled by the terms of the Free
X *  Software Foundation's GNU Emacs General Public License.
X *
X * Amiga Changes Copyright 1988 by William Loftus. All rights reserved.
X *
X * Rewrite for use with manx (or lattice), and Anews.
X */
X
X#include <stdio.h>
X#include <stdlib.h>
X
X#define MAXFILES    512
X
Xstatic char names[MAXFILES*10];
Xstatic char *pointers[MAXFILES];
X
Xint file_pointer;  /* External so that it can be read/written */
X
Xstatic valid = 0;
X
Xchar *
Xread_directory(dir)
Xchar *dir;
X{
X    int count, mycmp();
X    char *scdir();
X    char path[128];
X
X    file_pointer = 0;
X    if (dir) {
X	getcwd(path,127);
X	chdir(dir);
X    }
X
X    count = getfnl("#?", names, sizeof(names), 0);
X
X    if (dir) chdir(path);
X
X    if (count > 0) {
X      if (strbpl(pointers, MAXFILES, names) != count) {
X	 printf("Too many files\n");
X	 return (char *)NULL;
X      }
X    } else {
X      return (char *)NULL;
X    }
X
X    qsort((char *)pointers, count, sizeof(char *), mycmp);
X
X    valid = 1;	/* We have some files, and more important, some space has
X		   been malloc'd */
X
X    return (char *)1;
X}
X
Xchar *
Xget_next_file()
X{
X char *p;
X
X  if ( (p=pointers[file_pointer++]) == NULL )
X	file_pointer=0;
X  return p;
X}
X
Xfree_directory()
X{
X   int i;
X   if (valid) {
X	for(i=0;pointers[i] != NULL;i++)
X		free(pointers[i]);
X
X	valid = 0;
X    }
X	return(0);
X}
X
Xmycmp(a,b)
Xchar **a,**b;
X{
X	return (atol(*a)-atol(*b));
X}
X
X
END_OF_FILE
if test 1607 -ne `wc -c <'src/News060/Anews/mscan.c'`; then
    echo shar: \"'src/News060/Anews/mscan.c'\" unpacked with wrong size!
fi
# end of 'src/News060/Anews/mscan.c'
fi
if test -f 'src/compress/uuencode.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/compress/uuencode.c'\"
else
echo shar: Extracting \"'src/compress/uuencode.c'\" \(2000 characters\)
sed "s/^X//" >'src/compress/uuencode.c' <<'END_OF_FILE'
X
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();
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			perror(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
X#ifdef AMIGA
Xperror(err)
Xchar *err;
X{
X	printf("Can not open file \"%s\"\n", err);
X	return(NULL);
X}
X#endif
END_OF_FILE
if test 2000 -ne `wc -c <'src/compress/uuencode.c'`; then
    echo shar: \"'src/compress/uuencode.c'\" unpacked with wrong size!
fi
# end of 'src/compress/uuencode.c'
fi
if test -f 'src/dmail/DMakefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/dmail/DMakefile'\"
else
echo shar: Extracting \"'src/dmail/DMakefile'\" \(1616 characters\)
sed "s/^X//" >'src/dmail/DMakefile' <<'END_OF_FILE'
X
X#VERSION 1.11
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:dmail/
XEXE= uucp:c/dmail
XSYMS= uucp:src/lib/all.m
XCFLAGS= -iuucp:src/include/
X
XLIBS=	uucp:src/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 1616 -ne `wc -c <'src/dmail/DMakefile'`; then
    echo shar: \"'src/dmail/DMakefile'\" unpacked with wrong size!
fi
# end of 'src/dmail/DMakefile'
fi
if test -f 'src/dmail/cond.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/dmail/cond.c'\"
else
echo shar: Extracting \"'src/dmail/cond.c'\" \(1358 characters\)
sed "s/^X//" >'src/dmail/cond.c' <<'END_OF_FILE'
X
X/*
X * COND.C
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 1358 -ne `wc -c <'src/dmail/cond.c'`; then
    echo shar: \"'src/dmail/cond.c'\" unpacked with wrong size!
fi
# end of 'src/dmail/cond.c'
fi
if test -f 'src/dmail/globals.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/dmail/globals.c'\"
else
echo shar: Extracting \"'src/dmail/globals.c'\" \(1850 characters\)
sed "s/^X//" >'src/dmail/globals.c' <<'END_OF_FILE'
X
X/*
X * GLOBALS.C
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     */
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 1850 -ne `wc -c <'src/dmail/globals.c'`; then
    echo shar: \"'src/dmail/globals.c'\" unpacked with wrong size!
fi
# end of 'src/dmail/globals.c'
fi
if test -f 'src/getty/passwd.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/getty/passwd.c'\"
else
echo shar: Extracting \"'src/getty/passwd.c'\" \(1689 characters\)
sed "s/^X//" >'src/getty/passwd.c' <<'END_OF_FILE'
X
X/*
X *  PASSWD.C
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 <proto/all.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/R1000G1 <UUSER:%s/%d/R1000G1 ", 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 1689 -ne `wc -c <'src/getty/passwd.c'`; then
    echo shar: \"'src/getty/passwd.c'\" unpacked with wrong size!
fi
# end of 'src/getty/passwd.c'
fi
if test -f 'src/include/config.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/include/config.h'\"
else
echo shar: Extracting \"'src/include/config.h'\" \(1625 characters\)
sed "s/^X//" >'src/include/config.h' <<'END_OF_FILE'
X
X/*
X *  CONFIG.H
X *
X *  OBSOLETE, DO NOT USE
X */
X
Xchar *FindConfig(char *);
Xchar *GetConfig(char *, char *);
X
X#define USERNAME	"UserName"
X#define NODENAME	"NodeName"
X#define REALNAME	"RealName"
X#define DEBUGNAME	"Debug"
X#define NEWSFEED	"NewsFeed"
X#define ORGANIZATION	"Organization"
X#define FILTER		"Filter"        /*  can be run in the foregnd    */
X#define RFILTER 	"RFilter"       /*  can be run in the background */
X#define EDITOR		"MailEditor"
X#define HOME		"Home"
X
X/*
X *
X * This idea (and base) for this code was written by Fred Cassirer 10/9/88
X * as a Config file for News programs, to whom I say Thanx!
X *
X * It has since been expanded to include all the directory paths and some
X * command/filenames. This is to eliminate the forced use of hardcoding in
X * the executables.
X *
X * Simply change any of these you may need to, and recompile as needed.
X *
X * Sneakers 11/21/88
X *
X */
X
X#define MAXGROUPS 1024	/* Maximum # of subscribed newsgroups */
X#define MAXFILES  300	/* Max # of files in any news or spool directory */
X
X#define NEWSGROUPS "uulib:NewsGroups/" /* List of subscribed newsgroups */
X#define SAVEDIR    "uunews:Save/"      /* Place to save interesting article */
X#define NEWSDIR    "uunews:"           /* Directory to deposit the news */
X
X#define ERRORFILE  "uuspool:error.log"    /* File to hold any errors      */
X
X#ifdef NOTDEF
X
X#define CRONTAB    "uulib:CronTab"        /* Actual crontab file location */
X#define CRONERR    "uuspool:CronErro"     /* Location of cron error file  */
X
X#define CONFILE    "uulib:Config"         /* Location of the config file  */
X
X#endif
X
X/* #include <proto/all.h> */
X
END_OF_FILE
if test 1625 -ne `wc -c <'src/include/config.h'`; then
    echo shar: \"'src/include/config.h'\" unpacked with wrong size!
fi
# end of 'src/include/config.h'
fi
if test -f 'src/lib/config.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/lib/config.c'\"
else
echo shar: Extracting \"'src/lib/config.c'\" \(1505 characters\)
sed "s/^X//" >'src/lib/config.c' <<'END_OF_FILE'
X
X/*
X *  CONFIG.C
X *
X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
X *
X *  Extract fields from UULIB:Config
X */
X
X#include <stdio.h>
X#include <stdlib.h>
X#include <config.h>
X
X#define CTLZ	('z'&0x1F)
X
Xstatic char *ConfBuf = NULL;
X
Xchar *
XFindConfig(field)
Xchar *field;
X{
X    char *str;
X    short flen = strlen(field);
X
X    if (ConfBuf == NULL) {
X	FILE *fi = fopen("UULIB:Config", "r");
X	if (fi) {
X	    long buflen;
X	    fseek(fi, 0L, 2);
X	    buflen = ftell(fi);
X	    fseek(fi, 0L, 0);
X	    if (buflen > 0 && (ConfBuf = malloc(buflen + 1))) {
X		fread(ConfBuf, buflen, 1, fi);
X		ConfBuf[buflen] = CTLZ;     /*	can't use \0 */
X		for (str = ConfBuf; *str; ++str) {
X		    char *bup;
X		    if (*str == '\n') {     /*  make separate strs */
X			*str = 0;
X					    /*	remove white space at end */
X			for (bup = str - 1; bup >= ConfBuf && (*bup == ' ' || *bup == 9); --bup)
X			    *bup = 0;
X		    }
X		}
X	    } else {
X		ConfBuf = NULL;
X	    }
X	}
X    }
X    if (ConfBuf == NULL)
X	return(NULL);
X    /*
X     *	Search ConfBuf for Field<space/tab>
X     */
X
X    for (str = ConfBuf; *str != CTLZ; str += strlen(str) + 1) {
X	if (*str == 0)
X	    continue;
X	if (strncmp(str, field, flen) == 0 && (str[flen] == ' ' || str[flen] == '\t')) {
X	    str += flen;
X	    while (*str == ' ' || *str == 9)
X		++str;
X	    return(str);
X	}
X    }
X    return(NULL);
X}
X
Xchar *
XGetConfig(field, def)
Xchar *field;
Xchar *def;
X{
X    char *result = FindConfig(field);
X
X    if (result == NULL)
X	result = def;
X    return(result);
X}
X
END_OF_FILE
if test 1505 -ne `wc -c <'src/lib/config.c'`; then
    echo shar: \"'src/lib/config.c'\" unpacked with wrong size!
fi
# end of 'src/lib/config.c'
fi
if test -f 'src/lib/getpwnam.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/lib/getpwnam.c'\"
else
echo shar: Extracting \"'src/lib/getpwnam.c'\" \(1815 characters\)
sed "s/^X//" >'src/lib/getpwnam.c' <<'END_OF_FILE'
X
X/*
X *  GETPWNAM.C
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
Xstatic char *Breakout();
X
Xchar *PasswdFile = "UULIB:passwd";
X
Xstruct passwd *
Xgetpwnam(name)
Xchar *name;
X{
X    FILE *fi = fopen(PasswdFile, "r");
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 (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 1815 -ne `wc -c <'src/lib/getpwnam.c'`; then
    echo shar: \"'src/lib/getpwnam.c'\" unpacked with wrong size!
fi
# end of 'src/lib/getpwnam.c'
fi
if test -f 'src/lib/log.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/lib/log.c'\"
else
echo shar: Extracting \"'src/lib/log.c'\" \(1273 characters\)
sed "s/^X//" >'src/lib/log.c' <<'END_OF_FILE'
X
X/*
X *  LOG.C
X *
X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
X *
X *  ulog(level, ctl, args...)
X */
X
X#include <proto/all.h>
X#include <stdio.h>
X#include <stdlib.h>
X#include <fcntl.h>
X#include <time.h>
X
X#include "log.h"
X
Xint	LogLevel = -1;
Xint	LogToStdout = 0;
Xchar	*LogProgram = "-";
Xchar	*LogHost = "-";
Xchar	*LogWho = "-";
Xchar	*LogFile = "UUSPOOL:LOGFILE";
Xchar	LogBuf[512];
X
Xvoid
Xulog(level, ctl, arg1, arg2, arg3, arg4, arg5, arg6)
Xint level;
Xchar *ctl;
Xlong arg1, arg2, arg3, arg4, arg5, arg6;
X{
X    long clock;
X    struct tm *ut;
X    int logfd;
X    int len;
X
X    if (level > LogLevel)
X	return;
X
X    (void)time(&clock);
X    ut = localtime(&clock);
X
X    sprintf(LogBuf, "(%d/%d-%d:%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, arg1, arg2, arg3, arg4, arg5, arg6);
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
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}
X
END_OF_FILE
if test 1273 -ne `wc -c <'src/lib/log.c'`; then
    echo shar: \"'src/lib/log.c'\" unpacked with wrong size!
fi
# end of 'src/lib/log.c'
fi
if test -f 'src/sendmail/parse.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/sendmail/parse.c'\"
else
echo shar: Extracting \"'src/sendmail/parse.c'\" \(1232 characters\)
sed "s/^X//" >'src/sendmail/parse.c' <<'END_OF_FILE'
X
X/*
X *  PARSE.C
X *
X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
X */
X
X#include <proto/all.h>
X#include <stdio.h>
X#include <stdlib.h>
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
XParseAddress(str, buf, len)
Xchar *str;
Xchar *buf;
Xshort len;
X{
X    short i;
X    short 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
Xchar *
XParseAddress2(addr, buf, len)
Xchar *addr;
Xchar *buf;
Xshort len;
X{
X    short 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 1232 -ne `wc -c <'src/sendmail/parse.c'`; then
    echo shar: \"'src/sendmail/parse.c'\" unpacked with wrong size!
fi
# end of 'src/sendmail/parse.c'
fi
if test -f 'src/uucico/DMakefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/uucico/DMakefile'\"
else
echo shar: Extracting \"'src/uucico/DMakefile'\" \(974 characters\)
sed "s/^X//" >'src/uucico/DMakefile' <<'END_OF_FILE'
X
X#   DMakefile
X
XOD=ltmp:uucp/
XEXE= uucp:c/
XSYMS= uucp:src/lib/all.m
X
XCFLAGS= -iuucp:src/include/ -cq
X
XLOPTS= SC SD LIB uucp:src/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
X
XOBJS=$(SRCS:"*.c":"$(OD)*.o")
X
Xall:	$(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
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
END_OF_FILE
if test 974 -ne `wc -c <'src/uucico/DMakefile'`; then
    echo shar: \"'src/uucico/DMakefile'\" unpacked with wrong size!
fi
# end of 'src/uucico/DMakefile'
fi
if test -f 'src/uucico/sysdep.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/uucico/sysdep.h'\"
else
echo shar: Extracting \"'src/uucico/sysdep.h'\" \(1876 characters\)
sed "s/^X//" >'src/uucico/sysdep.h' <<'END_OF_FILE'
X/* Amiga Port by William Loftus */
X/* Changes are Copyright 1988 by William Loftus. All rights reserved. */
X
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 1876 -ne `wc -c <'src/uucico/sysdep.h'`; then
    echo shar: \"'src/uucico/sysdep.h'\" unpacked with wrong size!
fi
# end of 'src/uucico/sysdep.h'
fi
if test -f 'src/uucico/uucp.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/uucico/uucp.h'\"
else
echo shar: Extracting \"'src/uucico/uucp.h'\" \(1358 characters\)
sed "s/^X//" >'src/uucico/uucp.h' <<'END_OF_FILE'
X/*
X * @(#)uucp.h 1.5 87/08/13 -- uucp.h Copyright 1987 by John Gilmore
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 1358 -ne `wc -c <'src/uucico/uucp.h'`; then
    echo shar: \"'src/uucico/uucp.h'\" unpacked with wrong size!
fi
# end of 'src/uucico/uucp.h'
fi
if test -f 'src/uucico/version.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/uucico/version.doc'\"
else
echo shar: Extracting \"'src/uucico/version.doc'\" \(1459 characters\)
sed "s/^X//" >'src/uucico/version.doc' <<'END_OF_FILE'
X
X<all-Programs>
X    Dec-89  Matthew Dillon.  Modified to conform with my release.
X	    Specifically, now use common library routines in uucp:src/lib,
X	    file locking routines, logging routines, etc...
X
X
X
XUUXQT:
X
X	.01 First sub release number assigned.
X
X
X	11-Jul-88 by Dan Schein
X
X	    Added support for unknown command request(s)
X	    Added support for a RMAIL command
X	    Added "New Files Received." message
X	    Added Beta Version number
X
XUUCICO:
X
X	.06
X		as of date 25 January 1989
X
X	.05
X		G protocol now windows, window = 2.  Normally
X		arbitrates for window size, can be defeated (forced to
X		1) by using -n option.
X
X		Accepts filenames ~/path or ~user/path.  ~/path uses
X		UUPUB: while ~user/path looks up the home directory
X		in the Getty:Passwd file, defaulting to UUPUB: if
X		the requested user could not be found.
X
X	.04
X		only deletes queue files in a set if ALL make it
X		across... before would delete each file individually.
X
X		added security feature, does not allow remote end
X		to send C.#? files to our uuspool:
X
X	.02
X		G protocol rewritten from scratch
X
X	.01
X		Security list (UULIB:Security) allowed directories
X		for remote requests.
X
X		Getty support
X
X		File Locking (lib/lockfile.c)
X
XUUCP:
X	.00	First sub release assigned
X
XUUNAME:
X	.00	First sub release assigned
X
XUUX:
X	.01	Uses UULIB: instead of UUCP:LIB
X
XUUHOSTS:
X	.01	Uses UULIB: instead of UUCP:LIB
X
XUUPOLL:
X	.02	Uses UULIB: instead of UUCP:LIB
X		Uses run >nil: <nil: instead of brun
X
END_OF_FILE
if test 1459 -ne `wc -c <'src/uucico/version.doc'`; then
    echo shar: \"'src/uucico/version.doc'\" unpacked with wrong size!
fi
# end of 'src/uucico/version.doc'
fi
if test -f 'src/uuser/misc.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/uuser/misc.c'\"
else
echo shar: Extracting \"'src/uuser/misc.c'\" \(1880 characters\)
sed "s/^X//" >'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 *  (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 <proto/all.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 1880 -ne `wc -c <'src/uuser/misc.c'`; then
    echo shar: \"'src/uuser/misc.c'\" unpacked with wrong size!
fi
# end of 'src/uuser/misc.c'
fi
if test -f 'src/uuser/uuser.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/uuser/uuser.doc'\"
else
echo shar: Extracting \"'src/uuser/uuser.doc'\" \(2039 characters\)
sed "s/^X//" >'src/uuser/uuser.doc' <<'END_OF_FILE'
X
X			    UUSER.DOC
X
X			    UUSER V1.00 Beta
X
X    UUSER: (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
X
X
X    Currently UUSER: works only with single sessions started
X    by Getty (this has to do with how UUSER: deals with carrier
X    detect).  THIS WILL BE FIXED.
X
X    Openning UUSER:
X
X	fopen("UUSER:devicename/unit/options", ...);
X
X    Example:
X		    (suggested)
X
X	int  fd = open("UUSER:serial.device/0/R1000", O_RDWR | O_CREAT | O_TRUNC);
X
X		    (also can do this -- see below for problems using
X		     stdio to read)
X
X	FILE *rfi = fopen("UUSER:serial.device/0/R1000", "r");
X	FILE *wfi = fopen("UUSER:serial.device/0/R1000", "w");
X
X
X    Features:
X
X	* 1K asynchronous write buffer for each file handle.  I.E.
X	  your write() will return when 1K or less remains to be
X	  written (UUSER: has a 1K buffer for spooling these per
X	  file handle)
X
X	* selectable read timeout
X
X	* read poll
X
X	* carrier lost handling
X
X    General:
X
X	(1) Use Level 1 I/O if you can (read/write)
X	    read() returns 0 on timeout, -1 on carrier lost
X	    otherwise, read() returns the immediate number of
X	    data bytes ready up to the amount you requested.
X	    (i.e. if you read(0,buf,256) you can get anywhere from
X	    -1, 0, 1 to 256 back).
X
X	    write() returns the number you wrote or -1 (lost carrier)
X
X	    To 'poll' data ready you can read(0, NULL, 0) .. reading
X	    0 bytes returns 0 (data ready) or -1 (data not ready).
X	    NOTE: 0 (data ready) will be returned if carrier is lost
X	    when you read 0 bytes... this is so your program thinks
X	    data is ready and when it does a real read it finds that
X	    carrier was lost!
X
X	(2) If you want to use Level 2 I/O (stdio) I suggest you use
X	    it for writing only.  If you really want to use it for
X	    reading remember that the timeout will cause an EOF
X	    condition which must be cleared (clrerr()).  And you
X	    must call ferror() to determine whether an EOF is an
X	    EOF (timeout()) or an actual error (lost carrier).
X
X	REFER TO UUSERDUMP.C for a working source example.
X
X
END_OF_FILE
if test 2039 -ne `wc -c <'src/uuser/uuser.doc'`; then
    echo shar: \"'src/uuser/uuser.doc'\" unpacked with wrong size!
fi
# end of 'src/uuser/uuser.doc'
fi
echo shar: End of archive 2 \(of 16\).
cp /dev/null ark2isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 16 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
-- 
Submissions to comp.sources.amiga and comp.binaries.amiga should be sent to:
	amiga@cs.odu.edu	
or	amiga@xanth.cs.odu.edu	( obsolescent mailers may need this address )
or	...!uunet!xanth!amiga	( very obsolescent mailers need this address )

Comments, questions, and suggestions should be addressed to ``amiga-request''
(please only use ``amiga'' for actual submissions) at the above addresses.