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.
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.
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.
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
24 #ifndef __GEDCOM_GOM_H
25 #define __GEDCOM_GOM_H
40 struct xref_value *xref_value;
41 struct user_data *next;
42 struct user_data *previous;
45 struct address { /* ADDRESS_STRUCTURE */
46 char *full_label; /* ADDRESS_LINE */
47 char *line1; /* ADDRESS_LINE1 */
48 char *line2; /* ADDRESS_LINE2 */
49 char *city; /* ADDRESS_CITY */
50 char *state; /* ADDRESS_STATE */
51 char *postal; /* ADDRESS_POSTAL_CODE */
52 char *country; /* ADDRESS_COUNTRY */
53 struct user_data *extra;
57 char *text; /* TEXT_FROM_SOURCE */
58 struct user_data *extra;
60 struct text *previous;
63 struct source_citation { /* SOURCE_CITATION */
64 char *description; /* SOURCE_DESCRIPTION */
65 struct xref_value *reference;
66 char *page; /* WHERE_WITHIN_SOURCE */
67 char *event; /* EVENT_TYPE_CITED_FROM */
68 char *role; /* ROLE_IN_EVENT */
69 struct date_value *date; /* ENTRY_RECORDING_DATE */
71 char *quality; /* CERTAINTY_ASSESSMENT */
72 struct multimedia_link *mm_link;
73 struct note_sub *note;
74 struct user_data *extra;
75 struct source_citation *next;
76 struct source_citation *previous;
79 struct note_sub { /* NOTE_STRUCTURE */
80 char *text; /* SUBMITTER_TEXT */
81 struct xref_value *reference;
82 struct source_citation *citation;
83 struct user_data *extra;
84 struct note_sub *next;
85 struct note_sub *previous;
88 struct place { /* PLACE_STRUCTURE */
89 char *value; /* PLACE_VALUE */
90 char *place_hierarchy; /* PLACE_HIERARCHY */
91 struct source_citation *citation;
92 struct note_sub *note;
93 struct user_data *extra;
96 struct multimedia_link { /* MULTIMEDIA_LINK */
97 struct xref_value *reference;
98 char *form; /* MULTIMEDIA_FORMAT */
99 char *title; /* DESCRIPTIVE_TITLE */
100 char *file; /* MULTIMEDIA_FILE_REFERENCE */
101 struct note_sub *note;
102 struct user_data *extra;
103 struct multimedia_link *next;
104 struct multimedia_link *previous;
107 struct lds_event { /* LDS_INDIVIDUAL_ORDINANCE */
110 char *date_status; /* LDS_BAPTISM_DATE_STATUS */
111 struct date_value *date; /* DATE_LDS_ORD */
112 char *temple_code; /* TEMPLE_CODE */
113 char *place_living_ordinance; /* PLACE_LIVING_ORDINANCE */
114 struct xref_value *family;
115 struct source_citation *citation;
116 struct note_sub *note;
117 struct user_data *extra;
118 struct lds_event *next;
119 struct lds_event *previous;
122 struct user_ref_number {
123 char *value; /* USER_REFERENCE_NUMBER */
124 char *type; /* USER_REFERENCE_TYPE */
125 struct user_data *extra;
126 struct user_ref_number *next;
127 struct user_ref_number *previous;
130 struct change_date { /* CHANGE_DATE_STRUCTURE */
131 struct date_value *date; /* CHANGE_DATE */
132 char *time; /* TIME_VALUE */
133 struct note_sub *note;
134 struct user_data *extra;
137 struct event { /* FAMILY_EVENT_STRUCTURE */
141 char *type; /* EVENT_DESCRIPTOR */
142 struct date_value *date; /* DATE_VALUE */
144 struct address *address;
145 char *phone[3]; /* PHONE_NUMBER */
146 struct age_value *age; /* AGE_AT_EVENT */
147 char *agency; /* RESPONSIBLE_AGENCY */
148 char *cause; /* CAUSE_OF_EVENT */
149 struct source_citation *citation;
150 struct multimedia_link *mm_link;
151 struct note_sub *note;
152 struct age_value *husband_age;
153 struct age_value *wife_age;
154 struct xref_value *family;
155 char *adoption_parent; /* ADOPTED_BY_WHICH_PARENT */
156 struct user_data *extra;
158 struct event *previous;
162 struct xref_value *xref;
163 struct user_data *extra;
164 struct xref_list *next;
165 struct xref_list *previous;
168 struct personal_name { /* PERSONAL_NAME_STRUCTURE */
169 char *name; /* NAME_PERSONAL */
170 char *prefix; /* NAME_PIECE_PREFIX */
171 char *given; /* NAME_PIECE_GIVEN */
172 char *nickname; /* NAME_PIECE_NICKNAME */
173 char *surname_prefix; /* NAME_PIECE_SURNAME_PREFIX */
174 char *surname; /* NAME_PIECE_SURNAME */
175 char *suffix; /* NAME_PIECE_SUFFIX */
176 struct source_citation *citation;
177 struct note_sub *note;
178 struct user_data *extra;
179 struct personal_name *next;
180 struct personal_name *previous;
184 char *pedigree; /* PEDIGREE_LINKAGE_TYPE */
185 struct user_data *extra;
186 struct pedigree *next;
187 struct pedigree *previous;
190 struct family_link { /* CHILD_TO_FAMILY_LINK */
191 struct xref_value *family;
192 struct pedigree *pedigree;
193 struct note_sub *note;
194 struct user_data *extra;
195 struct family_link *next;
196 struct family_link *previous;
199 struct association { /* ASSOCIATION_STRUCTURE */
200 struct xref_value *to;
201 char *type; /* RECORD_TYPE */
202 char *relation; /* RELATION_IS_DESCRIPTOR */
203 struct source_citation *citation;
204 struct note_sub *note;
205 struct user_data *extra;
206 struct association *next;
207 struct association *previous;
210 struct source_event {
211 char *recorded_events; /* EVENTS_RECORDED */
212 struct date_value *date_period; /* DATE_PERIOD */
213 char *jurisdiction; /* SOURCE_JURISDICTION_PLACE */
214 struct user_data *extra;
215 struct source_event *next;
216 struct source_event *previous;
219 struct source_description {
220 char *call_number; /* SOURCE_CALL_NUMBER */
221 char *media; /* SOURCE_MEDIA_TYPE */
222 struct user_data *extra;
223 struct source_description *next;
224 struct source_description *previous;
227 /* Main structures */
229 struct header { /* HEADER */
230 struct header_source {
231 char *id; /* APPROVED_SYSTEM_ID */
232 char *name; /* NAME_OF_PRODUCT */
233 char *version; /* VERSION_NUMBER */
234 struct header_corporation {
235 char *name; /* NAME_OF_BUSINESS */
236 struct address *address;
237 char *phone[3]; /* PHONE_NUMBER */
240 char *name; /* NAME_OF_SOURCE_DATA */
241 struct date_value *date; /* PUBLICATION_DATE */
242 char *copyright; /* COPYRIGHT_SOURCE_DATA */
245 char *destination; /* RECEIVING_SYSTEM_NAME */
246 struct date_value *date; /* TRANSMISSION_DATE */
247 char *time; /* TIME_VALUE */
248 struct xref_value *submitter;
249 struct xref_value *submission;
250 char *filename; /* FILE_NAME */
251 char *copyright; /* COPYRIGHT_GEDCOM_FILE */
252 struct header_gedcom {
253 char *version; /* VERSION_NUMBER */
254 char *form; /* GEDCOM_FORM */
256 struct header_charset {
257 char *name; /* CHARACTER_SET */
258 char *version; /* VERSION_NUMBER */
260 char *language; /* LANGUAGE_OF_TEXT */
261 char *place_hierarchy; /* PLACE_HIERARCHY */
262 char *note; /* GEDCOM_CONTENT_DESCRIPTION */
263 struct user_data *extra;
266 struct submission { /* SUBMISSION_RECORD */
268 struct xref_value *submitter;
269 char *family_file; /* NAME_OF_FAMILY_FILE */
270 char *temple_code; /* TEMPLE_CODE */
271 char *nr_of_ancestor_gens; /* GENERATIONS_OF_ANCESTORS */
272 char *nr_of_descendant_gens; /* GENERATIONS_OF_DESCENDANTS */
273 char *ordinance_process_flag; /* ORDINANCE_PROCESS_FLAG */
274 char *record_id; /* AUTOMATED_RECORD_ID */
275 struct user_data *extra;
278 struct family { /* FAM_RECORD */
281 struct xref_value *husband;
282 struct xref_value *wife;
283 struct xref_list *children;
284 char *nr_of_children; /* COUNT_OF_CHILDREN */
285 struct xref_list *submitters;
286 struct lds_event *lds_spouse_sealing;
287 struct source_citation *citation;
288 struct multimedia_link *mm_link;
289 struct note_sub *note;
290 struct user_ref_number *ref;
291 char *record_id; /* AUTOMATED_RECORD_ID */
292 struct change_date *change_date;
293 struct user_data *extra;
295 struct family *previous;
298 struct individual { /* INDIVIDUAL_RECORD */
300 char *restriction_notice; /* RESTRICTION_NOTICE */
301 struct personal_name *name;
302 char *sex; /* SEX_VALUE */
304 struct event *attribute;
305 struct lds_event *lds_individual_ordinance;
306 struct family_link *child_to_family;
307 struct family_link *spouse_to_family;
308 struct xref_list *submitters;
309 struct association *association;
310 struct xref_list *alias;
311 struct xref_list *ancestor_interest;
312 struct xref_list *descendant_interest;
313 struct source_citation *citation;
314 struct multimedia_link *mm_link;
315 struct note_sub *note;
316 char *record_file_nr; /* PERMANENT_RECORD_FILE_NUMBER */
317 char *ancestral_file_nr; /* ANCESTRAL_FILE_NUMBER */
318 struct user_ref_number *ref;
319 char *record_id; /* AUTOMATED_RECORD_ID */
320 struct change_date *change_date;
321 struct user_data *extra;
322 struct individual *next;
323 struct individual *previous;
326 struct multimedia { /* MULTIMEDIA_RECORD */
328 char *form; /* MULTIMEDIA_FORMAT */
329 char *title; /* DESCRIPTIVE_TITLE */
330 struct note_sub *note;
331 char *data; /* ENCODED_MULTIMEDIA_LINE */
332 struct xref_value *continued;
333 struct user_ref_number *ref;
334 char *record_id; /* AUTOMATED_RECORD_ID */
335 struct change_date *change_date;
336 struct user_data *extra;
337 struct multimedia *next;
338 struct multimedia *previous;
341 struct note { /* NOTE_RECORD */
343 char *text; /* SUBMITTER_TEXT */
344 struct source_citation *citation;
345 struct user_ref_number *ref;
346 char *record_id; /* AUTOMATED_RECORD_ID */
347 struct change_date *change_date;
348 struct user_data *extra;
350 struct note *previous;
353 struct repository { /* REPOSITORY_RECORD */
355 char *name; /* NAME_OF_REPOSITORY */
356 struct address *address;
357 char *phone[3]; /* PHONE_NUMBER */
358 struct note_sub *note;
359 struct user_ref_number *ref;
360 char *record_id; /* AUTOMATED_RECORD_ID */
361 struct change_date *change_date;
362 struct user_data *extra;
363 struct repository *next;
364 struct repository *previous;
367 struct source { /* SOURCE_RECORD */
370 struct source_event *event;
371 char *agency; /* RESPONSIBLE_AGENCY */
372 struct note_sub *note;
374 char *author; /* SOURCE_ORIGINATOR */
375 char *title; /* SOURCE_DESCRIPTIVE_TITLE */
376 char *abbreviation; /* SOURCE_FILED_BY_ENTRY */
377 char *publication; /* SOURCE_PUBLICATION_FACTS */
378 char *text; /* TEXT_FROM_SOURCE */
380 struct xref_value *link;
381 struct note_sub *note;
382 struct source_description *description;
384 struct multimedia_link *mm_link;
385 struct note_sub *note;
386 struct user_ref_number *ref;
387 char *record_id; /* AUTOMATED_RECORD_ID */
388 struct change_date *change_date;
389 struct user_data *extra;
391 struct source *previous;
394 struct submitter { /* SUBMITTER_RECORD */
396 char *name; /* SUBMITTER_NAME */
397 struct address *address;
398 char *phone[3]; /* PHONE_NUMBER */
399 struct multimedia_link *mm_link;
400 char *language[3]; /* LANGUAGE_PREFERENCE */
401 char *record_file_nr; /* SUBMITTER_REGISTERED_RFN */
402 char *record_id; /* AUTOMATED_RECORD_ID */
403 struct change_date *change_date;
404 struct user_data *extra;
405 struct submitter *next;
406 struct submitter *previous;
413 struct xref_value *xref_value;
414 struct user_data *extra;
415 struct user_rec *next;
416 struct user_rec *previous;
421 int gom_parse_file(const char *file_name);
423 int gom_write_file(const char* file_name, int *total_conv_fails);
425 struct header* gom_get_header();
426 int gom_header_update_timestamp(time_t t);
428 struct submission* gom_get_submission();
429 struct submission* gom_add_submission(const char* xrefstr);
430 int gom_delete_submission();
432 struct family* gom_get_first_family();
433 struct family* gom_get_family_by_xref(const char *xref);
434 struct family* gom_add_family(const char* xrefstr);
435 int gom_delete_family(struct family* obj);
437 struct individual* gom_get_first_individual();
438 struct individual* gom_get_individual_by_xref(const char *xref);
439 struct individual* gom_add_individual(const char* xrefstr);
440 int gom_delete_individual(struct individual* obj);
442 struct multimedia* gom_get_first_multimedia();
443 struct multimedia* gom_get_multimedia_by_xref(const char *xref);
444 struct multimedia* gom_add_multimedia(const char* xrefstr);
445 int gom_delete_multimedia(struct multimedia* obj);
447 struct note* gom_get_first_note();
448 struct note* gom_get_note_by_xref(const char *xref);
449 struct note* gom_add_note(const char* xrefstr);
450 int gom_delete_note(struct note* obj);
452 struct repository* gom_get_first_repository();
453 struct repository* gom_get_repository_by_xref(const char *xref);
454 struct repository* gom_add_repository(const char* xrefstr);
455 int gom_delete_repository(struct repository* obj);
457 struct source* gom_get_first_source();
458 struct source* gom_get_source_by_xref(const char *xref);
459 struct source* gom_add_source(const char* xrefstr);
460 int gom_delete_source(struct source* obj);
462 struct submitter* gom_get_first_submitter();
463 struct submitter* gom_get_submitter_by_xref(const char *xref);
464 struct submitter* gom_add_submitter(const char* xrefstr);
465 int gom_delete_submitter(struct submitter* obj);
467 struct user_rec* gom_get_first_user_rec();
468 struct user_rec* gom_get_user_rec_by_xref(const char *xref);
469 struct user_rec* gom_add_user_rec(const char* xrefstr, const char* tag);
470 int gom_delete_user_rec(struct user_rec* obj);
472 char* gom_get_string(char* data);
473 char* gom_set_string(char** data, const char* utf8_str);
475 char* gom_get_string_for_locale(char* data, int* conversion_failures);
476 char* gom_set_string_for_locale(char** data, const char* locale_str);
477 void gom_set_unknown(const char* unknown);
483 #endif /* __GEDCOM_GOM_H */