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

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

Submitted-by: overload!dillon (Matt Dillon)
Posting-number: Volume 90, Issue 049
Archive-name: unix/uucp-1.03d/part05

#!/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 5 (of 16)."
# Contents:  QuickSetup.DOC man/Compress man/DCron man/Getty
#   man/NewsGroups man/dmail src/compress/unshar.c src/dmail/main.c
#   src/dmail/sub.c
# Wrapped by tadguy@xanth on Sat Feb  3 20:51:09 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'QuickSetup.DOC' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'QuickSetup.DOC'\"
else
echo shar: Extracting \"'QuickSetup.DOC'\" \(5830 characters\)
sed "s/^X//" >'QuickSetup.DOC' <<'END_OF_FILE'
X
X			    QUICKSETUP.DOC
X
X			    Matthew Dillon
X			    891 Regal Rd.
X			    Berkeley, Ca. 94708
X
X			    pacbell.PacBell.COM!sorinc!overload!dillon
X
X
X		    QUICKLY GETTING UUCP UP AND RUNNING
X
X
X    THE FIRST FLOPPY IN THE DISTRIBUTION IS BOOTABLE and sets up a dummy
X    system that accepts calls for Login = uucp and Password = uupc and
X    nodes named uucp, test1, or test2.	To quickly test UUCP with a friend
X    running the same distribution follow the directions immediately below.
X    Note that these directions exist so you can quickly test UUCP with a
X    copy of the boot floppy.  Once you know it works you MUST follow
X    the procedure described in SlowSetup.DOC to create a real UUCP node.
X
X    Phrases in parenthesis refer to what the second person should do.
X    Example, 1> dmail root@test2 (root@test1) asks person #1 to
X    'dmail root@test2' and person #2 to 'dmail root@test1'
X
X			Person #1 (Person #2)
X
X    (1) Make a copy of both distribution diskettes and then put the
X	originals away somewhere.  With a two floppy system you may
X	simply use DiskCopy.  With a one floppy system you will need
X	to copy things a directory at a time to your ram: disk and
X	back (be very sure that you make an exact duplicate to prevent
X	stupid mistakes).  If you are not using DiskCopy be sure to
X	run the Install program on the copy to make it bootable.
X
X	The test procedure described below requires only a bootable
X	copy of the FIRST distribution diskette.
X
X	You may want to copy your favorite editor to this floppy.  Remember
X	that enough room must remain for queue and mail files, at least for
X	initial testing.
X
X	You may also want to copy a terminal program to this floppy for
X	troubleshooting.
X
X	The DME editor already exists on this disk.
X
X    (2) Reboot your computer with the first distribution diskette.
X
X	The boot sequence will leave two programs running in the
X	background: DCron, and Getty.  Getty sits on the serial port
X	waiting for connections while DCron is a timekeeping program
X	which runs other programs at certain times based on a crontab
X	file in S:.
X
X    (3) In the "lib/Config" file modify the NodeName entry to test1 (test2).
X
X    (4) In the "lib/L.Sys" file modify the telephone number to that
X	of Person #1 (Person #2)
X
X    (5) Each of you email the other, 1> dmail root@test2 (root@test1)
X	(Note that you are emailing to the OTHER guy's machine).
X
X	Leave a blank line after the headers and write a small note to
X	the other person.  Shift-DEL deletes a line while F10 sends the
X	message.  BTW, DMail runs the DME editor and this is what you
X	are editing your email in.  You might want to refer to various
X	documentation in the MAN directory of the SECOND distribution
X	diskette.
X
X    (6) Check that the system has queued the files for transfer,
X
X	1> dir uuspool:
X
X	There should be one C. control file and two D. data files.  Each
X	mail item queues three files so if you had, for example, sent
X	two messages, there would be 6 files in UUSPOOL:
X
X
X    (7) This assumes both of you have relatively standard modems
X	connected to your systems.  If you do not have modems capable
X	of a minimal AT instruction set you may have problems.
X
X	**NOTE** Most modems have dip-switch selectable Ignore-DTR.
X	This should be disabled.  That is, dropping DTR should disconnect
X	any connection.
X
X	THE MODEM MUST SUPPORT CARRIER DETECT.	Be sure that your
X	serial cable passes carrier detect.
X
X	Current parameters set in lib/L.sys and s:startup-sequence assume
X	at least a 1200 baud modem.
X
X	One of you should call the other.  For example, person #1 may
X	call person #2 with the command "1> uucico -stest2", where 1>
X	is the CLI prompt, and vise versa for person #2 "1> uucico -stest1".
X
X	UUCico will send the appropriate commands to your modem to call
X	the other person using touch tone (ATDT) codes.  Refer to
X	man/uucico on the second distribution disk for other options.
X
X	UUCico will then connect to the other system.  The Getty,
X	run in the background on both systems, will accept the call
X	and handle the login then run uucico on the second machine
X	automatically.	The two uucico's should then transfer mail.
X	This should take maybe a minute.
X
X	UUCico will then hangup, do further processing, then run
X	another program in the background that deals with the queue
X	files that were transfered by the remote machine (the same
X	thing happens on the remote machine to deal with the queue
X	files we transfered it).  After all disk activity finishes
X	you each should have a message in your respective UUMAIL:
X	directories in a file called 'root'.
X
X	1> Dir uumail:
X	1> Type uumail:Root
X
X    (8) IF MAIL DID NOT GET TRANSFERED, and most likely you will have
X	noticed UUCico giving up early, then something went wrong
X	somewhere.
X
X	First determine on whos computer the problem is.  One of you
X	use your term program to call the other person's computer.
X	His Getty should answer with a stupid header line and a
X	Login: prompt.	You should be able to login as 'test1' or
X	'test2', password of 'uupc', and his computer ought to then
X	run UUCico (you will see the characters 'Shere' appear after
X	a short while and the system will appear to hang).  UUCico
X	is a transfer protocol.
X
X	Each of you follow the above sequence on the other's computer.
X	This verifies that the Getty program is working properly.
X
X	**NOTE**, some terminal programs will not work with Getty
X	running in the background, you may have to BREAK the Getty
X	program which in an unaltered startup-sequence will be
X	CLI process #2.  DCron is CLI process #3.
X
X	Refer to Problems.DOC for more information.  Most problems at
X	this point will be due to either screwing around with files
X	beyond what I've asked you to modify or incorrectly configured
X	or incompatible modems.
X
X				    ---
X
X	Please read SlowSetup.DOC for instructions on setting your
X	system up for real.
X
END_OF_FILE
if test 5830 -ne `wc -c <'QuickSetup.DOC'`; then
    echo shar: \"'QuickSetup.DOC'\" unpacked with wrong size!
fi
# end of 'QuickSetup.DOC'
fi
if test -f 'man/Compress' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'man/Compress'\"
else
echo shar: Extracting \"'man/Compress'\" \(5367 characters\)
sed "s/^X//" >'man/Compress' <<'END_OF_FILE'
X
X     NAME
X	  compress, uncompress, zcat - compress and expand data
X
X	  14compress		     - 14 bit version of compress,
X				       takes less memory.
X
X	  NOTE: 'uncompress' and 'zcat' are the exact same executable
X	  as 'compress', just renamed.  These 16 bit versions can also
X	  uncompress files compressed with 14compress
X
X     SYYNOPSIS
X	  compress [ -f ] [ -v ] [ -c ] [ -V ] [ -bits ] [ name ... ]
X	  uncompress [ -f ] [ -v ] [ -c ] [ -V ] [ name ... ]
X	  zcat [ -V ] [ name ... ]
X
X     DESCRIPTION
X	  * SPECIAL NOTE, for UUCP distributions which do not contain
X	    '14compress' but which do contain 'compress', the
X	    'compress' is actually the 14 bit version, not the 16
X	    bit version.
X
X	  Compress reduces the size of the named files using adaptive
X	  Lempel-Ziv coding.  Whenever possible, each file is replaced
X	  by one with the extension .Z , while keeping the same
X	  ownership modes, access and modification times.  If no files
X	  are specified, the standard input is compressed to the
X	  standard output.  Compressed files can be restored to their
X	  original form using uncompress or zcat.
X
X	  The -f option will force compression of name. This is useful
X	  for compressing an entire directory, even if some of the
X	  files do not actually shrink.  If -f is not given and
X	  compress is run in the foreground, the user is prompted as
X	  to whether an existing file should be overwritten.
X
X	  The -c option makes compress/uncompress write to the
X	  standard output; no files are changed.  The nondestructive
X	  behavior of zcat is identical to that of uncompress -c.
X
X	  Compress uses the modified Lempel-Ziv algorithm popularized
X	  in "A Technique for High Performance Data Compression",
X	  Terry A. Welch, IEEE Computer, vol. 17, no. 6 (June 1984),
X	  pp. 8-19.  Common substrings in the file are first replaced
X	  by 9-bit codes 257 and up.  When code 512 is reached, the
X	  algorithm switches to 10-bit codes and continues to use more
X	  bits until the limit specified by the -b flag is reached
X	  (default 16).  Bits must be between 9 and 16.  The default
X	  can be changed in the source to allow compress to be run on
X	  a smaller machine.
X
X	  After the bits limit is attained, compress periodically
X	  checks the compression ratio.  If it is increasing, compress
X	  continues to use the existing code dictionary.  However, if
X	  the compression ratio decreases, compress discards the table
X	  of substrings and rebuilds it from scratch.  This allows the
X	  algorithm to adapt to the next "block" of the file.
X
X	  Note that the -b flag is omitted for uncompress, since the
X	  bits parameter specified during compression is encoded
X	  within the output, along with a magic number to ensure that
X	  neither decompression of random data nor recompression of
X	  compressed data is attempted.
X
X	  The amount of compression obtained depends on the size of
X	  the input, the number of bits per code, and the distribution
X	  of common substrings.  Typically, text such as source code
X	  or English is reduced by 50-60%.  Compression is generally
X	  much better than that achieved by Huffman coding (as used in
X	  pack), or adaptive Huffman coding (compact), and takes less
X	  time to compute.
X
X	  Under the -v option, a message is printed yielding the
X	  percentage of reduction for each file compressed.
X
X	  If the -V option is specified, the current version and
X	  compile options are printed on stderr.
X
X	  Exit status is normally 0; if the last file is larger after
X	  (attempted) compression, the status is 2; if an error
X	  occurs, exit status is 1.
X
X     DIAGNOSTICS
X	  Usage: compress [-dfvcV] [-b maxbits] [file ...]
X		  Invalid options were specified on the command line.
X	  Missing maxbits
X		  Maxbits must follow -b.
X	  file: not in compressed format
X		  The file specified to uncompress has not been
X		  compressed.
X	  file: compressed with xx bits, can only handle yy bits
X		  File was compressed by a program that could deal
X		  with more bits than the compress code on this
X		  machine.  Recompress the file with smaller bits.
X	  file: already has .Z suffix -- no change
X		  The file is assumed to be already compressed.
X		  Rename the file and try again.
X	  file: filename too long to tack on .Z
X		  The file cannot be compressed because its name is
X		  longer than 12 characters.  Rename and try again.
X		  This message does not occur on BSD systems.
X	  file already exists; do you wish to overwrite (y or n)?
X		  Respond "y" if you want the output file to be
X		  replaced; "n" if not.
X	  uncompress: corrupt input
X		  A SIGSEGV violation was detected which usually means
X		  that the input file has been corrupted.
X	  Compression: xx.xx%
X		  Percentage of the input saved by compression.
X		  (Relevant only for -v.)
X	  -- not a regular file: unchanged
X		  When the input file is not a regular file, (e.g. a
X		  directory), it is left unaltered.
X
X	  -- has xx other links: unchanged
X		  The input file has links; it is left unchanged.  See
X		  ln(1) for more information.
X	  -- file unchanged
X		  No savings is achieved by compression.  The input
X		  remains virgin.
X
X     BUGS
X	  Although compressed files are compatible between machines
X	  with large memory, -b12 should be used for file transfer to
X	  architectures with a small process data space (64KB or less,
X	  as exhibited by the DEC PDP series, the Intel 80286, etc.)
X
END_OF_FILE
if test 5367 -ne `wc -c <'man/Compress'`; then
    echo shar: \"'man/Compress'\" unpacked with wrong size!
fi
# end of 'man/Compress'
fi
if test -f 'man/DCron' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'man/DCron'\"
else
echo shar: Extracting \"'man/DCron'\" \(4580 characters\)
sed "s/^X//" >'man/DCron' <<'END_OF_FILE'
X
X				DCRON.DOC
X
X			      UNIX-like CRON
X
X				  V2.00
X			      7 August 1989
X
X			      Matthew Dillon
X			      891 Regal Rd
X			      Berkeley, Ca. 94708
X
X			     dillon@ucbvax.Berkeley.edu
X			     ...!ucbvax!dillon
X
XDESCRIPTION:
X
X    Those not familar with the UNIX cron command probably do not need it.
X
X
XINSTALLATION:
X    the NULL: device must be mounted
X
X    an s:crontab file must exist (see instructions below)
X
X    1.3 RUN required so you can: run <nil: >nil: dcron <logfile>
X
X    copyadd l/null-handler into your l: and add the appropriate
X    Mountlist entry to your devs:Mountlist (see included Mountlist
X    file)
X
X    Create S:crontab with entries as you like.
X
XINSTRUCTIONS:
X
X    NOTE:   * All cron-commands are automatically RUN  in the background,
X	      you do not need to say 'run' in the command argument of the
X	      s:crontab file
X
X	    * You do not have to redirect standard command output.  I.E.
X	      if you do a 'List' from cron, the output is sent to the
X	      cia.
X
X	    * DCRON WORKS ONLY WITH 1.3, specifically, the 1.3 RUN command
X	      must be installed.
X
X	    * DO NOT RUNBACK CRON!!!  Use: run <nil: >nil:
X
X
X    Inspired by Rick Schaeffer's AmigaCron.  I decided to write this
Xone from scratch.  The program is crontab file compatible with Rick's
Xand the UNIX cron tab format with the same exceptions as Rick had.
XSpecifically, the % char is not implemented and the day-of-week is
Xranged 0-6 (Sun-Sat) rather than the UNIX 1-7 (Mon-Sun).
X
X
X    The major purpose of this program, apart from yielding the functionality
Xof cron, is the addition of major time optimizations.  The program loads
Xs:crontab into memory and only reloads if the datestamp of the file has been
Xmodified (checked every 60 seconds).  DCron also checks if the user has
Xmodified the system time.
X
X    The result is that my cron takes virtually no CPU.
X
X    [run <nil: >nil:] DCron [-d] logfile
X
X    Using the 1.3 RUN command and redirecting both stdin and stdout to NIL:,
X    you can safely close the CLI window that you ran DCron in.
X
X    The logfile is a required argument and logs all errors and status
Xmessages.  Under normal conditions this file does not get very big.
XCron does an open-append/write/close sequence every time it logs a message
Xallowing you to cat, edit, or even remove the file with cron running.
X(If you remove it, the next logged message will cause the file to be
Xre-created).
X
X    The -d option, for debug, is used for debugging and logs additional
Xinformation.  (may not be implemented in release)
X
X    The control file is S:CRONTAB and may contain one of three types of
Xlines:	(1) A blank line, (2) A line beginning with a hash ``#'' which
Xintroduces a comment, (3) A cron line of 5 or 6 fields:
X
X<min> <hour> <day> <month> <dayofweek>	[<command>]
X
X    Each field <min> to <dayofweek> can be either a single asterix ``*''
Xwhich matches all times, or a comma delimited list of numbers or ranges
Xwhich must be in numerical order.  Assume the control file is scanned
Xevery minute.  On every minute, each field that matches the current
Xtime, day, and day of week will be executed.
X
X    The <command> field is optional.  If no command is given the date is
Xsimply logged to the logfile (as well as the cron line that caused it).
XIf a command is given, it is a CLI command and is automatically RUN
X(asynchronous from the cron task).  Standard in/out is NIL:  The cron line
Xthat ran the command is logged.
X
X* * * * *   Date
X
X    Would execute the Date command every minute.  The output is ignored.
X    I.E. useless.  Also, running something every minute wastes CPU.
X
X0-3,5,7,40-50 * * * *	Date
X
X    Would execute it at the hour, 1 past, 2 past, 3 past, 5 past, 7 past,
X    40 41 42 ... and 50 past every hour.  Combinations can be used to
X    yield more interesting results:
X
X0 0,12 * * 0	Date
X
X    Would run Date at midnight and 12 noon, but only on sunday.
X
X0 0 25 12 *	Echo >ram:x "Merry Cristmas"
X
X    Would execute the Echo command at midnight beginning christmas day and
X    stick it in ram:x.
X
X* * * * 2-3 Date
X
X    Is useless ... execute the Date command every minute but only if the
X    day is a tuesday or wednesday (i.e. 1440 times on tuesday, 1440
X    times on wednesday, nothing for any other day).
X
X0 4 * * 1     shell >ram:backups -c "ChangeTaskPri -1;dobackups"
X
X    Would run a shell script to do my HD backup at 4:00 A.M. every Monday.
X(I have the advantage of having two physical drives and can back one up
Xto the other without user intervention).  This would also be useful to
Xbackup something to a remote host if you are on a network.
X
X
END_OF_FILE
if test 4580 -ne `wc -c <'man/DCron'`; then
    echo shar: \"'man/DCron'\" unpacked with wrong size!
fi
# end of 'man/DCron'
fi
if test -f 'man/Getty' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'man/Getty'\"
else
echo shar: Extracting \"'man/Getty'\" \(6005 characters\)
sed "s/^X//" >'man/Getty' <<'END_OF_FILE'
X
XNAME
X	Getty
X
XSYNOPSIS
X	Getty -Sserialname -Uunit -Bbaud -Bbaud.. -Mc
X	      -m1 -r0 -h0 -c0 -xn -A -7 -0 [modem-cmds]
X
X	NOTE BUG:  You currently cannot run more than one Getty per
X	*DEVICE NAME*, i.e. on more than one unit per device.
X
XDESCRIPTION
X	Getty hangs on the specified serial port (serial.device unit 0 by
X	default) waiting for connections via the connected modem.  Once
X	a connection is accepted Getty adjusts to the proper baud rate
X	using the CONNECT message, -B, -A options, then provides a
X	Login: request to the caller.
X
X	NOTE: A CONNECT message from the modem with no baud rate specified
X	will cause Getty to use the first baud rate in the -B list.  If
X	the -A option is specified, Getty *always* uses the first baud
X	rate in the -B list and never switches to any other baud rate.
X
X	If the caller sends a line-break Getty will switch to the next
X	baud rate in the specified list.  During the initialization phase
X	of the modem (before the first call and after a disconnect), Getty
X	readjusts the baud rate to the first specified rate.
X
X	Getty disconnects any caller who cannot provide a legal Login and
X	Password within 60 seconds.
X
X	Upon receiving a legal Login and and Password, verified via
X	GETTY:PASSWD, Getty will execute the program specified in
X	GETTY:PASSWD, usually UUCICO, and stay off the line until
X	UUCICO returns.  When UUCICO returns, Getty will disconnect
X	the caller and reset the modem, returning to its original state.
X
X	The file GETTY:Getty-Header contains a couple lines of text
X	that are sent over the serial port before the Login: request.
X	In it you normally have your machine type, name, etc...
X
X	Getty runs the specified program in the password entry adding
X	the following arguments:
X
X	    -Getty -DEVICE devicename -UNIT unitnumber
X
X	(uucico will recognize said arguments and not attempt to
X	 initialize / waitfor calls / hangup the modem itself)
X
X	Getty also recognizes when other amiga programs open the
X	serial.device it is waiting on and will get off the line for
X	the duration of the other program's connect (i.e. you can run
X	terminal programs without having to BREAK Getty).
X
X	NOTE 1:     Getty can only get off the line when it is idle,
X		    waiting for carrier.  UUCP related programs will
X		    also use a separate locking mechanism to properly
X		    talk to Getty under other circumstances.
X
X	NOTE 2:     Getty will attempt a disconnect sequence when it
X		    reestablishes control after the other program
X		    closes the serial.device .	Getty checks the
X		    device count once a second.
X
XOPTIONS
X	-Sserialname	    Specify serial device, default "serial.device"
X
X	-Uunit		    Specify unit number, default 0
X
X	-Bbaud		    Specify up to 32 baud rates
X
X	-A		    Specify modem will adjust to a single baud
X			    rate (locks the serial.device at the first
X			    baud rate in the -B list)
X
X	-7		    Use SERF_7WIRE protocol while online,
X			    else uses no protocol while online.  If
X			    you are using a modem with speed conversion
X			    you need this option or you will most likely
X			    overflow the modem's buffer!
X
X	-Mc		    Select Modem type,
X
X			    c = m   Multimodem
X				h   Hays
X				d   Dumb  (no AT or +++ commands are
X					   sent to the modem ever).
X
X	-mn		    Set modem speaker level, default 0.
X			    (ATMn command)
X
X	-rn		    Set modem to answer on the Nth ring
X			    (modem must support ATMn).  0 disables
X			    answer capability.	The default is to
X			    answer on the second ring.
X
X	-h0		    Ignore CD (carrier detect).  If this option
X			    is specified a continuous carrier detect is
X			    assumed, causing Getty to request Login:'s
X			    over the line as soon as it receives a CONNECT
X			    message.
X
X			    It is suggested you ONLY use this option
X			    when combined with -c0
X
X	-c0		    Do NOT look for a CONNECT message from the
X			    modem... useful for dumb modems.
X
X	-d0		    Normally Getty will disconnect by dropping
X			    DTR.  If this option is specified, Getty will
X			    use the less reliable +++ ATH0 sequence.
X
X	-xn		    Set debugging level to n.  If specified
X			    debugging messages are sent to stdout instead
X			    of GETTY:LOGFILE
X
X			    Note: to avoid GETTY:LOGFILE getting too
X			    large for busy systems, you can always add
X			    an entry to your crontab to delete it once
X			    a week (or whenever).
X
X	-0		    Kill any already-running Getty for this
X			    serial port and unit.
X
X	modem-cmds	    You may specify up to 16 specific commands
X			    to be sent to the modem whenever it is
X			    initialized (usually after a disconnect
X			    and on startup).  Each command will be
X			    sent to the modem with a CR on the end and
X			    a seconds delay afterwords.  Example:
X
X			    ATS2=.
X
X			    This is useful for provided specialized
X			    modems with the appropriate initialization
X			    strings.
X
XEXAMPLE
X	;   Run a Getty for a MultiModem
X
X	run >nil: <nil: Getty -Mm -A -B19200
X
X	;   Run a Getty for a Hays Modem
X
X	run >nil: <nil: Getty -Mh -B1200 -B2400
X
X	;   Modify options to a Getty already running in the background
X
X	Getty -m1	    ; Set speaker on during dialing
X	Getty -m0	    ; speaker off at all times.
X	Getty -0	    ; kill background Getty
X
XEXAMPLE CRONTAB ENTRIES
X	Assuming a getty has been run in the background from your
X	startup sequence, the most common desire is to disable the
X	modem speaker while you are asleep, and enable it at other
X	times.	The following crontab entry will accomplish this:
X
X0	23	*	*	*	getty -m0
X0	11	*	*	*	getty -m1
X
X	You can also kill (getty -0) or restart getty from your
X	crontab, though the prefered method is to leave it running
X	and only disable/enable the autoanswer (-r option) for those
X	times you wish your modem to not accept calls.
X
X
XFILES/REQUIRES
X	GETTY:PASSWD
X	GETTY:Getty-Header
X	GETTY:LOGFILE
X
X	The NULL: handler must be mounted
X	The UUSER: handler must be mounted if Passwd file contains
X	    *'d executable entries (don't confuse *'d executables
X	    with using '*' for the password field).
X
XREFERENCES
X	Getty
X	Passwd
X
END_OF_FILE
if test 6005 -ne `wc -c <'man/Getty'`; then
    echo shar: \"'man/Getty'\" unpacked with wrong size!
fi
# end of 'man/Getty'
fi
if test -f 'man/NewsGroups' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'man/NewsGroups'\"
else
echo shar: Extracting \"'man/NewsGroups'\" \(6833 characters\)
sed "s/^X//" >'man/NewsGroups' <<'END_OF_FILE'
Xnet.announce:
Xalt.aquaria:
Xalt.birthright:
Xalt.california:
Xalt.config:
Xalt.cult-movies:
Xalt.cyberpunk:
Xalt.dev.null:
Xalt.emusic:
Xalt.flame:
Xalt.general:
Xalt.gourmand:
Xalt.hypertext:
Xalt.individualism:
Xalt.recovery:
Xalt.rhode_island:
Xalt.rock-n-roll:
Xalt.sca:
Xalt.sex:
Xalt.sources:
Xalt.sources.amiga:
Xarchive.comp.os.minix:
Xarchive.comp.os.vms:
Xarchive.comp.sources.unix:
Xarchive.comp.sys.amiga:
Xarchive.comp.sys.sun:
Xarchive.comp.unix.wizards:
Xcomp.ai:
Xcomp.ai.digest:
Xcomp.ai.edu:
Xcomp.ai.neural-nets:
Xcomp.ai.nlang-know-rep:
Xcomp.ai.vision:
Xcomp.arch:
Xcomp.binaries.amiga:
Xcomp.binaries.apple2:
Xcomp.binaries.atari.st:
Xcomp.binaries.ibm.pc:
Xcomp.binaries.ibm.pc.d:
Xcomp.binaries.mac:
Xcomp.bugs.2bsd:
Xcomp.bugs.4bsd:
Xcomp.bugs.4bsd.ucb-fixes:
Xcomp.bugs.misc:
Xcomp.bugs.sys5:
Xcomp.cog-eng:
Xcomp.compilers:
Xcomp.databases:
Xcomp.dcom.lans:
Xcomp.dcom.modems:
Xcomp.dcom.telecom:
Xcomp.doc:
Xcomp.doc.techreports:
Xcomp.editors:
Xcomp.edu:
Xcomp.edu.composition:
Xcomp.emacs:
Xcomp.fonts:
Xcomp.graphics:
Xcomp.graphics.digest:
Xcomp.hypercube:
Xcomp.ivideodisc:
Xcomp.lang.ada:
Xcomp.lang.apl:
Xcomp.lang.asm370:
Xcomp.lang.c:
Xcomp.lang.c++:
Xcomp.lang.forth:
Xcomp.lang.fortran:
Xcomp.lang.icon:
Xcomp.lang.lisp:
Xcomp.lang.lisp.franz:
Xcomp.lang.lisp.x:
Xcomp.lang.misc:
Xcomp.lang.modula2:
Xcomp.lang.pascal:
Xcomp.lang.postscript:
Xcomp.lang.prolog:
Xcomp.lang.rexx:
Xcomp.lang.scheme:
Xcomp.lang.scheme.c:
Xcomp.lang.smalltalk:
Xcomp.laser-printers:
Xcomp.lsi:
Xcomp.lsi.cad:
Xcomp.mail.elm:
Xcomp.mail.headers:
Xcomp.mail.maps:
Xcomp.mail.mh:
Xcomp.mail.misc:
Xcomp.mail.sendmail:
Xcomp.mail.uucp:
Xcomp.misc:
Xcomp.music:
Xcomp.newprod:
Xcomp.org.decus:
Xcomp.org.fidonet:
Xcomp.org.usenix:
Xcomp.org.usrgroup:
Xcomp.os.cpm:
Xcomp.os.eunice:
Xcomp.os.fidonet:
Xcomp.os.minix:
Xcomp.os.misc:
Xcomp.os.os9:
Xcomp.os.research:
Xcomp.os.rsts:
Xcomp.os.v:
Xcomp.os.vms:
Xcomp.os.xinu:
Xcomp.parallel:
Xcomp.periphs:
Xcomp.periphs.printers:
Xcomp.protocols.appletalk:
Xcomp.protocols.ibm:
Xcomp.protocols.iso:
Xcomp.protocols.iso.x400:
Xcomp.protocols.iso.x400.gateway:
Xcomp.protocols.kermit:
Xcomp.protocols.misc:
Xcomp.protocols.tcp-ip:
Xcomp.protocols.tcp-ip.domains:
Xcomp.protocols.tcp-ip.ibmpc:
Xcomp.risks:
Xcomp.simulation:
Xcomp.society:
Xcomp.society.futures:
Xcomp.society.women:
Xcomp.software-eng:
Xcomp.sources.amiga:
Xcomp.sources.atari.st:
Xcomp.sources.bugs:
Xcomp.sources.d:
Xcomp.sources.games:
Xcomp.sources.games.bugs:
Xcomp.sources.mac:
Xcomp.sources.misc:
Xcomp.sources.unix:
Xcomp.sources.wanted:
Xcomp.std.c:
Xcomp.std.internat:
Xcomp.std.misc:
Xcomp.std.mumps:
Xcomp.std.unix:
Xcomp.sys.amiga:
Xcomp.sys.amiga.tech:
Xcomp.sys.apollo:
Xcomp.sys.apple:
Xcomp.sys.atari.8bit:
Xcomp.sys.atari.st:
Xcomp.sys.att:
Xcomp.sys.cbm:
Xcomp.sys.celerity:
Xcomp.sys.dec:
Xcomp.sys.dec.micro:
Xcomp.sys.encore:
Xcomp.sys.handhelds:
Xcomp.sys.hp:
Xcomp.sys.ibm.pc:
Xcomp.sys.ibm.pc.digest:
Xcomp.sys.ibm.pc.net:
Xcomp.sys.ibm.pc.rt:
Xcomp.sys.intel:
Xcomp.sys.intel.ipsc310:
Xcomp.sys.laptops:
Xcomp.sys.m6809:
Xcomp.sys.m68k:
Xcomp.sys.m68k.pc:
Xcomp.sys.mac:
Xcomp.sys.mac.digest:
Xcomp.sys.mac.hypercard:
Xcomp.sys.mac.programmer:
Xcomp.sys.masscomp:
Xcomp.sys.misc:
Xcomp.sys.nsc.32k:
Xcomp.sys.proteon:
Xcomp.sys.pyramid:
Xcomp.sys.ridge:
Xcomp.sys.sequent:
Xcomp.sys.sgi:
Xcomp.sys.sun:
Xcomp.sys.super:
Xcomp.sys.tahoe:
Xcomp.sys.tandy:
Xcomp.sys.ti:
Xcomp.sys.transputer:
Xcomp.sys.workstations:
Xcomp.sys.xerox:
Xcomp.sys.zenith:
Xcomp.sys.zenith.z100:
Xcomp.terminals:
Xcomp.terminals.bitgraph:
Xcomp.text:
Xcomp.text.desktop:
Xcomp.theory:
Xcomp.theory.cell-automata:
Xcomp.theory.dynamic-sys:
Xcomp.theory.info-retrieval:
Xcomp.theory.self-org-sys:
Xcomp.unix:
Xcomp.unix.aux:
Xcomp.unix.microport:
Xcomp.unix.questions:
Xcomp.unix.ultrix:
Xcomp.unix.wizards:
Xcomp.unix.xenix:
Xcomp.windows.misc:
Xcomp.windows.news:
Xcomp.windows.x:
Xgnu.announce:
Xgnu.chess:
Xgnu.config:
Xgnu.emacs:
Xgnu.emacs.bug:
Xgnu.emacs.lisp.manual:
Xgnu.emacs.vms:
Xgnu.g++:
Xgnu.g++.bug:
Xgnu.gcc:
Xgnu.gcc.bug:
Xgnu.gdb.bug:
Xmisc.consumers:
Xmisc.consumers.house:
Xmisc.forsale:
Xmisc.handicap:
Xmisc.headlines:
Xmisc.invest:
Xmisc.jobs:
Xmisc.jobs.misc:
Xmisc.jobs.offered:
Xmisc.jobs.resumes:
Xmisc.kids:
Xmisc.legal:
Xmisc.misc:
Xmisc.psi:
Xmisc.security:
Xmisc.taxes:
Xmisc.wanted:
Xnews.admin:
Xnews.announce.conferences:
Xnews.announce.important:
Xnews.announce.newusers:
Xnews.config:
Xnews.groups:
Xnews.lists:
Xnews.misc:
Xnews.newsites:
Xnews.software.b:
Xnews.software.nntp:
Xnews.software.notes:
Xnews.stargate:
Xnews.sysadmin:
Xnj.events:
Xnj.forsale:
Xnj.general:
Xnj.wanted:
Xny.forsale:
Xny.general:
Xny.nysernet.maps:
Xny.nysernet.nysertech:
Xny.wanted:
Xra.slug:
Xrec.arts.anime:
Xrec.arts.books:
Xrec.arts.comics:
Xrec.arts.drwho:
Xrec.arts.int-fiction:
Xrec.arts.movies:
Xrec.arts.movies.reviews:
Xrec.arts.poems:
Xrec.arts.sf-lovers:
Xrec.arts.startrek:
Xrec.arts.tv:
Xrec.arts.tv.soaps:
Xrec.arts.wobegon:
Xrec.audio:
Xrec.autos:
Xrec.autos.sport:
Xrec.autos.tech:
Xrec.aviation:
Xrec.bicycles:
Xrec.birds:
Xrec.boats:
Xrec.equestrian:
Xrec.folk-dancing:
Xrec.food.cooking:
Xrec.food.drink:
Xrec.food.recipes:
Xrec.food.veg:
Xrec.games.board:
Xrec.games.bridge:
Xrec.games.chess:
Xrec.games.empire:
Xrec.games.frp:
Xrec.games.go:
Xrec.games.hack:
Xrec.games.misc:
Xrec.games.moria:
Xrec.games.pbm:
Xrec.games.programmer:
Xrec.games.rogue:
Xrec.games.trivia:
Xrec.games.video:
Xrec.gardens:
Xrec.guns:
Xrec.ham-radio:
Xrec.ham-radio.packet:
Xrec.humor:
Xrec.humor.d:
Xrec.humor.funny:
Xrec.humor.spc:
Xrec.mag:
Xrec.mag.otherrealms:
Xrec.misc:
Xrec.models.rc:
Xrec.motorcycles:
Xrec.music.beatles:
Xrec.music.bluenote:
Xrec.music.classical:
Xrec.music.folk:
Xrec.music.gaffa:
Xrec.music.gdead:
Xrec.music.makers:
Xrec.music.misc:
Xrec.music.synth:
Xrec.nude:
Xrec.pets:
Xrec.photo:
Xrec.puzzles:
Xrec.railroad:
Xrec.scuba:
Xrec.skiing:
Xrec.skydiving:
Xrec.sport:
Xrec.sport.baseball:
Xrec.sport.basketball:
Xrec.sport.football:
Xrec.sport.hockey:
Xrec.sport.misc:
Xrec.travel:
Xrec.video:
Xrec.woodworking:
Xsci.astro:
Xsci.bio:
Xsci.crypt:
Xsci.electronics:
Xsci.lang:
Xsci.lang.japan:
Xsci.logic:
Xsci.math:
Xsci.math.stat:
Xsci.math.symbolic:
Xsci.med:
Xsci.med.aids:
Xsci.misc:
Xsci.nanotech:
Xsci.philosophy.meta:
Xsci.philosophy.tech:
Xsci.physics:
Xsci.psychology:
Xsci.research:
Xsci.space:
Xsci.space.shuttle:
Xsoc.college:
Xsoc.culture.african:
Xsoc.culture.arabic:
Xsoc.culture.celtic:
Xsoc.culture.china:
Xsoc.culture.esperanto:
Xsoc.culture.greek:
Xsoc.culture.indian:
Xsoc.culture.japan:
Xsoc.culture.jewish:
Xsoc.culture.misc:
Xsoc.human-nets:
Xsoc.men:
Xsoc.misc:
Xsoc.motss:
Xsoc.net-people:
Xsoc.politics:
Xsoc.politics.arms-d:
Xsoc.religion.christian:
Xsoc.roots:
Xsoc.singles:
Xsoc.women:
Xtalk.abortion:
Xtalk.bizarre:
Xtalk.origins:
Xtalk.philosophy.misc:
Xtalk.politics:
Xtalk.politics.arms-d:
Xtalk.politics.mideast:
Xtalk.politics.misc:
Xtalk.politics.soviet:
Xtalk.politics.theory:
Xtalk.religion:
Xtalk.religion.christian:
Xtalk.religion.misc:
Xtalk.religion.newage:
Xtalk.rumors:
Xunix-pc.bugs:
Xunix-pc.general:
Xunix-pc.sources:
Xunix-pc.uucp:
Xalt.test:
Xcontrol:
Xgnu.test:
Xjunk:
Xmisc.test:
Xnj.test:
Xny.test:
Xpa.test:
Xunix-pc.test:
END_OF_FILE
if test 6833 -ne `wc -c <'man/NewsGroups'`; then
    echo shar: \"'man/NewsGroups'\" unpacked with wrong size!
fi
# end of 'man/NewsGroups'
fi
if test -f 'man/dmail' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'man/dmail'\"
else
echo shar: Extracting \"'man/dmail'\" \(5912 characters\)
sed "s/^X//" >'man/dmail' <<'END_OF_FILE'
X
XNAME
X	DMail
X
XSYNOPSIS
X	DMail		go into mail shell if mail pending
X	DMail -O	go into mail shell whether you have mail or not
X	DMail path	mail somebody (go directly to mail editor)
X	DMail -f file	use a file other than your default mail box
X
X	There are other options.  To get a complete list of options
X	enter 'DMail -O' at a CLI prompt, then at the mail prompt
X	enter the 'help' command.
X
X	The file MAN:dmail.help must exist for dmail's online help
X	to work!  This file exists in the boot floppy's man directory.
X
XDESCRIPTION
X
X	DMail is an interactive mail editor that allows you to
X	view and respond to messages in your mail box as well
X	as generate new messages from scratch.	DMail has a huge
X	number of commands and options ('set' variables) that cannot
X	be described in a manual entry like this so I leave those to
X	the online help capability.
X
X	The basic dmail commands are (and these may be abbreviated):
X
X	    type  [msgno]	type a message
X	    reply [msgno]	reply to a message
X	    Reply [msgno]	reply to a message and include original text
X	    mail  path		send new mail to somebody
X	    d	  [msgno]	delete a message
X	    dt			delete current msg and type next one
X	    db			delete current msg and type previous one
X	    list		list available messages
X
X	These are only a few commands out of many.  Commands like
X	mail and reply bring up an interactive editor (default is DME
X	but you should be able to use your favorite editor... just
X	change the defaults in UULIB:Config).
X
X	When sending and replying to email, what you see from the
X	editor is pretty much what you get.  If you quit out of the
X	editor without saving the email is aborted.  If you save and
X	quit from the editor DMail will scan the message and figure
X	out who to send it to by extracting addresses out of the
X	To:, Cc:, and Bcc: fields.  DMail then runs Sendmail to
X	actually send the message (which may wind up queueing it
X	via UUCP to somewhere else).
X
X	You list the primary recipients of the message in the To:
X	field, separated by commas.  you may continue an address
X	list like this:
X
X	    To:     blah, blah, blah, blah, blah,
X		    blah, blah, blah, blah, blah,
X	    Cc:
X
X	The Cc: field lists carbon-copy recipients of the message...
X	people you want to see the message but for which the message
X	is not primarily meant for.  This can be left blank or
X	deleted.
X
X	The Bcc: field lists blind-carbon-copy recipients of the
X	message.  Specifically, the message gets sent to these
X	people but the Bcc: field itself is NOT propogated, so nobody
X	but you knows that the message was also sent to these
X	people.
X
X	Every message should have a Subject: field, usually a one
X	liner that describes the subject of the message.  When replying
X	to a message you usually keep the original message's Subject:
X	line and prepend an 'Re:' to it... normally you do NOT allow
X	Re:'s to build up.  I.E. Re: Re: Re: <original subj> is not
X	considered proper.
X
X	When using the upper case Reply that includes the original
X	text of the message, please prune out as much as you can to
X	decrease redundant bandwidth.  The original most likely has
X	a copy of the original message anyway and the idea is to
X	simply provide a soft reminder to jog the originator's memory.
X
X	A BLANK LINE ALWAYS SEPARATES THE HEADER LIST FROM THE MESSAGE
X	BODY!!!
X
XADDRESSES
X
X	DMail attempts to pick the proper return path when you reply
X	to a message and place that path into the To: field for you.
X
X	DMail does not always get it right.  Sometimes it is not
X	possible to get it right.  Generally, bang (!) only paths
X	are safe.  A bang path lists the machines the message to
X	reach through with the last field being the user on the
X	destination machine.  For example:
X
X	    To: sorinc!pacbell!nobody
X
X	Assuming I talk UUCP to sorinc directly my message will be
X	sent first to the machine sorinc, then the machine pacbell,
X	and then placed in 'nobody's mailbox on pacbell.
X
X	When at all possible finding a fully domained machine in a
X	path makes email all the more reliable.  For example,
X
X	    To: pacbell.pacbell.com!sorinc!overload!dillon
X
X	This is the path to my amiga.  Note that the first element
X	in the path is a fully domain'd machine (an address with
X	dots in it).  If your Amiga talks to a machine that understands
X	domains (say you connect to a university machine), and assuming
X	you set your 'DefaultNode' entry in UULIB:Config to this
X	machine, a message addressed as above will get to me.
X
X			BADLY FORMED ADDRESSES
X
X	Unfortunately, USENET and INTERNET addresses do not mix well.
X	On the INTERNET and address like this:
X
X		a!b!user@foo.com    maps to	foo.com!a!b!user
X
X	Whereas the same address in USENET format:
X
X		a!b!user@foo.com    maps to	a!b!foo.com!user
X
X	Your best bet is to look at the 'Received:' fields in the
X	mail header (the HEADER command in DMail, but read the online
X	help for the HEADER command before using it).  These fields
X	tell you exactly which machines the message got routed
X	through and the order in which it was routed.  Try your
X	best to construct a bang (!) only path to the destination.
X
X	Sending mail directly to an arbitrary address usually doesn't
X	work.  For example, mail to fnf@fishpond.UUCP (Fred Fish)
X	will fail utterly.  On the otherhand, using the path:
X
X	    <adjacent-big-machine>!cs.utexas.edu!asuvax!mcdphx!estinc!fnf
X
X	will work assuming <adjacent-big-machine> understands domains.
X	P.S. if your DefaultNode entry in your UULIB:Config file is
X	set properly and assuming the later about your connection to the
X	outside world, you can just email directly through an arbitrary
X	domained name:
X
X	    cs.utexas.edu!asuvax!mcdphx!estinc!fnf
X
X	Of course, if you have UUCP setup in a small network between
X	a few friends and none of you have access to a major USENET
X	node then you cannot email outside your little group.
X
X	Refer to the Domains manual page for information on using
X	the UULIB:Domain file to simplify addressing.
X
END_OF_FILE
if test 5912 -ne `wc -c <'man/dmail'`; then
    echo shar: \"'man/dmail'\" unpacked with wrong size!
fi
# end of 'man/dmail'
fi
if test -f 'src/compress/unshar.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/compress/unshar.c'\"
else
echo shar: Extracting \"'src/compress/unshar.c'\" \(6648 characters\)
sed "s/^X//" >'src/compress/unshar.c' <<'END_OF_FILE'
X/*
X *	unshar	-- undo a shell archive file
X *	(C) Copyright June 4 1987 by Craig Norborg
X *	Permission given to use this code in any form as long as it is
X *	not sold or marketed in any form without the written permission
X *	of its author.	Removal of this copyright notice is expressly
X *	forbidden as well as any alteration of it.
X */
X/*
X *	Here is a small unshar program written to be as portable as possible.
X *	It was written under Aztec C on an Amiga and tested on a VAX 11/780,
X *	pdp11/70 and a Sequent Balance 21000.  Any bug reports or enhancements
X *	should be reported to the author.  Some further enhancements may
X *	include the correct handling of sub-directories and the handling of
X *	btoa/atob type shars.  If you find a type of shar that this code
X *	does not work on, please send it to me, doc@j.cc.purdue.edu.
X */
X
X#include <stdio.h>
X#include <ctype.h>
X#include "/version.h"
X
XIDENT(".00");
X
X#ifdef unix
X#include <sys/file.h>
X#endif unix
X#ifdef AMIGA
X#define F_OK	0
X#endif AMIGA
X
X#define BUFSIZE 512		/* Max length of an input line */
X#define STRLEN	25		/* Max length of a file name or delimiter */
X#define CAT	"cat"           /* The name of the 'cat' program */
X#define SED	"sed"           /* The name of the 'sed' program */
X#define TEST	"if test"       /* Leader for test types */
X
X/*
X * This is a small routine that given the beginning of a quoted, backslashed
X * or just plain string, will return it in a given buffer.
X */
Xvoid
Xcopystring(source, dest)
Xchar *source, *dest;
X{
X	register int i = 0;
X	char c;
X
X	if ('\'' == *source || '\"' == *source) {/* Is it a quoted string? */
X		c = *source;
X		while (c != *++source)
X			dest[i++] = *source;
X		source++;
X	} else if ('\\' == *source) {                   /* Is it a backslashed string? */
X		while (!isspace(*++source))
X			dest[i++] = *source;
X	} else {								/* Just a string */
X		while (!isspace(*source)) {
X			dest[i++] = *source;
X			source++;
X		}
X	}
X	dest[i] = '\0';
X}
X
Xvoid
Xwordcount(buf, filename, wc)
Xchar *buf, *filename;
Xint wc;
X{
X	if (wc != atoi(buf)) {
X		(void) printf("Error unsharing %s (wc should have been %d, but was %d)\n", filename, atoi(buf), wc);
X	}
X}
X
Xint
Xcheckfile(string)
Xchar *string;
X{
X	char filename[BUFSIZE];
X
X	while (0 != isspace(*string))
X		string++;
X
X	copystring(string, filename);
X	if (0 == access(filename, F_OK))
X		return 1;
X
X	return 0;
X}
X
X/*
X * This is a small routine that given a 'cat' or 'sed' string, will pull out
X * the end of file string and the file name
X */
Xvoid
Xgetendfile(line, end, file)
Xchar   *line,			/* The 'sed' or 'cat' string */
X       *end,			/* Place to store the end of file marker */
X       *file;			/* Place for the filename */
X{
X	char   *tmp, *strrchr();
X
X	/*
X	 * This section of code finds the end of file string.  It assumes
X	 * that the eof string is the string of characters immediately
X	 * following the last '<' and that it has either a '\' preceding it
X	 * or is surrounded by single quotes.
X	 */
X	tmp = (char *) strrchr(line, '<');       /* Find the last '<' on the
X											 * line */
X	while (isspace(*++tmp))
X		;	/* Do nothing */
X	copystring(tmp, end);
X
X	/*
X	 * This section of code finds the name of the file.  It assumes that
X	 * the name of the file is the string immediately following the last
X	 * '>' in the line
X	 */
X	tmp = (char *) strrchr(line, '>');
X	while (isspace(*++tmp))
X		;	/* Do Nothing */
X	copystring(tmp, file);
X
X#ifdef DEBUG
X	(void) printf("EOF = %s, FILE = %s\n", end, file);
X#endif DEBUG
X}
X
Xint
Xmain(argc, argv)
Xint	argc;
Xchar  **argv;
X{
X	FILE   *fp, *dfp, *fopen();     /* input file pointer and dest file
X					 * pointer */
X	char	buf[BUFSIZE],		/* line buffer */
X		prefix[STRLEN], 	/* SED leader if any */
X		endstring[STRLEN],	/* EOF marker */
X		filename[STRLEN];	/* file name */
X	int	infile = 0,			/* var to tell if we're in the middle of a
X								 * file or not */
X		wc = 0, 			/* variable to keep a word count */
X			fileexists = 0; 	/* does the file exist? */
X
X	if (1 == argc) {        /* check usage */
X		(void) printf("usage: unshar <file>");
X	}
X	if (NULL == (fp = fopen(argv[1], "r"))) {
X		(void) printf("Error opening input file\n");
X		exit(1);
X	}
X	while (NULL != fgets(buf, BUFSIZE, fp)) {       /* while there are lines
X							 * to get */
X#ifdef DEBUG
X		puts(buf);
X#endif DEBUG
X
X		if (0 == infile) {      /* if we are not in the middle of a
X					 * file */
X			if ('#' == buf[0])      /* comment? */
X				continue;
X
X			/* Is this a CAT type shar? */
X			if (0 == strncmp(buf, CAT, strlen(CAT))) {
X				prefix[0] = '\0';
X				getendfile(buf, endstring, filename);
X				if (fileexists != 0) {
X					fprintf(stderr, "File exists (%s), skipping\n", filename);
X					fileexists = 0;
X					continue;
X				}
X				if (NULL == (dfp = fopen(filename, "w"))) {
X					(void) printf("Error opening output file %s\n", filename);
X					exit(1);
X				}
X				(void) printf("Extracting %s ... ", filename);
X				(void) fflush(stdout);
X				infile = 1;
X				wc = 0;
X				continue;
X			}
X			/* Is it a SED type shar? */
X			if (0 == strncmp(buf, SED, strlen(SED))) {
X				register int i = 0, j = 0;
X
X				while ('^' != buf[i++])
X					;
X				while ('/' != buf[i]) {
X					prefix[j++] = buf[i++];
X				}
X				prefix[j] = '\0';
X				getendfile(&buf[i], endstring, filename);
X				if (fileexists != 0) {
X					fprintf(stderr, "File exists (%s), skipping\n", filename);
X					fileexists = 0;
X					continue;
X				}
X				if (NULL == (dfp = fopen(filename, "w"))) {
X					(void) printf("Error opening output file %s\n", filename);
X					exit(1);
X				}
X				(void) printf("Extracting %s ... ", filename);
X				(void) fflush(stdout);
X				infile = 1;
X				wc = 0;
X				continue;
X			}
X			/* Do we want to do a test of sorts on a file? */
X			if (0 == strncmp(buf, TEST, strlen(TEST))) {
X				register int i = 0;
X
X				while(!isdigit(buf[i]) && '-' != buf[i] && NULL != buf[i])
X					i++;
X
X				if (0 != isdigit(buf[i])) {
X					wordcount(&buf[i], filename, wc);
X				}
X
X				if ('f' == buf[++i]) {
X					fileexists = checkfile(&buf[++i]);
X				}
X				continue;
X			}
X		} else {	/* We are in the middle of a file */
X
X			/* Are we at the end of this one? */
X			if (0 == strncmp(buf, endstring, strlen(endstring))) {
X				(void) printf("Done\n");
X				(void) fclose(dfp);
X				infile = 0;
X				continue;
X			}
X			/* No, then does it have a prefix? */
X			if ('\0' == prefix[0]) {
X				fputs(buf, dfp);
X				wc = wc + strlen(buf);
X			} else {
X
X				/*
X				 * If it does have a prefix, is there one on
X				 * this line?
X				 */
X				if (0 != strncmp(buf, prefix, strlen(prefix))) {
X					fputs(buf, dfp);
X				} else {
X					fputs(&buf[strlen(prefix)], dfp);
X					wc = wc + strlen(buf) - strlen(prefix);
X				}
X			}
X		}
X	}
X	(void) printf("All Done!\n");
X	(void) fclose(fp);
X}
END_OF_FILE
if test 6648 -ne `wc -c <'src/compress/unshar.c'`; then
    echo shar: \"'src/compress/unshar.c'\" unpacked with wrong size!
fi
# end of 'src/compress/unshar.c'
fi
if test -f 'src/dmail/main.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/dmail/main.c'\"
else
echo shar: Extracting \"'src/dmail/main.c'\" \(6011 characters\)
sed "s/^X//" >'src/dmail/main.c' <<'END_OF_FILE'
X
X/*
X * MAIN.C
X *
X *  (C) Copyright 1985-1990 by Matthew Dillon,  All Rights Reserved.
X *
X *  Global Routines:	MAIN()
X *			INIT()
X *			SIG_HANDLE()
X *
X *  Static Routines:	none.
X */
X
X#include <pwd.h>
X#include <stdio.h>
X#include <signal.h>
X#include <sys/types.h>
X#include <sys/stat.h>
X#include <config.h>
X#include "/version.h"
X
X#include "dmail.h"
X
XIDENT(".00");
Xchar *dillon_cpr = DCOPYRIGHT;
X
X#define MAILHOME "UUMAIL:"
X#define MBOX	 "UUMAIL:mbox"
X#define ALT_MBOX "UUMAIL:.mbox"
X#define MAILRC	 "UULIB:.dmailrc"
X#define VISUAL	 "dme"
X
Xvoid  init();
X
Xvoid
Xmain(argc, argv)
Xchar *argv[];
X{
X    int i, next, Retry;
X    int fop = 0, oop = 0;
X    int rcload = 1;
X    int options = 1;
X    int no_mail_overide = 0;
X    int nc = 0;
X    static int nameslist[128];
X    char *rcname;
X
X    if (push_base())
X	done (1);
X
X    init();
X    rcname = malloc (strlen(home_dir) + strlen(MAILRC) + 2);
X#ifdef AMIGA
X    rcname[0] = 0;
X#else
X    strcpy (rcname, home_dir);
X    strcat (rcname, "/");
X#endif
X    strcat (rcname, MAILRC);
X    for (i = 1; i < argc; ++i) {
X	next = 0;
X	if ((*argv[i] == '-') && options) {
X	    if (*(argv[i] + 1) == '\0') {
X		options = 0;
X		continue;
X	    }
X	    while (*++argv[i]) {
X		switch (*argv[i]) {
X		case 'S':
X		    lmessage_overide = 1;
X		    break;
X		case 'O':
X		    no_mail_overide = 1;
X		    break;
X		case 'l':
X		    rcload  = 1;
X		    if (i + 1 < argc  &&  *argv[i + 1] != '-') {
X			xfree (rcname);
X			oop = 1;
X			++i;
X			++next;
X			rcname = malloc (strlen (argv[i]) + 1);
X			strcpy (rcname, argv[i]);
X		    }
X		    break;
X		case 'L':
X		    rcload = 0;
X		    break;
X		case 'D':
X		    XDebug = 1;
X		    break;
X		case 'F':
X		    if (++i < argc) {
X			add_extra (argv[i]);
X		    } else {
X			puts (" -F Requires Field argument");
X			exit (1);
X		    }
X		    ++next;
X		    break;
X		case 'v':
X		    set_var (LEVEL_SET, "verbose", "");
X		    break;
X		case 'o':
X		    xfree (output_file);
X		    if (i + 1 < argc  &&  *argv[i + 1] != '-') {
X			oop = 1;
X			++i;
X			++next;
X			output_file = malloc (strlen (argv[i]) + 1);
X			strcpy (output_file, argv[i]);
X		    } else {
X			oop = -1;
X			output_file = malloc (strlen(home_dir) +
X				strlen(ALT_MBOX) + 2);
X#ifdef AMIGA
X			strcpy (output_file, ALT_MBOX);
X#else
X			sprintf (output_file, "%s/%s", home_dir, ALT_MBOX);
X#endif
X		    }
X		    break;
X		case 'f':
X		    if (i + 1 < argc  &&  *argv[i + 1] != '-') {
X			fop = 1;
X			++i;
X			++next;
X			mail_file = realloc (mail_file, strlen (argv[i]) + 1);
X			strcpy (mail_file, argv[i]);
X		    } else {
X			fop = -1;
X			mail_file = realloc (mail_file,
X				strlen(home_dir) + strlen(MBOX) + 2);
X#ifdef AMIGA
X			strcpy (mail_file, MBOX);
X#else
X			sprintf (mail_file, "%s/%s", home_dir, MBOX);
X#endif
X		    }
X		    break;
X		default:
X		    puts ("dmail: Bad argument");
X		    puts ("dmail -O      then 'help' for help.");
X		    done (1);
X		}
X		if (next)
X		    break;
X	    }
X	} else {
X	    No_load_mail = 1;
X	    nameslist[nc++] = i;
X	}
X    }
X    if (oop == -1  &&  fop == -1) {
X	mail_file = realloc (mail_file, strlen(output_file) + 1);
X	strcpy (mail_file, output_file);
X    }
Xends:
X    initial_load_mail();
X    m_select (Nulav, M_RESET);
X    Current = indexof (1);
X    if (nc)
X	set_var (LEVEL_SET, "comlinemail", "");
X    if (rcload) {
X	ac = 2;
X	av[1] = rcname;
X	do_source(rcname, 1);
X    }
X    if (nc) {
X	av[0] = "mail";
X	for (i = 0; i < nc; ++i)
X	    av[i + 1] = argv[nameslist[i]];
X	ac = nc + 1;
X	do_reply ("", R_MAIL);
X	done (0);
X    }
X    if (Entries + no_mail_overide == 0) {
X	printf ("\nNO MAIL for %s\n\n", user_name);
X	return;
X    }
X    printf ("\nRF %-20s   WF %-20s\n", mail_file, output_file);
X    do {
X	Retry = 20;
X	pop_base();
Xloop:
X	if (push_base()) {
X	    pop_base();
X	    if (XDebug)
X		printf ("TOP LEVEL INTR, Level: %d\n", Longstack);
X	    if (--Retry == 0)
X		done (1);
X	    puts ("");
X	    goto loop;
X	}
X	check_new_mail();
X    } while (do_command() > 0);
X    return;
X}
X
Xvoid
Xinit()
X{
X    char *str;
X    struct passwd *passwd;
X    extern int sig_handle();
X
X    Entry = (struct ENTRY *)malloc (sizeof(*Entry));
X    Entry->status = Entry->no = Entry->fpos = 0;
X    passwd = getpwuid(getuid());
X    if (passwd == NULL) {
X	printf("DMail, unable to get passwd entry for uid %d\n", getuid());
X	exit(1);
X    }
X    user_name	= malloc (strlen(passwd->pw_name) + 1);
X    home_dir	= malloc (strlen(passwd->pw_dir) + 1);
X    visual	= malloc (sizeof(VISUAL));
X    strcpy  (visual     , VISUAL);
X    strcpy  (user_name, passwd->pw_name);
X    strcpy  (home_dir , passwd->pw_dir);
X#ifdef AMIGA
X    if (str = FindConfig(HOME))
X	strcpy ((home_dir = realloc (home_dir, strlen(str) + 1)), str);
X    if (str = FindConfig(USERNAME))
X	strcpy ((user_name = realloc (user_name, strlen(str) + 1)), str);
X    if (str = FindConfig(EDITOR))
X	strcpy ((visual = realloc (visual, strlen(str) + 1)), str);
X#else
X    if ((str = getenv ("HOME")) != NULL)
X	strcpy ((home_dir = realloc (home_dir, strlen(str) + 1)), str);
X    if ((str = getenv ("USER")) != NULL)
X	strcpy ((user_name = realloc (user_name, strlen(str) + 1)), str);
X    if ((str = getenv ("VISUAL")) != NULL)
X	strcpy ((visual = realloc (visual, strlen(str) + 1)), str);
X#endif
X    mail_file	= malloc (strlen(MAILHOME) + strlen(user_name) + 1);
X    sprintf (mail_file  , "%s%s", MAILHOME, user_name);
X    output_file = malloc (strlen(home_dir) + 2 + sizeof(MBOX));
X#ifdef AMIGA
X    strcpy(output_file, MBOX);
X#else
X    sprintf (output_file, "%s/%s", home_dir, MBOX);
X#endif
X    fix_globals();
X#ifdef UNIX
X    signal (SIGHUP, sig_handle);
X    signal (SIGINT, sig_handle);
X    signal (SIGPIPE, SIG_IGN);
X#endif
X#ifdef AMIGA
X    signal (SIGINT, sig_handle);
X#endif
X}
X
Xsig_handle()
X{
X#ifdef UNIX
X    int mask = sigblock (0);
X
X    sigsetmask (mask & ~((1 << SIGHUP) | (1 << SIGINT)));
X#endif
X#ifdef AMIGA
X    signal (SIGINT, sig_handle);    /*  reload signal */
X#endif
X    if (Longstack  &&  !Breakstack)
X	longjmp (env[Longstack], 1);
X    return(0);
X}
X
Xget_inode(file)
Xchar *file;
X{
X    struct stat stats;
X
X    if (stat (file, &stats) < 0)
X	return (-1);
X    return (stats.st_ino);
X}
X
END_OF_FILE
if test 6011 -ne `wc -c <'src/dmail/main.c'`; then
    echo shar: \"'src/dmail/main.c'\" unpacked with wrong size!
fi
# end of 'src/dmail/main.c'
fi
if test -f 'src/dmail/sub.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/dmail/sub.c'\"
else
echo shar: Extracting \"'src/dmail/sub.c'\" \(4899 characters\)
sed "s/^X//" >'src/dmail/sub.c' <<'END_OF_FILE'
X
X/*
X * SUB.C
X *
X *  (C) Copyright 1985-1990 by Matthew Dillon,  All Rights Reserved.
X *
X *  Global Routines:	INDEXOF()
X *			SIG()
X *			POSITION_CURRENT()
X *			SKIP_TO_DATE()
X *			GET_FIELD()
X *			COMPILE_FIELD()
X *			ISFROM()
X *			XSTRNCMP()
X *			NEXT_WORD()
X *			DONE()
X *
X */
X
X#include <signal.h>
X#include <stdio.h>
X#include "dmail.h"
X
X#ifdef UNIX
Xextern FILE *popen();
X#endif
X
X#define SENDMAIL "sendmail"
X
Xxfree(ptr)
Xchar *ptr;
X{
X    static char *sptr;
X
X    if (sptr)
X	free (sptr);
X    sptr = ptr;
X    return (1);
X}
X
X
Xindexof(num)
Xregister int num;
X{
X    register int i, last;
X
X    if (num < 1)
X	num = -1;
X    for (last = -1, i = 0; i < Entries; ++i) {
X	if (Entry[i].no) {
X	    last = i;
X	    if (Entry[i].no == num)
X		return (i);
X	}
X    }
X    if (num == -1  &&  last >= 0)
X	return (last);
X    return (-1);
X}
X
Xvoid
Xnull()
X{
X}
X
X
Xposition_current()
X{
X    int pos;
X
X    if (!m_fi)
X	return(0);
X    if (Current >= 0) {
X	pos = Entry[Current].fpos;
X	if (fseek (m_fi, pos, 0) < 0 || ftell(m_fi) != pos)
X	    puts ("ERROR: Cannot position file to message");
X    } else {
X	fseek (m_fi, 0, 0);
X    }
X}
X
X
Xskip_to_data(fi)
XFILE *fi;
X{
X    static char buf[MAXFIELDSIZE];
X
X    while (fgets (buf, MAXFIELDSIZE, fi) != NULL) {
X	if (*buf == '\n')
X	    return (1);
X    }
X    return (-1);
X}
X
X
Xchar *
Xget_field(str)
Xchar *str;
X{
X    int i, entry = Current;
X    int len = strlen(str);
X
X    if (Current < 0)
X	return("");
X    i = get_extra (str);
X    if (i >= 0)
X	return (Entry[entry].fields[i]);
X    if (m_fi == NULL)
X	return ("");
X    fseek (m_fi, Entry[entry].fpos, 0);
X    while (fgets (Buf, MAXFIELDSIZE, m_fi) != NULL) {
X	if (isfrom (Buf))
X	    break;
X	if (strncmp (Buf, str, len) == 0) {
X	    Buf[strlen(Buf) - 1] = '\0';
X	    compile_field(Buf, m_fi);
X	    return (next_word (Buf));
X	}
X    }
X    return ("");
X}
X
X
Xcompile_field(buf, fi)
Xchar *buf;
XFILE *fi;
X{
X    int len, acc, pos;
X
X    acc = 0;
X    buf += strlen (buf) + 1;
X    pos = ftell (fi);
X    while (fgets (buf, MAXFIELDSIZE - acc, fi) != NULL) {
X	if (*buf == ' ' || *buf == 9) {
X	    *(buf - 1) = '\n';
X	    len = strlen (buf) - 1;
X	    *(buf + len) = '\0';
X	    buf += len;
X	    acc += len + 2;
X	    if (acc > MAXFIELDSIZE - 10) {
X		printf ("Warning: Field size beyond %d bytes\n", MAXFIELDSIZE);
X		sleep (2);
X		return (1);
X	    }
X	} else {
X	    *buf = '\0';
X	    fseek (fi, pos, 0);
X	    return (1);
X	}
X	pos = ftell (fi);
X    }
X    fseek (fi, pos, 0);
X}
X
X
Xisfrom(str)
Xregister char *str;
X{
X    static char from[] = {"From "};
X    register int i = 0;
X
X    while (i < 5) {
X	if (*str++ != from[i++])
X	    return (0);
X    }
X    return (1);
X}
X
X
Xxstrncmp (src, dest, len)
Xregister char *src, *dest;
Xregister int len;
X{
X    while (--len >= 0) {
X	if ((*src & 0x1f) != (*dest & 0x1f)) {
X	    if ((*src & 0x1f) < (*dest & 0x1f))
X		return (-1);
X	    return (1);
X	}
X	++src; ++dest;
X    }
X    return (0);
X}
X
X
X
Xchar *
Xnext_word(str)
Xregister char *str;
X{
X    while (*str  &&  *str != ' '  && *str != 9)
X	++str;
X    while (*str  &&  (*str == ' ' || *str == 9))
X	++str;
X    return (str);
X}
X
Xvoid
Xdone(n)
X{
X    char scr[64];
X
X    push_break();
X    sprintf (scr, "tmp:dmail%d", getpid());
X    unlink (scr);
X    sprintf (scr, "tmp:dmt%d", getpid());
X    unlink (scr);
X    unlink ("#");
X    exit (n);
X}
X
Xvoid
Xfix_globals()
X{
X    char *ptr;
X
X    push_break();
X    S_page = (ptr = get_var (LEVEL_SET, "page")) ?
X	    ((*ptr) ? atoi (ptr) : 24) : -1;
X    if (S_page > 0  && (S_page -= 4) < 0)
X	S_page = 1;
X
X    S_sendmail = (ptr = get_var (LEVEL_SET, "sendmail")) ? ptr : SENDMAIL;
X    S_novibreak= (ptr = get_var (LEVEL_SET, "vibreak")) ? 0 : 1;
X    S_verbose  = (ptr = get_var (LEVEL_SET, "verbose")) ? 1 : 0;
X    S_ask      = (ptr = get_var (LEVEL_SET, "ask")) ? 1 : 0;
X    S_archive  = (ptr = get_var (LEVEL_SET, "archive")) ? 1 : 0;
X    if (S_archive && *ptr == '\0')
X	S_archive = 0;
X    pop_break();
X}
X
X
X_pager(str, nl)
Xchar *str;
Xint nl;
X{
X    static int count;
X    static FILE *fi;
X    static char buf[1024];
X#ifdef UNIX
X    char *ptr;
X#endif
X
X    if (str == 0) {
X	switch (S_page) {
X	case -1:
X	    count = 0;
X	    return (1);
X	case 0:
X#ifdef UNIX
X	    ptr = get_var (LEVEL_SET, "page");
X	    fi = popen (ptr, "w");
X	    if (fi == NULL) {
X		count = 0;
X		printf ("CANNOT RUN PAGER PROGRAM: %s\n", ptr);
X	    } else {
X		count = -1;
X	    }
X#else
X	    count = 0;
X	    fi = stdout;
X#endif
X	    return (1);
X	default:
X	    count = 0;
X	    return (1);
X	}
X    }
X    if ((long)str == -1) {
X#ifdef UNIX
X	if (fi != NULL) {
X	    pclose (fi);
X	    fi = NULL;
X	}
X#else
X	fi = NULL;
X#endif
X	return (1);
X    }
X    if (count < 0) {
X	fputs (str, fi);
X	while (nl--)
X	    fputs ("\n", fi);
X    } else {
X	fputs (str, stdout);
X	while (nl--) {
X	    fputs ("\n", stdout);
X	    ++count;
X	}
X#ifdef AMIGA
X	fflush(stdout);
X#endif
X	while (*str) {
X	    if (*str++ == '\n')
X		++count;
X	}
X	if (S_page > 0  &&  S_page <= count) {
X	    count = 0;
X	    puts ("\n-- more --");
X	    gets(buf);
X	}
X    }
X}
X
END_OF_FILE
if test 4899 -ne `wc -c <'src/dmail/sub.c'`; then
    echo shar: \"'src/dmail/sub.c'\" unpacked with wrong size!
fi
# end of 'src/dmail/sub.c'
fi
echo shar: End of archive 5 \(of 16\).
cp /dev/null ark5isdone
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.