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