home *** CD-ROM | disk | FTP | other *** search
Text File | 1986-11-30 | 36.9 KB | 1,470 lines |
- : Use /bin/sh
-
- # This is the automatically generated output of the AUTODIFF program after
- # being run on the two directories;
- # Old Directory: Elm-Posted
- # New Directory: Elm
-
- # Any problems with execution of this script should be reported to the
- # author of the program, Dave Taylor, at "hplabs!taylor". Thanks
-
- # first off, let's make sure we're running in SH
-
- export PATH || (sh $0; exit $$)
-
- # next, let's ensure the user has "ed"...
-
- if [ ! -f /bin/ed ]
- then
- echo I can\'t find /bin/ed\!
- exit 1
- fi
-
- # finally, let's get this show on the road!!
-
- #---------------------------------
- # File Elm/src/Makefile.mstr is new!
-
- echo File Elm/src/Makefile.mstr is new - extracting...
- if [ -f src/Makefile.mstr ]
- then
- echo File \'src/Makefile.mstr\' is new, but you already have something called that\!
- echo I\'m going to move your file to \'src/Makefile.mstr.old\'...
- /bin/mv -f src/Makefile.mstr src/Makefile.mstr.old
- else
- echo Extracting new file \'src/Makefile.mstr\'
- fi
-
- cat > src/Makefile.mstr << 'END_OF_FILE'
- #
- # Makefile for the ELM mail program.
- #
- # (C) Copyright 1986, Dave Taylor
- #
- # Last modification: March 7th, 1986
-
- SHELL=/bin/sh
-
- ##############################
- #
- # if on a BSD system;
- # DEFINE=-DBSD
- # LIB2 = -lcurses
- # else if on a UTS system;
- # DEFINE=-DUTS
- # LIB2 = -la -lq
- # else if on a SUN system;
- # DEFINE=-DBSD -DSUN
- # LIB2 = -lcurses
- # else if on a Pyramid system;
- # DEFINE=-DBSD -DNO_VAR_ARGS
- # LIB2 = -lcurses
- # else
-
- DEFINE= >os-define<
- LIB2 = >lib2<
-
- # IF you're on an ACSnet system (Australia) then
- # you'll want to uncomment the following;
-
- # DEFINE= ${DEFINE} -DACSNET
-
- ##############################
-
- CFILES= addr_utils.c alias.c aliasdb.c aliaslib.c args.c bounceback.c \
- calendar.c connect_to.c curses.c date.c delete.c domains.c edit.c \
- encode.c errno.c file.c file_utils.c fileio.c hdrconfg.c help.c \
- initialize.c input_utils.c leavembox.c mailmsg1.c mailmsg2.c \
- mailtime.c mkhdrs.c elm.c newmbox.c notesfile.c options.c opt_utils.c \
- output_utils.c pattern.c quit.c read_rc.c remail.c reply.c \
- return_addr.c savecopy.c screen.c showmsg.c signals.c softkeys.c \
- sort.c strings.c syscall.c utils.c validname.c getopt.c string2.c \
- builtin.c pmalloc.c
-
- HEADERS=../hdrs/curses.h ../hdrs/defs.h ../hdrs/headers.h ../hdrs/sysdefs.h
-
- OBJS= addr_utils.o alias.o aliasdb.o aliaslib.o args.o bounceback.o \
- calendar.o connect_to.o curses.o date.o delete.o domains.o edit.o \
- encode.o errno.o file.o file_utils.o fileio.o hdrconfg.o help.o \
- initialize.o input_utils.o leavembox.o mailmsg1.o mailmsg2.o \
- mailtime.o mkhdrs.o elm.o newmbox.o notesfile.o options.o opt_utils.o \
- output_utils.o pattern.o quit.o read_rc.o remail.o reply.o \
- return_addr.o savecopy.o screen.o showmsg.o signals.o softkeys.o \
- sort.o strings.o syscall.o utils.o validname.o getopt.o string2.o \
- builtin.o pmalloc.o
-
- BIN= ../bin
- LIBS= -ltermcap
- CFLAGS= -O -I../hdrs
- CC= >cc<
- RM= >rm<
-
- ../bin/elm: ${OBJS} ${EXTRA} ${HEADERS} ../hdrs/elm.h
- ${CC} -o ${BIN}/elm -n ${OBJS} ${LIBS} ${LIB2}
-
- .c.o: ${HEADERS}
- ${CC} -c ${CFLAGS} ${DEFINE} $*.c
-
- curses.o: curses.c ../hdrs/curses.h
- ${CC} -c ${CFLAGS} -DRAWMODE ${DEFINE} curses.c
-
- # curses.c : curses.q
- # @../bin/quickscreen curses.q
- #
- # curses.q :
- # @cp curses.c curses.q
-
- clean:
- ${RM} ${OBJS} LINT.OUT
-
- lint: LINT.OUT
-
- LINT.OUT: ${CFILES}
- lint -p -I../hdrs ${CFILES} > LINT.OUT
-
- listing: LISTING
-
- LISTING: Makefile INDEX ${HEADERS} ${CFILES}
- @echo adding file 'Makefile'...
- @/bin/echo \\f > LISTING
- @cat Makefile >> LISTING
- @echo adding file 'INDEX'...
- @/bin/echo \\f >> LISTING
- @cat INDEX >> LISTING
- @../bin/makelisting ${HEADERS} ${CFILES}
- @echo LISTING generated.
-
- index: INDEX
-
- INDEX: ${CFILES} ${HEADERS}
- @echo Creating function definition index
- @index *.c | sort > INDEX
- @echo File INDEX generated
- END_OF_FILE
-
- chars=`cat src/Makefile.mstr | wc -c`
-
- if [ $chars -ne 2882 ]
- then
- echo File damaged in transit...should be 2882 bytes, is $chars instead
- echo I suggest you check it closely...
- fi
-
- #---------------------------------
- # File Elm/src/pmalloc.c is new!
-
- echo File Elm/src/pmalloc.c is new - extracting...
- if [ -f src/pmalloc.c ]
- then
- echo File \'src/pmalloc.c\' is new, but you already have something called that\!
- echo I\'m going to move your file to \'src/pmalloc.c.old\'...
- /bin/mv -f src/pmalloc.c src/pmalloc.c.old
- else
- echo Extracting new file \'src/pmalloc.c\'
- fi
-
- cat > src/pmalloc.c << 'END_OF_FILE'
- /** pmalloc.c **/
-
- /** This routine contains a cheap permanent version of the malloc call to
- speed up the initial allocation of the weedout headers and the uuname
- data.
-
- This routine is originally from Jim Davis of HP Labs, with some
- mods by me.
- **/
-
- #include <stdio.h>
- #include "defs.h"
-
- char *pmalloc(size)
- int size;
- {
- /** return the address of a specified block **/
-
- static char *our_block = NULL;
- static int free_mem = 0;
-
- char *return_value;
-
- /** if bigger than our threshold, just do the real thing! **/
-
- if (size > PMALLOC_THRESHOLD)
- return( (char *) malloc(size));
-
- /** if bigger than available space, get more, tossing what's left **/
-
- if (size > free_mem) {
- if ((our_block = (char *) malloc(PMALLOC_BUFFER_SIZE)) == NULL) {
- fprintf(stderr, "\n\r\n\rCouldn't pmalloc %d bytes!!\n\r\n\r",
- PMALLOC_BUFFER_SIZE);
- leave();
- }
- free_mem = PMALLOC_BUFFER_SIZE;
- }
-
- return_value = our_block; /* get the memory */
- our_block += size; /* use it up */
- free_mem -= size; /* and decrement */
-
- return( (char *) return_value);
- }
- END_OF_FILE
-
- chars=`cat src/pmalloc.c | wc -c`
-
- if [ $chars -ne 1114 ]
- then
- echo File damaged in transit...should be 1114 bytes, is $chars instead
- echo I suggest you check it closely...
- fi
-
- #-------------------------------------
- # File 'hdrs/defs.h' diffs...
-
- cat << 'EOF' > hdrs/defs.h.D
- 209a
-
- #ifdef SHORTNAMES /* map long names to shorter ones */
- # include <shortnames.h>
- #endif
- .
- 144a
- /* some stuff for our own malloc call - pmalloc */
-
- #define PMALLOC_THRESHOLD 256 /* if greater, then just use malloc */
- #define PMALLOC_BUFFER_SIZE 2048 /* internal [memory] buffer size... */
-
- .
- 12a
- #define KLICK 10
-
- .
- 11c
- #define WHAT_STRING "@(#) Version 1.2a, patch #3 release - August, 1986"
- .
- 9c
- #define VERSION "1.2a" /* Version number! WHAT_STRING should agree */
- .
- w
- EOF
-
- chars=`cat hdrs/defs.h | wc -c`
-
- if [ $chars -ne 6693 ]
- then
- echo Your file hdrs/defs.h has been changed\!
- echo diffs saved as \"hdrs/defs.h.D\"
- else
- echo applying diffs to file hdrs/defs.h...
- /bin/cat hdrs/defs.h.D | /bin/ed - hdrs/defs.h
- fi
-
- #-------------------------------------
- # File 'hdrs/headers.h' diffs...
-
- cat << 'EOF' > hdrs/headers.D
- 102c
- extern int max_headers; /* number of headers currently allocated */
-
- extern struct header_rec *header_table;
- .
- 93c
- extern long size_of_pathfd; /** size of pathfile, 0 if none **/
- .
- w
- EOF
-
- chars=`cat hdrs/headers.h | wc -c`
-
- if [ $chars -ne 5082 ]
- then
- echo Your file hdrs/headers.h has been changed\!
- echo diffs saved as \"hdrs/headers.D\"
- else
- echo applying diffs to file hdrs/headers.h...
- /bin/cat hdrs/headers.D | /bin/ed - hdrs/headers.h
- fi
-
- #-------------------------------------
- # File 'hdrs/elm.h' diffs...
-
- cat << 'EOF' > hdrs/elm.h.D
- 107c
- int max_headers; /* number of headers allocated */
-
- struct header_rec *header_table;
- .
- 98c
- long size_of_pathfd; /** size of pathfile, 0 if none **/
- .
- 20a
- /******** and another string for the copyright notice ********/
-
- static char copyright[] = { "@(#) (C) Copyright 1986, Dave Taylor" };
-
- .
- 17,18d
- 15c
- /******** static character string containing the version number *******/
- .
- 13d
- w
- EOF
-
- chars=`cat hdrs/elm.h | wc -c`
-
- if [ $chars -ne 4889 ]
- then
- echo Your file hdrs/elm.h has been changed\!
- echo diffs saved as \"hdrs/elm.h.D\"
- else
- echo applying diffs to file hdrs/elm.h...
- /bin/cat hdrs/elm.h.D | /bin/ed - hdrs/elm.h
- fi
-
- #---------------------------------
- # File Elm/hdrs/sysdefs.master is new!
-
- echo File Elm/hdrs/sysdefs.master is new - extracting...
- if [ -f hdrs/sysdefs.master ]
- then
- echo File \'hdrs/sysdefs.master\' is new, but you already have something called that\!
- echo I\'m going to move your file to \'hdrs/sysdefs.master.old\'...
- /bin/mv -f hdrs/sysdefs.master hdrs/sysdefs.master.old
- else
- echo Extracting new file \'hdrs/sysdefs.master\'
- fi
-
- cat > hdrs/sysdefs.master << 'END_OF_FILE'
- /** sysdefs.h **/
-
- /** System level, configurable, defines for the ELM mail system. **/
-
- /** (C) Copyright 1986 Dave Taylor **/
-
- /** Define the following if you think that the information in messages
- that have "Reply-To:" and/or "From:" fields with addresses will
- contain valid addressing information. If this isn't defined, the
- calculated return address will ALWAYS be used instead. (note that
- this doesn't necessarily preclude the use of G)roup replies).
- **/
-
- #define USE_EMBEDDED_ADDRESSES
-
-
- #define FIND_DELTA 10 /* byte region where the binary search
- on the path alias file is fruitless
- (can't be within this boundary) */
-
- #define MAX_HEADERS >500< /* max number of messages in one file! */
- #define MAX_SALIASES >503< /* number of system aliases allowed */
- #define MAX_UALIASES >251< /* number of user aliases allowed */
- #define MAX_IN_WEEDLIST >150< /* max headers to weed out */
-
- #define MAX_HOPS 35 /* max hops in return addr to E)veryone */
-
- #define MAX_ATTEMPTS >6< /* #times to attempt lock file creation */
-
- /** see leavembox.c to determine if this should be defined or not....The
- default is to NOT have it defined.
- **/
-
- #define REMOVE_AT_LAST
-
- #define DEFAULT_BATCH_SUBJECT "no subject (file transmission)"
-
- /** If you want to have the mailer know about valid mailboxes on the
- host machine (assumes no delivery agent aliases) then you should
- undefine this (the default is to have it defined)...
- **/
-
- #define NOCHECK_VALIDNAME
-
- /** If your machine doesn't have virtual memory (specifically the vfork()
- command) then you should define the following....
- **/
-
- /** #define NO_VM **/
-
-
- /** If you want the mailer to check the pathalias database BEFORE it
- looks to see if a specified machine is in the L.sys database (in
- some cases routing is preferable to direct lines) then you should
- define the following...
- **/
-
- #define LOOK_CLOSE_AFTER_SEARCH
-
-
- /** If you'd rather the program automatically used the 'uuname' command
- to figure out what machines it talks to (instead of trying to get
- it from L.sys first) then define the following...
- **/
-
- #define USE_UUNAME
-
-
- /** If you'd like "newmail" to automatically go into background when you
- start it up (instead of the "newmail &" junk with the process id output,
- then define the following...
- **/
-
- #define AUTO_BACKGROUND
-
- /** If you'd rather your mail transport agent (ie sendmail) put the From:
- line into the message, define the following...
- **/
-
- #define DONT_ADD_FROM
-
- /** If your machine prefers the Internet notation of user@host for the
- From: line and addresses, define the following...(the default is to
- use this rather than the USENET notation - check your pathalias file!)
-
- **/
-
- #define INTERNET_ADDRESS_FORMAT
-
- /** If you're on a machine that prefers UUCP to Internet addresses, then
- define the following (the basic change is that on a machine that
- receives messages of the form <path>!user@<localhost> the displayed
- address will be <path>!user instead of user@<localhost>.
-
- BOGUS_INTERNET is the address that your local system appends to
- messages occasionally. The algorithm is simply to REMOVE the
- BOGUS_INTERNET string. This is horrible. *sigh*
-
- **/
-
- #define PREFER_UUCP
- #define BOGUS_INTERNET "@hplabs.HP.COM"
-
- /** If you're running ACSNET and/or want to have your domain name
- attached to your hostname on outbound mail then you can define
- the following (default are not defined)
- **/
-
- #define USE_DOMAIN
- #define DOMAIN "<enter your domain here>"
-
- /** If you are going to be running the mailer with setgid mail (or
- something similar) you'll need to define the following to ensure
- that the users mailbox in the spool directory has the correct
- group (NOT the users group)
- **/
-
- #define SAVE_GROUP_MAILBOX_ID
-
- /** If you want a neat feature that enables scanning of the message
- body for entries to add to the users ".calendar" (or whatever)
- file, define this.
- **/
-
- #define ENABLE_CALENDAR
- #define dflt_calendar_file "calendar" /* in HOME directory */
-
- /** If you want to implement 'site hiding' in the mail, then you'll need to
- uncomment the following lines and set them to reasonable values. See
- the configuration guide for more details....
- **/
-
- /****************************************************************************
-
- #undef DONT_ADD_FROM
-
- #define SITE_HIDING
- #define HIDDEN_SITE_NAME "fake-machine-name"
- #define HIDDEN_SITE_USERS "/usr/mail/lists/hidden_site_users"
-
- ****************************************************************************/
-
- /** Do we have the 'gethostname()' call? If not, define the following **/
- /** #define NEED_GETHOSTNAME **/
-
- /** are you stuck on a machine that has short names? If so, define the
- following **/
-
- /** #define SHORTNAMES **/
-
- #define NOTES_HEADER "/***** "
- #define NOTES_FOOTER "/* ---------- */"
-
- #ifdef BSD
- # define system_hash_file "/usr/spool/mail/.alias_hash"
- # define system_data_file "/usr/spool/mail/.alias_data"
- #else
- # define system_hash_file "/usr/mail/.alias_hash"
- # define system_data_file "/usr/mail/.alias_data"
- #endif
-
- #define pathfile "/usr/lib/nmail.paths"
- #define domains "/usr/lib/domains"
-
- #define Lsys "/usr/lib/uucp/L.sys"
-
- /** where to put the output of the elm -d command... (in home dir) **/
- #define DEBUG "ELM:debug.info"
-
- #define temp_file "/tmp/snd."
- #define temp_mbox "/tmp/mbox."
- #define temp_print "/tmp/print."
- #define mailtime_file ".last_read_mail"
- #define readmsg_file ".readmsg"
- #define signature_file ".signature"
-
- #ifdef BSD
- # define default_editor "/usr/ucb/vi"
- # define mailhome "/usr/spool/mail/"
- #else
- # define default_editor "/usr/bin/vi"
- # define mailhome "/usr/mail/"
- #endif
-
- # define default_pager "builtin"
-
- #define sendmail "/usr/lib/sendmail"
- #define smflags "-oi"
- #define mailer "/bin/rmail"
- #ifdef BSD
- # define mailx "/usr/ucb/Mail"
- #else
- # define mailx "/usr/bin/mailx"
- #endif
-
- #define helphome "/usr/local/lib"
- #define helpfile "elm-help.main"
-
- #define elmrcfile "/.elmrc"
- #define mailheaders ".elmheaders"
- #define dead_letter "Cancelled.mail"
-
- #define unedited_mail "emergency.mbox"
-
- #define newalias "newalias -q 1>&2 > /dev/null"
- #define readmsg "readmsg"
-
- #define remove "/bin/rm -f" /* how to remove a file */
- #define cat "/bin/cat" /* how to display files */
- #define uuname "uuname" /* how to get a uuname */
- END_OF_FILE
-
- chars=`cat hdrs/sysdefs.master | wc -c`
-
- if [ $chars -ne 6490 ]
- then
- echo File damaged in transit...should be 6490 bytes, is $chars instead
- echo I suggest you check it closely...
- fi
-
- #---------------------------------
- # File Elm/hdrs/shortnames.h is new!
-
- echo File Elm/hdrs/shortnames.h is new - extracting...
- if [ -f hdrs/shortnames.h ]
- then
- echo File \'hdrs/shortnames.h\' is new, but you already have something called that\!
- echo I\'m going to move your file to \'hdrs/shortnames.h.old\'...
- /bin/mv -f hdrs/shortnames.h hdrs/shortnames.h.old
- else
- echo Extracting new file \'hdrs/shortnames.h\'
- fi
-
- cat > hdrs/shortnames.h << 'END_OF_FILE'
- /** shortnames.h **/
-
- /** This file is from Geoff Kuenning, and will help those poor users that
- are stuck using C compilers that don't have flexnames. Too bad.
-
- This file has no explicit copyright.
-
- **/
-
- #define PutLine0 PLine0
- #define PutLine1 PLine1
- #define PutLine2 PLine2
- #define PutLine3 PLine3
-
- #define add_to_table add_2_table
- #define address1 addrs1
- #define addressII addrsII
- #define addresses addr_s
- #define alternate_prompt alt_prompt
- #define alternative_addresses alt_addrs
- #define always_leave alw_leave
-
- #define calendar_line cal_line
- #define cancelled_msg cncld_msg
- #define central_message_buffer cntrl_bfr
- #define compare_dates cmp_dates
- #define compare_headers cmp_hdrs
- #define copy_message_across cpy_msg_across
- #define current_record cur_rec
- #define current_time cur_time
-
- #define define_softkeys def_softkeys
- #define display_central_message displ_cntrl_msg
- #define display_error displ_error
- #define display_headers displ_hdrs
- #define display_helpfile dspl_helpfile
- #define display_options displ_options
- #define display_title displ_titles
- #define display_to displ_to
-
- #define encrypted crypted
- #define encrypted_key crypt_key
- #define expanded_cc xp_cc
- #define expanded_to xp_to
- #define expand_address xp_addr
- #define expand_domain xp_domain
- #define expand_env xp_env
- #define expand_filename xp_filename
- #define expand_group xp_group
- #define expand_logname xp_logname
- #define expand_site xp_site
- #define expand_system xp_system
-
- #define filename2 fn2
- #define forward forwrd
-
- #define generate_reply_to gen_reply_to
- #define get_return_name g_ret_name
-
- #define header_line h_line
- #define header_page h_page
- #define headers_per_page h_per_page
- #define header_table h_table
-
- #define install_aliases ins_aliases
-
- #define last_line_loc last_ln_loc
-
- #define machine_group mach_group
- #define mailbox_defined mbox_defined
- #define mailfile_size mfile_size
- #define message_count msg_count
- #define message_number msg_number
-
- #define newaliases nwaliases
- #define noptimize_return noret_opt
- #define noptimize_usenet nousenet_opt
-
- #define optimize_and_add opt_and_add
- #define optimize_arpa opt_arpa
- #define optimize_cmplx_arpa opt_cmplx_arpa
- #define optimize_return opt_return
- #define optimize_usenet opt_usenet
- #define optional_arg opt_arg
- #define optionally_enter opt_enter
- #define original_cc orig_cc
- #define original_msg_num orig_msg_num
- #define original_to orig_to
-
- #define parse_arguments pars_arguments
- #define parse_arpa_from prs_arpa_from
- #define password_entry pw_entry
- #define pattern_enter pat_enter
- #define pattern_match pat_match
-
- #define read_alias_files rd_alias_files
- #define read_headers rd_headers
- #define read_notesfile rd_notesfile
- #define read_rc rd_rc
- #define read_rc_file rd_rc_file
- #define received_on_machine rcvd_on_machine
- #define remove_all rem_all
- #define remove_first_word rem_1st_word
- #define remove_domains rem_domains
- #define remove_header rem_hdr
- #define remove_user rem_user
- #define remove_through_ch rem_thru_ch
- #define reply_to_everyone repl_to_everyone
- #define resolve_received rslv_received
-
- #define show_message shw_message
- #define show_msg showmsg
- #define show_msg_tag sh_msg_tag
- #define size_of_pathfd sz_of_pathfd
- #define softkeys_off soft_off
- #define softkeys_on soft_on
- #define subjectbuffer subjbuff
- #define subject_matches subj_matches
- #define system_call sys_call
- #define system_data sys_data
- #define system_files sys_files
- #define system_hash_table sys_hash_table
- #define system_record sys_record
-
- #define tail_of_string tl_of_string
- #define talk_to_sys tlk_to_sys
- #define tempfile tmpfile
- #define termcap_label tcap_label
- #define top_of_screen_left top_left_of_screen
- #define top_of_screen_right top_right_of_screen
- #define translate_return xlate_return
-
- #define update_mailtime upd_mailtime
- #define update_title upd_title
- #define unexpanded_cc unexp_cc
- #define unexpanded_to unexp_to
-
- #define verify_transmission vfy_xmsn
-
- #define weeding_out wding_out
- END_OF_FILE
-
- chars=`cat hdrs/shortnames.h | wc -c`
-
- if [ $chars -ne 4006 ]
- then
- echo File damaged in transit...should be 4006 bytes, is $chars instead
- echo I suggest you check it closely...
- fi
-
- #-------------------------------------
- # File 'utils/arepdaemon.c' diffs...
-
- cat << 'EOF' > utils/arepdaemon.D
- 59,60d
- 37c
-
- #ifdef BSD
- # include <sys/time.h>
- #else
- # include <time.h>
- #endif
-
- .
- w
- EOF
-
- chars=`cat utils/arepdaemon.c | wc -c`
-
- if [ $chars -ne 13380 ]
- then
- echo Your file utils/arepdaemon.c has been changed\!
- echo diffs saved as \"utils/arepdaemon.D\"
- else
- echo applying diffs to file utils/arepdaemon.c...
- /bin/cat utils/arepdaemon.D | /bin/ed - utils/arepdaemon.c
- fi
-
- #-------------------------------------
- # File 'utils/autoreply.c' diffs...
-
- cat << 'EOF' > utils/autoreply.D
- 24,25d
- w
- EOF
-
- chars=`cat utils/autoreply.c | wc -c`
-
- if [ $chars -ne 4746 ]
- then
- echo Your file utils/autoreply.c has been changed\!
- echo diffs saved as \"utils/autoreply.D\"
- else
- echo applying diffs to file utils/autoreply.c...
- /bin/cat utils/autoreply.D | /bin/ed - utils/autoreply.c
- fi
-
- #-------------------------------------
- # File 'utils/fastmail.c' diffs...
-
- cat << 'EOF' > utils/fastmail.D
- 218a
- # endif
- .
- 217a
- # ifdef BSD4.1
- timezone(loc_time.time_zone, the_time->tz_isdst));
- # else
- .
- 203a
- # endif
- .
- 201a
- # ifdef BSD4.1
- junk = (long) time((long *) 0);
- ftime(&loc_time);
- # else
- .
- 198a
- # endif
- .
- 196a
- # ifdef BSD4.1
- struct timeb loc_time; /* of course this is different! */
- # else
- .
- 32c
- # ifdef BSD4.1
- # include <time.h>
- # include <sys/types.h>
- # include <sys/timeb.h>
- # else
- # include <sys/time.h>
- # endif
- .
- w
- EOF
-
- chars=`cat utils/fastmail.c | wc -c`
-
- if [ $chars -ne 7799 ]
- then
- echo Your file utils/fastmail.c has been changed\!
- echo diffs saved as \"utils/fastmail.D\"
- else
- echo applying diffs to file utils/fastmail.c...
- /bin/cat utils/fastmail.D | /bin/ed - utils/fastmail.c
- fi
-
- #-------------------------------------
- # File 'utils/newmail.c' diffs...
-
- cat << 'EOF' > utils/newmail.D
- 251c
- printf(">> %s mail from %s - %s\n\r",
- priority? "PRIORITY" : "New", from, subject);
- .
- 218c
- show_header(priority, from, subject)
- int priority;
- .
- 136c
- show_header(priority, from_whom, subject);
- .
- 131a
- else if (first_word(buffer,"Priority:"))
- priority++;
- .
- 113c
- register int subj = 0, in_header = 1, count = 0, priority=0;
- .
- 29a
- #ifdef AUTO_BACKGROUND
- #include <signal.h> /* background jobs ignore some signals... */
- #endif
-
- .
- 20,23d
- w
- EOF
-
- chars=`cat utils/newmail.c | wc -c`
-
- if [ $chars -ne 7761 ]
- then
- echo Your file utils/newmail.c has been changed\!
- echo diffs saved as \"utils/newmail.D\"
- else
- echo applying diffs to file utils/newmail.c...
- /bin/cat utils/newmail.D | /bin/ed - utils/newmail.c
- fi
-
- #-------------------------------------
- # File 'utils/newalias.c' diffs...
-
- cat << 'EOF' > utils/newalias.D
- 453a
- }
-
- extract_comment(comment, buffer, first, last)
- char *comment, *buffer;
- int first, last;
- {
- /** Buffer contains a comment, located between the first and last
- values. Copy that into 'comment', but remove leading and
- trailing white space. Note also that it doesn't copy past
- a comma, so `unpublishable' comments can be of the form;
- dave: Dave Taylor, HP Labs : taylor@hplabs
- and the output will be "taylor@hplabs (Dave Taylor)".
- **/
-
- register int loc = 0;
-
- /** first off, skip the LEADING white space... **/
-
- while (buffer[first] == ' ') first++;
-
- /** now let's backup the 'last' value until we hit a non-space **/
-
- last -= 2; /* starts at ch AFTER colon.. */
- while (buffer[last] == ' ') last--;
-
- /** now a final check to make sure we're still talking about a
- reasonable string (rather than a "joe :: joe@dec" type string) **/
-
- if (first < last) {
- /* one more check - let's find the comma, if present... */
- for (loc=first; loc < last; loc++)
- if (buffer[loc] == ',') {
- last = loc-1;
- break;
- }
- loc = 0;
- while (first <= last)
- comment[loc++] = buffer[first++];
- comment[loc] = '\0';
- }
- .
- 311a
- if (first_colon == -1 && string[i] == ':') {
- first_colon = i;
- for (last_colon=strlen(string);string[last_colon] != ':';
- last_colon--) ;
- }
- else if (i > first_colon && i < last_colon)
- if (string[i] == c1 || string[i] == c2)
- buffer[j++] = string[i];
- }
-
- .
- 308c
- for (i = 0; string[i] != '\0' && i < LONG_STRING; i++) {
- .
- 306c
- register int i = 0, j = 0, first_colon = -1, last_colon = -1;
- .
- 304c
- /* Remove all occurances of character 'c1' or 'c2' from the string.
- Hacked (literally) to NOT remove ANY characters from within the
- colon fields. This will only be used if the line contains TWO
- colons (and comments with colons in them are the kiss of death!)
- */
-
- .
- 284c
- if (strlen(comment) > 0) {
- fprintf(data, "%s (%s)\n", address, comment);
- additive = (long) (strlen(comment) + 4);
- }
- else
- fprintf(data, "%s\n", address, comment);
- .
- 267,268c
- /** add address + comment to datafile, incrementing offset count
- (bytes), then for each alias in the aliases string, add to the
- .
- 263c
- char *aliases, *comment, *address;
- .
- 261c
- add_to_table(data, aliases, comment, address, table, size)
- .
- 212c
- add_to_table(data, aliases, comment, address, table, size);
- .
- 209a
- comment[0] = '\0'; /* default to nothing at all... */
-
- if ((first=strlen(aliases)+1) < (last=(strlen(buffer) - j))) {
- extract_comment(comment, buffer, first, last);
- }
-
- .
- 198c
- char comment[LONG_STRING];
- int first, last, i = 0, j = 0;
- .
- 193,195c
- /** break buffer down into three pieces: aliases, comment, and address.
- Make the appropriate entries in the table (size)
- **/
- .
- w
- EOF
-
- chars=`cat utils/newalias.c | wc -c`
-
- if [ $chars -ne 11051 ]
- then
- echo Your file utils/newalias.c has been changed\!
- echo diffs saved as \"utils/newalias.D\"
- else
- echo applying diffs to file utils/newalias.c...
- /bin/cat utils/newalias.D | /bin/ed - utils/newalias.c
- fi
-
- #-------------------------------------
- # File 'utils/printmail.c' diffs...
-
- cat << 'EOF' > utils/printmail.D
- 72,73c
- argv++;
- if (argc-1) {
- .
- 34c
- argv++;
- .
- 28c
- argv++; /* get past argv[0] */
- .
- w
- EOF
-
- chars=`cat utils/printmail.c | wc -c`
-
- if [ $chars -ne 2472 ]
- then
- echo Your file utils/printmail.c has been changed\!
- echo diffs saved as \"utils/printmail.D\"
- else
- echo applying diffs to file utils/printmail.c...
- /bin/cat utils/printmail.D | /bin/ed - utils/printmail.c
- fi
-
- #-------------------------------------
- # File 'utils/readmsg.c' diffs...
-
- cat << 'EOF' > utils/readmsg.D
- 317a
- if (strlen(to) > 0) { printf("%s", to); displayed_line++;}
- .
- 304a
- to[0] = '\0';
- .
- 301a
- else if (strncmp(buffer,"To: ", 3) == 0)
- strncpy(to, buffer, SLEN);
- .
- 287c
- static char from[SLEN], subject[SLEN], date[SLEN], to[SLEN];
- .
- 200c
- if (current == read_message[current_in_queue] || list_all_messages)
- .
- 195,196c
- if ((current == read_message[current_in_queue] || list_all_messages)
- && page_breaks && current_in_queue > 0)
- .
- 190,193c
- if (! list_all_messages) {
- if (current == read_message[current_in_queue])
- current_in_queue++;
- if (current_in_queue >= messages)
- exit(0);
- }
- .
- 124c
- else if (*argv[0] == STAR) /* all messages.... */
- list_all_messages++;
- else { /* list of nums */
- .
- 117c
- else if (! isdigit(*argv[0]) && *argv[0] != LAST_CHAR &&
- *argv[0] != STAR) {
- .
- 67a
- list_all_messages = 0, /* just list 'em all?? */
- .
- 42a
- #define STAR '*' /* char to delimit all messages... */
- .
- 21a
- Also added '*' as a flag - indicating ALL messages in the mailbox.
-
- .
- 18c
-
- .
- w
- EOF
-
- chars=`cat utils/readmsg.c | wc -c`
-
- if [ $chars -ne 9564 ]
- then
- echo Your file utils/readmsg.c has been changed\!
- echo diffs saved as \"utils/readmsg.D\"
- else
- echo applying diffs to file utils/readmsg.c...
- /bin/cat utils/readmsg.D | /bin/ed - utils/readmsg.c
- fi
-
- #-------------------------------------
- # File 'utils/wnewmail.c' diffs...
-
- cat << 'EOF' > utils/wnewmail.D
- 249c
- /** Try to parse the 'From:' line given... It can be in one of
- .
- 243c
- printf("%sMail from %s -- %s\n",
- priority? "PRIORITY ": "", from, subject);
- .
- 208c
- show_header(priority, from, subject)
- int priority;
- .
- 126c
- show_header(priority, from_whom, subject);
- .
- 123a
- else if (first_word(buffer, "Priority:"))
- priority++;
- .
- 103c
- register int subj = 0, in_header = 1, count = 0, priority = 0;
- .
- 17a
- #ifdef AUTO_BACKGROUND
- #include <signal.h> /* background jobs ignore some signals... */
- #endif
-
- .
- 8,11d
- w
- EOF
-
- chars=`cat utils/wnewmail.c | wc -c`
-
- if [ $chars -ne 7804 ]
- then
- echo Your file utils/wnewmail.c has been changed\!
- echo diffs saved as \"utils/wnewmail.D\"
- else
- echo applying diffs to file utils/wnewmail.c...
- /bin/cat utils/wnewmail.D | /bin/ed - utils/wnewmail.c
- fi
-
- #---------------------------------
- # File Elm/utils/trim-headers is new!
-
- echo File Elm/utils/trim-headers is new - extracting...
- if [ -f utils/trim-headers ]
- then
- echo File \'utils/trim-headers\' is new, but you already have something called that\!
- echo I\'m going to move your file to \'utils/trim-headers.old\'...
- /bin/mv -f utils/trim-headers utils/trim-headers.old
- else
- echo Extracting new file \'utils/trim-headers\'
- fi
-
- cat > utils/trim-headers << 'END_OF_FILE'
- : Use /bin/sh
-
- # This shell script is designed to be used either to trim the 'junk' headers
- # out of an archived/saved mailbox file or to trim the headers off a file
- # that is being piped to it. The program considers the following headers
- # to be worth saving - everything else is junked.
- #
- # From <user> <date>
- # From: name <address>
- # Subject:
- # To:
- # Cc:
- # Date:
- #
- # all others are ignored and trashed.
- #
- # (C) Copyright 1986, Dave Taylor
-
- # first off, let's make the 'awk' script we'll be using...
-
- cat << 'END_OF_AWK_SCRIPT' > /tmp/awk.$$
- BEGIN { in_body = 1 }
- { if (in_body) {
- if ($1 == "From") in_body = 0;
- print $0
- }
- else if ($1 == "From:" || $1 == "Subject:" || $1 == "To:" || \
- $1 == "Cc:" || $1 == "Date:")
- print $0
- else if (length($0) == 0) {
- in_body = 1;
- print $0
- }
- }
- END_OF_AWK_SCRIPT
-
- # next let's see if we're being piped to or if we've been handed
- # either a file name or list of file names...
-
- if [ "$1" = "" ]
- then
- cat - | awk -f /tmp/awk.$$ | uniq
- rm -f /tmp/awk.$$
- else
- for filename in $*
- do
- echo filtering file $filename
- cat $filename | awk -f /tmp/awk.$$ | uniq > OUTFILE
- mv OUTFILE $filename
- done
- echo done
- fi
-
- exit 0
- END_OF_FILE
-
- chars=`cat utils/trim-headers | wc -c`
-
- if [ $chars -ne 1201 ]
- then
- echo File damaged in transit...should be 1201 bytes, is $chars instead
- echo I suggest you check it closely...
- fi
-
- #---------------------------------
- # File Elm/utils/Makefile.mstr is new!
-
- echo File Elm/utils/Makefile.mstr is new - extracting...
- if [ -f utils/Makefile.mstr ]
- then
- echo File \'utils/Makefile.mstr\' is new, but you already have something called that\!
- echo I\'m going to move your file to \'utils/Makefile.mstr.old\'...
- /bin/mv -f utils/Makefile.mstr utils/Makefile.mstr.old
- else
- echo Extracting new file \'utils/Makefile.mstr\'
- fi
-
- cat > utils/Makefile.mstr << 'END_OF_FILE'
- #
- # Makefile for the Elm system utilities
- #
- # (C) Copyright 1986, Dave Taylor
- #
- # Last modification: March 5th, 1986
-
- SHELL=/bin/sh
-
- ##############################
- #
- # if on a BSD system;
- # DEFINE=-DBSD
- # LIB2 = -lcurses
- # else if on a UTS system;
- # DEFINE=-DUTS
- # LIB2 = -la
- # else if on a SUN system;
- # DEFINE=-DBSD -DSUN
- # LIB2 = -lcurses
- # else if on a Pyramid system;
- # DEFINE=-DBSD -DNO_VAR_ARGS
- # LIB2 = -lcurses
- # else
-
- DEFINE= >os-define<
- LIB2 = >lib2<
-
- ##############################
-
- CFLAGS= -O -I../hdrs
- CC= >cc<
- RM= >rm<
- ECHO= /bin/echo
-
- OBJS= ../bin/newalias ../bin/from ../bin/newmail ../bin/answer \
- ../bin/printmail ../bin/fastmail ../bin/readmsg \
- ../bin/checkalias ../bin/arepdaemon ../bin/autoreply ../bin/wnewmail \
- ../bin/messages ../bin/trim-headers
-
- all: ${OBJS}
-
- ../bin/newalias: ../hdrs/defs.h newalias.c ../src/validname.o \
- ../src/opt_utils.o
- ${CC} ${CFLAGS} ${DEFINE} newalias.c ../src/validname.o \
- ../src/opt_utils.o -o ../bin/newalias
-
- ../bin/from: from.c ../src/opt_utils.o ../src/string2.o
- ${CC} ${CFLAGS} ${DEFINE} from.c ../src/opt_utils.o \
- ../src/string2.o -o ../bin/from
-
- ../bin/newmail: ../src/opt_utils.c newmail.c ../src/string2.o
- ${CC} ${CFLAGS} ${DEFINE} newmail.c \
- ../src/string2.o -o ../bin/newmail
-
- ../bin/wnewmail: ../src/opt_utils.c wnewmail.c ../src/string2.o
- ${CC} ${CFLAGS} ${DEFINE} ../src/opt_utils.o \
- ../src/string2.o wnewmail.c -o ../bin/wnewmail
-
- ../bin/answer: answer.c ../src/opt_utils.o
- ${CC} ${CFLAGS} ${DEFINE} answer.c ../src/opt_utils.o -o ../bin/answer
-
- ../bin/printmail: printmail.c ../src/opt_utils.o
- ${CC} ${CFLAGS} ${DEFINE} printmail.c ../src/opt_utils.o \
- -o ../bin/printmail
-
- ../bin/fastmail: fastmail.c
- ${CC} ${CFLAGS} ${DEFINE} fastmail.c ../src/opt_utils.o \
- -o ../bin/fastmail
-
- ../bin/readmsg: readmsg.c ../src/getopt.o ../src/opt_utils.o
- ${CC} ${CFLAGS} ${DEFINE} readmsg.c ../src/getopt.o \
- ../src/opt_utils.o -o ../bin/readmsg
-
- ../bin/arepdaemon: arepdaemon.c
- ${CC} ${CFLAGS} ${DEFINE} arepdaemon.c -o ../bin/arepdaemon
-
- ../bin/autoreply: autoreply.c ../src/opt_utils.o
- ${CC} ${CFLAGS} ${DEFINE} autoreply.c ../src/opt_utils.o \
- -o ../bin/autoreply
-
- ../bin/checkalias:
- @echo ': Use /bin/sh' > ../bin/checkalias
- @echo 'if [ "$$*" = "" ]; then' >> ../bin/checkalias
- @echo ' echo Usage: checkalias alias \[or aliases\]' >> \
- ../bin/checkalias
- @echo ' exit 1' >> ../bin/checkalias
- @echo 'fi' >> ../bin/checkalias
- @echo ' ' >> ../bin/checkalias
- @echo 'exec elm -c $$*' >> ../bin/checkalias
- @chmod +x ../bin/checkalias
-
- ../bin/messages:
- @echo ': Use /bin/sh' > ../bin/messages
- @echo 'if [ "$$2" != "" ]; then' >> ../bin/messages
- @echo ' echo Usage: messages \{folder-name\}' >> ../bin/messages
- @echo ' exit 1' >> ../bin/messages
- @echo 'fi' >> ../bin/messages
- @echo ' ' >> ../bin/messages
- @echo 'if [ "$$1" = "" ]; then' >> ../bin/messages
- @echo ' fname=$$MAIL' >> ../bin/messages
- @echo ' optional="in your mailbox"' >> ../bin/messages
- @echo 'else' >> ../bin/messages
- @echo ' fname=$$1' >> ../bin/messages
- @echo ' optional="in folder $$1"' >> ../bin/messages
- @echo 'fi' >> ../bin/messages
- @echo ' ' >> ../bin/messages
- @echo 'mcount=`egrep "^From " $$fname | wc -l`' >> ../bin/messages
- @echo ' ' >> ../bin/messages
- @echo 'if [ $$mcount = 1 ];then' >> ../bin/messages
- @echo ' echo There is $$mcount message $$optional' >> ../bin/messages
- @echo 'else' >> ../bin/messages
- @echo ' echo There are $$mcount messages $$optional' >> ../bin/messages
- @echo 'fi' >> ../bin/messages
- @echo ' ' >> ../bin/messages
- @echo 'exit 0' >> ../bin/messages
- @chmod +x ../bin/messages
-
- ../bin/trim-headers:
- @cp trim-headers ../bin/trim-headers
- @chmod +x ../bin/trim-headers
-
- ../src/validname.o: ../src/validname.c ../hdrs/defs.h
- @(cd ../src; ${CC} -c ${CFLAGS} ${DEFINE} validname.c; cd ../utils)
-
- ../src/opt_utils.o: ../src/opt_utils.c ../hdrs/defs.h
- @(cd ../src; ${CC} -c ${CFLAGS} ${DEFINE} opt_utils.c; cd ../utils)
-
- ../src/getopt.o: ../src/getopt.c ../hdrs/defs.h
- @(cd ../src; ${CC} -c ${CFLAGS} ${DEFINE} getopt.c; cd ../utils)
-
- ../src/string2.o: ../src/string2.c ../hdrs/defs.h
- @(cd ../src; ${CC} -c ${CFLAGS} ${DEFINE} string2.c; cd ../utils)
-
- clean:
- ${RM} *.o ${OBJS}
-
- lint:
- lint -p -I../hdrs *.c > LINT.OUT
- END_OF_FILE
-
- chars=`cat utils/Makefile.mstr | wc -c`
-
- if [ $chars -ne 4391 ]
- then
- echo File damaged in transit...should be 4391 bytes, is $chars instead
- echo I suggest you check it closely...
- fi
-
- #-------------------------------------
- # File 'bin/mail.elm' diffs...
-
- cat << 'EOF' > bin/mail.elm.D
- 16c
- sleep 1800
- .
- w
- EOF
-
- chars=`cat bin/mail.elm | wc -c`
-
- if [ $chars -ne 363 ]
- then
- echo Your file bin/mail.elm has been changed\!
- echo diffs saved as \"bin/mail.elm.D\"
- else
- echo applying diffs to file bin/mail.elm...
- /bin/cat bin/mail.elm.D | /bin/ed - bin/mail.elm
- fi
-
- #-------------------------------------
- # File 'Instructions' diffs...
-
- cat << 'EOF' > Instructions.D
- 84c
- should say "no mail" if nothing's in your incoming mailbox, and
- .
- 75c
- Note: the mailer runs as setgid mail to have the ability to WRITE
- .
- 63,73c
- $ make -i install
- .
- 59,61c
- next, you can install all the software on your system by;
- .
- 56,57c
- "answer", "arepdaemon", "autoreply", "fastmail", "from",
- "elm", "newalias", "newmail", "printmail", and "readmsg".
- .
- 40,47d
- 36,38c
- (if you're in "sh", you can use "> MAKELOG 2>&1" instead of ">& MAKELOG")
- .
- 34c
- $ (make -i all >& MAKELOG) &
- $ tail -f MAKELOG
- .
- 32c
- When that's done, or even if it fails (don't worry too much about it)
- .
- 29,30c
- $ make documentation
- .
- 27c
- $
- .
- 25c
- Once you're happy with the localized files, you then need to create
- the documentation (so there's a bit of a catch-22 that you need to format the
- Configuration guide before you are happy with the localization but can't do
- that until you're happy with the localization...oh well).
- .
- 23c
- Answer the questions of that program,, then let it create the localized
- Makefiles and system definition files for you. When it's done you can double
- check the configuration (or customize it further) by reading the Configuration
- Guide + editing the file "hdrs/sysdefs.h". There are lots of neat features
- that are unique to this mailer - it's worth a quick perusal at least!
- .
- 19,21c
- $ sh Configure.sh
- .
- 17c
- $ cd <where-ever you're keeping the Elm sources>
- .
- 13,15c
- There is actually really one step needed - unpack all the shar
- files and then;
- .
- 5c
- Last Update: July 17th, 1986
- .
- w
- EOF
-
- chars=`cat Instructions | wc -c`
-
- if [ $chars -ne 5058 ]
- then
- echo Your file Instructions has been changed\!
- echo diffs saved as \"Instructions.D\"
- else
- echo applying diffs to file Instructions...
- /bin/cat Instructions.D | /bin/ed - Instructions
- fi
-