home *** CD-ROM | disk | FTP | other *** search
/ The Best Internet Programs / BESTINTERNET.bin / latest / ged2ht20 / database.h < prev    next >
C/C++ Source or Header  |  1995-04-07  |  3KB  |  131 lines

  1. /*
  2.  * GEDCOM lineage-linked database structure definitions
  3.  */
  4.  
  5. /*
  6.  * Counts of various kinds of top-level records
  7.  */
  8.  
  9. extern int total_individuals;
  10. extern int total_families;
  11. extern int total_events;
  12. extern int total_sources;
  13. extern int total_notes;
  14. extern int total_repositories;
  15. extern int total_submitters;
  16.  
  17. /*
  18.  * Flag controlling capitalization of surnames
  19.  */
  20.  
  21. extern int capitalization;
  22.  
  23. /*
  24.  * Arrays for each access to top-level records
  25.  */
  26.  
  27. struct individual_record **all_individuals;
  28. struct family_record **all_familes;
  29.  
  30. /*
  31.  * Database structure definitions
  32.  */
  33.  
  34. struct individual_record {
  35.   int serial;
  36.   char *xref;
  37.   struct name_structure *personal_name;
  38.   char *title;
  39.   char sex;
  40.   char *refn;
  41.   char *rfn;
  42.   char *afn;
  43.   struct xref *fams, *lastfams;
  44.   struct xref *famc, *lastfamc;
  45.   struct xref *sources, *lastsource;
  46.   struct note_structure *notes, *lastnote;
  47.   struct event_structure *events, *lastevent;
  48.   struct individual_record *next;
  49. };
  50.  
  51. struct family_record {
  52.   char *xref;
  53.   char *refn;
  54.   struct xref *husband;
  55.   struct xref *wife;
  56.   struct xref *children, *lastchild;
  57.   struct xref *sources, *lastsource;
  58.   struct note_structure *notes, *lastnote;
  59.   struct event_structure *events, *lastevent;
  60.   struct family_record *next;
  61. };
  62.  
  63. struct source_record {
  64.   char *xref;
  65.   char *text;
  66.   struct continuation *cont;
  67. };
  68.  
  69. struct name_structure {
  70.   char *name;
  71.   int surname_start;
  72.   int surname_end;
  73. };
  74.  
  75. struct place_structure {
  76.   char *name;
  77.   struct note_structure *notes, *lastnote;
  78. };
  79.  
  80. struct note_structure {
  81.    char *xref;
  82.    char *text;
  83.    struct continuation *cont;
  84.    struct note_structure *next;
  85. };
  86.  
  87. struct event_structure {
  88.   struct tag *tag;
  89.   char *date;
  90.   struct place_structure *place;
  91.   struct event_structure *next;
  92. };
  93.  
  94. struct xref {
  95.   char *id;
  96.   union {
  97.     struct individual_record *individual;
  98.     struct family_record *family;
  99.     struct source_record *source;
  100.   } pointer;
  101.   struct xref *next;
  102. };
  103.  
  104. struct continuation {
  105.   char *text;
  106.   struct continuation *next;
  107. };
  108.  
  109. /*
  110.  * Function prototypes
  111.  */
  112.  
  113. void process_records(struct node *np);
  114. void process_individual_record(struct node *np);
  115. void process_family_record(struct node *np);
  116. void process_event_record(struct node *np);
  117. void process_note_record(struct node *np);
  118. void process_submitter_record(struct node *np);
  119. void process_repository_record(struct node *np);
  120. void process_source_record(struct node *np);
  121. struct event_structure *process_event(struct node *np);
  122. struct note_structure *process_note(struct node *np);
  123. struct xref *process_xref(struct node *np);
  124. struct name_structure *process_name(struct node *np);
  125. void link_records(struct node *np);
  126. void link_individual_record(struct node *np);
  127. void link_family_record(struct node *np);
  128. int compare_name(struct individual_record **ipp1,
  129.          struct individual_record **ipp2);
  130.  
  131.