buz@ucla-cs.UUCP (04/02/87)
Every wanted to get involved with Sexigisma? But didn't know when to? Were you a little shy and weren't sure when to run on Sadie Hawkins Day? Here is a program that will tell you all that and more. It lists holidays for a given year. It reconstructs the recent past so that it will not tell you about things that didn't happen. It tries to predict the future on the basis of the way things are (How much better can it do?). This is an expert system for holidays. Unpack in its own directory, make and enjoy it. BUZ : 'is for poor Xenix users' #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh or : line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # README # datelib.3t # easter.1t # holidays.1t # Makef.bsd+sysV # Makefile.xenix # datelib.h # taxc.h # This archive created: Wed Apr 1 14:57:36 1987 export PATH; PATH=/bin:$PATH echo shar: extracting "'README'" '(4663 characters)' if test -f 'README' then echo shar: will not over-write existing file "'README'" else sed 's/^ X//' << \SHAR_EOF > 'README' X X X EASTER, HOLIDAYS, and DATELIB X XThe Easter, Holidays, and Datelib Programs and Manual Pages are XCopyright (c) 1987 Tigertail Associates. All Rights Reserved. X XAuthor: Robert Uzgalis. X XThese routine provide date functions similar to ones provided by Xmost Unix systems. These however have be augmented by additional Xroutines to allow one to go to and from Gregorian dates, find Xout information about a given Unix date, for example the number Xof preceeding calendar weeks to the current date, or the number Xof days with the same name in this month. Also there are a Xcouple of routines to give information about years, one provides Xa Boolean if the year is a leap year, the other provides the Unix Xdate of 0H for Easter Sunday. X XIn these routines calculation is only done for the Gregorian calendar. X XFor these routines a Unix date is assumed to be signed and represent Xdates before 1970 -- this is contrary to some advanced speculation. XUsing a signed scheme Unix dates cover an era from about 1903 to about X2032. Beyond these dates other reperesentations must be used. An Xalternative is to consider Unix dates as unsigned longs. Using that Xscheme no date before 1970 can be represented. These programs use signed Xlongs but with a beginning era of 1914. The year 1914 has some nice Xproperties since it has a calendar identical to 1970 and it falls in the Xsame place in the leap year cycle. These programs will fail on dates Xbetween 1903 and 1913. X X X/* The Date Library Provides the Following Functions: */ X Xlong uxdate(int,int,int); /* Convert y,m,d to a Unix date at Greenwich*/ Xlong uxldate(int,int,int); /* Convert y,m,d to a Unix date locally */ Xlong uxtime(int,int,int); /* Convert h,m,s to a Unix time in seconds */ Xlong uxeaster(int); /* For y return the Unix date of 0H Easter */ XBool leap(int); /* For y return TRUE if a leap year */ Xint yrday(int,int,int); /* For y,m,d return number of preceeding days */ Xint weeknum(long); /* For udate return the week of the month */ Xint daynum(long); /* For udate return the day index of month */ X X/* The next two routines breakdown a Unix date/time into Gregorian Calendar X * and time elements. They perform about the same function as the gmtime X * system call. They do not use gmtime however, so they don't destroy its X * static information. They retain no static information themself. X */ Xvoid datex(long,int*,int*,int*,int*,int*); Xvoid timex(long,int*,int*,int*); X Xvoid ldatex(long,int*,int*,int*,int*,int*); /* Supply localtime breakdown */ X X XTo test the datelib routines two test programs were generated. Easter provides Xthe date of Easter from the start of the Gregorian Calendar to some Xinconcievable date in the future when Christianity will probably not be Xpracticed. The other routine is more fun, for a given year it will provide Xa list of the holidays for that year including the church dates that depend Xon Easter. It will output in a format compatable with the standard Unix Xreminder program calendar(1). For current years it provides phase of the Xmoon information. It can also be made to output a complete calendar for Xthe year which can be used as a form for calendar(1) reminders. X XThese routines were developed on a Xenix system on the IBM PC/AT using X16 bit integers. They should perform beautifully on a bigger machine. XThey have been tried under System Vr2 and Berkeley 4.3. Although the XMakefile will have to be modified. The make file is designed to maintain Xmultiple library models in the Xenix tradition. X XHolidays requires the use of getopt(3) which should be availble on your Xlocal system somewhere. If it is not available locally then a public Xdomain version is available from a net.sources archive. X XTo do local time adjustment datelib uses tzset to force the external Xtimezone and daylight variables to be set. If these are incorrect the Xlocal time adjustment will be wrong. X XINSTALLATION X X1. Unpack the shar files. X2. Notice there are two Makefiles X One is called Makef.bds+sysV X The other is Makefile.xenix X link one or the other to Makefile X by doing a 'ln xxxxx Makefile' X where you select xxxxx to be the one X you want for the kind of system you are X running on. X3. Edit the Makefile and adjust for local conventions. X On BSD systems set the TIMEZONE variable. X4. Run make... it should do its thing. X5. Try out Easter and Holidays X6. If you want manual pages run `make man' X it will produce manual pages you can more X to your screen in the local directory. X7. 'make install' will install the manual pages X and the rest of the stuff where you set X the directorys in the Makefile. SHAR_EOF if test 4663 -ne "`wc -c < 'README'`" then echo shar: error transmitting "'README'" '(should have been 4663 characters)' fi fi # end of overwriting check echo shar: extracting "'datelib.3t'" '(4575 characters)' if test -f 'datelib.3t' then echo shar: will not over-write existing file "'datelib.3t'" else sed 's/^ X//' << \SHAR_EOF > 'datelib.3t' X.TH DATELIB 3T X.SH NAME X.sp Xdatelib \- Library of Tigertail Date routines X.SH SYNOPSIS X Xint y, m, d; /* year (1954), month (1 = Jan), day */ X.br Xint h, mn, s; /* hr (24hr clock), minute, second */ X.br Xlong ud; /* a unix date: seconds since 0hr 1970 */ X.br X Xlong uxdate ( y, m, d) /* unix seconds since 1970 */ X.br X Xvoid datex ( ud, &y, &m, &dy, &dm, &dw ) /* extract a date from ud */ X.br X Xlong ldate ( y, m, d) /* corrected for local time */ X.br X Xvoid ldatex ( ud, &y, &m, &dy, &dm, &dw ) /* extract a date from ud */ X.br X Xlong uxtime ( h, mn, s ) /* seconds since midnight */ X.br X Xvoid timex ( ud, &h, &mn, &s ) /* extract time from a ud */ X.br X Xlong uxeaster ( y ) /* 0h Easter sunday for year */ X.br X Xint yrday ( y, m, d ) /* Full days sofar this year Jan 1st gives 0 */ X.br X Xint leap ( y ) /* 1 if leap year; 0 otherwise */ X.br X Xint weeknum ( ud ) /* The week of month */ X.br X Xint daynum ( ud ) /* The nth weekday of month */ X.br X X X.SH DESCRIPTION X.PP XProcedure X.I uxdate XReturn the number of seconds between Jan 1, 1970 and the X0h 0m 0s of the date pm/pd/py in the current era, circa 2000. XThe date is the Greenwich date, it needs correction for the timezone Xif you want local time/date. XThe year is the full year, 70 is nonsense not the year 1970. X.PP XProcedure X.I datex XReturn a broken down long Unix date as integers representing the Xnumber of full years since the birth of Christ; Xthe number of full months since the start of the year; Xthe number of full days since the start of the year; Xthe number of full days since the start of the month; Xthe number of full days since the start of the week. XThis preforms some of the same functions as X.I gmtime(3). X.PP XProcedure X.I ldate XReturn the number of seconds between GMT Jan 1, 1970 0h 0m 0s Xand local time 0h 0m 0s of date pm/pd/py in the current era. XThe date is thus based on local time. X.PP XProcedure X.I ldatex XReturn a broken down long Unix date adjusted to local time Xas integers representing the Xnumber of full years since the birth of Christ; Xthe number of full months since the start of the year; Xthe number of full days since the start of the year; Xthe number of full days since the start of the month; Xthe number of full days since the start of the week. XThis preforms some of the same functions as X.I localtime(3). X.PP XProcedure X.I uxtime XConvert a broken-down 24 hour local time hh:mm:ss to seconds Xsince local midnight. X.PP XProcedure X.I timex XConvert a long Unix date to integers representing a broken down time. XIt returns Xthe number of full hours since midnight; Xthe number of full minutes since the start of the last hour; Xthe number of full seconds since the start of the last minute. X.PP XProcedure X.I uxeaster Xgiven a year (eg 1984) it provides a long unix date Xin seconds since 1970 for 0h0s the date of Easter. XThe center of this algorithm was copied from page 5 of X.I "Practical Astronomy with your Calculator" X(second edition) by Peter Duffett-Smith, published Xby Cambridge University Press in 1979 and 1981. X.PP XProcedure X.I yrday Xgives the number of full days sofar this year for a given date (y,m,d). XThus X.I yrday + 1 Xis the current day number. X.PP XProcedure X.I leap Xreturns 1 if the argument y is a leap year, returns 0 otherwise. XThe year should be a full year number 1987 not 87. X.PP XProcedure X.I weeknum XReturn the current week of the month (1-5). X.PP XProcedure X.I daynum XReturn the current weekday index of this month (1-4). XE.g. If date is the 3rd Tuesday of Sept. ... function returns 3. X.br X.SH "SEE ALSO" X.sp X.PP Xctime(3) and time(3). X.sp X.SH BUGS X.sp X.PP XFor the routine uxdate and ldate. XCalculation is Gregorian calendar as in the current era. XThat is, this program always computes Gregorian dates Xnever Julian ones. XDates before September of 1752 in England and her colonies are Xwrong by about 12 days and then get even worse as the date gets smaller. XDates before October of 1582 in Catholic countries will likewise Xbe incorrect by abut 10 days and then get progressively worse. XThis is viewed as a minor difficulty with these routines. X.PP XThe routine ldate and ldatex only corrects for daylight savings time Xby subtracting an hour, if someother convention is operating Xit will produce the wrong correction. X.sp X.SH COMMENTS X.sp X.PP XThis date interface is a Tigertail Associates Xenix improvement. XThese routines may not be present in other Unix systems. XIf they are used the program must be Xlinked with the local C-library X.I /usr/local/Lib/{SML}libtig.a. X.sp X.SH AUTHOR X.sp X.PP XRobert Uzgalis, Tigertail Associates SHAR_EOF if test 4575 -ne "`wc -c < 'datelib.3t'`" then echo shar: error transmitting "'datelib.3t'" '(should have been 4575 characters)' fi fi # end of overwriting check echo shar: extracting "'easter.1t'" '(2586 characters)' if test -f 'easter.1t' then echo shar: will not over-write existing file "'easter.1t'" else sed 's/^ X//' << \SHAR_EOF > 'easter.1t' X.TH EASTER 1T X.SH NAME X.sp Xeaster \- Given a year print the date of Gregorian Easter Sunday X.SH SYNOPSIS X X.B easter [year] X X.SH DESCRIPTION X.PP XThe command X.I easter Xprints the date of the next Easter Sunday. XThe command X.I easter year Xprints the date of the Gregorian Easter Sunday for the year specified. X.PP XEaster is a Christian religious festival held on the first sunday Xafter the first full moon following the spring equinox. XMany of the churches holidays are based on offsets from Easter, this Xprovides variety from year to year as the moon cycle beats against Xthe solar cycle. XThis program uses an algorithm from page 5 of X.I "Practical Astronomy with your Calculator" X(second edition) by Peter Duffett-Smith, published Xby Cambridge University Press in 1979 and 1981 to calculate Xthe date of Easter. X.PP XThe word `Easter' comes from the Old English word 'eastre' which is the Xname for a Celtic celebration of the start of spring. X.br X.sp X.SH BUGS X.PP XThis program works only in the Gregorian calendar, so early Easters Xare not well reperesented. XIn 1752, England and her colonies joined many other (mostly Catholic) Xcontries in using the Gregorian calendar. XBefore 1753 the program prints a warning by appending Gregorian calendar Xto the date printed. XFrom 1583 to 1752 Easter could be celebrated either Xaccording to the Julian calendar or according to the Gregorian one depending Xon the country and the church. XIn fact the Eastern Orthodox church still celebrates Easter using the XJulian calendar; this celebration called `Russian Easter' in the West Xcan be over a month away from the Gregorian Easter reported here. XFor the nearly two-hundred years between 1582 and 1752 many countries ran Xon the Julian calendar (mostly anti-pope ones) Xand other countries followed the lead of the Roman Catholic Chuch Xand converted to the calendar prescribed by Pope Gregrory XIII. XIn Catholic countries the Gregorian calendar started in October of 1582 Xwith the deletion of ten days to resynchronize the calendars with the Sun Xcrossing the celestial equator in the spring (vernal equinox). XBefore 1583 the program will never be correct so it refuses to work. X.PP XSombody might consider modifying the algorithm to produce Julian calendar XEasters. XWith that code the program could be extended back to the time of the first XNicaean Council (ca 325) that established the commeration of Christ's XResurection on the first Sunday after the 14th day of the Paschel new moon. XIn early Christianity the Easter date was not computed uniformly. X.sp X.SH AUTHOR X.PP XRobert Uzgalis, Tigertail Associates SHAR_EOF if test 2586 -ne "`wc -c < 'easter.1t'`" then echo shar: error transmitting "'easter.1t'" '(should have been 2586 characters)' fi fi # end of overwriting check echo shar: extracting "'holidays.1t'" '(4644 characters)' if test -f 'holidays.1t' then echo shar: will not over-write existing file "'holidays.1t'" else sed 's/^ X//' << \SHAR_EOF > 'holidays.1t' X.TH holidays 1T X.SH NAME X.sp Xholidays \- Print a Holiday [Christian's] Calendar X.SH SYNOPSIS X X.B holidays [flags] [yr] X X.SH DESCRIPTION X.PP XThe command X.I holidays [year] Xprints a Gregorian calendar marking most standard secular and XChristian religious holidays. XIf year is not specified the current year is printed. X.PP XThe flags control the content, holidays, and the format Xof the resulting calendar. X.sp X.in +0.5i X.ta 0.5i +0.5i +0.5i +0.5i +0.5i +0.5i X Calendar Content ( Default: -h ) X.sp X-h Only holidays printed X.br X-a Every day printed X.br X-u Print usage summary with flag information X.sp X Annotation Content ( Default: -beLp1 ) X.sp X-b both religious and secular calendar X.br X-B neither religious nor secular calendar X.br X-r additional religious calendar X.br X-s additional secular calendar X.br X-e additional event calendar X.br X-l additional lunar calendar X.br X [] represents new moon X.br X |) represents the first quarter X.br X () represents full moon X.br X (| represents last quarter X.br X-p <0-9> priority limit of holidays X.br X 0 most important holidays (eg Christmas) X.br X 3 a holiday like April Fools Day X.br X 9 least important holidays (eg My birthday) X.sp X Date Format ( Default: -NwmdF ) X.sp X-n day number X.br X-w weekday X.br X-m month name X.br X-d day of month X.br X-t two digit year X.br X-f four digit year X.br X.in -0.5i X.sp XCapitalizing a flag inverts it so to delete the weekday from the Xdate is -W. XTo add a four digit year to the date is -f. XTo have no year in the date is -F. X.PP XThe X.I -a Xflag is useful for providing a model calendar to edit Xif one uses the calendar(3) reminder program. XThe X.I -z Xflag is useful for providing a model calendar to edit Xif one uses the remindme(3t) program. X.PP XTo calculate Easter and related holidays the program uses Xan algorithm from page 5 of X.I "Practical Astronomy with your Calculator" X(second edition) by Peter Duffett-Smith, published Xby Cambridge University Press in 1979 and 1981. X.PP XMany sources were used as the authority for the dates and Xbackground of the holidays and festivals marked by this Xprogram: X.I "Encyclopedia Brittanica," X.I "The 1987 Year Book," X.I "The World Book Encyclopedia," X.I "Webster's Seventh New Collegiate Dictionary," X.I "The Book of Days," Xand other reference books. X.PP XIn the United States federal holidays are celebrated by local option. XMost states follow federal conventions. XFederal holidays that fall on a Saturday are observed on Friday; Xholidays that fall on a Sunday are observed on Monday. XThis program does not implement these sliding rules, instead Xit expects federal workers to take their lumps if a holiday falls Xon a weekend. X.PP XThis program will have to be adapted to local conditions and Xconventions. XOutside the United States and Canada holidays are vastly different Xand the tables in the program should change to reflect that. X.PP XChristian church holidays are more standard. XHowever they suffer by having different sects emphasising one festival Xover another so the priorities in the tables are far from universal. XIn the early days of Christianity holidays were not nearly so standard; Xnor for that matter was the calendar. XThe celebration of Easter was set by the first Nicaean Council (in 325) Xas the first Sunday after 14th day from the Paschel new moon preceeding Xthe vernal equinox. X(Are you glad you asked?) XMany church holidays are related to Easter: the Pre-Lent Sundays, XLent, Pentecost, and Holy Thursday (the Feast of the Ascension). X.PP XIt is not clear who established the date for Christmas, but early X(first century) Christians, celebrated it around the vernal equinox. XIn fact well into the 16th century the year changed just after the Xvernal equinox not in January. XIt is believed that Constantine (ca. 325) moved the celebration Xof Christmas to December to mark his conversion. X.PP XThe Advent celebration was establish by the Council of Ephesus in 431. XHowever the starting date has changed somewhat. XThe currently accepted date is four weeks before Christmas. X.br X.sp X.SH BUGS X.PP XThis program works only in a restricted Unix era, ca 1914 to 2036. XOutside that range the program refuses to work. X.PP XThe program does not slide US federal holidays out of a weekend Xto the nearest Friday or Monday. X.pp XThe lunar option (-l) has not been extensively checked; Xit is simple (I daresay too simple); Xalthough it does `seem' to work. X.PP XProbably should show lunar eclipses (at least). XSolar eclipses are less interesting because they are Xso local. X.PP XPriority ratings are subjective as are the Xincluded holidays. X.PP XThere are too many options. X.sp X.SH AUTHOR X.PP XRobert Uzgalis, Tigertail Associates SHAR_EOF if test 4644 -ne "`wc -c < 'holidays.1t'`" then echo shar: error transmitting "'holidays.1t'" '(should have been 4644 characters)' fi fi # end of overwriting check echo shar: extracting "'Makef.bsd+sysV'" '(3023 characters)' if test -f 'Makef.bsd+sysV' then echo shar: will not over-write existing file "'Makef.bsd+sysV'" else sed 's/^ X//' << \SHAR_EOF > 'Makef.bsd+sysV' X# SYSV and BSD Makefile for Date Library X# This maintains a Small, Medimum, and a Large Model Libaray X# X# General Files X XMAIN = datelib XLIB = tig XSRC = easter.c holidays.c XOBJS = $(MAIN).o XINCL1 = $(MAIN).h XINCL2 = taxc.h XHDRS = $(INCL1) $(INCL2) XMANP = $(MAIN).3t XDOCS = README $(MANP) easter.1t holidays.1t XLIBS = -lx -l$(LIB) XMDIR3 = /tmp/man/man3 XMDIR1 = /tmp/man/man1 XIDIR = /tmp/include XLDIR = /tmp/lib XBDIR = /tmp/bin XARLIB = lib$(LIB).a XTEXT = $(HDRS) $(MAIN).c $(SRC) XTIMEZONE = 8 /* Hours west of greenwich for BSD systems */ X X# X# General Flags X XLFLAGS = XCFLAGS = -O -DBSD -DTZV=$(TIMEZONE) XCFLAGS = -O -DSYSV X X# X# General Programs X XLINT = /usr/bin/lint -hp XPR = @/usr/local/print1 XSPELL = spell XNROFF = nroff XSHAR = cshar -a XCC = /bin/cc XAR = /bin/ar XRANLIB = /bin/ranlib X X# X# General Rules X Xall: $(ARLIB) easter holidays X X$(ARLIB): $(OBJS) X $(AR) rvu $(ARLIB) $(OBJS) X $(RANLIB) $(ARLIB) X @echo $(MAIN) made X Xeaster: easter.o $(ARLIB) X $(CC) $(LFLAGS) -o easter easter.o $(ARLIB) X Xholidays: holidays.o $(ARLIB) X $(CC) $(LFLAGS) -o holidays holidays.o $(ARLIB) X Xinstall: X if [ -d $(LDIR) ] ; \ X then \ X if [ -f $(LDIR)/$(ARLIB) ] ; \ X then \ X $(AR) rvu $(LDIR)/$(ARLIB) $(OBJS) ; \ X else \ X cp $(ARLIB) $(LDIR)/$(ARLIB) ; \ X fi ; \ X chown bin $(LDIR)/$(ARLIB) ; \ X chgrp bin $(LDIR)/$(ARLIB) ; \ X chmod 644 $(LDIR)/$(ARLIB) ; \ X $(RANLIB) $(LDIR)/$(ARLIB) ; \ X fi X if [ -d $(BDIR) ] ; \ X then \ X cp holidays $(BDIR) ; \ X cp easter $(BDIR) ; \ X chown bin $(BDIR)/holidays $(BDIR)/easter ; \ X chgrp bin $(BDIR)/holidays $(BDIR)/easter ; \ X chmod 755 $(BDIR)/holidays $(BDIR)/easter ; \ X fi X if [ -d $(IDIR) ] ; \ X then \ X rm -f $(IDIR)/$(INCL) ; \ X cp $(INCL) $(IDIR) ; \ X chown bin $(IDIR)/$(INCL) ; \ X chgrp bin $(IDIR)/$(INCL) ; \ X chmod 644 $(IDIR)/$(INCL) ; \ X fi X if [ -d $(MDIR3) ] ; \ X then \ X rm -f $(MDIR3)/$(MANP) ; \ X cp $(MANP) $(MDIR3) ; \ X chown bin $(MDIR3)/$(MANP) ; \ X chgrp bin $(MDIR3)/$(MANP) ; \ X chmod 644 $(MDIR3)/$(MANP) ; \ X fi X if [ -d $(MDIR1) ] ; \ X then \ X rm -f $(MDIR1)/holidays.1t $(MDIR1)/easter.1t ; \ X cp holidays.1t $(MDIR1) ; \ X chown bin $(MDIR1)/holidays.1t ; \ X chgrp bin $(MDIR1)/holidays.1t ; \ X chmod 644 $(MDIR1)/holidays.1t ; \ X cp easter.1t $(MDIR1) ; \ X chown bin $(MDIR1)/easter.1t ; \ X chgrp bin $(MDIR1)/easter.1t ; \ X chmod 644 $(MDIR1)/easter.1t ; \ X fi X Xprint: X $(PR) $(TEXT) X Xlint: X $(LINT) $(LNTFLG) $(SRC) X Xman: X $(NROFF) -man $(MANP) | col >:$(MAIN).manpg X $(NROFF) -man easter.1t | col >:easter.manpg X $(NROFF) -man holidays.1t | col >:holidays.manpg X Xspell: X $(SPELL) $(DOCS) X Xarchive: X $(SHAR) $(DOCS) Makef.bsd+sysV Makefile.xenix $(HDRS) > archive1 X $(SHAR) $(MAIN).c $(SRC) > archive2 X Xclean: X rm -f *.[SMLoa] core *.out :* X X.PRECIOUS: $(TEXT) $(SRC) $(MAIN).c SHAR_EOF if test 3023 -ne "`wc -c < 'Makef.bsd+sysV'`" then echo shar: error transmitting "'Makef.bsd+sysV'" '(should have been 3023 characters)' fi fi # end of overwriting check echo shar: extracting "'Makefile.xenix'" '(3867 characters)' if test -f 'Makefile.xenix' then echo shar: will not over-write existing file "'Makefile.xenix'" else sed 's/^ X//' << \SHAR_EOF > 'Makefile.xenix' X# Makefile for Date Library X# This maintains a Small, Medimum, and a Large Model Libaray X# X# General Files X XMAIN = datelib XLIB = tig XSRC = easter.c holidays.c XOBJS = $(MAIN).S XOBJM = $(MAIN).M XOBJL = $(MAIN).L XINCL1 = $(MAIN).h XINCL2 = taxc.h XHDRS = $(INCL1) $(INCL2) XMANP = $(MAIN).3t XDOCS = README $(MANP) easter.1t holidays.1t XLIBS = -lx -l$(LIB) XMDIR3 = /usr/man/man3 XMDIR1 = /usr/man/man1 XIDIR = . XLDIR = /usr/local/Lib XBDIR = /usr/local XARLIB = lib$(LIB).a XTEXT = $(HDRS) $(MAIN).c $(SRC) X X# X# General Flags X XLFLAGS = -F 2000 XCFLAGS = -O XCFLGS = $(CFLAGS) -I $(IDIR) -i XCFLGM = $(CFLAGS) -I $(IDIR) -Mm XCFLGL = $(CFLAGS) -I $(IDIR) -Ml X X# X# General Programs X XLINT = /usr/bin/lint -hp XPR = @/usr/local/print1 XSPELL = spell XNROFF = nroff XSHAR = /usr/local/cshar -a XCC = /bin/cc XAR = ar XRANLIB = ranlib X X# X# General Rules X Xall: S$(ARLIB) easter holidays X XS$(ARLIB): $(OBJS) $(OBJM) $(OBJL) X $(AR) rvu S$(ARLIB) $(OBJS) X $(AR) rvu M$(ARLIB) $(OBJM) X $(AR) rvu L$(ARLIB) $(OBJL) X $(RANLIB) S$(ARLIB) M$(ARLIB) L$(ARLIB) X @echo $(MAIN) made X Xeaster: easter.o S$(ARLIB) X $(CC) -i $(LFLAGS) -o easter easter.o S$(ARLIB) /usr/local/Lib/Slibz.a X Xholidays: holidays.o S$(ARLIB) X $(CC) -i $(LFLAGS) -o holidays holidays.o S$(ARLIB) /usr/local/Lib/Slibz.a X Xinstall: X if [ -f $(LDIR)/S$(ARLIB) ] ; \ X then \ X $(AR) rvu $(LDIR)/S$(ARLIB) $(OBJS) ; \ X $(AR) rvu $(LDIR)/M$(ARLIB) $(OBJM) ; \ X $(AR) rvu $(LDIR)/L$(ARLIB) $(OBJL) ; \ X else \ X cp S$(ARLIB) $(LDIR)/S$(ARLIB) ; \ X cp M$(ARLIB) $(LDIR)/M$(ARLIB) ; \ X cp L$(ARLIB) $(LDIR)/L$(ARLIB) ; \ X fi X chown bin $(LDIR)/S$(ARLIB) $(LDIR)/M$(ARLIB) $(LDIR)/L$(ARLIB) X chgrp bin $(LDIR)/S$(ARLIB) $(LDIR)/M$(ARLIB) $(LDIR)/L$(ARLIB) X chmod 644 $(LDIR)/S$(ARLIB) $(LDIR)/M$(ARLIB) $(LDIR)/L$(ARLIB) X $(RANLIB) $(LDIR)/S$(ARLIB) $(LDIR)/M$(ARLIB) $(LDIR)/L$(ARLIB) X cp holidays $(BDIR) X cp easter $(BDIR) X chown bin $(BDIR)/holidays $(BDIR)/easter X chgrp bin $(BDIR)/holidays $(BDIR)/easter X chmod 755 $(BDIR)/holidays $(BDIR)/easter X if [ -d $(IDIR) ] ; \ X then \ X rm -f $(IDIR)/$(INCL) ; \ X cp $(INCL) $(IDIR) ; \ X chown bin $(IDIR)/$(INCL) ; \ X chgrp bin $(IDIR)/$(INCL) ; \ X chmod 644 $(IDIR)/$(INCL) ; \ X fi X if [ -d $(MDIR3) ] ; \ X then \ X rm -f $(MDIR3)/$(MANP) ; \ X cp $(MANP) $(MDIR3) ; \ X chown bin $(MDIR3)/$(MANP) ; \ X chgrp bin $(MDIR3)/$(MANP) ; \ X chmod 644 $(MDIR3)/$(MANP) ; \ X fi X if [ -d $(MDIR1) ] ; \ X then \ X rm -f $(MDIR1)/holidays.1t $(MDIR1)/easter.1t ; \ X cp holidays.1t $(MDIR1) ; \ X chown bin $(MDIR1)/holidays.1t ; \ X chgrp bin $(MDIR1)/holidays.1t ; \ X chmod 644 $(MDIR1)/holidays.1t ; \ X cp easter.1t $(MDIR1) ; \ X chown bin $(MDIR1)/easter.1t ; \ X chgrp bin $(MDIR1)/easter.1t ; \ X chmod 644 $(MDIR1)/easter.1t ; \ X fi X Xprint: X $(PR) $(TEXT) X Xlint: X $(LINT) $(LNTFLG) $(SRC) X Xman: X $(NROFF) -man $(MANP) | col >:$(MAIN).manpg X $(NROFF) -man easter.1t | col >:easter.manpg X $(NROFF) -man holidays.1t | col >:holidays.manpg X Xspell: X $(SPELL) $(DOCS) X Xarchive: X $(SHAR) $(DOCS) Makef.bsd+sysV Makefile.xenix $(HDRS) > archive1 X $(SHAR) $(MAIN).c $(SRC) > archive2 X Xclean: X rm -f *.[SMLoa] core *.out :* X X.PRECIOUS: $(TEXT) $(SRC) $(MAIN).c X X.SUFFIXES: X.SUFFIXES: .L .M .S .c .a .o X X.c.o: X $(CC) -i $(CFLAGS) -I $(IDIR) -c $*.c X X.c.S .c.M .c.L .c.a: X @echo ".c.S" X $(CC) $(CFLGS) -c $*.c X @mv $*.o $*.S X X.S.M .S.L .S.a: X @echo ".S.M" X $(CC) $(CFLGM) -c $*.c X @mv $*.o $*.M X X.M.L .M.a: X @echo ".M.L" X $(CC) $(CFLGL) -c $*.c X @mv $*.o $*.L X X.L.a: X $(AR) rvu ../aS$(ARLIB) $*.S X $(AR) rvu ../aM$(ARLIB) $*.M X $(AR) rvu ../aL$(ARLIB) $*.L X $(RANLIB) ../aS$(ARLIB) ../aM$(ARLIB) ../aL$(ARLIB) X SHAR_EOF if test 3867 -ne "`wc -c < 'Makefile.xenix'`" then echo shar: error transmitting "'Makefile.xenix'" '(should have been 3867 characters)' fi fi # end of overwriting check echo shar: extracting "'datelib.h'" '(569 characters)' if test -f 'datelib.h' then echo shar: will not over-write existing file "'datelib.h'" else sed 's/^ X//' << \SHAR_EOF > 'datelib.h' X X /* Datelib Declarations */ X X#if defined(lint) || defined(BSD) || defined(SYSV) Xlong uxdate(), uxldate(), uxtime(), uxeaster(); Xint yrday(), weeknum(), daynum(); XBool leap(); Xvoid datex(), ldatex(), timex(); X#else /* XENIX is presumed */ Xlong uxdate(int,int,int), uxldate(int,int,int), uxtime(int,int,int); Xlong uxeaster(int); Xint yrday(int,int,int), weeknum(long), daynum(long); XBool leap(int); Xvoid datex(long,int*,int*,int*,int*,int*); Xvoid ldatex(long,int*,int*,int*,int*,int*); Xvoid timex(long,int*,int*,int*); X#endif SHAR_EOF if test 569 -ne "`wc -c < 'datelib.h'`" then echo shar: error transmitting "'datelib.h'" '(should have been 569 characters)' fi fi # end of overwriting check echo shar: extracting "'taxc.h'" '(2760 characters)' if test -f 'taxc.h' then echo shar: will not over-write existing file "'taxc.h'" else sed 's/^ X//' << \SHAR_EOF > 'taxc.h' X X/* Tigertail C Extensions */ X/* */ X/* Copyright (c) 1987 Tigertail Associates. All Rights Reserved */ X/* 320 North Bundy Drive */ X/* Los Angeles, California 90049 */ X/* USA */ X/* */ X/* e-mail: (uucp) ucla-cs!buz or (arpa) buz@cs.ucla.edu */ X X#ifndef PROC X#define PROC X#define then X#define fi X#define Bool int X#ifndef TRUE X#define TRUE 1 X#define FALSE 0 X#endif X X#define NULLC '\0' X#define NULLF ((FILE *) NULL) X#define NULLS ((char*) NULL) X X#define abs(x) (((x)>0)?(x):(-(x))) X#define sign(x) (((x)>0)?(1):(((x)<0)?(-1):(0))) X#define max(x,y) (((x)>(y))?(x):((y))) X#define min(x,y) (((x)>(y))?(y):((x))) X X/* Define string functions and INDEX for compliers with index sans strchr. */ X X#if defined(INDEX) || defined(BSD) X#define strchr index X#define strrchr rindex Xchar *strcat(); Xchar *strncat(); Xint strcmp(); Xint strncmp(); Xchar *strcpy(); Xchar *strncpy(); Xint strlen(); Xchar *strchr(); Xchar *index(); Xchar *rindex(); Xint strspn(); Xint strcspn(); Xchar *strtok(); Xchar *strdup(); X#else X/* Define string functions. */ X#if defined(lint) || defined(SYSV) Xchar *strcat(); Xchar *strncat(); Xint strcmp(); Xint strncmp(); Xchar *strcpy(); Xchar *strncpy(); Xint strlen(); Xchar *strchr(); Xchar *strrchr(); Xchar *strpbrk(); Xint strspn(); Xint strcspn(); Xchar *strtok(); Xchar *strdup(); X#else /* Xenix is presumed */ Xchar *strcat(char*,char*); Xchar *strncat(char*,char*,int); Xint strcmp(char*,char*); Xint strncmp(char*,char*,int); Xchar *strcpy(char*,char*); Xchar *strncpy(char*,char*,int); Xint strlen(char*); Xchar *strchr(char*,int); Xchar *strrchr(char*,int); Xchar *strpbrk(char*,char*); Xint strspn(char*,char*); Xint strcspn(char*,char*); Xchar *strtok(char*,char*); Xchar *strdup(char*); X#endif X#endif X X/* Debugging macros */ X X#ifdef EBUG X#define debug1(w) printf(w) X#define debug2(w,x) printf(w,x) X#define debug3(w,x,y) printf(w,x,y) X#define debug4(w,x,y,z) printf(w,x,y,z) X#define debug5(w,x,y,z,a) printf(w,x,y,z,a) X#define debug6(w,x,y,z,a,b) printf(w,x,y,z,a,b) X#define debug7(w,x,y,z,a,b,c) printf(w,x,y,z,a,b,c) X#define debug8(w,x,y,z,a,b,c,d) printf(w,x,y,z,a,b,c,d) X#else X#define debug1(w) X#define debug2(w,x) X#define debug3(w,x,y) X#define debug4(w,x,y,z) X#define debug5(w,x,y,z,a) X#define debug6(w,x,y,z,a,b) X#define debug7(w,x,y,z,a,b,c) X#define debug8(w,x,y,z,a,b,c,d) X#endif X X#endif /* No defines ... taxc.h already included */ SHAR_EOF if test 2760 -ne "`wc -c < 'taxc.h'`" then echo shar: error transmitting "'taxc.h'" '(should have been 2760 characters)' fi fi # end of overwriting check # End of shell archive exit 0