home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-11-03 | 35.6 KB | 1,261 lines |
- Newsgroups: comp.sources.misc,soc.culture.jewish
- From: sadinoff@unagi.cis.upenn.edu (Danny Sadinoff)
- Subject: v33i034: hebcal - A Jewish calendar generator, Part01/01
- Message-ID: <1992Nov4.143505.10918@sparky.imd.sterling.com>
- X-Md4-Signature: d4f77fc558f4307f42fd6ee9dfe3ed94
- Date: Wed, 4 Nov 1992 14:35:05 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: sadinoff@unagi.cis.upenn.edu (Danny Sadinoff)
- Posting-number: Volume 33, Issue 34
- Archive-name: hebcal/part01
- Environment: UNIX
-
- [ Freeware, shareware .. and now distribu-ware ? I'm not crazy about ]
- [ the minor conditions below but what the hey... -Kent+ ]
-
- Here is version 1.0 of hebcal, a Jewish calendar generator for unix
- machines. (It's not called jucal since that sounds like something you
- step on if you see it indoors) It's probably not hard to adapt it to
- any C environment
-
- Hebcal is somewhat more sophisticated than other freely distributed
- Jewish calendar programs I've seen, notably hcal. Hebcal is fairly
- flexible in terms of which events in the Jewish calendar it displays.
- Each of the following can be individualy turned on or off:
-
- The Hebrew date
- Jewish Holdiays (including Yom Ha'atzmaut and Yom HaShoah etc.)
- The weekly Sedrah
- The day of the week
- The days of the Omer
-
- This program is DISTRIBU-WARE.
- It may be distributed freely, with a few conditions:
- 1) The package must be distributed INTACT with ALL source code, as
- well as this file. You are welcome to modify the code,
- but DON'T distribute it modified. This disclaimer should certainly
- appear with every distributed copy.
-
- 2) You can use this program for free for one week. After that
- trial period, if you wish to use this program, drop me a line.
- I'd like to know who you are, how you're using hebcal, and any
- thing else you'd like to tell me.
-
- I am NOT asking for monetary payment for the use of my program, but
- if you use my program for more than one week without letting me
- know about it, I'd rather you didn't use it.
-
- send US Mail to: send email to:
- Danny Sadinoff sadinoff@eniac.seas.upenn.edu
- 1 Cove La.
- Great Neck, NY 11024
-
- Email respondents will receive new versions of the program as they
- come out, as will US Mail responents (if they send me postage for a disk).
-
- If you do not mail me or email me after one week, please don't
- use the program, although you may feel free to distribute it further.
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: README Makefile danlib.c danlib.h error.c error.h greg.c
- # greg.h hebcal.c
- # Wrapped by kent@sparky on Wed Nov 4 08:23:41 1992
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 1 (of 1)."'
- if test -f 'README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README'\"
- else
- echo shar: Extracting \"'README'\" \(4104 characters\)
- sed "s/^X//" >'README' <<'END_OF_FILE'
- XHebcal 1.0 - a program for printing Jewish calendars
- X by Danny Sadinoff
- X
- XDESCRIPTION
- XHebcal is a program which prints out the days in the Jewish calendar
- Xfor a given gregorian year. Hebcal is fairly flexible in terms of which
- Xevents in the Jewish calendar it displays. Each of the following can
- Xbe individualy turned on or off:
- X
- X The Hebrew date
- X Jewish Holdiays (including Yom Ha'atzmaut and Yom HaShoah etc.)
- X The weekly Sedrah
- X The day of the week
- X The days of the Omer
- X
- XOPERATION:
- XThe operation of hebcal is fairly simple. Hebcal defaults to printing
- Xout the holidays for the current gregorian year. With the
- Xcommand-line options, a specific gregorian year, month or date can be
- Xspecified.
- X
- XGiven one numeric argument, hebcal will print out the calendar
- Xfor that year. Given two numeric argumetnts mm yyyy, it
- Xprints out the calendar for month mm of year yyyy. Given three
- Xnumeric arguments mm dd yyyy, it will print out the hebrew calendar
- Xentries for day dd of month mm of year yyyy.
- X
- Xusage: hebcal [-dhoptw] [[month [day]] year]
- X hebcal help --- prints this message.
- X
- XOPTIONS: -d : add hebrew dates
- X -h : suppress holidays
- X -t : only output for today's date
- X -o : add days of the omer
- X -p : add weekly parshiot, including hachodesh, etc
- X -w : add day of the week
- X
- X
- XExamples:
- Xexample% hebcal -ho
- X4/19/1992 1st day of the Omer
- X4/20/1992 2nd day of the Omer
- X4/21/1992 3rd day of the Omer
- X4/22/1992 4th day of the Omer
- X4/23/1992 5th day of the Omer
- X4/24/1992 6th day of the Omer
- X.
- X.
- X6/5/1992 48th day of the Omer
- X6/6/1992 49th day of the Omer
- X
- Xto print out all of the data pertaining to today's date, use
- Xexample% hebcal -tdwo
- X10/26/1992 Mon, 29 of Tishrei, 5753
- X
- XCOMPILATION
- XSome versions of cc will not compile hebcal as it is written now. Use
- Xgcc if you can. If nothing seems to work, let me know and I'll try to
- Xcome up with something.
- X
- XDISCLAIMER
- XI tried to make this program as accurate as possible. However, I
- Xtake no responsibility for any horrible consequences which may come
- Xabout as a result of faulty output from this program. Remember: never
- Xtrust a program with a zero at the end of its revision number.
- X
- XThe secular dates before 1522 are meaningless, as I made no correction
- Xfor the changeover from julian to gregorian calendars; but the Hebrew
- Xdates and years are correct.
- X
- XThis program is DISTRIBU-WARE.
- XIt may be distributed freely, with a few conditions:
- X 1) The package must be distributed INTACT with ALL source code, as
- X well as this file. You are welcome to modify the code,
- X but DON'T distribute it modified. This disclaimer should certainly
- X appear with every distributed copy.
- X
- X 2) You can use this program for free for one week. After that
- X trial period, if you wish to use this program, drop me a line.
- X I'd like to know who you are, how you're using hebcal, and any
- X thing else you'd like to tell me.
- X
- X I am NOT asking for monetary payment for the use of my program, but
- X if you use my program for more than one week without letting me
- X know about it, I'd rather you didn't use it.
- X
- X send US Mail to: send email to:
- X Danny Sadinoff sadinoff@eniac.seas.upenn.edu
- X 1 Cove La.
- X Great Neck, NY 11024
- X
- X Email respondents will receive new versions of the program as they
- X come out, as will US Mail responents (if they send me postage for a disk).
- X
- X If you do not mail me or email me after one week, please don't
- X use the program, although you may feel free to distribute it further.
- X
- XCOMING SOON
- XFeatures to be included in future versions:
- X - A manpage
- X - The ability to specify and output a particular HEBREW year, month
- X or date. The absence of this feature is a serious drawback to
- X hebcal as it now stands.
- X - the ability to supress gregorian date output
- X - calendar-like operation with user specified "holidays",
- X e.g. birthdays, yahrtzeits.
- X - yahrtzeit lists: calculate a list of dates in successive gregorian
- X years with the same Hebrew date.
- X
- X
- XGRIPES
- Xsend questions, comments or complaints to:
- XDanny Sadinoff
- Xsadinoff@eniac.seas.upenn.edu
- END_OF_FILE
- if test 4104 -ne `wc -c <'README'`; then
- echo shar: \"'README'\" unpacked with wrong size!
- fi
- # end of 'README'
- fi
- if test -f 'Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Makefile'\"
- else
- echo shar: Extracting \"'Makefile'\" \(135 characters\)
- sed "s/^X//" >'Makefile' <<'END_OF_FILE'
- X#you may have to de-comment the following line.
- X#CC= gcc
- XOBJ= hebcal.o greg.o error.o danlib.o
- Xhebcal: $(OBJ)
- X $(CC) -o hebcal $(OBJ)
- END_OF_FILE
- if test 135 -ne `wc -c <'Makefile'`; then
- echo shar: \"'Makefile'\" unpacked with wrong size!
- fi
- # end of 'Makefile'
- fi
- if test -f 'danlib.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'danlib.c'\"
- else
- echo shar: Extracting \"'danlib.c'\" \(1158 characters\)
- sed "s/^X//" >'danlib.c' <<'END_OF_FILE'
- X#include "danlib.h"
- X
- X/* Some generally useful routines */
- X
- Xvoid initStr(char **s, int size){
- X /* allocate space for a string */
- X if ((*s = (char *)malloc((size + 1) * sizeof(char))) == NULL)
- X die("\n Memory Error: Couldn't allocate string\n","");
- X
- X **s = '\0';
- X}
- X
- Xint isAllNums(char * s){
- X/* returns true if a string contains only digits, dashes and newlines */
- X int n = 0, len = strlen(s);
- X
- X for(n=0;
- X (n < len)
- X && (isdigit(s[n])) || (s[n] == '-') || (s[n] == '\n');
- X n++);
- X return (n == len);
- X}
- X
- Xchar * numSuffix(int i){
- X/* returns a pointer to the proper ordinal suffix of a number */
- X switch (i % 10) {
- X case 1 : return "st";
- X case 2 : return "nd";
- X case 3 : return "rd";
- X default: return "th";
- X }
- X}
- X
- Xchar * itoa(int i) {
- X static char ret[7];
- X int c = 0;
- X char tmp;
- X
- X if (i < 0) { /* is i negative? */
- X ret[c++] = '-'; /* then put a minus */
- X i = abs(i);
- X }
- X
- X while (i >0) { /* compose the number */
- X ret[c++] = (i % 10) + '0';
- X i /= 10;
- X }
- X i = c-1;
- X
- X for (c =0; c < i; c++) { /* reverse the number */
- X tmp = ret[c];
- X ret[c] = ret[i-c];
- X ret[i-c] = tmp;
- X }
- X
- X return ret;
- X}
- X
- X
- END_OF_FILE
- if test 1158 -ne `wc -c <'danlib.c'`; then
- echo shar: \"'danlib.c'\" unpacked with wrong size!
- fi
- # end of 'danlib.c'
- fi
- if test -f 'danlib.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'danlib.h'\"
- else
- echo shar: Extracting \"'danlib.h'\" \(176 characters\)
- sed "s/^X//" >'danlib.h' <<'END_OF_FILE'
- X#include <stdio.h>
- X#include "error.h"
- X
- X#define CHAR2NUM(x) ((x) - '0')
- X
- Xint isAllNums(char * s);
- Xvoid initStr(char **s, int size);
- Xchar * numSuffix(int i);
- Xchar * itoa(int i);
- END_OF_FILE
- if test 176 -ne `wc -c <'danlib.h'`; then
- echo shar: \"'danlib.h'\" unpacked with wrong size!
- fi
- # end of 'danlib.h'
- fi
- if test -f 'error.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'error.c'\"
- else
- echo shar: Extracting \"'error.c'\" \(613 characters\)
- sed "s/^X//" >'error.c' <<'END_OF_FILE'
- X#include <stdio.h>
- X#include "error.h"
- X
- X
- Xextern int errno, sys_nerr;
- Xextern char *sys_errlist[], *progname;
- X
- Xvoid die (char * s1, char *s2){ /* print error message and die */
- X if (progname)
- X fprintf(stderr, "%s: ", progname);
- X fprintf(stderr, s1, s2);
- X if (errno > 0 && errno < sys_nerr)
- X fprintf(stderr, " (%s)\n", sys_errlist[errno]);
- X exit(1);
- X}
- X
- Xvoid warn (char * s1, char *s2){ /* print error message */
- X if (progname) /* but don't die*/
- X fprintf(stderr, "%s: ", progname);
- X fprintf(stderr, s1, s2);
- X if (errno > 0 && errno < sys_nerr)
- X fprintf(stderr, " (%s)\n", sys_errlist[errno]);
- X}
- END_OF_FILE
- if test 613 -ne `wc -c <'error.c'`; then
- echo shar: \"'error.c'\" unpacked with wrong size!
- fi
- # end of 'error.c'
- fi
- if test -f 'error.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'error.h'\"
- else
- echo shar: Extracting \"'error.h'\" \(85 characters\)
- sed "s/^X//" >'error.h' <<'END_OF_FILE'
- X#include <errno.h>
- X
- Xvoid die (char * s1, char *s2);
- Xvoid warn (char * s1, char *s2);
- END_OF_FILE
- if test 85 -ne `wc -c <'error.h'`; then
- echo shar: \"'error.h'\" unpacked with wrong size!
- fi
- # end of 'error.h'
- fi
- if test -f 'greg.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'greg.c'\"
- else
- echo shar: Extracting \"'greg.c'\" \(2719 characters\)
- sed "s/^X//" >'greg.c' <<'END_OF_FILE'
- X#include <stdio.h>
- X#include <stdlib.h>
- X#include "greg.h"
- X
- X/* greg.c gregorian calendar module for hebrew calendar program
- X By Danny Sadinoff
- X
- X $Date: 92/10/26 20:26:37 $
- X $Revision: 1.0 $
- X
- X*/
- X
- Xchar * eMonths[] = {
- X "January","February","March","April","May","June","July",
- X "August","September","October","November","December"
- X };
- X
- Xint MonthLengths[][12] ={
- X {31,28,31,30,31,30,31,31,30,31,30,31},
- X {31,29,31,30,31,30,31,31,30,31,30,31}
- X};
- X
- Xchar * DayNames[] = {
- X "Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"
- X };
- X
- Xchar * ShortDayNames[] = {
- X "Sun","Mon","Tue","Wed","Thu","Fri","Sat"
- X };
- X
- Xstatic int checkRange (date_t dt,char * routine) {
- X if ((dt.mm > 13)||(dt.dd > 31) || (dt.yy > 7000) ||
- X (dt.mm <0) ||(dt.dd <0 ) || (dt.yy < -7000))
- X die("Date out of range from routine %s.",routine);
- X}
- X
- Xstatic long int daysSinceOrigin (date_t dt){
- X int m,y,days = 0;
- X
- X checkRange(dt,"daysSinceOrigin");
- X
- X for (y =1; y < dt.yy; y++)
- X days += DAYS_IN(y);
- X y = dt.yy;
- X for (m= JAN; m < dt.mm; m++)
- X days += MonthLengths[LEAP(y)][m];
- X days += dt.dd -1;
- X return days;
- X}
- X
- Xint diffDays(date_t d1, date_t d2){
- X return (int) (daysSinceOrigin(d1) - daysSinceOrigin(d2));
- X}
- X
- Xint exceeds (date_t d1, date_t d2) {
- X if (d1.yy > d2.yy)
- X return 1;
- X else if (d1.yy < d2.yy)
- X return 0;
- X else if (d1.mm > d2.mm)
- X return 1;
- X else if (d1.mm < d2.mm)
- X return 0;
- X else if (d1.dd > d2.dd)
- X return 1;
- X else return 0;
- X}
- X
- Xvoid decDate (date_t *dt, int n){ /* decrements dt by n days */
- X/*under construction*/
- X/* while (n > 365) {
- X n -= DAYS_IN(dt->yy -1);
- X dt ->yy--;
- X }
- X
- X
- X if ((dt->mm == FEB) && (dt->dd == 29) && !LEAP(dt->yy))
- X dt->dd--;
- X*/
- X
- X while (n--)
- X if (dt->dd ==1) {
- X if (dt->mm == JAN) {
- X dt->yy--;
- X dt->mm = DEC;
- X dt->dd = 31;
- X }
- X else {
- X dt->mm--;
- X dt->dd = MonthLengths[LEAP(dt->yy)][dt->mm];
- X }
- X }
- X else dt->dd--;
- X}
- X
- Xvoid incDate(date_t *dt, int n) { /* increments dt by n days */
- X
- X/* while (n > 365) {
- X n -= DAYS_IN(dt->yy);
- X dt->yy++;
- X }
- X
- X if ((dt->mm == FEB) && (dt->dd == 29) && !LEAP(dt->yy) ) {
- X dt-> mm = MAR;
- X dt-> dd = 1;
- X }
- X*/
- X while (n--)
- X if ((dt->dd + 1) > MonthLengths[LEAP(dt->yy)][dt->mm])
- X if (dt->mm == DEC) {
- X dt->yy++;
- X dt->mm = JAN;
- X dt->dd = 1;
- X }
- X else {
- X dt->mm++;
- X dt->dd =1;
- X }
- X else
- X dt->dd ++;
- X}
- X
- Xint dayOfWeek(date_t d1) { /* sunday = 0 */
- X return (int) ((daysSinceOrigin(d1) + 1) % 7 ) ;
- X}
- X
- Xvoid setDate (date_t *d) {
- X time_t secs;
- X struct tm *loctm;
- X
- X secs = time(NULL);
- X loctm = localtime(&secs);
- X d->yy = 1900 + loctm->tm_year;
- X d->mm = loctm->tm_mon;
- X d->dd = loctm->tm_mday;
- X}
- X
- X
- END_OF_FILE
- if test 2719 -ne `wc -c <'greg.c'`; then
- echo shar: \"'greg.c'\" unpacked with wrong size!
- fi
- # end of 'greg.c'
- fi
- if test -f 'greg.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'greg.h'\"
- else
- echo shar: Extracting \"'greg.h'\" \(705 characters\)
- sed "s/^X//" >'greg.h' <<'END_OF_FILE'
- X#include <time.h>
- X
- X#define LEAP(x) (!((x) % 4) && ( ((x) % 100) || !((x) % 400)))
- X#define DAYS_IN(x) (LEAP((x))?366:365)
- X
- Xenum {JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC};
- Xenum {SUN,MON,TUE,WED,THU,FRI,SAT};
- Xextern char * eMonths[];
- Xextern int MonthLengths[][12] ;
- Xextern char * DayNames[] ;
- Xextern char * ShortDayNames[];
- Xextern char * eDays[] ;
- X
- Xtypedef struct {
- X int mm; /* months since january 0,11*/
- X int dd; /* day of month 1,31 */
- X int yy; /* years since year 1 BCE i.e. -1 = 2 BCE */
- X } date_t;
- X
- Xint diffDays(date_t d1, date_t d2);
- Xint exceeds (date_t d1, date_t d2);
- Xvoid decDate (date_t *dt, int n);
- Xvoid incDate(date_t *dt, int n);
- Xint dayOfWeek(date_t d1);
- Xvoid setDate (date_t *d);
- END_OF_FILE
- if test 705 -ne `wc -c <'greg.h'`; then
- echo shar: \"'greg.h'\" unpacked with wrong size!
- fi
- # end of 'greg.h'
- fi
- if test -f 'hebcal.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'hebcal.c'\"
- else
- echo shar: Extracting \"'hebcal.c'\" \(19232 characters\)
- sed "s/^X//" >'hebcal.c' <<'END_OF_FILE'
- X#include <stdio.h>
- X#include <stdlib.h>
- X#include <time.h>
- X#include "error.h"
- X#include "danlib.h"
- X#include "greg.h"
- X/* hebcal.c main module for hebrew calendar program
- X By Danny Sadinoff
- X
- X $Date: 92/10/26 20:13:23 $
- X $Revision: 1.0 $
- X
- X*/
- X
- X
- X int parshiot_sw, hebDates_sw, specMonth_sw,specDay_sw,
- X weekday_sw, supressHolidays_sw, printOmer_sw, omer;
- X
- Xtypedef struct {
- X
- X char * name;
- X int length;
- X
- X int daysInCheshvan;
- X int daysInKislev;
- X
- X int vayakhelPikudei; /* double parsha flags */
- X int tazriaMetzorah;
- X int achreiKedoshim;
- X int beharBech;
- X int chukatBalak;
- X int matotMasei;
- X int nitzavimVayelech;
- X
- X} year_t;
- X
- X
- Xyear_t legend[2][8] = {
- X { /* stam years */
- X {"1BX",353,29,29,1,1,1,1,0,1,1}, /* BX */
- X {"1BS",355,30,30,1,1,1,1,1,1,1}, /* BS */
- X {"2GC",354,29,30,1,1,1,1,1,1,1}, /* GC */
- X {"4HC",354,29,30,1,1,1,1,0,1,0}, /* HC */
- X {"0error - HX",354,29,29,1,1,1,1,0,1,0}, /* error! hx */
- X {"4HS",355,30,30,0,1,1,1,0,1,0}, /* HS */
- X {"6ZX",353,29,29,1,1,1,1,0,1,0}, /* ZX */
- X {"6ZS",355,30,30,1,1,1,1,0,1,1}, /* ZS */
- X },
- X { /* leap years */
- X {"1BX",383,29,29,0,0,0,0,1,1,1}, /* BX */
- X {"1BS",385,30,30,0,0,0,0,0,1,0}, /* BS */
- X {"2GC",384,29,30,0,0,0,0,0,1,0}, /* GC */
- X {"0error - HC",383,29,30,0,0,0,0,0,0,0}, /* error ! hc */
- X {"4HX",383,29,29,0,0,0,0,0,0,0}, /* HX */
- X {"4HS",385,30,30,0,0,0,0,0,0,1}, /* HS */
- X {"6ZX",383,29,29,0,0,0,0,0,1,1}, /* ZX */
- X {"6ZS",385,30,30,0,0,0,0,1,1,1}, /* ZS */
- X }
- X};
- X
- Xint leapYears[] = {0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,1};
- X
- Xenum {BX,BS,GC,HC,HX,HS,ZX,ZS};
- X
- Xint luach[][19] =
- X{
- X {HC,BX,HS,HC,BS,ZX,HC,BS,BX,HS,GC,BS,ZX,GC,BS,ZS,HX,GC,ZS},
- X {ZS,HC,BX,ZS,HC,BX,ZS,HS,HC,BX,HS,HC,BS,ZX,HC,BS,ZX,HS,GC},
- X {BS,ZX,GC,BS,ZS,HX,GC,ZS,ZS,HC,BX,ZS,HC,BS,BX,HC,BS,BS,ZX},
- X {HC,HS,ZX,HC,HS,ZS,ZX,GC,BS,ZS,HX,GC,ZS,HS,HC,BX,HS,HC,BX},
- X {ZS,HC,BS,BX,HC,BS,BS,ZX,HC,BS,ZX,HS,GC,ZS,ZS,HC,BX,ZS,HX},
- X {GC,ZS,HS,HC,BX,HS,HC,BX,ZS,HC,BS,BX,HS,GC,BS,ZX,GC,BS,ZS},
- X {ZX,GC,ZS,ZS,HC,BX,ZS,HX,GC,ZS,HS,HC,BX,HS,HC,BS,ZX,HC,BS},
- X {BS,ZX,GC,BS,ZS,HX,GC,ZS,ZX,GC,ZS,ZS,HC,BX,ZS,HC,BS,BX,HS},
- X {HC,BS,ZX,HC,BS,ZX,HS,GC,BS,ZX,GC,BS,ZS,HX,GC,ZS,HS,HC,BX},
- X {ZS,HC,BX,ZS,HC,BS,BX,HS,HC,BS,ZX,HC,BS,ZX,HS,GC,ZS,ZX,GC},
- X {BS,ZS,HX,GC,ZS,HS,HC,BX,ZS,HC,BX,ZS,HC,BS,BX,HS,GC,BS,ZX}, /* 10,11 GX? */
- X {HC,BS,ZS,ZX,GC,ZS,ZS,HX,GC,ZS,HX,GC,ZS,HS,HC,BX,HS,HC,BS},
- X {BX,HC,BS,BS,ZX,GC,BS,ZX,HS,GC,ZS,ZS,HC,BX,ZS,HC,BX,ZS,HS}
- X};
- X
- Xstruct {
- X char * name;
- X int length;
- X}hMonths[][14] = {
- X {
- X {"Tishrei",30}, {"Cheshvan",29}, {"Kislev",30},
- X {"Tevet",29}, {"Shvat",30}, {"Adar",29},
- X {"Nisan",30}, {"Iyyar",29}, {"Sivan",30},
- X {"Tamuz",29}, {"Av",30},{"Elul",29},{"Tishrei",30}},
- X {
- X {"Tishrei",30}, {"Cheshvan",29}, {"Kislev",30},
- X {"Tevet",29}, {"Shvat",30}, {"Adar I",29}, {"Adar II",30},
- X {"Nisan",30}, {"Iyyar",29}, {"Sivan",30},
- X {"Tamuz",29}, {"Av",30},{"Elul",29},{"Tishrei",30}}
- X};
- X
- Xenum {TISHREI, CHESHVAN, KISLEV, ADAR_2 = 6};
- X
- Xchar * sedrot[] = {
- X
- X "Bereshit", "Noach", "Lech Lecha", "Vayera", "Chayei Sara",
- X "Toldot", "Vayetzei", "Vayishlach", "Vayeshev", "Miketz", "Vayigash",
- X "Vayechi",
- X
- X "Sh'mot", "Vaera", "Bo", "Beshalach", "Yitro", "Mishpatim",
- X "Terumah", "Tetzaveh", "Ki Tisa", "Vayakhel", "Pekudei",
- X
- X "Vayikra", "Tzav", "Shmini", "Tazria", "Metzora", "Achrei Mot",
- X "Kedoshim", "Emor", "Behar", "Bechukosai",
- X
- X "Bamidbar", "Nasso", "Beha'aloscha", "Sh'lach", "Korach", "Chukat",
- X "Balak", "Pinchas", "Matot", "Masei",
- X
- X "Devarim", "Vaetchanan", "Eikev", "Re'eh", "Shoftim",
- X "Ki Teitzei", "Ki Tavo", "Nitzavim", "Vayeilech", "Ha'Azinu",
- X "V'Zot Habracha"
- X };
- X
- Xenum { VAYAKHEL = 21,
- X TAZRIA = 26, ACHREI = 28,
- X BEHAR = 31,
- X CHUKAT = 38, MATOT= 41,
- X NITZAVIM = 50};
- X
- X#define NM_LEN 30
- Xtypedef struct hnode{
- X date_t date;
- X char *name;
- X int ownSedra;
- X int nidche;
- X int mukdam;
- X int mukdam2;
- X struct hnode *next;
- X} holiday_t, *holidayp_t;
- X
- Xholiday_t special[100];
- X
- Xholiday_t holidays[] = { /* 5 = Adar I */
- X /* 6 = Adar = Adar II */
- X {{0,1},"Rosh Hashana I",1},{{0,2},"Rosh Hashana II",1},
- X {{0,3},"Tzom Gedalia",0,1},
- X {{0,9},"Erev Yom Kippur"},
- X {{0,10},"Yom Kippur",1},
- X
- X {{0,15},"Sukkot I",1},{{0,16},"Sukkot II",1},
- X {{0,17},"Sukkot III (CH\"M)",1},{{0,18},"Sukkot IV (CH\"M)",1},
- X {{0,19},"Sukkot V (CH\"M)",1},{{0,20},"Sukkot VI (CH\"M)",1},
- X {{0,21},"Sukkot VII (Hoshana Raba)",1},
- X {{0,22},"Shmini Atzeret",1},{{0,23},"Simchat Torah",1},
- X
- X {{2,25},"Chanukah"},
- X {{3,10},"Asara B'Tevet",0,1},
- X {{4,15},"Tu B'Shevat"} /*,0,1}?*/,
- X
- X {{5,15},"Purim katan"},
- X {{6,14},"Ta'anit Esther",0,0,1},{{6,15},"Purim"},
- X {{6,16},"Shushan Purim"},
- X
- X {{7,14},"Erev Pesach - Taanit B'chorot",0},
- X#define PESACH2_STR "Pesach II"
- X {{7,15},"Pesach I",1},{{7,16},PESACH2_STR,1},
- X {{7,17},"Pesach III (CH\"M)",1},{{7,18},"Pesach IV (CH\"M)",1},
- X {{7,19},"Pesach V (CH\"M)",1},{{7,20},"Pesach VI (CH\"M)",1},
- X {{7,21},"Pesach VII",1},
- X {{7,22},"Pesach VIII",1},
- X
- X {{7,27},"Yom HaShoah"},
- X {{8,4},"Yom HaZikaron",0,0,0,1},
- X {{8,5},"Yom Ha'atzmaut",0,0,1},
- X#define SHAVUOT_STR "Shavuot I"
- X {{9,6},SHAVUOT_STR,1},{{9,7},"Shavuot II",1},
- X {{10,17},"Shiva Assar B'Tamuz",0,1},
- X {{11,9},"Tish'a B'Av",0,1},
- X {{12,29},"Erev Rosh Hashana"}
- X};
- X
- Xenum {SIMCHAT_DAY = 23};
- X/* = {
- X {{0,0},"Shabbat Shekalim"},
- X {{0,0},"Shabbat Zachor"},
- X {{0,0},"Parshat HaChodesh"},
- X {{0,0},"Parshat Parah"},
- X {{0,0},"Yom Yerushalayim"}
- X };*/
- X
- X
- X#define LEAP_YR_HEB(x) (leapYears[((x) -1) % 19])
- X#define MONTHS_IN_HEB(x) (LEAP_YR_HEB(x) ? 13 :12)
- X
- Xyear_t yearData(int yr){
- X return legend[LEAP_YR_HEB(yr)][luach[((yr-1)/19+7)%13][(yr-1) %19]];
- X}
- X
- X#define LAST_INDEX(x) (sizeof x / sizeof x[0])
- X
- Xint daysInHebMonth(int month, int year) {
- X year_t theYear;
- X
- X theYear = yearData(year);
- X if (month == CHESHVAN)
- X return theYear.daysInCheshvan;
- X else if (month == KISLEV)
- X return theYear.daysInKislev;
- X else return hMonths[LEAP_YR_HEB(year)][month].length;
- X}
- X
- Xdate_t nextHebDate (date_t dth) {
- X dth.dd++;
- X if (dth.dd > daysInHebMonth(dth.mm,dth.yy))
- X if (dth.mm == MONTHS_IN_HEB(dth.yy)-1){
- X dth.yy++;
- X dth.mm =0;
- X dth.dd =1;
- X }
- X else {
- X dth.mm++;
- X dth.dd =1;
- X }
- X return dth;
- X}
- X
- Xdate_t prevHebDate (date_t dth) {
- X dth.dd--;
- X if (dth.dd == 0)
- X if (dth.mm == 0) {
- X dth.yy--;
- X dth.mm = MONTHS_IN_HEB(dth.yy) -1 ;
- X dth.dd = daysInHebMonth(dth.mm,dth.yy);
- X }
- X else {
- X dth.mm--;
- X dth.dd = daysInHebMonth(dth.mm,dth.yy);
- X }
- X return dth;
- X}
- X
- XaddHoliday(holiday_t theHoliday, holiday_t **holiList){
- X holidayp_t newHol, currHol = *holiList;
- X
- X if (currHol)
- X while (currHol->next) /* scan to the end of the list */
- X currHol = currHol->next; /* now currhol points to the last */
- X
- X if (!(newHol = (holiday_t *) malloc(sizeof (holiday_t))))
- X die("Mem allocation error in getHebHolidays routine.","");
- X
- X if (currHol)
- X currHol->next = newHol;
- X else *holiList = newHol;
- X
- X *newHol = theHoliday;
- X newHol->next = NULL;
- X}
- X
- Xholidayp_t getHebHolidays (date_t dt, /* returns a linked list */
- X int weekday, /* of holidays for that date. */
- X year_t theYear,
- X holiday_t ** holiList) {
- X int c, specialCounter=0;
- X holidayp_t tmpholip;
- X
- X *holiList = NULL;
- X
- X#define CORRECTION(yy,mm) (LEAP_YR_HEB(yy) ? 0 : (((mm) > 4) ? 1: 0))
- X#define MATCH(X,Y) ((X.mm == (Y.mm + CORRECTION(Y.yy,Y.mm)) ) && (X.dd == Y.dd))
- X
- X for (c = 0; c < LAST_INDEX(holidays); c++) {
- X if (MATCH(holidays[c].date,dt))
- X if (!((weekday == SAT) && (holidays[c].nidche)) &&
- X !(holidays[c].mukdam &&
- X ((weekday == FRI) || (weekday == SAT))) &&
- X !(holidays[c].mukdam2 &&
- X ((weekday == THU) || (weekday == FRI)))){/* do normal holidays*/
- X addHoliday(holidays[c],holiList);
- X if (!strcmp((*holiList)->name,PESACH2_STR)) omer++;
- X if (omer && holiList && !strcmp((*holiList)->name,SHAVUOT_STR)) omer=0;
- X }
- X
- X
- X if (holidays[c].nidche && /* fast days which are */
- X (MATCH(holidays[c].date,prevHebDate(dt))) &&
- X (weekday ==SUN)){
- X char *st;
- X
- X initStr(&st,NM_LEN);
- X strncat(st,holidays[c].name,NM_LEN);
- X strncat(st," [nidche]",NM_LEN);
- X addHoliday(holidays[c],holiList);
- X (*holiList)->name = st;
- X }
- X
- X if (holidays[c].mukdam && /* if the date actually falls */
- X (MATCH(holidays[c].date,nextHebDate(nextHebDate(dt))) ||
- X MATCH(holidays[c].date,nextHebDate(dt))) &&
- X (weekday == THU)) /* on friday or shabbat*/
- X addHoliday(holidays[c],holiList);
- X
- X if (holidays[c].mukdam2 && /* if the date actually falls */
- X (MATCH(holidays[c].date,nextHebDate(nextHebDate(dt))) ||
- X MATCH(holidays[c].date,nextHebDate(dt))) &&
- X (weekday == WED)) /* on thursday or friday*/
- X addHoliday(holidays[c],holiList);
- X }
- X
- X /* Lag B'Omer Processing */
- X if (omer == 33) {
- X tmpholip = &special[specialCounter++];
- X initStr(&tmpholip->name,NM_LEN);
- X strncat(tmpholip->name,"Lag B'Omer",NM_LEN);
- X addHoliday(*tmpholip,holiList);
- X }
- X
- X /* rosh Chodesh Processing... */
- X if ((dt.dd == 1)&& dt.mm){ /* every 1st of the month except tishrei */
- X tmpholip = &special[specialCounter++];
- X initStr(&tmpholip->name,NM_LEN);
- X strcat(tmpholip->name,"Rosh Chodesh ");
- X strncat(tmpholip->name,hMonths[LEAP_YR_HEB(dt.yy)][dt.mm].name,NM_LEN);
- X addHoliday(*tmpholip,holiList);
- X }
- X if (dt.dd == 30){
- X tmpholip = &special[specialCounter++];
- X initStr(&tmpholip->name,NM_LEN);
- X strcat(tmpholip->name,"Rosh Chodesh ");
- X strncat(tmpholip->name,hMonths[LEAP_YR_HEB(dt.yy)][dt.mm+1].name,NM_LEN);
- X addHoliday(*tmpholip,holiList);
- X }
- X
- X
- X return *holiList;
- X}
- X
- X
- Xvoid incHebJulDate(date_t *dth, date_t *dtj, int *wkday){
- X /* increments both hebrew and julian calendars */
- X
- X incDate (dtj,1);
- X *wkday = dayOfWeek(*dtj);
- X *dth = nextHebDate(*dth);
- X}
- X
- X#define JUL2HEB(x) ((x) + 3760)
- X
- Xvoid PrintWeekday (date_t dt) {
- X printf ("%s, ",ShortDayNames[dayOfWeek(dt)]);
- X}
- X
- Xvoid PrintJulDate (date_t dt) {
- X printf ("%d/%d/%d ",dt.mm+1,dt.dd,dt.yy);
- X}
- X
- X
- Xchar *DoSedra (int *sedra,year_t ydat) {
- X#define PLENGTH 40
- X static char s[PLENGTH+1];
- X
- X *s = '\0';
- X strncat(s,"Parshat ",PLENGTH);
- X strncat(s,sedrot[*sedra],PLENGTH);
- X switch (*sedra) {
- X case VAYAKHEL :
- X if (ydat.vayakhelPikudei){
- X strncat(s,"-",PLENGTH);
- X strncat(s,sedrot[*sedra+1],PLENGTH);
- X *sedra += 2;
- X }
- X else {
- X (*sedra)++;
- X }
- X break;
- X case TAZRIA:
- X if (ydat.tazriaMetzorah){
- X strncat(s,"-",PLENGTH);
- X strncat(s,sedrot[*sedra+1],PLENGTH);
- X *sedra += 2;
- X }
- X else {
- X (*sedra)++;
- X }
- X break;
- X case ACHREI :
- X if (ydat.achreiKedoshim){
- X strncat(s,"-",PLENGTH);
- X strncat(s,sedrot[*sedra+1],PLENGTH);
- X *sedra += 2;
- X }
- X else {
- X (*sedra)++;
- X }
- X break;
- X case BEHAR :
- X if (ydat.beharBech){
- X strncat(s,"-",PLENGTH);
- X strncat(s,sedrot[*sedra+1],PLENGTH);
- X *sedra += 2;
- X }
- X else {
- X (*sedra)++;
- X }
- X break;
- X case CHUKAT :
- X if (ydat.chukatBalak){
- X strncat(s,"-",PLENGTH);
- X strncat(s,sedrot[*sedra+1],PLENGTH);
- X *sedra += 2;
- X }
- X else {
- X (*sedra)++;
- X }
- X break;
- X case MATOT :
- X if (ydat.matotMasei){
- X strncat(s,"-",PLENGTH);
- X strncat(s,sedrot[*sedra+1],PLENGTH);
- X *sedra += 2;
- X }
- X else {
- X (*sedra)++;
- X }
- X break;
- X case NITZAVIM :
- X if (ydat.nitzavimVayelech){
- X strncat(s,"-",PLENGTH);
- X strncat(s,sedrot[*sedra+1],PLENGTH);
- X *sedra += 2;
- X }
- X else {
- X (*sedra)++;
- X }
- X break;
- X case LAST_INDEX(sedrot)-1:
- X *sedra = 0;
- X break;
- X default:
- X (*sedra)++;
- X }
- X strncat(s,"\n",PLENGTH);
- X return s;
- X}
- X
- X#define CHAR2NUM(x) ((x) - '0')
- X
- X
- Xvoid DoCalendar (date_t roshDt, /* rosh Hashana of preceeding year */
- X int justMonth,/* print this month */
- X int justDay ){ /* print this day */
- X
- X
- X int sedra,weekday;
- X date_t todayh, todayj = roshDt;
- X holiday_t *holip;
- X year_t theYear;
- X
- X todayh.mm = 0;
- X todayh.dd = 1;
- X todayh.yy = JUL2HEB(roshDt.yy)+1; /* because it's after R"H */
- X
- X
- X theYear = yearData(todayh.yy);
- X
- X if (CHAR2NUM(theYear.name[0]) != dayOfWeek(roshDt))
- X die ("Bad Day!\n","");
- X
- X /* first scan forward to simchat Torah, keeping track of dates only. */
- X while (todayh.dd != SIMCHAT_DAY){
- X#if defined(DEBUG)
- X PrintJulDate(todayj);
- X if (weekday_sw)
- X PrintWeekday(todayj);
- X printf ("%d of %s, %d\n",todayh.dd, /* print the hebrew date */
- X hMonths[LEAP_YR_HEB(todayh.yy)][todayh.mm].name,
- X todayh.yy);
- X
- X#endif
- X incHebJulDate(&todayh, &todayj,&weekday);
- X }
- X sedra = 0; /* initialize sedra */
- X
- X /* then continue until january 1st. */
- X do {
- X getHebHolidays(todayj,weekday,theYear,&holip);
- X#if defined(DEBUG)
- X PrintJulDate(todayj);
- X if (weekday_sw)
- X PrintWeekday(todayj);
- X printf ("%d of %s, %d\n",todayh.dd, /* print the hebrew date */
- X hMonths[LEAP_YR_HEB(todayh.yy)][todayh.mm].name,
- X todayh.yy);
- X for (;holip;holip = holip->next) {
- X PrintJulDate(todayj);
- X if (weekday_sw)
- X PrintWeekday(todayj);
- X printf ("%s\n",holip->name);
- X }
- X
- X if ((weekday == SAT) && !(holip && holip->ownSedra))
- X printf("%s",DoSedra(&sedra,theYear));
- X#else
- X if ((weekday == SAT) && !(holip && holip->ownSedra))
- X DoSedra(&sedra,theYear);
- X#endif
- X
- X incHebJulDate(&todayh,&todayj,&weekday);
- X } while (!((todayj.mm==0) && (todayj.dd==1)));
- X
- X /* -------Main Year Loop-------*/
- X do {
- X if (hebDates_sw &&
- X (!specMonth_sw || (justMonth== todayj.mm)) &&
- X (!specDay_sw || (justDay == todayj.dd))) {
- X PrintJulDate(todayj);
- X if (weekday_sw)
- X PrintWeekday(todayj);
- X printf ("%d of %s, %d\n",todayh.dd, /* print the hebrew date */
- X hMonths[LEAP_YR_HEB(todayh.yy)][todayh.mm].name,
- X todayh.yy);
- X }
- X getHebHolidays(todayh,weekday,theYear,&holip);
- X
- X if ((todayh.mm == TISHREI) && (todayh.dd == 1))
- X theYear = yearData(todayh.yy); /* if R"H reset YearData */
- X
- X if (parshiot_sw && (weekday == SAT) && !(holip && holip->ownSedra)){
- X if ((!specMonth_sw || (justMonth == todayj.mm)) &&
- X (!specDay_sw || (justDay == todayj.dd))){
- X PrintJulDate(todayj);
- X printf("%s",DoSedra(&sedra,theYear));
- X }
- X else DoSedra(&sedra,theYear);
- X }
- X
- X if ((todayh.mm == TISHREI) && /* reset the sedra on simchat torah */
- X (todayh.dd == SIMCHAT_DAY)) sedra =0;
- X
- X if (!supressHolidays_sw &&
- X (!specMonth_sw || (justMonth == todayj.mm)) &&
- X (!specDay_sw || (justDay == todayj.dd)))
- X for (;holip;holip = holip->next) {
- X PrintJulDate(todayj);
- X if (weekday_sw)
- X PrintWeekday(todayj);
- X printf ("%s\n",holip->name);
- X }
- X
- X /* print the omer if desired */
- X if (omer && printOmer_sw &&
- X (!specMonth_sw || (justMonth == todayj.mm)) &&
- X (!specDay_sw || (justDay == todayj.dd))) {
- X char *omerStr;
- X initStr(&omerStr,NM_LEN);
- X strncat(omerStr,itoa(omer),NM_LEN);
- X strncat(omerStr,numSuffix(omer),NM_LEN);
- X strncat(omerStr," day of the Omer",NM_LEN);
- X PrintJulDate(todayj);
- X if (weekday_sw) PrintWeekday(todayj);
- X printf ("%s\n",omerStr);
- X }
- X if (omer) omer++;
- X
- X
- X incHebJulDate(&todayh,&todayj,&weekday);
- X } while (!((todayj.mm==0) && (todayj.dd==1))); /* continue to january 1st */
- X
- X}
- X
- Xvoid getDate (date_t *d) {
- X printf ("Enter the date (mm dd yy): ");
- X scanf ("%d %d %d",&d->mm,&d->dd,&d->yy);
- X d->yy += 1900;
- X d->mm -= 1;
- X}
- X
- Xvoid PrintDate(date_t dt) {
- X printf ("%d/%d/%d ",dt.mm,dt.dd,dt.yy);
- X}
- X
- XRollBack(date_t *dtj, int target){ /* move rosh hashana dtj back until it's */
- X /* in the year before target*/
- X int days,theyear;
- X
- X for (days = 0,theyear = dtj->yy ;theyear > target -1; theyear--)
- X days +=yearData(JUL2HEB(theyear)).length;
- X decDate (dtj,days);
- X
- X}
- X
- XRollForward(date_t *dtj,int target){ /* move rosh hashana dtj forward until it's*/
- X /* in the year before target*/
- X int days,theyear;
- X
- X for (days = 0,theyear = dtj->yy ;theyear < target -1; theyear++)
- X days +=yearData(JUL2HEB(theyear+1)).length;
- X incDate (dtj,days);
- X
- X}
- X
- Xchar * progname;
- X
- Xmain(int argc, char * argv[]) {
- X char *c;
- X date_t startDate,tempdt;
- X int theYear,theMonth,theDay,yearDirty=0;
- X
- X char * usage = "usage: hebcal [-dhoptw] [[month [day]] year]\n hebcal help\n";
- X progname = argv[0];
- X
- X startDate.dd = 28;
- X startDate.mm = SEP; /* any ol' rosh hashana */
- X startDate.yy = 1992;
- X
- X setDate(&tempdt); /* do this year */
- X theYear = tempdt.yy;
- X
- X for (argv++, argc--; argc; argv++, argc--)
- X if (isAllNums(*argv))
- X if ((argc-1) && isAllNums(*(argv+1)) && !yearDirty)
- X if ((argc-2) && isAllNums(*(argv+2))) {
- X specMonth_sw =1;
- X specDay_sw =1;
- X theMonth = atoi(*argv) -1; /* year and month specified */
- X theDay = atoi(*++argv); /* print theDay of theMonth */
- X theYear = atoi(*++argv); /* print theMonth of theYear */
- X yearDirty =1;
- X argc -=2;
- X }
- X else {
- X specMonth_sw =1;
- X theMonth = atoi(*argv) -1; /* year and month specified */
- X theYear = atoi(*++argv); /* print theMonth of theYear */
- X yearDirty =1;
- X argc--;
- X }
- X else if (!yearDirty) {
- X theYear = atoi(*argv); /* just year specified */
- X yearDirty = 1; /* print whole year */
- X }
- X else die(usage,"");
- X else if (**argv == '-')
- X for (c = *argv,c++;*c;c++)
- X switch (*c) {
- X case 'd' : /* print hebrew dates */
- X hebDates_sw = 1;
- X break;
- X case 'h':
- X supressHolidays_sw =1;
- X break;
- X case 't': /* do hebcal for today. */
- X specMonth_sw =1;
- X specDay_sw =1;
- X theMonth = tempdt.mm; /* year and month specified */
- X theDay = tempdt.dd; /* print theDay of theMonth */
- X yearDirty =1;
- X break;
- X case 'o':
- X printOmer_sw =1;
- X break;
- X case 'p' : /* print parshiot */
- X parshiot_sw = 1;
- X break;
- X case 'w' : /* print days of the week */
- X weekday_sw = 1;
- X break;
- X default: die(usage,"");
- X }
- X else if (!strcmp(*argv,"help")) {
- X printf ("Hebcal Version 1.0\n\n");
- X printf ("Hebcal prints out hebrew calendars one solar year at a time.\n");
- X printf ("Given one numeric argument, it will print out the calendar \n");
- X printf ("for that year. Given two numeric argumetnts mm yyyy, it\n");
- X printf ("prints out the calendar for month mm of year yyyy. \n");
- X printf ("usage: hebcal [-dhoptw] [[month [day]] year]\n");
- X printf ("\nOPTIONS:\n -d : add hebrew dates\n");
- X printf (" -h : suppress holidays\n");
- X printf (" -t : only output for today's date\n");
- X printf (" -o : add days of the omer\n");
- X printf (" -p : add weekly parshiot, including hachodesh, etc \n");
- X printf (" -w : add day of the week\n\n");
- X printf (" hebcal help --- prints this message\n");
- X printf ("\nExample: \n");
- X printf (" hebcal -ho\n");
- X printf ("will just print out the days of the omer for the current year.\n");
- X exit(0);
- X }
- X else die (usage,"");
- X
- X if (specDay_sw) hebDates_sw = 1;
- X
- X if (theYear < startDate.yy +1) /* go to R"H of the year before */
- X RollBack(&startDate,theYear);
- X else if (theYear > startDate.yy +1) /* start from there */
- X RollForward(&startDate,theYear);
- X
- X DoCalendar(startDate,theMonth,theDay);
- X
- X exit(0);
- X}
- X
- END_OF_FILE
- if test 19232 -ne `wc -c <'hebcal.c'`; then
- echo shar: \"'hebcal.c'\" unpacked with wrong size!
- fi
- # end of 'hebcal.c'
- fi
- echo shar: End of archive 1 \(of 1\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have the archive.
- rm -f ark[1-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-