X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;ds=sidebyside;f=doc%2Fgom.html;fp=doc%2Fgom.html;h=84985a9267d05df396890cf54bb3effb040a28ed;hb=c7d446fe2de9a4b79a122dbe9310fc5c03764eca;hp=0000000000000000000000000000000000000000;hpb=1cf48191249776e09860fb40d6391777154d41a3;p=gedcom-parse.git diff --git a/doc/gom.html b/doc/gom.html new file mode 100644 index 0000000..84985a9 --- /dev/null +++ b/doc/gom.html @@ -0,0 +1,121 @@ +
gedcom_init
): either by starting from scratch, or by starting from a given GEDCOM file. This is done via the following two functions:+int gom_parse_file (const char* file_name)
+
+This initializes the object model by parsing the GEDCOM file given by+file_name
. It returns 0 on success and 1 on failure.
+
+In the GEDCOM object model, all the data is immediately available after callingint gom_new_model ()
+
+This starts an empty model. Actually, this is done by processing the file "+new.ged
" in the gedcom-parse data directory.
+
gom_parse_file()
or gom_new_model()
. For this, an entire model based on C structs is used. These structs are documented here,
+and follow the GEDCOM syntax quite closely. Each of the records in
+a GEDCOM file are modelled by a separate struct, and some common sub-structures
+have their own struct definition.struct header* gom_get_header();
+struct submission* gom_get_submission();
+
+ +struct XXX* gom_get_first_XXX();
+struct XXX* gom_get_XXX_by_xref(char* xref);
+
The XXX stands for one of the following:+family,
individual, multimedia, note, repository, source, submitter, user_rec
.
+
next
member of the structs. This means that e.g. the following piece of code will traverse the linked list of family records:+Thestruct family* fam;
+
+for (fam = gom_get_first_family() ; fam ; fam = fam->next) {
+ ...
+}
+
next
member of the last element in the list is guaranteed to have the NULL
value.previous
member. But for implementation reasons the behaviour of this previous
member on the edges of the linked list will not be guaranteed, i.e. it can be circular or terminated with NULL
, no assumptions can be made in the application code.next
and previous
+member following the above conventions. This means that the following
+piece of code traverses all children of a family (see the details of the
+different structs here):+Note that all character strings in the object model are encoded in UTF-8 (Why UTF-8?).struct family* fam = ...;
+
+struct xref_list* xrl;
+for (xrl = fam->children ; xrl ; xrl = xrl->next) {
+ ...
+}
+
extra
(of type struct user_data*
).
+ This gathers all non-standard GEDCOM tags within the scope of the struct
+in a flat linked list, no matter what the internal structure of the non-standard
+tags is. Each element of the linked list has:$Id$+ + +
$Name$
+ + +