Finish doxygen conversion of 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 #include "gedcom.h"
28 #include <time.h>
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 /* Sub-structures */
35
36 struct user_data {
37   int level;
38   char *tag;
39   char *str_value;
40   struct xref_value *xref_value;
41   struct user_data *next;
42   struct user_data *previous;
43 };
44
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;
54 };
55
56 struct text {
57   char *text;                         /* TEXT_FROM_SOURCE */
58   struct user_data *extra;
59   struct text *next;
60   struct text *previous;
61 };
62
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 */
70   struct text *text;
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;
77 };
78
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;
86 };
87
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;
94 };
95
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;
105 };
106
107 struct lds_event {                    /* LDS_INDIVIDUAL_ORDINANCE */
108   int event;
109   char *event_name;
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;
120 };
121
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;
128 };
129
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;
135 };
136
137 struct event {                        /* FAMILY_EVENT_STRUCTURE */
138   int event;
139   char *event_name;
140   char *val;
141   char *type;                         /* EVENT_DESCRIPTOR */
142   struct date_value *date;            /* DATE_VALUE */
143   struct place *place;
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;
157   struct event *next;
158   struct event *previous;
159 };
160
161 struct xref_list {
162   struct xref_value *xref;
163   struct user_data *extra;
164   struct xref_list *next;
165   struct xref_list *previous;
166 };
167
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;
181 };
182
183 struct pedigree {
184   char *pedigree;                     /* PEDIGREE_LINKAGE_TYPE */
185   struct user_data *extra;
186   struct pedigree *next;
187   struct pedigree *previous;
188 };
189
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;
197 };
198
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;
208 };
209
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;
217 };
218
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;
225 };
226
227 /* Main structures */
228
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 */
238     } corporation;
239     struct header_data {
240       char *name;                     /* NAME_OF_SOURCE_DATA */
241       struct date_value *date;        /* PUBLICATION_DATE */
242       char *copyright;                /* COPYRIGHT_SOURCE_DATA */
243     } data;
244   } source;
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 */
255   } gedcom;
256   struct header_charset {
257     char *name;                       /* CHARACTER_SET */
258     char *version;                    /* VERSION_NUMBER */
259   } charset;
260   char *language;                     /* LANGUAGE_OF_TEXT */
261   char *place_hierarchy;              /* PLACE_HIERARCHY */
262   char *note;                         /* GEDCOM_CONTENT_DESCRIPTION */
263   struct user_data *extra;
264 };
265
266 struct submission {                   /* SUBMISSION_RECORD */
267   char *xrefstr;
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;
276 };
277
278 struct family {                       /* FAM_RECORD */
279   char *xrefstr;
280   struct event *event;
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;
294   struct family *next;
295   struct family *previous;
296 };
297
298 struct individual {                   /* INDIVIDUAL_RECORD */
299   char *xrefstr;
300   char *restriction_notice;           /* RESTRICTION_NOTICE */
301   struct personal_name *name;
302   char *sex;                          /* SEX_VALUE */
303   struct event *event;
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;
324 };
325
326 struct multimedia {                   /* MULTIMEDIA_RECORD */
327   char *xrefstr;
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;
339 };
340
341 struct note {                         /* NOTE_RECORD */
342   char *xrefstr;
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;
349   struct note *next;
350   struct note *previous;
351 };
352
353 struct repository {                   /* REPOSITORY_RECORD */
354   char *xrefstr;
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;
365 };
366
367 struct source {                       /* SOURCE_RECORD */
368   char *xrefstr;
369   struct source_data {
370     struct source_event *event;
371     char *agency;                     /* RESPONSIBLE_AGENCY */
372     struct note_sub *note;
373   } data;
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 */
379   struct repo_link {
380     struct xref_value *link;
381     struct note_sub *note;
382     struct source_description *description;
383   } repository;
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;
390   struct source *next;
391   struct source *previous;
392 };
393
394 struct submitter {                    /* SUBMITTER_RECORD */
395   char *xrefstr;
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;
407 };
408
409 struct user_rec {
410   char *xrefstr;
411   char *tag;
412   char *str_value;
413   struct xref_value *xref_value;
414   struct user_data *extra;
415   struct user_rec *next;
416   struct user_rec *previous;
417 };
418
419 /* Functions */
420
421   /** \addtogroup gommain */
422   /** @{ */
423   /** \brief Parses an existing Gedcom file */
424 int  gom_parse_file(const char *file_name);
425   /** \brief Starts a new Gedcom model */
426 int  gom_new_model();
427   /** @} */
428
429   /** \addtogroup gom_write */
430   /** @{ */
431   /** \brief Write a Gedcom file */
432 int  gom_write_file(const char* file_name, int *total_conv_fails);
433   /** \brief Update the timestamp in a Gedcom model */
434 int  gom_header_update_timestamp(time_t t);
435   /** @} */
436   
437   /** \addtogroup gomget */
438   /** @{ */
439   /** \brief Retrieve header object
440       \return The header object */
441 struct header*     gom_get_header();
442   /** \brief Retrieve submission object
443       \return The submission object, or \c NULL if there is none */
444 struct submission* gom_get_submission();
445   /** \brief Retrieve first family object
446       \return The first family object, or \c NULL if there is none */
447 struct family*     gom_get_first_family();
448   /** \brief Retrieve family object by cross-reference
449       \param xref The cross-reference key of the object to retrieve
450       \return The object referenced by \c xref, \c NULL if it doesn't exist
451               or is not a family object */
452 struct family*     gom_get_family_by_xref(const char *xref);
453   /** \brief Retrieve first individual object
454       \return The first individual object, or \c NULL if there is none */
455 struct individual* gom_get_first_individual();
456   /** \brief Retrieve individual object by cross-reference
457       \param xref The cross-reference key of the object to retrieve
458       \return The object referenced by \c xref, \c NULL if it doesn't exist
459               or is not an individual object */
460 struct individual* gom_get_individual_by_xref(const char *xref);
461   /** \brief Retrieve first multimedia object
462       \return The first multimedia object, or \c NULL if there is none */
463 struct multimedia* gom_get_first_multimedia();
464   /** \brief Retrieve multimedia object by cross-reference
465       \param xref The cross-reference key of the object to retrieve
466       \return The object referenced by \c xref, \c NULL if it doesn't exist
467               or is not a multimedia object */
468 struct multimedia* gom_get_multimedia_by_xref(const char *xref);
469   /** \brief Retrieve first note object
470       \return The first note object, or \c NULL if there is none */
471 struct note*       gom_get_first_note();
472   /** \brief Retrieve note object by cross-reference
473       \param xref The cross-reference key of the object to retrieve
474       \return The object referenced by \c xref, \c NULL if it doesn't exist
475               or is not a note object */
476 struct note*       gom_get_note_by_xref(const char *xref);
477   /** \brief Retrieve first repository object
478       \return The first repository object, or \c NULL if there is none */
479 struct repository* gom_get_first_repository();
480   /** \brief Retrieve repository object by cross-reference
481       \param xref The cross-reference key of the object to retrieve
482       \return The object referenced by \c xref, \c NULL if it doesn't exist
483               or is not a repository object */
484 struct repository* gom_get_repository_by_xref(const char *xref);
485   /** \brief Retrieve first source object
486       \return The first source object, or \c NULL if there is none */
487 struct source*     gom_get_first_source();
488   /** \brief Retrieve source object by cross-reference
489       \param xref The cross-reference key of the object to retrieve
490       \return The object referenced by \c xref, \c NULL if it doesn't exist
491               or is not a source object */
492 struct source*     gom_get_source_by_xref(const char *xref);
493   /** \brief Retrieve first submitter object
494       \return The first submitter object, or \c NULL if there is none */
495 struct submitter*  gom_get_first_submitter();
496   /** \brief Retrieve submitter object by cross-reference
497       \param xref The cross-reference key of the object to retrieve
498       \return The object referenced by \c xref, \c NULL if it doesn't exist
499               or is not a submitter object */
500 struct submitter*  gom_get_submitter_by_xref(const char *xref);
501   /** \brief Retrieve first user record object
502       \return The first user record object, or \c NULL if there is none */
503 struct user_rec*   gom_get_first_user_rec();
504   /** \brief Retrieve user record object by cross-reference
505       \param xref The cross-reference key of the object to retrieve
506       \return The object referenced by \c xref, \c NULL if it doesn't exist
507               or is not a user record object */
508 struct user_rec*   gom_get_user_rec_by_xref(const char *xref);
509   /** @} */
510
511   /** \addtogroup gom_add_rec */
512   /** @{ */
513   /** \brief Add a submission record
514       \param xrefstr The cross-reference key for the new object
515       \return The new object if successful, \c NULL if an error happened (e.g.
516       the cross-reference is already in use */
517 struct submission* gom_new_submission(const char* xrefstr);
518   /** \brief Delete the submission record
519       \retval 0 if successful
520       \retval 1 if error */
521 int                gom_delete_submission();
522
523   /** \brief Add a new family record
524       \param xrefstr The cross-reference key for the new object
525       \return The new object if successful, \c NULL if an error happened (e.g.
526       the cross-reference is already in use */
527 struct family*     gom_new_family(const char* xrefstr);
528   /** \brief Delete an existing family record
529       \param obj The object to be deleted
530       \retval 0 if successful
531       \retval 1 if error */
532 int                gom_delete_family(struct family* obj);
533
534   /** \brief Add a new individual record
535       \param xrefstr The cross-reference key for the new object
536       \return The new object if successful, \c NULL if an error happened (e.g.
537       the cross-reference is already in use */
538 struct individual* gom_new_individual(const char* xrefstr);
539   /** \brief Delete an existing individual record
540       \param obj The object to be deleted
541       \retval 0 if successful
542       \retval 1 if error */
543 int                gom_delete_individual(struct individual* obj);
544
545   /** \brief Add a new multimedia record
546       \param xrefstr The cross-reference key for the new object
547       \return The new object if successful, \c NULL if an error happened (e.g.
548       the cross-reference is already in use */
549 struct multimedia* gom_new_multimedia(const char* xrefstr);
550   /** \brief Delete an existing multimedia record
551       \param obj The object to be deleted
552       \retval 0 if successful
553       \retval 1 if error */
554 int                gom_delete_multimedia(struct multimedia* obj);
555
556   /** \brief Add a new note record
557       \param xrefstr The cross-reference key for the new object
558       \return The new object if successful, \c NULL if an error happened (e.g.
559       the cross-reference is already in use */
560 struct note*       gom_new_note(const char* xrefstr);
561   /** \brief Delete an existing note record
562       \param obj The object to be deleted
563       \retval 0 if successful
564       \retval 1 if error */
565 int                gom_delete_note(struct note* obj);
566
567   /** \brief Add a new repository record
568       \param xrefstr The cross-reference key for the new object
569       \return The new object if successful, \c NULL if an error happened (e.g.
570       the cross-reference is already in use */
571 struct repository* gom_new_repository(const char* xrefstr);
572   /** \brief Delete an existing repository record
573       \param obj The object to be deleted
574       \retval 0 if successful
575       \retval 1 if error */
576 int                gom_delete_repository(struct repository* obj);
577
578   /** \brief Add a new source record
579       \param xrefstr The cross-reference key for the new object
580       \return The new object if successful, \c NULL if an error happened (e.g.
581       the cross-reference is already in use */
582 struct source*     gom_new_source(const char* xrefstr);
583   /** \brief Delete an existing source record
584       \param obj The object to be deleted
585       \retval 0 if successful
586       \retval 1 if error */
587 int                gom_delete_source(struct source* obj);
588
589   /** \brief Add a new submitter record
590       \param xrefstr The cross-reference key for the new object
591       \return The new object if successful, \c NULL if an error happened (e.g.
592       the cross-reference is already in use */
593 struct submitter*  gom_new_submitter(const char* xrefstr);
594   /** \brief Delete an existing submitter record
595       \param obj The object to be deleted
596       \retval 0 if successful
597       \retval 1 if error */
598 int                gom_delete_submitter(struct submitter* obj);
599
600   /** \brief Add a new user record
601       \param xrefstr The cross-reference key for the new object
602       \param tag The tag for the new object
603       \return The new object if successful, \c NULL if an error happened (e.g.
604       the cross-reference is already in use */
605 struct user_rec*   gom_new_user_rec(const char* xrefstr, const char* tag);
606   /** \brief Delete an existing user record
607       \param obj The object to be deleted
608       \retval 0 if successful
609       \retval 1 if error */
610 int                gom_delete_user_rec(struct user_rec* obj);
611   /** @} */
612
613   /** \addtogroup gom_mod_string */
614   /** @{ */
615   /** \brief Get string in UTF-8 encoding */
616 char* gom_get_string(char* data);
617   /** \brief Modify string using UTF-8 encoding */
618 char* gom_set_string(char** data, const char* utf8_str);
619
620   /** \brief Get string in encoding defined by current locale */
621 char* gom_get_string_for_locale(char* data, int* conversion_failures);
622   /** \brief Modify string using encoding defined by current locale */
623 char* gom_set_string_for_locale(char** data, const char* locale_str);
624   /** \brief Set the replacement string for conversion failures */
625 void  gom_set_unknown(const char* unknown);
626   /** @} */
627
628   /** \addtogroup gom_add_xref */
629   /** @{ */
630   /** \brief Direction of moving cross-references or sub-structures. */
631 enum _DIR {
632   MOVE_UP,    /**< Move up */
633   MOVE_DOWN   /**< Move down */
634 };
635
636   /** \brief Direction of moving cross-references or sub-structures. */
637   typedef enum _DIR Gom_direction;
638
639   /** \brief Modify a cross-reference */
640 struct xref_value* gom_set_xref(struct xref_value** data, const char* xref);
641   
642   /** \brief Add a cross-reference in a cross-reference list */
643 struct xref_list*  gom_add_xref(struct xref_list** data, const char* xref);
644   /** \brief Remove a cross-reference from a cross-reference list */
645 int                gom_remove_xref(struct xref_list** data, const char* xref);
646   /** \brief Move a cross-reference up or down in a cross-reference list */
647 int                gom_move_xref(Gom_direction dir, struct xref_list** data,
648                                  const char* xref);
649   /** @} */
650
651   /** \addtogroup gom_add_sub */
652   /** @{ */
653   /** \brief Create new address substructure */
654 struct address*    gom_set_new_address(struct address** obj);
655   /** \brief Delete an address substructure */
656 int                gom_delete_address(struct address** obj);
657
658   /** \brief Add new association substructure to the list */
659 struct association* gom_add_new_association(struct association** data);
660   /** \brief Remove an association substructure to the list */
661 int                gom_remove_association(struct association** data,
662                                           struct association* obj);
663   /** \brief Move an association substructure up or down in the list */
664 int                gom_move_association(Gom_direction dir,
665                                         struct association** data,
666                                         struct association* obj);
667   
668   /** \brief Create new change_date substructure */
669 struct change_date* gom_set_new_change_date(struct change_date** obj);
670   /** \brief Delete a change_date substructure */
671 int                 gom_delete_change_date(struct change_date** obj);
672   /** \brief Update the timestamp in a change_date substructure */
673 int                 gom_update_timestamp(struct change_date** obj, time_t t);
674
675   /** \brief Add new event substructure to the list */
676 struct event*      gom_add_new_event(struct event** data);
677   /** \brief Remove an event substructure to the list */
678 int                gom_remove_event(struct event** data, struct event* obj);
679   /** \brief Move an event substructure up or down in the list */
680 int                gom_move_event(Gom_direction dir, struct event** data,
681                                   struct event* obj);
682   
683   /** \brief Add new family_link substructure to the list */
684 struct family_link* gom_add_new_family_link(struct family_link** data);
685   /** \brief Remove a family_link substructure to the list */
686 int                gom_remove_family_link(struct family_link** data,
687                                           struct family_link* obj);
688   /** \brief Move a family_link substructure up or down in the list */
689 int                gom_move_family_link(Gom_direction dir,
690                                         struct family_link** data,
691                                         struct family_link* obj);
692   
693   /** \brief Add new lds_event substructure to the list */
694 struct lds_event*  gom_add_new_lds_event(struct lds_event** data);
695   /** \brief Remove an lds_event substructure to the list */
696 int                gom_remove_lds_event(struct lds_event** data,
697                                         struct lds_event* obj);
698   /** \brief Move an lds_event substructure up or down in the list */
699 int                gom_move_lds_event(Gom_direction dir,
700                                       struct lds_event** data,
701                                       struct lds_event* obj);
702   
703   /** \brief Add new multimedia_link substructure to the list */
704 struct multimedia_link*
705                    gom_add_new_multimedia_link(struct multimedia_link** data);
706   /** \brief Remove a multimedia_link substructure to the list */
707 int                gom_remove_multimedia_link(struct multimedia_link** data,
708                                               struct multimedia_link* obj);
709   /** \brief Move a multimedia_link substructure up or down in the list */
710 int                gom_move_multimedia_link(Gom_direction dir,
711                                             struct multimedia_link** data,
712                                             struct multimedia_link* obj);
713   
714   /** \brief Add new note substructure to the list */
715 struct note_sub*   gom_add_new_note_sub(struct note_sub** data);
716   /** \brief Remove a note substructure to the list */
717 int                gom_remove_note_sub(struct note_sub** data,
718                                        struct note_sub* obj);
719   /** \brief Move a note substructure up or down in the list */
720 int                gom_move_note_sub(Gom_direction dir,
721                                      struct note_sub** data,
722                                      struct note_sub* obj);
723   
724   /** \brief Add new pedigree substructure to the list */
725 struct pedigree*   gom_add_new_pedigree(struct pedigree** data);
726   /** \brief Remove a pedigree substructure to the list */
727 int                gom_remove_pedigree(struct pedigree** data,
728                                        struct pedigree* obj);
729   /** \brief Move a pedigree substructure up or down in the list */
730 int                gom_move_pedigree(Gom_direction dir,
731                                      struct pedigree** data,
732                                      struct pedigree* obj);
733   
734   /** \brief Add new personal_name substructure to the list */
735 struct personal_name* gom_add_new_personal_name(struct personal_name** data);
736   /** \brief Remove a personal_name substructure to the list */
737 int                gom_remove_personal_name(struct personal_name** data,
738                                             struct personal_name* obj);
739   /** \brief Move a personal_name substructure up or down in the list */
740 int                gom_move_personal_name(Gom_direction dir,
741                                           struct personal_name** data,
742                                           struct personal_name* obj);
743   
744   /** \brief Create new place substructure */
745 struct place*      gom_set_new_place(struct place** obj);
746   /** \brief Delete a place substructure */
747 int                gom_delete_place(struct place** obj);
748
749   /** \brief Add new source_citation substructure to the list */
750 struct source_citation*
751                    gom_add_new_source_citation(struct source_citation** data);
752   /** \brief Remove a source_citation substructure to the list */
753 int                gom_remove_source_citation(struct source_citation** data,
754                                               struct source_citation* obj);
755   /** \brief Move a source_citation substructure up or down in the list */
756 int                gom_move_source_citation(Gom_direction dir,
757                                             struct source_citation** data,
758                                             struct source_citation* obj);
759   
760   /** \brief Add new source_description substructure to the list */
761 struct source_description*
762               gom_add_new_source_description(struct source_description** data);
763   /** \brief Remove a source_description substructure to the list */
764 int           gom_remove_source_description(struct source_description** data,
765                                             struct source_description* obj);
766   /** \brief Move a source_description substructure up or down in the list */
767 int           gom_move_source_description(Gom_direction dir,
768                                           struct source_description** data,
769                                           struct source_description* obj);
770   
771   /** \brief Add new source_event substructure to the list */
772 struct source_event* gom_add_new_source_event(struct source_event** data);
773   /** \brief Remove a source_event substructure to the list */
774 int                gom_remove_source_event(struct source_event** data,
775                                            struct source_event* obj);
776   /** \brief Move a source_event substructure up or down in the list */
777 int                gom_move_source_event(Gom_direction dir,
778                                          struct source_event** data,
779                                          struct source_event* obj);
780   
781   /** \brief Add new text substructure to the list */
782 struct text*       gom_add_new_text(struct text** data);
783   /** \brief Remove a text substructure to the list */
784 int                gom_remove_text(struct text** data,
785                                    struct text* obj);
786   /** \brief Move a text substructure up or down in the list */
787 int                gom_move_text(Gom_direction dir,
788                                  struct text** data,
789                                  struct text* obj);
790   
791   /** \brief Add new user_data substructure to the list */
792 struct user_data*  gom_add_new_user_data(struct user_data** data);
793   /** \brief Remove a user_data substructure to the list */
794 int                gom_remove_user_data(struct user_data** data,
795                                         struct user_data* obj);
796   /** \brief Move a user_data substructure up or down in the list */
797 int                gom_move_user_data(Gom_direction dir,
798                                       struct user_data** data,
799                                       struct user_data* obj);
800   
801   /** \brief Add new user_ref_number substructure to the list */
802 struct user_ref_number*
803                    gom_add_new_user_ref_number(struct user_ref_number** data);
804   /** \brief Remove a user_ref_number substructure to the list */
805 int                gom_remove_user_ref_number(struct user_ref_number** data,
806                                               struct user_ref_number* obj);
807   /** \brief Move a user_ref_number substructure up or down in the list */
808 int                gom_move_user_ref_number(Gom_direction dir,
809                                             struct user_ref_number** data,
810                                             struct user_ref_number* obj);
811   /** @} */
812   
813 #ifdef __cplusplus
814 }
815 #endif
816
817 #endif /* __GEDCOM_GOM_H */