home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d09xx / d0975.lha / PCal / pcaldefs.h < prev    next >
C/C++ Source or Header  |  1992-02-19  |  18KB  |  598 lines

  1. /*
  2.  * pcaldefs.h - definitions for Pcal program
  3.  *
  4.  * Revision history:
  5.  *
  6.  *    4.3    AWR    12/05/91    Revise moonfile name templates for
  7.  *                    consistency with current standards
  8.  *                    for substituting year in strings
  9.  *
  10.  *            12/03/91    Add support for -s flag
  11.  *
  12.  *            10/17/91    Add support for -Z flag and subflags;
  13.  *                    removed obsolete PUTSTR macro
  14.  *
  15.  *    4.2    AWR    10/08/91    Add support for -[kK] flags; renamed
  16.  *                    START_DAY as START_BOX for clarity
  17.  *
  18.  *            10/03/91    Add various definitions relating to
  19.  *                    "note/<n>"
  20.  *
  21.  *            09/30/91    Add MAX_IF_NESTING (related to "elif";
  22.  *                    cf. read_datefile() in readfile.c)
  23.  *
  24.  *    4.11    AWR    08/20/91    Add "nearest" keyword (as per Andy
  25.  *                    Fyfe)
  26.  *
  27.  *    4.1    AWR    08/16/91    Add support for -G flag
  28.  *
  29.  *    4.0    AWR    03/01/91    Add STDLIB macro for systems which
  30.  *                    support <stdlib.h>
  31.  *
  32.  *        AWR    02/22/91    add definitions for MS-DOS support (as
  33.  *                    per Floyd Miller)
  34.  *
  35.  *        AWR    02/19/91    revise ORD_XXX to support negative
  36.  *                    ordinals
  37.  *
  38.  *                    add definitions for Amiga support (as
  39.  *                    per Bill Hogsett)
  40.  *
  41.  *        AWR    02/06/91    additional defs for expression
  42.  *                    processing
  43.  *
  44.  *        AWR    02/04/91    support "year" as additional month
  45.  *                    name; use negative numbers for
  46.  *                    special ordinal codes (reserve
  47.  *                    positive numbers for ordinals)
  48.  *
  49.  *            01/28/91    miscellaneous new constants/macros
  50.  *
  51.  *            01/07/91    add FEB_29_OK (cf. enter_day_info())
  52.  *
  53.  *    3.0    AWR    12/10/90    support "weekday", "workday",
  54.  *                    "holiday", et. al.
  55.  *
  56.  *        AWR    11/13/90    extracted from pcal.c; added scale and
  57.  *                    translation support (-x, -y, -X, -Y);
  58.  *                    added -j, -J flags
  59.  *
  60.  */
  61.  
  62. /*
  63.  * System dependencies:
  64.  */
  65.  
  66. #ifdef VMS        /* VMS oddities isolated here */
  67.  
  68. #include <ssdef.h>    /* required for trnlog() */
  69. #include <descrip.h>
  70.  
  71. #define HOME_DIR    "SYS$LOGIN"
  72. #define DATEFILE    "calendar.dat"
  73. #define MOONFILE    "moon%y.dat"    /* '%y' replaced with year */
  74. #define DEFAULT_OUTFILE    "calendar.ps"
  75. #define START_PATH    '['
  76. #define END_PATH    ']'
  77.  
  78. #define EXIT_SUCCESS    1        /* VMS exit() parameters */
  79. #define EXIT_FAILURE    3
  80.  
  81. #else
  82. #ifdef AMIGA        /* more oddities for Amiga */
  83.  
  84. #include <string.h>
  85.  
  86. #define PROTOS                /* compiler accepts prototypes */
  87. #define STDLIB                /* system has <stdlib.h> */
  88. #define HOME_DIR    "RAM:"
  89. #define DATEFILE    "s:calendar.dat"
  90. #define MOONFILE    "s:.moon%y"    /* '%y' replaced with year */
  91. #define DEFAULT_OUTFILE    "RAM:calendar.ps"
  92. #define START_PATH    '/'
  93. #define END_PATH    '/'
  94.  
  95. #else
  96. #ifdef DOS        /* even more oddities for MS-DOS */
  97.  
  98. #define DATEFILE    "pcal.dat"
  99. #define MOONFILE    "moon%y.dat"    /* '%y' replaced with year */
  100. #define START_PATH    '\\'
  101. #define END_PATH    '\\'
  102. #define HOME_DIR    "HOME"
  103. #define ALT_DATEFILE    "calendar"    /* for backward compatibility */
  104.  
  105. #else            /* neither VMS, Amiga, nor MS-DOS - assume Un*x */
  106.  
  107. #define UNIXX        /* to distinguish Un*x from others */
  108.  
  109. #define HOME_DIR    "HOME"
  110. #define DATEFILE    ".calendar"
  111. #define ALT_DATEFILE    "calendar"    /* for backward compatibility */
  112. #define MOONFILE    ".moon%y"    /* '%y' replaced with year */
  113. #define ALT_MOONFILE    "moon%y"    /* analogous to ALT_DATEFILE */
  114. #define START_PATH    '/'
  115. #define END_PATH    '/'
  116.  
  117. #endif
  118. #endif
  119. #endif
  120.  
  121. /* define OUTFILE to DEFAULT_OUTFILE if defined, otherwise to "" (stdout) */
  122.  
  123. #ifdef DEFAULT_OUTFILE
  124. #define OUTFILE        DEFAULT_OUTFILE
  125. #else
  126. #define OUTFILE        ""
  127. #endif
  128.  
  129. /* PROTOS may be defined independently of __STDC__ for compilers which
  130.  * support function prototypes but are not fully ANSI-compliant
  131.  */
  132.  
  133. #if defined(__STDC__) && ! defined(PROTOS)
  134. #define PROTOS    
  135. #endif
  136.  
  137. /* STDLIB may be defined independently of __STDC__ for systems which
  138.  * support <stdlib.h> but are not fully ANSI-compliant
  139.  */
  140.  
  141. #if defined(__STDC__) && ! defined(STDLIB)
  142. #define STDLIB            /* cf. {no}protos.h */
  143. #endif
  144.  
  145. #ifdef STDLIB            /* include <stdlib.h> if known to exist */
  146. #include <stdlib.h>
  147. #endif
  148.  
  149. /* EXIT_SUCCESS and EXIT_FAILURE should be defined in <stdlib.h>
  150.  * (or above if non-standard); define here if necessary
  151.  */
  152.  
  153. #ifndef EXIT_SUCCESS
  154. #define EXIT_SUCCESS    0
  155. #endif
  156. #ifndef EXIT_FAILURE
  157. #define EXIT_FAILURE    1
  158. #endif
  159.  
  160. /* definition of NULL (if needed) */
  161.  
  162. #ifndef NULL
  163. #define NULL    0
  164. #endif
  165.  
  166. /*
  167.  * Environment variables (global symbol, logical name on VMS):
  168.  */
  169.  
  170. #define PCAL_OPTS    "PCAL_OPTS"    /* command-line flags */
  171. #define PCAL_DIR    "PCAL_DIR"    /* calendar file directory */
  172. #define PATH_ENV_VAR    "PATH"        /* cf. find_executable() (pcalutil.c) */
  173.  
  174. /*
  175.  * Function-like macros:
  176.  */
  177.  
  178. #define FPR        (void)fprintf
  179. #define PRT        (void)printf
  180.  
  181. #define PUTCHAR(_c) \
  182.     PRT((_c) == ' ' || isalnum(_c) ? "%c" : "\\%03o" , (_c) & 0377)
  183.  
  184. #define IS_LEAP(y)    ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0))
  185. #define LENGTH_OF(m, y) (month_len[(m)-1] + ((m) == FEB && IS_LEAP(y)))
  186. #define YEAR_LEN(y)    (IS_LEAP(y) ? 366 : 365)
  187. #define DAY_OF_YEAR(m, d, y) ((month_off[(m)-1] + ((m) > FEB && IS_LEAP(y))) + d)
  188. #define OFFSET_OF(m, y) ((month_off[(m)-1] + ((m) > FEB && IS_LEAP(y))) % 7)
  189. #define FIRST_OF(m, y)    calc_weekday(m, 1, y)
  190. #define START_BOX(m, y)    ((FIRST_OF(m, y) - first_day_of_week + 7) % 7)
  191.  
  192. #define PREV_MONTH(m, y) ((m) == JAN ? DEC : (m) - 1)
  193. #define PREV_YEAR(m, y)  ((m) == JAN ? (y) - 1 : (y))
  194. #define NEXT_MONTH(m, y) ((m) == DEC ? JAN : (m) + 1)
  195. #define NEXT_YEAR(m, y)  ((m) == DEC ? (y) + 1 : (y))
  196.  
  197. #define INIT_COLORS    memcpy(day_color, default_color, sizeof(day_color))
  198.  
  199. #define P_LASTCHAR(p)    ((p) && *(p) ? (p) + strlen(p) - 1 : NULL)
  200. #define LASTCHAR(p)    (p)[strlen(p) - 1]
  201.  
  202. #define IS_NUMERIC(p)    ((p)[strspn((p), DIGITS)] == '\0')
  203. #define IS_WILD(w)    ((w) >= WILD_FIRST && (w) <= WILD_LAST)
  204.  
  205. #define MAKE_DATE(dt, m, d, y) \
  206.     if (1) { (dt).mm = m; (dt).dd = d; (dt).yy = y; } else
  207.  
  208. #define ERR(errmsg) \
  209.     FPR(stderr, E_ILL_LINE, progname, errmsg, filename, line);
  210.  
  211. #define DEBUG(f)    ((debug_flags & f) != 0)
  212.  
  213. #ifdef __STDC__
  214. #define TOLOWER(c)    tolower(c)
  215. #else
  216. #define TOLOWER(c)    (isupper(c) ? tolower(c) : (c))
  217. #endif
  218.  
  219. #ifndef isodigit            /* rare */
  220. #define isodigit(c)    ((c) >= '0' && (c) <= '7')
  221. #endif
  222. #ifndef isxdigit            /* ANSI standard */
  223. #define isxdigit(c) \
  224.     (isdigit(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
  225. #endif
  226.  
  227. /* debug subflag codes (must be distinct) - cf. pcallang.h */
  228.  
  229. #define DEBUG_DATES    (1 << 1)
  230. #define DEBUG_MOON    (1 << 2)
  231. #define DEBUG_PATHS    (1 << 3)
  232. #define DEBUG_OPTS    (1 << 4)
  233. #define DEBUG_PP    (1 << 5)
  234. #define DEBUG_TEXT    (1 << 6)
  235.  
  236. /* preprocessor token codes - cf. get_token(), pcallang.h */
  237.  
  238. #define PP_DEFINE     0
  239. #define PP_ELIF         1
  240. #define PP_ELSE         2
  241. #define PP_ENDIF     3
  242. #define PP_IFDEF     4
  243. #define PP_IFNDEF     5
  244. #define PP_INCLUDE     6
  245. #define PP_UNDEF     7
  246. #define PP_OTHER    -1    /* not pp token */
  247.  
  248. /* ordinal number codes - cf. get_ordinal(), pcallang.h */
  249.  
  250. #define ORD_NEGNUM    -1    /* negative ordinal (-2nd == next to last) */
  251. #define ORD_POSNUM     1    /* positive ordinal */
  252. #define ORD_ODD         2    /* special codes for "odd" and "even" */
  253. #define ORD_EVEN     3
  254. #define ORD_ALL         4    /* special code for "all" used as ordinal */
  255. #define ORD_OTHER     0    /* not ordinal token */
  256.  
  257. /* moon phase codes - cf. pcallang.h and moonphas.c; these must take the
  258.  * values 0 (NM) .. 3 (3Q) since they are used in phase calculations
  259.  */
  260.  
  261. #define MOON_NM         0    /* new moon */
  262. #define MOON_1Q         1    /* first quarter */
  263. #define MOON_FM          2    /* full moon */
  264. #define MOON_3Q         3    /* last quarter */
  265. #define MOON_OTHER    -1    /* unrecognizable */
  266.  
  267. /* date type codes - cf. date_type(), get_keywd(), and pcallang.h */
  268.  
  269. #define DT_ALL         0    /* "all" keyword" */
  270. #define DT_NOTE         1    /* "note" keyword */
  271. #define DT_OPT         2    /* "opt" keyword */
  272. #define DT_YEAR         3    /* "year" keyword */
  273. #define DT_MONTH     4    /* name of month */
  274. #define DT_DATE         5    /* date of form dd/mm{/yy} or mm/dd{/yy} */
  275. #define DT_EURDATE     6    /* European date of form dd <month> */
  276. #define DT_ORDINAL     7    /* ordinal (first, 1st, ... last) */
  277. #define DT_WEEKDAY     8    /* weekday name */
  278. #define DT_OTHER    -1    /* unrecognizable first token */
  279.  
  280. /* preposition token codes - cf. get_prep(), pcallang.h */
  281.  
  282. #define PR_BEFORE     0
  283. #define PR_ON_BEFORE     1
  284. #define PR_AFTER     2
  285. #define PR_ON_AFTER     3
  286. #define PR_NEAREST     4
  287. #define PR_OTHER    -1    /* not a preposition */
  288.  
  289.  
  290. /*
  291.  * Miscellaneous other constants:
  292.  */
  293.  
  294. #define FALSE        0    /* pseudo-Booleans */
  295. #define TRUE        1
  296.  
  297. #define MAX_FILE_NESTING 10    /* maximum nesting level for file inclusion */
  298. #define MAX_IF_NESTING    20    /* maximum nesting level for if{n}def */
  299.  
  300. #define MAX_PP_SYMS    100    /* number of definable preprocessor symbols */
  301. #define PP_SYM_UNDEF     -1    /* flag for undefined symbol */
  302.  
  303. #define EXPR_ERR    -1    /* expression parsing error */
  304.  
  305. #define MIN_YR        1900    /* significant years (calendar limits) */
  306. #define MAX_YR        9999
  307.  
  308. #define CENTURY        1900    /* default century for two-digit years */
  309.  
  310. #define JAN         1    /* significant months */
  311. #define FEB         2
  312. #define DEC        12
  313. #define NOT_MONTH    -1    /* not valid month */
  314. #define ALL_MONTHS     0    /* select all months */
  315. #define ENTIRE_YEAR    13    /* select entire year as one entity */
  316.  
  317. #define SUN         0    /* significant weekdays */
  318. #define SAT         6
  319. #define NOT_WEEKDAY    -1    /* not valid weekday */
  320.  
  321. #define SCREENWIDTH    72    /* command-line message in usage() */
  322.  
  323. #define FEB_29_OK     1    /* if != 0, ignore 2/29 of common year */
  324.  
  325. #define NEAREST_INCR     1    /* if 1, disambiguate "nearest" as later    */
  326.                 /* date; if -1, to earlier (cf. readfile.c) */
  327.  
  328. /* wildcards - cf. days[] in pcallang.h and pdatefcn[] in pcal.c */
  329.  
  330. #define ANY_DAY         7    /* special - matches any day */
  331. #define ANY_WEEKDAY     8    /* matches any weekday (including holidays) */
  332. #define ANY_WORKDAY     9    /* matches any weekday (excluding holidays) */
  333. #define ANY_HOLIDAY    10    /* matches any holiday */
  334. #define ANY_NONWEEKDAY    11    /* converses of above three */
  335. #define ANY_NONWORKDAY    12
  336. #define ANY_NONHOLIDAY    13
  337. /* moon phase wildcards - must be in same order as MOON_* below */
  338. #define ANY_NM        14    /* matches any new moon, etc. */
  339. #define ANY_1Q        15
  340. #define ANY_FM        16
  341. #define ANY_3Q        17
  342.  
  343. #define WILD_FIRST    ANY_DAY
  344. #define WILD_FIRST_WKD    ANY_DAY
  345. #define WILD_LAST_WKD    ANY_NONHOLIDAY
  346. #define WILD_FIRST_MOON ANY_NM 
  347. #define WILD_LAST_MOON    ANY_3Q
  348. #define WILD_LAST    ANY_3Q
  349.  
  350. #define DAY_TEXT    0    /* types of text in data structure */
  351. #define HOLIDAY_TEXT    1
  352. #define NOTE_TEXT    2
  353.  
  354. #define NOTE_DEFAULT    -1    /* default note box number (-1 = last box) */
  355. #define FIRST_NOTE_BOX     0    /* first box position for notes text */
  356. #define LAST_NOTE_BOX    41    /* last position (w/o small calendars) */
  357. #define NULL_NOTE_BOX    -1    /* negative number for nonexistent box */
  358.  
  359. /* number and range of dummy days for notes text */
  360. #define NUM_NOTE_DAYS    (LAST_NOTE_BOX - 28 + 1)    
  361. #define FIRST_NOTE_DAY    32
  362. #define LAST_NOTE_DAY    (FIRST_NOTE_DAY + NUM_NOTE_DAYS - 1)
  363.  
  364. #define MAX_DATES    366    /* maximum "wildcard" dates */
  365.  
  366. #define MAXWORD        100    /* maximum words in date file line */
  367. #define STRSIZ        200    /* size of misc. strings */
  368. #define LINSIZ        512    /* size of source line buffer */
  369.  
  370. #define MAXARGS        3    /* numeric command-line args */
  371.  
  372. #define WHITESPACE    " \t"    /* token delimiters in date file */
  373. #define DIGITS        "0123456789"
  374.  
  375. /* passes where flags may be recognized (cf. get_args(), pcallang.h) */
  376. #define P_CMD0    (1 << 1)    /* parsed in command line pre-pass (-Z only) */
  377. #define P_ENV    (1 << 2)    /* parsed from environment variable */
  378. #define P_CMD1    (1 << 3)    /* parsed in first command-line pass */
  379. #define P_OPT    (1 << 4)    /* parsed on "opt" lines in date file */
  380. #define P_CMD2    (1 << 5)    /* parsed in second command-line pass */
  381.  
  382. /*
  383.  * Defaults for calendar layout:
  384.  */
  385.  
  386. #define DAYFONT        "Times-Bold"    /* default font names */
  387. #define TITLEFONT    "Times-Bold"
  388. #define NOTESFONT    "Helvetica-Narrow/6"
  389. #define NOTESFONTSIZE    6
  390.  
  391. #define SHADING        "0.8/0.9"    /* default shading (dates/fill boxes) */
  392.  
  393. #define LFOOT         ""              /* default foot strings */
  394. #define CFOOT         ""
  395. #define RFOOT         ""
  396.  
  397. #define LANDSCAPE      90        /* degrees to rotate */
  398. #define PORTRAIT         0
  399. #define ROTATE           LANDSCAPE    /* default */
  400.  
  401. /* scaling/translation factors based on 8.5 x 11 inch (612 x 792 point) page */
  402.  
  403. #define XSVAL_L        "1"        /* scale/translate values (landscape) */
  404. #define YSVAL_L        "1"
  405. #define XTVAL_L        "46"        /* (792 - 700) / 2 = 46 */
  406. #define YTVAL_L        "-120"
  407. #define XSVAL_P        "0.773"        /* scale/translate values (portrait) */
  408. #define YSVAL_P        "0.773"        /* 612/792 */
  409. #define XTVAL_P        "46"
  410. #define YTVAL_P        "492"        /* 612 - 120 = 492 */
  411.  
  412. #if (ROTATE == LANDSCAPE)        /* select appropriate defaults */
  413. #define XSVAL        XSVAL_L
  414. #define YSVAL        YSVAL_L
  415. #define XTVAL        XTVAL_L
  416. #define YTVAL        YTVAL_L
  417. #else
  418. #define XSVAL        XSVAL_P
  419. #define YSVAL        YSVAL_P
  420. #define XTVAL        XTVAL_P
  421. #define YTVAL        YTVAL_P
  422. #endif
  423.  
  424. #define USA_DATES    0        /* date styles */
  425. #define EUR_DATES    1
  426. #define DATE_STYLE    USA_DATES    /* default */
  427.  
  428. #define FIRST_DAY    SUN        /* first day of logical week */
  429.  
  430. #define BLACK        0        /* colors for dates */
  431. #define GRAY        1
  432. #define DAY_COLOR    { GRAY, BLACK, BLACK, BLACK, BLACK, BLACK, GRAY }
  433.  
  434. #define NO_DATEFILE     0        /* date file (if any) to use */
  435. #define USER_DATEFILE    1
  436. #define SYS_DATEFILE    2
  437.  
  438. /* position of small calendars */
  439. #define SC_NONE        0        /* suppress small calendars */
  440. #define SC_LAST        1        /* use last two boxes */
  441. #define SC_FIRST    2        /* use first two boxes */
  442. #define SC_SPLIT    3        /* split between first and last */
  443. #define SMALL_CAL_POS    SC_LAST        /* default */
  444.  
  445. /* box numbers for small calendars - must conform to order defined above */
  446. #define PREV_CAL_BOX    \
  447.     { NULL_NOTE_BOX, LAST_NOTE_BOX - 1, FIRST_NOTE_BOX, FIRST_NOTE_BOX }
  448. #define NEXT_CAL_BOX    \
  449.     { NULL_NOTE_BOX, LAST_NOTE_BOX, FIRST_NOTE_BOX + 1, LAST_NOTE_BOX }
  450.  
  451. /* values below must be in sync with cond[] and gray[] in writefil.c */
  452. #define NO_MOONS    0        /* no moon icons */
  453. #define ALL_MOONS    1        /* moon icon on every day */
  454. #define SOME_MOONS    2        /* icons on full, half, new moons */
  455. #define DRAW_MOONS    NO_MOONS    /* default */
  456.  
  457. #define NO_JULIANS    0        /* no Julian dates */
  458. #define ALL_JULIANS    1        /* Julian date + days left */
  459. #define SOME_JULIANS    2        /* just Julian dates */
  460. #define JULIAN_DATES    NO_JULIANS    /* default: none */
  461.  
  462. #define    GRAY_NUMS    0        /* print "gray" dates in gray */
  463. #define OUTLINE_NUMS    1        /* print as unfilled outlines */
  464. #define FILLED_NUMS    2        /* print as filled outlines */
  465. #define    NUM_STYLE    GRAY_NUMS    /* default */
  466.  
  467. /*
  468.  * Global typedef declarations for data structure (cf. readfile.c)
  469.  */
  470.  
  471. /*
  472.  * The internal data structure consists of a series of linked lists as 
  473.  * pictured below (for clarity, only one instance of each node is shown):
  474.  *
  475.  *
  476.  * head
  477.  *  |
  478.  *  |        year_info
  479.  *  |    -----------------           month_info
  480.  *   -->| year            |       -----------------            day_info
  481.  *      | month_info*[0]  |----->| holidays        |       ----------------
  482.  *      |   ...           |      | day_info*[0]    |----->| is_holiday     |
  483.  *      | month_info*[11] |--->  |   ...           |      | text_string*   |--->
  484.  *      | next year_info* |--    | day_info*[30]   |--->  | next day_info* |-- 
  485.  *       -----------------   |   | day_info*[NOTE] |--->   ----------------   |
  486.  *                           |   |   ...           |                          |
  487.  *                           |    -----------------                           |
  488.  *             ...        <--                                     ...      <--
  489.  *
  490.  * 
  491.  * Each year_info node consists of the year, 12 pointers (Jan .. Dec) to
  492.  * month_info nodes, and a pointer to the next year_info node in the chain.
  493.  * (The year_info chain is maintained in ascending order by year.)
  494.  *
  495.  * Each month_info node consists of a bitmap of the holidays for that month, 
  496.  * a pointer to the day_info chain for all 31 possible days of the month, and
  497.  * N additional pointers to the day_info chains for the "Notes" pseudo-days. 
  498.  * (A day_info chain is a linked list of all the text entries for a given
  499.  * day, in the order in which they were encountered in the date file.)
  500.  *
  501.  * Each day_info node consists of a flag indicating whether the associated
  502.  * text string is holiday or non-holiday text (any given day may have both),
  503.  * a pointer to the text string itself, and a pointer to the next day_info 
  504.  * node in the chain.
  505.  *
  506.  */
  507.  
  508. typedef struct d_i {
  509.     int is_holiday;
  510.     char *text;
  511.     struct d_i *next;
  512.     } day_info;
  513.  
  514. typedef struct m_i {
  515.     unsigned long holidays;
  516.     day_info *day[LAST_NOTE_DAY];    /* including extra days for notes */
  517.     } month_info;
  518.  
  519. typedef struct y_i {
  520.     int year;
  521.     month_info *month[12];
  522.     struct y_i *next;
  523.     } year_info;
  524.  
  525. /*
  526.  * Global typedef declarations for keyword descriptors (cf. pcallang.h)
  527.  */
  528.  
  529. typedef struct {
  530.     char *name;
  531.     int   code;
  532.     } KWD;
  533.  
  534. typedef struct {
  535.     char *name;
  536.     int   code;
  537.     int   value;
  538.     } KWD_O;        /* keyword plus ordinal value */
  539.  
  540. typedef struct {
  541.     char *name;
  542.     int   code;
  543. #ifdef PROTOS
  544.     int (*pfcn)(char *);
  545. #else
  546.     int (*pfcn)();
  547. #endif
  548.     } KWD_F;        /* keyword plus dispatch function */
  549.  
  550.  
  551. /*
  552.  * Global typedef declaration for date structure (cf. parse_ord())
  553.  */
  554.  
  555. typedef struct {
  556.     int mm;
  557.     int dd;
  558.     int yy;
  559. } DATE;
  560.  
  561. /* 
  562.  * Global typedef declaration for flag usage struct (cf. pcallang.h, get_args())
  563.  */
  564.  
  565. typedef struct {
  566.     char flag;        /* name of flag */
  567.     char has_arg;        /* TRUE if flag takes (optional) arg */
  568.     char passes;        /* "or" of P_xxx for relevant passes */
  569.     } FLAG_USAGE;
  570.  
  571. /*
  572.  * Global typedef declaration for debugging info struct (cf. pcallang.h)
  573.  */
  574.  
  575. typedef struct {
  576.     char flag;        /* name of flag */
  577.     int  value;        /* value corresponding to flag (1 << n) */
  578.     } DEBUG_INFO;
  579.  
  580. /*
  581.  * Global typedef declarations for usage message (cf. pcallang.h, usage())
  582.  */
  583.  
  584. typedef struct {
  585.     char flag;        /* name of flag */
  586.     char *meta;        /* metaname for argument (if any) */
  587.     char *text;        /* associated text */
  588.     char *def;        /* default value (if any) */
  589.     } FLAG_MSG;
  590.  
  591. typedef struct {
  592.     char *desc;        /* description of param */
  593.     char *text;        /* associated text */
  594.     } PARAM_MSG;
  595.  
  596. typedef char *DATE_MSG;        /* date file syntax message */
  597.  
  598.