-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
- <title>Libgedcom interface details</title>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>Libgedcom interface details</title>
+
- <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
-</head>
- <body text="#000000" bgcolor="#ffffff" link="#000099" vlink="#990099" alink="#000099">
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"></head><body text="#000000" bgcolor="#ffffff" link="#000099" vlink="#990099" alink="#000099">
<h1 align="center">Libgedcom interface details</h1>
<br>
<li><a href="#Gedcom_val_types">Gedcom_val types</a></li>
<ul>
- <li><a href="#struct_date_value">struct date_value</a></li>
- <li><a href="#struct_date">struct date</a></li>
- <li><a href="#struct_xref_value">struct xref_value</a><br>
+ <li><a href="#date_value">struct date_value</a></li>
+ <li><a href="#date">struct date</a></li><li><a href="#age_value">struct age_value</a><br>
+ </li>
+
+ <li><a href="#xref_value">struct xref_value</a><br>
</li>
</ul>
ELT_SUB_INDIV_RESI,<br>
ELT_SUB_INDIV_BIRT,<br>
ELT_SUB_INDIV_GEN,<br>
- ELT_SUB_INDIV_ADOP<br>
- </code><br>
- <br>
+ ELT_SUB_INDIV_ADOP,<br>
+ELT_SUB_INDIV_EVEN</code><br>
</td>
<td valign="top"><code>STRING</code><br>
</td>
ELT_SUB_INDIV_RESI,<br>
ELT_SUB_INDIV_BIRT,<br>
ELT_SUB_INDIV_GEN,<br>
- ELT_SUB_INDIV_ADOP<br>
- </code><br>
- <br>
+ ELT_SUB_INDIV_ADOP,<br>
+ELT_SUB_INDIV_EVEN</code><br>
</td>
<td valign="top"><code>STRING</code><br>
</td>
</td>
<td valign="top"><code>REC_INDI</code><br>
</td>
- <td valign="top"><code>XREF_PTR(INDI)</code><br>
+ <td valign="top"><code>XREF_PTR(FAM),<br>
+XREF_PTR(INDI),<br>
+XREF_PTR(NOTE),<br>
+XREF_PTR(OBJE),<br>
+XREF_PTR(REPO),<br>
+XREF_PTR(SOUR),<br>
+XREF_PTR(SUBM),<br>
+XREF_PTR(SUBN)</code><br>
</td>
</tr>
<tr>
ELT_SUB_INDIV_RESI,<br>
ELT_SUB_INDIV_BIRT,<br>
ELT_SUB_INDIV_GEN,<br>
- ELT_SUB_INDIV_ADOP<br>
- </code><br>
+ ELT_SUB_INDIV_ADOP,<br>
+ELT_SUB_INDIV_EVEN</code><br>
</td>
<td valign="top"><code>STRING</code><br>
</td>
ELT_SUB_INDIV_RESI,<br>
ELT_SUB_INDIV_BIRT,<br>
ELT_SUB_INDIV_GEN,<br>
- ELT_SUB_INDIV_ADOP<br>
- </code><br>
- <br>
- <br>
+ ELT_SUB_INDIV_ADOP,<br>
+ELT_SUB_INDIV_EVEN</code><br>
</td>
<td valign="top"><code>DATE</code><br>
</td>
ELT_SUB_INDIV_RESI</code><code>,<br>
ELT_SUB_INDIV_BIRT,<br>
ELT_SUB_INDIV_GEN,<br>
- ELT_SUB_INDIV_ADOP</code><br>
- <br>
- <br>
+ ELT_SUB_INDIV_ADOP,<br>
+ELT_SUB_INDIV_EVEN</code><br>
</td>
- <td valign="top"><code>STRING</code><br>
+ <td valign="top"><code>AGE</code><br>
</td>
</tr>
<tr>
ELT_SUB_INDIV_RESI</code><code>,<br>
ELT_SUB_INDIV_BIRT,<br>
ELT_SUB_INDIV_GEN,<br>
- ELT_SUB_INDIV_ADOP</code><br>
- <br>
- <br>
+ ELT_SUB_INDIV_ADOP,<br>
+ELT_SUB_INDIV_EVEN</code><br>
</td>
<td valign="top"><code>STRING</code><br>
</td>
ELT_SUB_INDIV_RESI</code><code>,<br>
ELT_SUB_INDIV_BIRT,<br>
ELT_SUB_INDIV_GEN,<br>
- ELT_SUB_INDIV_ADOP</code><br>
- <br>
- <br>
+ ELT_SUB_INDIV_ADOP,<br>
+ELT_SUB_INDIV_EVEN</code><br>
</td>
<td valign="top"><code>STRING</code><br>
</td>
<td valign="top"><code>ELT_SUB_FAM_EVT_HUSB</code>,<br>
<code>ELT_SUB_FAM_EVT_WIFE</code><br>
</td>
- <td valign="top"><code>STRING</code><br>
+ <td valign="top"><code>AGE</code><br>
</td>
</tr>
<tr>
ELT_SUB_INDIV_BIRT,<br>
ELT_SUB_INDIV_GEN,<br>
ELT_SUB_INDIV_ADOP,<br>
+ELT_SUB_INDIV_EVEN,<br>
ELT_SUB_SOUR</code><br>
</td>
<td valign="top"><code>NULL<br>
ELT_SUB_INDIV_BIRT,<br>
ELT_SUB_INDIV_GEN,<br>
ELT_SUB_INDIV_ADOP,<br>
+ELT_SUB_INDIV_EVEN,<br>
ELT_SUB_LIO_BAPL,<br>
ELT_SUB_LIO_SLGC,<br>
ELT_SUB_LSS_SLGS,<br>
<td valign="top"><code>ELT_SUB_FAM_EVT</code>,<br>
<code>ELT_SUB_FAM_EVT_EVEN,<br>
ELT_SUB_INDIV_ATTR,<br>
- ELT_SUB_INDIV_RESI</code><br>
+ ELT_SUB_INDIV_RESI</code><code>,
+ <br>
+ELT_SUB_INDIV_BIRT,<br>
+ ELT_SUB_INDIV_GEN,<br>
+ ELT_SUB_INDIV_ADOP,<br>
+ELT_SUB_INDIV_EVEN</code><br>
</td>
<td valign="top"><code>STRING</code><br>
</td>
ELT_SUB_INDIV_BIRT,<br>
ELT_SUB_INDIV_GEN,<br>
ELT_SUB_INDIV_ADOP,<br>
+ELT_SUB_INDIV_EVEN,<br>
ELT_SUB_LIO_BAPL,<br>
ELT_SUB_LIO_SLGC,<br>
ELT_SUB_LSS_SLGS,<br>
<td valign="top"><code>struct date_value dv = GEDCOM_DATE(val);</code></td>
</tr>
<tr>
+ <td valign="top">age<br>
+ </td>
+ <td valign="top"><code>GEDCOM_IS_AGE(val)</code><br>
+ </td>
+ <td valign="top"><code>struct age_value age = GEDCOM_AGE(val);</code><br>
+ </td>
+ </tr>
+<tr>
<td valign="top">xref pointer<br>
</td>
<td valign="top"><code>GEDCOM_IS_XREF_PTR(val)</code><br>
<br>
The string value is the most general used value currently, for all
those values that don't have a more specific meaning. In essence,
-the value that is returned by GEDCOM_STRING is always the same as the
-raw_value passed to the start callback, and is thus in fact redundant.<br>
+the value that is returned by <code>GEDCOM_STRING(val)</code> is always the same as the
+<code>raw_value</code> passed to the start callback, and is thus in fact redundant.<br>
<br>
The date value is used for all elements that return a date. See
-<a href="#struct_date_value">here</a> for the definition.<br>
+<a href="#date_value">here</a> for the definition.<br>
<br>
The xref value is for cross-references between records in the file. See
-<a href="#struct_xref_value">here</a> for the definition.<br>
+<a href="#xref_value">here</a> for the definition.<br>
<br>
-<h3><a name="struct_date_value"></a>struct date_value</h3>
+<h3><a name="date_value"></a>struct date_value</h3>
This struct describes a date as given in the GEDCOM file, and has the
following definition:<br>
Date_value_type type;<br>
struct date date1;<br>
struct date date2;<br>
- char phrase[MAX_PHRASE_LEN
+ char phrase[MAX_PHRASE_LEN
+ 1];<br>
};</code><br>
</blockquote>
</table>
<br>
- <h3><a name="struct_date"></a>struct date<br>
+ <h3><a name="date"></a>struct date<br>
</h3>
The <code>date1</code> and <code>date2</code> also have a strict syntax:<br>
<blockquote>
- <blockquote>These are represented by 2 serial day numbers (<code>
- sdn1</code> and <code>sdn2</code>) and a <code>Date_type</code> equal
+
+ <blockquote>These are represented by 2 serial day numbers (<code>sdn1</code> and <code>sdn2</code>) and a <code>Date_type</code> equal
to <code>DATE_BOUNDED</code>.<br>
- <br>
+ <br>
+
For example, the Gregorian date "MAR 1990" is represented by the serial
day numbers for "1 MAR 1990" and "31 MAR 1990", and the Gregorian date
"1990" is represented by the serial day numbers for "1 JAN 1990" and "31
DEC 1990". Similarly for the other calendar types.<br>
+ </blockquote>
+
+ <br>
+</blockquote>
+<h3><a name="age_value"></a>struct age_value</h3>
+
+ This struct describes an age as given in the GEDCOM file, and has the
+ following definition:<br>
+
+
+<blockquote><code>struct age_value {<br>
+ Age_type type;<br>
+ Age_modifier mod;<br>
+ int years;<br>
+ int months;<br>
+ int days;<br>
+ char phrase[MAX_PHRASE_LEN
+ + 1];<br>
+ };</code><br>
+ </blockquote>
+<blockquote>
</blockquote>
- </blockquote>
+
- <h3><a name="struct_xref_value"></a>struct xref_value</h3>
+
+ It depends on the first member, the type, which members are actually
+ relevant:<br>
+<br>
+<table cellpadding="2" cellspacing="2" border="1" width="100%">
+<tbody><tr>
+ <td valign="top" align="center"><b>Age_type</b><br>
+ </td>
+ <td valign="top" align="center"><b>Meaning</b><br>
+ </td>
+ <td valign="top" align="center"><b>Relevant members</b><br>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top"><code>AGE_UNRECOGNIZED</code><br>
+ </td>
+ <td valign="top">format not recognized, full raw value in phrase<br>
+ </td>
+ <td valign="top">phrase<br>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top"><code>AGE_CHILD</code><br>
+ </td>
+ <td valign="top">the indication 'CHILD'<br>
+ </td>
+ <td valign="top">mod<br>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top"><code>AGE_INFANT</code><br>
+ </td>
+ <td valign="top">the indication 'INFANT'<br>
+ </td>
+ <td valign="top">mod<br>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top"><code>AGE_STILLBORN</code><br>
+ </td>
+ <td valign="top">the indication 'STILLBORN'<br>
+ </td>
+ <td valign="top">mod<br>
+</td></tr><tr>
+ <td valign="top"><code>AGE_NUMERIC</code><br>
+ </td>
+ <td valign="top">an indication in years, months and/or days (each can be -1 if not given)<br>
+ </td>
+ <td valign="top">mod, years, months, days<br>
+ </td>
+ </tr>
+</tbody>
+</table>
+<br>
+The modifier can be one of the following:<br>
+<ul>
+<li><code> AGE_NO_MODIFIER</code> : no modifier</li><li><code>AGE_LESS_THAN</code><code></code> : the modifier '<' is added</li><li><code>AGE_GREATER_THAN </code>: the modifier '>' is added</li>
+</ul>
+<br>
+<h3><a name="xref_value"></a>struct xref_value</h3>
+
This struct represents a cross-reference in the GEDCOM file (but note that
the <code>Gedcom_val</code> contains a pointer to such a struct, not the struct
itself). It is defined as:<br>
<li><code>XREF_REPO</code></li>
<li><code>XREF_SOUR</code></li>
<li><code>XREF_SUBM</code></li>
- <li><code>XREF_SUBN</code></li>
+ <li><code>XREF_SUBN</code></li><li><code>XREF_ANY</code> (if the type is not known, see below)<br>
+ </li>
+
<li><code>XREF_USER</code> (for application-specific cross-references)<br>
<code></code></li>
with the cross-reference, and then later extracted when the cross-reference
is used or defined again in the file. This relieves the application
from the burden of maintaining the mapping between cross-references and objects.<br>
+<br>
+The value <code>XREF_ANY</code> is used when the type of the object is not
+immediately known: it has to come from further information. This is
+the case in an association (<code>ELT_SUB_ASSO</code>): the type is then given by the <code>TYPE</code> subtag.<br>
<br>
- The parser checks whether all cross-references that are used are defined
-(if not, an error is produced) and whether all cross-references that are defined
-are used (if not, a warning is produced). It also checks whether the
-type of the cross-reference is the same on definition and use (if not, an
-error is produced).<br>
- <br>
+ The parser checks whether all cross-references that are used are defined
+ (if not, an error is produced) and whether all cross-references that are
+defined are used (if not, a warning is produced). It also checks whether
+the type of the cross-reference is the same on definition and use (if not,
+an error is produced). The first two checks are done at the end of
+the parsing, because cross-references can be defined after their usage in
+GEDCOM.<br>
+<br>
+An xref_value can also be retrieved by its key via the following function:<br>
+
+<blockquote><code>struct xref_value* <b>gedcom_get_by_xref</b> (char *key)</code><br>
+ </blockquote>
+The function returns <code>NULL</code> if the given key isn't used.<br>
<hr width="100%" size="2">
<pre>$Id$<br>$Name$<br></pre>
<br>
- </body>
- </html>
+ <br>
+<br>
+<br>
+<br>
+</body></html>