+<hr width="100%" size="2"><br>
+<h2><a name="C_object_model"></a>C object model</h2>
+In the GEDCOM object model, all the data is immediately available after calling <code>gom_parse_file()</code>. For this, an entire model based on C structs is used. These structs are documented <a href="gomxref.html">here</a>,
+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.<br>
+<br>
+<h3><a name="Main_functions"></a>Main functions<br>
+</h3>
+The following functions are available to get at these structs:<br>
+<ul>
+ <li>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):<br>
+ <blockquote><code>struct header* gom_get_header();<br>
+struct submission* gom_get_submission();<br>
+ </code></blockquote>
+ </li>
+ <li>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:<br>
+ <blockquote><code>struct XXX* gom_get_first_XXX();<br>
+struct XXX* gom_get_XXX_by_xref(char* xref);</code><br>
+ </blockquote>
+ </li>
+</ul>
+<blockquote>The XXX stands for one of the following: <code>family, </code><code>individual, multimedia, note, repository, source, submitter, user_rec</code>.<br>
+</blockquote>
+<h3><a name="Object_model_structure"></a>Object model structure<br>
+</h3>
+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 <code>next</code> member of the structs. This means that e.g. the following piece of code will traverse the linked list of family records:<br>
+<blockquote><code>struct family* fam;<br>
+ <br>
+for (fam = gom_get_first_family() ; fam ; fam = fam->next) {<br>
+ ...<br>
+}</code><br>
+</blockquote>
+The <code>next</code> member of the last element in the list is guaranteed to have the <code>NULL</code> value.<br>
+<br>
+Actually, the linked list is a doubly-linked list: each record also has a <code>previous</code> member. But for implementation reasons the behaviour of this <code>previous</code> member on the edges of the linked list will not be guaranteed, i.e. it can be circular or terminated with <code>NULL</code>, no assumptions can be made in the application code.<br>
+<br>
+This linked-list model applies also to all sub-structures of the main record structs, i.e. each struct that has a <code>next </code>and <code>previous</code>
+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 <a href="gomxref.html">here</a>):<br>
+<blockquote><code>struct family* fam = ...;<br>
+ <br>
+struct xref_list* xrl;<br>
+for (xrl = fam->children ; xrl ; xrl = xrl->next) {<br>
+ ...<br>
+}</code> <br>
+</blockquote>
+Note that all character strings in the object model are encoded in UTF-8 (<a href="file:///home/verthezp/src/external/gedcom-parse/doc/encoding.html">Why UTF-8?</a>).<br>
+<h3><a name="User_data"></a>User data</h3>
+Each of the structs has an extra member called <code>extra</code> (of type <code>struct user_data*</code>).
+ 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:<br>
+<ul>
+ <li>a level: the level number in the GEDCOM file</li>
+ <li>a tag: the tag given in the GEDCOM file</li>
+ <li>a value: the value, which can be a string value or a cross-reference value (one of the two will be non-NULL)<br>
+ </li>
+</ul>
+This way, none of the information in the GEDCOM file is lost, even the non-standard information.<br>