version 1.2, 1998/03/30 06:59:24 |
version 1.11, 2004/12/10 20:47:30 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright |
* 2. Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* documentation and/or other materials provided with the distribution. |
* 3. All advertising materials mentioning features or use of this software |
* 3. Neither the name of the University nor the names of its contributors |
* must display the following acknowledgement: |
|
* This product includes software developed by the University of |
|
* California, Berkeley and its contributors. |
|
* 4. Neither the name of the University nor the names of its contributors |
|
* may be used to endorse or promote products derived from this software |
* may be used to endorse or promote products derived from this software |
* without specific prior written permission. |
* without specific prior written permission. |
* |
* |
|
|
|
|
extern struct passwd *pw; |
extern struct passwd *pw; |
extern int doall; |
extern int doall; |
|
extern int bodun_always; |
|
extern time_t f_time; |
extern struct iovec header[]; |
extern struct iovec header[]; |
extern struct tm *tp; |
extern struct tm *tp; |
extern char *calendarFile; |
extern char *calendarFile; |
|
extern char *calendarHome; |
extern char *optarg; |
extern char *optarg; |
|
|
void cal __P((void)); |
struct fixs { |
void closecal __P((FILE *)); |
char *name; |
int getday __P((char *)); |
int len; |
int getdayvar __P((char *)); |
}; |
int getfield __P((char *, char **, int *)); |
|
int getmonth __P((char *)); |
|
int geteaster __P((char *, int)); |
|
int getpaskha __P((char *, int)); |
|
int easter __P((int)); |
|
int isnow __P((char *, int *, int *, int *)); |
|
FILE *opencal __P((void)); |
|
void settime __P((time_t)); |
|
time_t Mktime __P((char *)); |
|
void usage __P((void)); |
|
void setnnames __P((void)); |
|
|
|
|
struct event { |
|
time_t when; |
|
char print_date[31]; |
|
char **desc; |
|
char *ldesc; |
|
struct event *next; |
|
}; |
|
|
|
struct match { |
|
time_t when; |
|
char print_date[30]; |
|
int bodun; |
|
int var; |
|
struct match *next; |
|
}; |
|
|
|
struct specialev { |
|
char *name; |
|
int nlen; |
|
char *uname; |
|
int ulen; |
|
int (*getev)(int); |
|
}; |
|
|
|
void cal(void); |
|
void closecal(FILE *); |
|
int getday(char *); |
|
int getdayvar(char *); |
|
int getfield(char *, char **, int *); |
|
int getmonth(char *); |
|
int pesach(int); |
|
int easter(int); |
|
int paskha(int); |
|
void insert(struct event **, struct event *); |
|
struct match *isnow(char *, int); |
|
FILE *opencal(void); |
|
void settime(time_t *); |
|
time_t Mktime(char *); |
|
void usage(void); |
|
int foy(int); |
|
void variable_weekday(int *, int, int); |
|
void setnnames(void); |
|
|
/* some flags */ |
/* some flags */ |
#define F_ISMONTH 0x01 /* month (Januar ...) */ |
#define F_ISMONTH 0x01 /* month (Januar ...) */ |
#define F_ISDAY 0x02 /* day of week (Sun, Mon, ...) */ |
#define F_ISDAY 0x02 /* day of week (Sun, Mon, ...) */ |
#define F_ISDAYVAR 0x04 /* variables day of week, like SundayLast */ |
/*#define F_ISDAYVAR 0x04 variables day of week, like SundayLast */ |
#define F_EASTER 0x08 /* Easter or easter depending days */ |
#define F_SPECIAL 0x08 /* Events that occur once a year but don't track |
|
* calendar time--e.g. Easter or easter depending |
|
* days */ |
|
|
extern int f_dayAfter; /* days after current date */ |
extern int f_dayAfter; /* days after current date */ |
extern int f_dayBefore; /* days before current date */ |
extern int f_dayBefore; /* days before current date */ |
|
|
struct fixs { |
/* Special events; see also setnnames() in day.c */ |
char *name; |
/* '=' is not a valid character in a special event name */ |
int len; |
#define PESACH "pesach" |
}; |
#define PESACHLEN (sizeof(PESACH) - 1) |
|
#define EASTER "easter" |
|
#define EASTERNAMELEN (sizeof(EASTER) - 1) |
|
#define PASKHA "paskha" |
|
#define PASKHALEN (sizeof(PASKHA) - 1) |
|
|
|
/* calendars */ |
|
extern enum calendars { GREGORIAN = 0, JULIAN, LUNAR } calendar; |
|
extern u_long julian; |
|
|
|
#define NUMEV 3 /* Total number of such special events */ |
|
extern struct specialev spev[NUMEV]; |
|
|
|
/* For calendar -a, specify a maximum time (in seconds) to spend parsing |
|
* each user's calendar files. This prevents them from hanging calendar |
|
* (e.g. by using named pipes) |
|
*/ |
|
#define USERTIMEOUT 20 |