home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume17
/
remind
/
part04
/
defines.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-02-19
|
2KB
|
65 lines
/***************************************************************/
/* */
/* DEFINES.H */
/* */
/* Contains macros and #defines for REMIND program. */
/* */
/* By David Skoll - 30 Sept 1990. */
/* */
/***************************************************************/
/* User-definable variables. BASE *must* be a year for which the
first of January is a Monday!!! FOMITSIZE and POMITSIZE control
the number of fully-specified (dd-mm-yy) and partially-specified
(dd-mm) holidays. */
#define BASE 1990
#define FOMITSIZE 150
#define POMITSIZE 75
/* Useful macros */
#define upper(c) ( ((c) >= 'a' && (c) <= 'z') ? ((c)-32) : (c) )
#define DaysInYear(y) (((y) % 4) ? 365 : ((!((y) % 100) && ((y) % 400)) ? 365 : 366 ))
#define IsLeapYear(y) (((y) % 4) ? 0 : ((!((y) % 100) && ((y) % 400)) ? 0 : 1 ))
#define DaysInMonth(m, y) ((m) != 1 ? MonthDays[m] : 28 + IsLeapYear(y))
#define TimeLess(h1, m1, h2, m2) (((h1) < (h2)) || (((h1) == (h2)) && ((m1) < (m2))))
#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#ifndef ABS
#define ABS(x) ((x) < 0 ? (-(x)) : (x))
#endif
/* Bit masks for constraint map */
#define DAY_M 1
#define MONTH_M 2
#define YEAR_M 4
#define WKDAY_M 8
enum Token_t { Unknown_t, Year_t, Month_t, Day_t, WkDay_t, Msg_t, Run_t,
Omit_t, Banner_t, Rem_t, Delta_t, Back_t, Once_t, Include_t,
Repeat_t, At_t, Time_t, Skip_t, Until_t, Push_t, Pop_t,
Clear_t, Eol_t };
/* Define the Token structure */
typedef struct {
char *str;
enum Token_t type;
int val;
char len; /* Minimum length to match */
} Token;
#ifdef UNIX
/* Define the structure of an AT entry */
typedef struct AtEntry_t{
int time; /* Time in minutes after midnight - 0 to 1439 */
int firsttime; /* Time of first triggering */
int repeat; /* Repeat period */
int delta; /* Delta time */
enum Token_t type; /* Run_t or Msg_t */
char *text;
struct AtEntry_t *next;
} AtEntry;
#endif