home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Aktief 1995 #3 / CDA3.iso / genealog / pafctool.zip / PAFSUBS.H < prev    next >
Text File  |  1992-04-09  |  3KB  |  115 lines

  1. /*
  2.  * Copyright (C) 1992, Stephen A. Wood.  All rights reserved.
  3.  *
  4.  * This file is part of PAF C-Tools.
  5.  *  
  6.  * These programs are free software; you can redistribute them and/or modify
  7.  * them under the terms of the GNU General Public License as published by
  8.  * the Free Software Foundation; either version 2 of the License, or
  9.  * (at your option) any later version.
  10.  * 
  11.  * These programs are distributed in the hope that they will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  * 
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program; if not, write to the Free Software
  18.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  * The GNU General Public License can be found in the file LICENSE.
  20.  * 
  21.  * The author of PAF C-Tools is Stephen A. Wood.  He may be reached on internet
  22.  * at the address saw@cegaf.gov, or via mail at 328 Dominion Drive,
  23.  * Newport News, VA 23602.
  24.  * 
  25.  * ------------
  26.  * 
  27.  * This include file contains data structures used by the various PAF C-Tools
  28.  * programs.
  29.  */
  30.  
  31. #define TRUE 1
  32. #define FALSE 0
  33.  
  34. typedef unsigned short int RECORD_PTR;
  35.  
  36. typedef struct {
  37.   char fname[30];
  38.   int reclen;
  39.   FILE *ptr;
  40.   int nrec;
  41.   RECORD_PTR freehead, freetail, currec;
  42. } PAF_FILE;
  43.  
  44. typedef struct {
  45.   RECORD_PTR left;
  46.   char name[17];
  47.   RECORD_PTR right;
  48. } NAME_REC;
  49.  
  50. typedef long int LONGDATE;
  51.  
  52. typedef struct {
  53.   RECORD_PTR names[5];
  54.   char sex;
  55.   LONGDATE birthdate;/*15*/
  56.   RECORD_PTR birthplace[4];/*23*/
  57.   LONGDATE christdate;/*27*/
  58.   RECORD_PTR christplace[4];/*35*/
  59.   LONGDATE deathdate;/*39*/
  60.   RECORD_PTR deathplace[4];/*47*/
  61.   LONGDATE burialdate;/*51*/
  62.   RECORD_PTR burialplace[4];/*59*/
  63.   char ldsinfo[15];/*74*/
  64.   RECORD_PTR oldersib, ownmarriage, parentmarriage;/*80*/
  65.   char idnum[10];/*90*/
  66.   RECORD_PTR notepad;/*92*/
  67. } INDIV_REC;
  68.  
  69. typedef struct {
  70.   RECORD_PTR husband, wife, child;
  71.   LONGDATE marriagedate;
  72.   RECORD_PTR marriageplace[4];
  73.   char sealings[5];
  74.   RECORD_PTR mnext_husband;
  75.   RECORD_PTR mnext_wife;
  76.   char divorce;
  77. } MARR_REC;
  78.  
  79. typedef struct {
  80.   RECORD_PTR next_pad;
  81.   char notelines[254];
  82. } NOTE_REC;
  83.  
  84. typedef struct {
  85.   char name[41];
  86.   char addr1[41];
  87.   char addr2[41];
  88.   char addr3[41];
  89.   char phone[41];
  90.   char stake[26];
  91.   char unit[8];
  92. } NAMADD_REC;
  93.  
  94. void paf_open_name(char c);
  95. void paf_open_indiv(char c);
  96. void paf_open_marr(char c);
  97. void paf_open_notes(char c);
  98. void paf_open_namadd(char c);
  99. void get_name_rec(RECORD_PTR recno,NAME_REC *namrec);
  100. void get_indiv_rec(RECORD_PTR rin,INDIV_REC *indrec);
  101. void get_marr_rec(unsigned short int mrin,MARR_REC *marec);
  102. void get_note_rec(unsigned short int nbp,NOTE_REC *noterec);
  103. void get_namadd_rec(RECORD_PTR recno,NAMADD_REC *noterec);
  104. void write_indiv_rec(unsigned short int rin,INDIV_REC *indrec);
  105. void write_note_rec(unsigned short int nbp,NOTE_REC *indrec);
  106.  
  107. PAF_FILE *get_paf_filed(enum paffiles type);
  108.  
  109. void add_to_freelist(RECORD_PTR newfree, PAF_FILE *fil);
  110. RECORD_PTR get_tail(RECORD_PTR first, PAF_FILE *fil);
  111. RECORD_PTR get_next(RECORD_PTR recno, PAF_FILE *fil);
  112. RECORD_PTR get_free_rec(PAF_FILE *fil);
  113.  
  114. enum paffiles {NAME, INDIV, MARR, NOTE, NAMADD};
  115.