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
39 struct xref_value *xref_value;
40 struct user_data *next;
41 struct user_data *previous;
44 struct address { /* ADDRESS_STRUCTURE */
45 char *full_label; /* ADDRESS_LINE */
46 char *line1; /* ADDRESS_LINE1 */
47 char *line2; /* ADDRESS_LINE2 */
48 char *city; /* ADDRESS_CITY */
49 char *state; /* ADDRESS_STATE */
50 char *postal; /* ADDRESS_POSTAL_CODE */
51 char *country; /* ADDRESS_COUNTRY */
52 struct user_data *extra;
56 char *text; /* TEXT_FROM_SOURCE */
57 struct user_data *extra;
59 struct text *previous;
62 struct source_citation { /* SOURCE_CITATION */
63 char *description; /* SOURCE_DESCRIPTION */
64 struct xref_value *reference;
65 char *page; /* WHERE_WITHIN_SOURCE */
66 char *event; /* EVENT_TYPE_CITED_FROM */
67 char *role; /* ROLE_IN_EVENT */
68 struct date_value *date; /* ENTRY_RECORDING_DATE */
70 char *quality; /* CERTAINTY_ASSESSMENT */
71 struct multimedia_link *mm_link;
72 struct note_sub *note;
73 struct user_data *extra;
74 struct source_citation *next;
75 struct source_citation *previous;
78 struct note_sub { /* NOTE_STRUCTURE */
79 char *text; /* SUBMITTER_TEXT */
80 struct xref_value *reference;
81 struct source_citation *citation;
82 struct user_data *extra;
83 struct note_sub *next;
84 struct note_sub *previous;
87 struct place { /* PLACE_STRUCTURE */
88 char *value; /* PLACE_VALUE */
89 char *place_hierarchy; /* PLACE_HIERARCHY */
90 struct source_citation *citation;
91 struct note_sub *note;
92 struct user_data *extra;
95 struct multimedia_link { /* MULTIMEDIA_LINK */
96 struct xref_value *reference;
97 char *form; /* MULTIMEDIA_FORMAT */
98 char *title; /* DESCRIPTIVE_TITLE */
99 char *file; /* MULTIMEDIA_FILE_REFERENCE */
100 struct note_sub *note;
101 struct user_data *extra;
102 struct multimedia_link *next;
103 struct multimedia_link *previous;
106 struct lds_event { /* LDS_INDIVIDUAL_ORDINANCE */
109 char *date_status; /* LDS_BAPTISM_DATE_STATUS */
110 struct date_value *date; /* DATE_LDS_ORD */
111 char *temple_code; /* TEMPLE_CODE */
112 char *place_living_ordinance; /* PLACE_LIVING_ORDINANCE */
113 struct xref_value *family;
114 struct source_citation *citation;
115 struct note_sub *note;
116 struct user_data *extra;
117 struct lds_event *next;
118 struct lds_event *previous;
121 struct user_ref_number {
122 char *value; /* USER_REFERENCE_NUMBER */
123 char *type; /* USER_REFERENCE_TYPE */
124 struct user_data *extra;
125 struct user_ref_number *next;
126 struct user_ref_number *previous;
129 struct change_date { /* CHANGE_DATE_STRUCTURE */
130 struct date_value *date; /* CHANGE_DATE */
131 char *time; /* TIME_VALUE */
132 struct note_sub *note;
133 struct user_data *extra;
136 struct event { /* FAMILY_EVENT_STRUCTURE */
140 char *type; /* EVENT_DESCRIPTOR */
141 struct date_value *date; /* DATE_VALUE */
143 struct address *address;
144 char *phone[3]; /* PHONE_NUMBER */
145 struct age_value *age; /* AGE_AT_EVENT */
146 char *agency; /* RESPONSIBLE_AGENCY */
147 char *cause; /* CAUSE_OF_EVENT */
148 struct source_citation *citation;
149 struct multimedia_link *mm_link;
150 struct note_sub *note;
151 struct age_value *husband_age;
152 struct age_value *wife_age;
153 struct xref_value *family;
154 char *adoption_parent; /* ADOPTED_BY_WHICH_PARENT */
155 struct user_data *extra;
157 struct event *previous;
161 struct xref_value *xref;
162 struct user_data *extra;
163 struct xref_list *next;
164 struct xref_list *previous;
167 struct personal_name { /* PERSONAL_NAME_STRUCTURE */
168 char *name; /* NAME_PERSONAL */
169 char *prefix; /* NAME_PIECE_PREFIX */
170 char *given; /* NAME_PIECE_GIVEN */
171 char *nickname; /* NAME_PIECE_NICKNAME */
172 char *surname_prefix; /* NAME_PIECE_SURNAME_PREFIX */
173 char *surname; /* NAME_PIECE_SURNAME */
174 char *suffix; /* NAME_PIECE_SUFFIX */
175 struct source_citation *citation;
176 struct note_sub *note;
177 struct user_data *extra;
178 struct personal_name *next;
179 struct personal_name *previous;
183 char *pedigree; /* PEDIGREE_LINKAGE_TYPE */
184 struct user_data *extra;
185 struct pedigree *next;
186 struct pedigree *previous;
189 struct family_link { /* CHILD_TO_FAMILY_LINK */
190 struct xref_value *family;
191 struct pedigree *pedigree;
192 struct note_sub *note;
193 struct user_data *extra;
194 struct family_link *next;
195 struct family_link *previous;
198 struct association { /* ASSOCIATION_STRUCTURE */
199 struct xref_value *to;
200 char *type; /* RECORD_TYPE */
201 char *relation; /* RELATION_IS_DESCRIPTOR */
202 struct source_citation *citation;
203 struct note_sub *note;
204 struct user_data *extra;
205 struct association *next;
206 struct association *previous;
209 struct source_event {
210 char *recorded_events; /* EVENTS_RECORDED */
211 struct date_value *date_period; /* DATE_PERIOD */
212 char *jurisdiction; /* SOURCE_JURISDICTION_PLACE */
213 struct user_data *extra;
214 struct source_event *next;
215 struct source_event *previous;
218 struct source_description {
219 char *call_number; /* SOURCE_CALL_NUMBER */
220 char *media; /* SOURCE_MEDIA_TYPE */
221 struct user_data *extra;
222 struct source_description *next;
223 struct source_description *previous;
226 /* Main structures */
228 struct header { /* HEADER */
229 struct header_source {
230 char *id; /* APPROVED_SYSTEM_ID */
231 char *name; /* NAME_OF_PRODUCT */
232 char *version; /* VERSION_NUMBER */
233 struct header_corporation {
234 char *name; /* NAME_OF_BUSINESS */
235 struct address *address;
236 char *phone[3]; /* PHONE_NUMBER */
239 char *name; /* NAME_OF_SOURCE_DATA */
240 struct date_value *date; /* PUBLICATION_DATE */
241 char *copyright; /* COPYRIGHT_SOURCE_DATA */
244 char *destination; /* RECEIVING_SYSTEM_NAME */
245 struct date_value *date; /* TRANSMISSION_DATE */
246 char *time; /* TIME_VALUE */
247 struct xref_value *submitter;
248 struct xref_value *submission;
249 char *filename; /* FILE_NAME */
250 char *copyright; /* COPYRIGHT_GEDCOM_FILE */
251 struct header_gedcom {
252 char *version; /* VERSION_NUMBER */
253 char *form; /* GEDCOM_FORM */
255 struct header_charset {
256 char *name; /* CHARACTER_SET */
257 char *version; /* VERSION_NUMBER */
259 char *language; /* LANGUAGE_OF_TEXT */
260 char *place_hierarchy; /* PLACE_HIERARCHY */
261 char *note; /* GEDCOM_CONTENT_DESCRIPTION */
262 struct user_data *extra;
265 struct submission { /* SUBMISSION_RECORD */
267 struct xref_value *submitter;
268 char *family_file; /* NAME_OF_FAMILY_FILE */
269 char *temple_code; /* TEMPLE_CODE */
270 char *nr_of_ancestor_gens; /* GENERATIONS_OF_ANCESTORS */
271 char *nr_of_descendant_gens; /* GENERATIONS_OF_DESCENDANTS */
272 char *ordinance_process_flag; /* ORDINANCE_PROCESS_FLAG */
273 char *record_id; /* AUTOMATED_RECORD_ID */
274 struct user_data *extra;
277 struct family { /* FAM_RECORD */
280 struct xref_value *husband;
281 struct xref_value *wife;
282 struct xref_list *children;
283 char *nr_of_children; /* COUNT_OF_CHILDREN */
284 struct xref_list *submitters;
285 struct lds_event *lds_spouse_sealing;
286 struct source_citation *citation;
287 struct multimedia_link *mm_link;
288 struct note_sub *note;
289 struct user_ref_number *ref;
290 char *record_id; /* AUTOMATED_RECORD_ID */
291 struct change_date *change_date;
292 struct user_data *extra;
294 struct family *previous;
297 struct individual { /* INDIVIDUAL_RECORD */
299 char *restriction_notice; /* RESTRICTION_NOTICE */
300 struct personal_name *name;
301 char *sex; /* SEX_VALUE */
303 struct event *attribute;
304 struct lds_event *lds_individual_ordinance;
305 struct family_link *child_to_family;
306 struct family_link *spouse_to_family;
307 struct xref_list *submitters;
308 struct association *association;
309 struct xref_list *alias;
310 struct xref_list *ancestor_interest;
311 struct xref_list *descendant_interest;
312 struct source_citation *citation;
313 struct multimedia_link *mm_link;
314 struct note_sub *note;
315 char *record_file_nr; /* PERMANENT_RECORD_FILE_NUMBER */
316 char *ancestral_file_nr; /* ANCESTRAL_FILE_NUMBER */
317 struct user_ref_number *ref;
318 char *record_id; /* AUTOMATED_RECORD_ID */
319 struct change_date *change_date;
320 struct user_data *extra;
321 struct individual *next;
322 struct individual *previous;
325 struct multimedia { /* MULTIMEDIA_RECORD */
327 char *form; /* MULTIMEDIA_FORMAT */
328 char *title; /* DESCRIPTIVE_TITLE */
329 struct note_sub *note;
330 char *data; /* ENCODED_MULTIMEDIA_LINE */
331 struct xref_value *continued;
332 struct user_ref_number *ref;
333 char *record_id; /* AUTOMATED_RECORD_ID */
334 struct change_date *change_date;
335 struct user_data *extra;
336 struct multimedia *next;
337 struct multimedia *previous;
340 struct note { /* NOTE_RECORD */
342 char *text; /* SUBMITTER_TEXT */
343 struct source_citation *citation;
344 struct user_ref_number *ref;
345 char *record_id; /* AUTOMATED_RECORD_ID */
346 struct change_date *change_date;
347 struct user_data *extra;
349 struct note *previous;
352 struct repository { /* REPOSITORY_RECORD */
354 char *name; /* NAME_OF_REPOSITORY */
355 struct address *address;
356 char *phone[3]; /* PHONE_NUMBER */
357 struct note_sub *note;
358 struct user_ref_number *ref;
359 char *record_id; /* AUTOMATED_RECORD_ID */
360 struct change_date *change_date;
361 struct user_data *extra;
362 struct repository *next;
363 struct repository *previous;
366 struct source { /* SOURCE_RECORD */
369 struct source_event *event;
370 char *agency; /* RESPONSIBLE_AGENCY */
371 struct note_sub *note;
373 char *author; /* SOURCE_ORIGINATOR */
374 char *title; /* SOURCE_DESCRIPTIVE_TITLE */
375 char *abbreviation; /* SOURCE_FILED_BY_ENTRY */
376 char *publication; /* SOURCE_PUBLICATION_FACTS */
377 char *text; /* TEXT_FROM_SOURCE */
379 struct xref_value *link;
380 struct note_sub *note;
381 struct source_description *description;
383 struct multimedia_link *mm_link;
384 struct note_sub *note;
385 struct user_ref_number *ref;
386 char *record_id; /* AUTOMATED_RECORD_ID */
387 struct change_date *change_date;
388 struct user_data *extra;
390 struct source *previous;
393 struct submitter { /* SUBMITTER_RECORD */
395 char *name; /* SUBMITTER_NAME */
396 struct address *address;
397 char *phone[3]; /* PHONE_NUMBER */
398 struct multimedia_link *mm_link;
399 char *language[3]; /* LANGUAGE_PREFERENCE */
400 char *record_file_nr; /* SUBMITTER_REGISTERED_RFN */
401 char *record_id; /* AUTOMATED_RECORD_ID */
402 struct change_date *change_date;
403 struct user_data *extra;
404 struct submitter *next;
405 struct submitter *previous;
412 struct xref_value *xref_value;
413 struct user_data *extra;
414 struct user_rec *next;
415 struct user_rec *previous;
420 int gom_parse_file(const char *file_name);
422 int gom_write_file(const char* file_name, int *total_conv_fails);
424 struct header* gom_get_header();
425 struct submission* gom_get_submission();
427 struct family* gom_get_first_family();
428 struct family* gom_get_family_by_xref(const char *xref);
430 struct individual* gom_get_first_individual();
431 struct individual* gom_get_individual_by_xref(const char *xref);
433 struct multimedia* gom_get_first_multimedia();
434 struct multimedia* gom_get_multimedia_by_xref(const char *xref);
436 struct note* gom_get_first_note();
437 struct note* gom_get_note_by_xref(const char *xref);
439 struct repository* gom_get_first_repository();
440 struct repository* gom_get_repository_by_xref(const char *xref);
442 struct source* gom_get_first_source();
443 struct source* gom_get_source_by_xref(const char *xref);
445 struct submitter* gom_get_first_submitter();
446 struct submitter* gom_get_submitter_by_xref(const char *xref);
448 struct user_rec* gom_get_first_user_rec();
449 struct user_rec* gom_get_user_rec_by_xref(const char *xref);
451 char* gom_get_string(char* data);
452 char* gom_set_string(char** data, const char* utf8_str);
454 char* gom_get_string_for_locale(char* data, int* conversion_failures);
455 char* gom_set_string_for_locale(char** data, const char* locale_str);
456 void gom_set_unknown(const char* unknown);
462 #endif /* __GEDCOM_GOM_H */