home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3065 / db.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-03-15  |  1.2 KB  |  55 lines

  1. /*
  2.  *    db.h : External defs for database users.
  3.  *
  4.  *      George Ferguson, ferguson@cs.rochester.edu, 27 Oct 1990.
  5.  *    Version 1.1 - 27 Feb 1991.
  6.  *
  7.  *    $Id: db.h,v 2.1 91/02/28 11:21:15 ferguson Exp $
  8.  */
  9.  
  10. #ifndef DB_H
  11. #define DB_H
  12.  
  13. /*
  14.  * The appointment database is a hierarchical data structure. It has an
  15.  * array indexed by dow (and 0 for unspecified dow) of year structures,
  16.  * which in turn each contain a list of month structures, each containing
  17.  * a list day structures, each containing a list of message structures
  18.  * that store the actual reminders.
  19.  *
  20.  * The key to using incompletely-specified patterns is described in
  21.  * lookupEntry().
  22.  */
  23. typedef struct _msgrec {
  24.     int dow,year,month,day;        /* redundant, but useful */
  25.     int hour,mins;
  26.     char *text;
  27.     int system;
  28.     int level;
  29.     struct _msgrec *next;
  30. } Msgrec;
  31. typedef struct _dayrec {
  32.     int day;
  33.     Msgrec *msgs;
  34.     struct _dayrec *next;
  35. } Dayrec;
  36. typedef struct _monrec {
  37.     int mon;
  38.     Dayrec *days;
  39.     struct _monrec *next;
  40. } Monrec;
  41. typedef struct _yearrec {
  42.     int year;
  43.     Monrec *mons;
  44.     struct _yearrec *next;
  45. } Yearrec;
  46.  
  47. extern Yearrec *Db[8];
  48.  
  49. extern void initDb(), readDb(), writeDb();
  50. extern Msgrec *addEntry();
  51. extern Boolean deleteEntry();
  52. extern int lookupEntry();
  53.  
  54. #endif /* DB_H */
  55.