Changes to be able to generate documentation.
[gedcom-parse.git] / include / gom.h
1 /* External header for the Gedcom parser library.
2    Copyright (C) 2002 The Genes Development Team
3    This file is part of the Gedcom parser library.
4    Contributed by Peter Verthez <Peter.Verthez@advalvas.be>, 2002.
5
6    The Gedcom parser library is free software; you can redistribute it
7    and/or modify it under the terms of the GNU Lesser General Public
8    License as published by the Free Software Foundation; either
9    version 2.1 of the License, or (at your option) any later version.
10
11    The Gedcom parser library is distributed in the hope that it will be
12    useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15
16    You should have received a copy of the GNU Lesser General Public
17    License along with the Gedcom parser library; if not, write to the
18    Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19    02111-1307 USA.  */
20
21 /* $Id$ */
22 /* $Name$ */
23
24 #ifndef __GEDCOM_GOM_H
25 #define __GEDCOM_GOM_H
26
27 __BEGIN_DECLS
28
29 /* Sub-structures */
30
31 struct user_data {
32   int level;
33   char *tag;
34   char *str_value;
35   struct xref_value *xref_value;
36   struct user_data *next;
37   struct user_data *previous;
38 };
39
40 struct address {
41   char *full_label;
42   char *line1;
43   char *line2;
44   char *city;
45   char *state;
46   char *postal;
47   char *country;
48   struct user_data *extra;
49 };
50
51 struct text {
52   char *text;
53   struct user_data *extra;
54   struct text *next;
55   struct text *previous;
56 };
57
58 struct source_citation {
59   char *description;
60   struct xref_value *reference;
61   char *page;
62   char *event;
63   char *role;
64   struct date_value *date;
65   struct text *text;
66   char *quality;
67   struct multimedia_link *mm_link;
68   struct note_sub *note;
69   struct user_data *extra;
70   struct source_citation *next;
71   struct source_citation *previous;
72 };
73
74 struct note_sub {
75   char *text;
76   struct xref_value *reference;
77   struct source_citation *citation;
78   struct user_data *extra;
79   struct note_sub *next;
80   struct note_sub *previous;
81 };
82
83 struct place {
84   char *value;
85   char *place_hierarchy;
86   struct user_data *extra;
87   struct source_citation *citation;
88   struct note_sub *note;
89 };
90
91 struct multimedia_link {
92   struct xref_value *reference;
93   char *form;
94   char *title;
95   char *file;
96   struct note_sub *note;
97   struct user_data *extra;
98   struct multimedia_link *next;
99   struct multimedia_link *previous;
100 };
101
102 struct lds_event {
103   char *date_status;
104   struct date_value *date;
105   char *temple_code;
106   char *place_living_ordinance;
107   struct xref_value *family;
108   struct source_citation *citation;
109   struct note_sub *note;
110   struct user_data *extra;
111   struct lds_event *next;
112   struct lds_event *previous;
113 };
114
115 struct user_ref_number {
116   char *value;
117   char *type;
118   struct user_data *extra;
119   struct user_ref_number *next;
120   struct user_ref_number *previous;
121 };
122
123 struct change_date {
124   struct date_value *date;
125   char *time;
126   struct note_sub *note;
127   struct user_data *extra;
128 };
129
130 struct event {
131   int event;
132   char *event_name;
133   char *val;
134   char *type;
135   struct date_value *date;
136   struct place *place;
137   struct address *address;
138   char *phone[3];
139   struct age_value *age;
140   char *agency;
141   char *cause;
142   struct source_citation *citation;
143   struct multimedia_link *mm_link;
144   struct note_sub *note;
145   struct age_value *husband_age;
146   struct age_value *wife_age;
147   struct xref_value *family;
148   char *adoption_parent;
149   struct user_data *extra;
150   struct event *next;
151   struct event *previous;
152 };
153
154 struct xref_list {
155   struct xref_value *xref;
156   struct user_data *extra;
157   struct xref_list *next;
158   struct xref_list *previous;
159 };
160
161 struct personal_name {
162   char *name;
163   char *prefix;
164   char *given;
165   char *nickname;
166   char *surname_prefix;
167   char *surname;
168   char *suffix;
169   struct source_citation *citation;
170   struct note_sub *note;
171   struct user_data *extra;
172   struct personal_name *next;
173   struct personal_name *previous;
174 };
175
176 struct pedigree {
177   char *pedigree;
178   struct user_data *extra;
179   struct pedigree *next;
180   struct pedigree *previous;
181 };
182
183 struct family_link {
184   struct xref_value *family;
185   struct pedigree *pedigree;
186   struct note_sub *note;
187   struct user_data *extra;
188   struct family_link *next;
189   struct family_link *previous;
190 };
191
192 struct association {
193   struct xref_value *to;
194   char *type;
195   char *relation;
196   struct source_citation *citation;
197   struct note_sub *note;
198   struct user_data *extra;
199   struct association *next;
200   struct association *previous;
201 };
202
203 struct source_event {
204   char *recorded_events;
205   struct date_value *date_period;
206   char *jurisdiction;
207   struct user_data *extra;
208   struct source_event *next;
209   struct source_event *previous;
210 };
211
212 struct source_description {
213   char *call_number;
214   char *media;
215   struct user_data *extra;
216   struct source_description *next;
217   struct source_description *previous;
218 };
219
220 /* Main structures */
221
222 struct header {
223   struct header_source {
224     char *id;
225     char *name;
226     char *version;
227     struct header_corporation {
228       char *name;
229       struct address *address;
230       char *phone[3];
231     } corporation;
232     struct header_data {
233       char *name;
234       struct date_value *date;
235       char *copyright;
236     } data;
237   } source;
238   char *destination;
239   struct date_value *date;
240   char *time;
241   struct xref_value *submitter;
242   struct xref_value *submission;
243   char *filename;
244   char *copyright;
245   struct header_gedcom {
246     char *version;
247     char *form;
248   } gedcom;
249   struct header_charset {
250     char *name;
251     char *version;
252   } charset;
253   char *language;
254   char *place_hierarchy;
255   char *note;
256   struct user_data *extra;
257 };
258
259 struct submission {
260   char *xrefstr;
261   struct xref_value *submitter;
262   char *family_file;
263   char *temple_code;
264   char *nr_of_ancestor_gens;
265   char *nr_of_descendant_gens;
266   char *ordinance_process_flag;
267   char *record_id;
268   struct user_data *extra;
269 };
270
271 struct family {
272   char *xrefstr;
273   struct event *event;
274   struct xref_value *husband;
275   struct xref_value *wife;
276   struct xref_list *children;
277   char *nr_of_children;
278   struct xref_list *submitters;
279   struct lds_event *lds_spouse_sealing;
280   struct source_citation *citation;
281   struct multimedia_link *mm_link;
282   struct note_sub *note;
283   struct user_ref_number *ref;
284   char *record_id;
285   struct change_date *change_date;
286   struct user_data *extra;
287   struct family *next;
288   struct family *previous;
289 };
290
291 struct individual {
292   char *xrefstr;
293   char *restriction_notice;
294   struct personal_name *name;
295   char *sex;
296   struct event *event;
297   struct event *attribute;
298   struct lds_event *lds_individual_ordinance;
299   struct family_link *child_to_family;
300   struct family_link *spouse_to_family;
301   struct xref_list *submitters;
302   struct association *association;
303   struct xref_list *alias;
304   struct xref_list *ancestor_interest;
305   struct xref_list *descendant_interest;
306   struct source_citation *citation;
307   struct multimedia_link *mm_link;
308   struct note_sub *note;
309   char *record_file_nr;
310   char *ancestral_file_nr;
311   struct user_ref_number *ref;
312   char *record_id;
313   struct change_date *change_date;
314   struct user_data *extra;
315   struct individual *next;
316   struct individual *previous;
317 };
318
319 struct multimedia {
320   char *xrefstr;
321   char *form;
322   char *title;
323   struct note_sub *note;
324   char *data;
325   struct xref_value *continued;
326   struct user_ref_number *ref;
327   char *record_id;
328   struct change_date *change_date;
329   struct user_data *extra;
330   struct multimedia *next;
331   struct multimedia *previous;
332 };
333
334 struct note {
335   char *xrefstr;
336   char *text;
337   struct source_citation *citation;
338   struct user_ref_number *ref;
339   char *record_id;
340   struct change_date *change_date;
341   struct user_data *extra;
342   struct note *next;
343   struct note *previous;
344 };
345
346 struct repository {
347   char *xrefstr;
348   char *name;
349   struct address *address;
350   char *phone[3];
351   struct note_sub *note;
352   struct user_ref_number *ref;
353   char *record_id;
354   struct change_date *change_date;
355   struct user_data *extra;
356   struct repository *next;
357   struct repository *previous;
358 };
359
360 struct source {
361   char *xrefstr;
362   struct source_data {
363     struct source_event *event;
364     char *agency;
365     struct note_sub *note;
366   } data;
367   char *author;
368   char *title;
369   char *abbreviation;
370   char *publication;
371   char *text;
372   struct repo_link {
373     struct xref_value *link;
374     struct note_sub *note;
375     struct source_description *description;
376   } repository;
377   struct multimedia_link *mm_link;
378   struct note_sub *note;
379   struct user_ref_number *ref;
380   char *record_id;
381   struct change_date *change_date;
382   struct user_data *extra;
383   struct source *next;
384   struct source *previous;
385 };
386
387 struct submitter {
388   char *xrefstr;
389   char *name;
390   struct address *address;
391   char *phone[3];
392   struct multimedia_link *mm_link;
393   char *language[3];
394   char *record_file_nr;
395   char *record_id;
396   struct change_date *change_date;
397   struct user_data *extra;
398   struct submitter *next;
399   struct submitter *previous;
400 };
401
402 struct user_rec {
403   char *xrefstr;
404   char *tag;
405   char *str_value;
406   struct xref_value *xref_value;
407   struct user_data *extra;
408   struct user_rec *next;
409   struct user_rec *previous;
410 };
411
412 /* Functions */
413
414 int  gom_parse_file(char *file_name);
415
416 struct header*     gom_get_header();
417 struct submission* gom_get_submission();
418
419 struct family*     gom_get_first_family();
420 struct family*     gom_get_family_by_xref(char *xref);
421
422 struct individual* gom_get_first_individual();
423 struct individual* gom_get_individual_by_xref(char *xref);
424
425 struct multimedia* gom_get_first_multimedia();
426 struct multimedia* gom_get_multimedia_by_xref(char *xref);
427
428 struct note*       gom_get_first_note();
429 struct note*       gom_get_note_by_xref(char *xref);
430
431 struct repository* gom_get_first_repository();
432 struct repository* gom_get_repository_by_xref(char *xref);
433
434 struct source*     gom_get_first_source();
435 struct source*     gom_get_source_by_xref(char *xref);
436
437 struct submitter*  gom_get_first_submitter();
438 struct submitter*  gom_get_submitter_by_xref(char *xref);
439
440 struct user_rec*   gom_get_first_user_rec();
441 struct user_rec*   gom_get_user_rec_by_xref(char *xref);
442
443 __END_DECLS
444
445 #endif /* __GEDCOM_GOM_H */