X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=doc%2Fusage.html;h=ee3d2d4b1133ea50d60f301feb1ef40107719a84;hb=7cbefaec45b82eb0449465da19d38a89f2ff2cf3;hp=ee3e248bae1331b1f9d175c2320c416ef024881d;hpb=7372fd1bb10934271adbb12fe27f45df8ea225d2;p=gedcom-parse.git
diff --git a/doc/usage.html b/doc/usage.html
index ee3e248..ee3d2d4 100644
--- a/doc/usage.html
+++ b/doc/usage.html
@@ -17,15 +17,7 @@
Start and end callbacks
Default callbacks
- C object model
-
-
- Other API functions
+ Other API functions
- Debugging
@@ -37,7 +29,7 @@
- Support for configure.in
- - Interface details of the callback parser
- C object model details
+ - Interface details of the callback parser
- C object model
@@ -154,7 +146,7 @@ way it wants. Warnings are similar, but use "Warning" instead of "Error"
Data callback mechanism
The most important use of the parser is of course to get the data
-out of the GEDCOM file. This section focuses on the callback mechanism (see the next section for the C object model). In fact, the mechanism involves two levels.
+out of the GEDCOM file. This section focuses on the callback mechanism (see here for the C object model). In fact, the mechanism involves two levels.
The primary level is that each of the sections in a GEDCOM file is
notified to the application code via a "start element" callback and an
@@ -419,72 +411,6 @@ raw_value, int parsed_tag)
of the "upper" tags has been subscribed upon.
-
-C object model
-In the GEDCOM object model, all the data is immediately available after calling gom_parse_file()
. 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.
-
-Main functions
-
-The following functions are available to get at these structs:
-
- - First, there are two functions to get the header record and the submission
-record (there can be only one of them in a GEDCOM file):
- struct header* gom_get_header();
-struct submission* gom_get_submission();
-
-
- - Further, for each of the other records, there are two functions, one
-to get the first of such records, and one to get a record via its cross-reference
-tag in the GEDCOM file:
- 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
.
-
-Object model structure
-
-All records of a certain type are linked together in a linked list. The
-above functions only give access to the first record of each linked list.
- The others can be accessed by traversing the linked list via the next
member of the structs. This means that e.g. the following piece of code will traverse the linked list of family records:
-struct family* fam;
-
-for (fam = gom_get_first_family() ; fam ; fam = fam->next) {
- ...
-}
-
-The next
member of the last element in the list is guaranteed to have the NULL
value.
-
-Actually, the linked list is a doubly-linked list: each record also has a 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.
-
-This linked-list model applies also to all sub-structures of the main record structs, i.e. each struct that has a 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):
-struct family* fam = ...;
-
-struct xref_list* xrl;
-for (xrl = fam->children ; xrl ; xrl = xrl->next) {
- ...
-}
-
-Note that all character strings in the object model are encoded in UTF-8 (Why UTF-8?).
-User data
-Each of the structs has an extra member called 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:
-
- - a level: the level number in the GEDCOM file
- - a tag: the tag given in the GEDCOM file
- - a value: the value, which can be a string value or a cross-reference value (one of the two will be non-NULL)
-
-
-This way, none of the information in the GEDCOM file is lost, even the non-standard information.
Other API functions
@@ -804,6 +730,7 @@ handle needs to be closed (when the program exits):
+