From 1316fee80103b38bf682f5c626c0abaa525db41c Mon Sep 17 00:00:00 2001 From: Peter Verthez Date: Wed, 9 Jan 2002 16:55:47 +0000 Subject: [PATCH] Use own colors; specifically to have white background. --- doc/interface.html | 4037 ++++++++++++++++++++++---------------------- doc/links.html | 5 +- doc/parser.html | 208 +-- doc/usage.html | 767 ++++----- 4 files changed, 2517 insertions(+), 2500 deletions(-) diff --git a/doc/interface.html b/doc/interface.html index aab8221..74d5aad 100644 --- a/doc/interface.html +++ b/doc/interface.html @@ -2,2133 +2,2138 @@ Libgedcom interface details - + - - + +

Libgedcom interface details

-
- +
+

Index

- + -
- -
+
+ +

Record identifiers

- The following table describes the identifiers to be used in the record - callbacks.  The last columns gives the - Gedcom_val type of the xref and val - arguments in the header start callback.
+ The following table describes the identifiers to be used in the record + callbacks.  The last columns gives the + Gedcom_val type of the xref and  +val arguments in the header start callback.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Record
+
Meaning
+
Possible
+  xref types

+
Possible
+ val types
+

+
REC_HEAD
+
The header of the GEDCOM file
+
NULL
+
NULL
+
REC_FAM
+
A record describing a family
+
XREF_PTR(FAM)
+
NULL
+
REC_INDI
+
A record describing an individual
+
XREF_PTR(INDI)
+
NULL
+
REC_OBJE
+
A record describing a multimedia object
+
XREF_PTR(OBJE)
+
NULL
+
REC_NOTE
+
A record describing a note
+
XREF_PTR(NOTE)
+
STRING
+
REC_REPO
+
A record describing a source repository
+
XREF_PTR(REPO)
+
NULL
+
REC_SOUR
+
A record describing a source
+
XREF_PTR(SOUR)
+
NULL
+
REC_SUBN
+
A record describing the submission
+
XREF_PTR(SUBN)
+
NULL
+
REC_SUBM
+
A record describing the submitter
+
XREF_PTR(SUBM)
+
NULL
+
REC_USER
+
An application-specific record (the tag + in the start callback contains the actually used tag).
+
NULL
+ XREF_PTR(USER)
+

+
NULL
+ STRING
+ XREF_PTR(USER)

+
+ +
+

Element identifiers

+ The following table describes the identifiers to be used in the element + callbacks.  The last column gives the + Gedcom_val type of the val argument in the +element start callback.

- +
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - - - - + - - - - + - - - - + - - - - + - - + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + - + + + - + + - - - - + - - - + - - - + - -
Record
+
Element
+
Possible
+ tags
+

+
Used within
+
Possible
+ val types
+

+
ELT_HEAD_SOUR
+
SOUR
+
REC_HEAD
+
STRING
+
ELT_HEAD_SOUR_VERS
+
VERS
+
ELT_HEAD_SOUR
+
STRING
+
ELT_HEAD_SOUR_NAME
+
NAME
+
ELT_HEAD_SOUR
+
STRING
+
ELT_HEAD_SOUR_CORP
+
CORP
+
ELT_HEAD_SOUR
+
STRING
+
ELT_HEAD_SOUR_DATA
+
DATA
+
ELT_HEAD_SOUR
+
STRING
+
ELT_HEAD_SOUR_DATA_DATE
+
DATE
+
ELT_HEAD_SOUR_DATA
+
DATE
+
ELT_HEAD_SOUR_DATA_COPR
+
COPR
+
ELT_HEAD_SOUR_DATA
+
STRING
+
ELT_HEAD_DEST
+
DEST
+
REC_HEAD
+
STRING
+
ELT_HEAD_DATE
+
DATE
+
REC_HEAD
+
DATE
+
ELT_HEAD_DATE_TIME
+
TIME
+
ELT_HEAD_DATE
+
STRING
+
ELT_HEAD_SUBM
+
SUBM
+
REC_HEAD
+
XREF_PTR(SUBM)
+
ELT_HEAD_SUBN
+
SUBN
+
REC_HEAD
+
XREF_PTR(SUBN)
+
ELT_HEAD_FILE
+
FILE
+
REC_HEAD
+
STRING
+
ELT_HEAD_COPR
+
COPR
+
REC_HEAD
+
STRING
+
ELT_HEAD_GEDC
+
GEDC
+
REC_HEAD
+
NULL
+
ELT_HEAD_GEDC_VERS
+
VERS
+
ELT_HEAD_GEDC
+
STRING
+
ELT_HEAD_GEDC_FORM
+
FORM
+
ELT_HEAD_GEDC
+
STRING
+
ELT_HEAD_CHAR
+
CHAR
+
REC_HEAD
+
STRING
+
ELT_HEAD_CHAR_VERS
+
VERS
+
ELT_HEAD_CHAR
+
STRING
+
ELT_HEAD_LANG
+
LANG
+
REC_HEAD
+
STRING
+
ELT_HEAD_PLAC
+
PLAC
+
REC_HEAD
+
NULL
+
ELT_HEAD_PLAC_FORM
+
FORM
+
ELT_HEAD_PLAC
+
STRING
+
ELT_HEAD_NOTE
+
NOTE
+
REC_HEAD
+
STRING
+
ELT_FAM_HUSB
+
HUSB
+
REC_FAM
+
XREF_PTR(INDI)
+
ELT_FAM_WIFE
+
WIFE
+
REC_FAM
+
XREF_PTR(INDI)
+
ELT_FAM_CHIL
+
CHIL
+
REC_FAM
+
XREF_PTR(INDI)
+
ELT_FAM_NCHI
+
NCHI
+
REC_FAM
+
STRING
+
ELT_FAM_SUBM
+
SUBM
+
REC_FAM
+
XREF_PTR(SUBM)
+
ELT_INDI_RESN
+
RESN
+
REC_INDI
+
STRING
+
ELT_INDI_SEX
+
SEX
+
REC_INDI
+
STRING
+
ELT_INDI_SUBM
+
SUBM
+
REC_INDI
+
XREF_PTR(SUBM)
+
ELT_INDI_ALIA
+
ALIA
+
REC_INDI
+
XREF_PTR(INDI)
+
ELT_INDI_ANCI
+
ANCI
+
REC_INDI
+
XREF_PTR(SUBM)
+
ELT_INDI_DESI
+
DESI
+
REC_INDI
+
XREF_PTR(SUBM)
+
ELT_INDI_RFN
+
RFN
+
REC_INDI
+
STRING
+
ELT_INDI_AFN
+
AFN
+
REC_INDI
+
STRING
+
ELT_OBJE_FORM
+
FORM
+
REC_OBJE
+
STRING
+
ELT_OBJE_TITL
+
TITL
+
REC_OBJE
+
STRING
+
ELT_OBJE_BLOB
+
BLOB
+
REC_OBJE
+
NULL
+
ELT_OBJE_BLOB_CONT
+
CONT
+
ELT_OBJE_BLOB
+
STRING
+
ELT_OBJE_OBJE
+
OBJE
+
REC_OBJE
+
XREF_PTR(OBJE)
+
ELT_REPO_NAME
+
NAME
+
REC_REPO
+
STRING
+
ELT_SOUR_DATA
+
DATA
+
REC_SOUR
+
NULL
+
ELT_SOUR_DATA_EVEN
+
EVEN
+
ELT_SOUR_DATA
+
STRING
+
ELT_SOUR_DATA_EVEN_DATE
+
DATE
+
ELT_SOUR_DATA_EVEN
+
DATE
+
ELT_SOUR_DATA_EVEN_PLAC
+
PLAC
+
ELT_SOUR_DATA_EVEN
+
STRING
+
ELT_SOUR_DATA_AGNC
+
AGNC
+
ELT_SOUR_DATA
+
STRING
+
ELT_SOUR_AUTH
+
AUTH
+
REC_SOUR
+
STRING
+
ELT_SOUR_TITL
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ELT_SUB_FAM_EVT_HUSB
+
HUSB
+
ELT_SUB_FAM_EVT,
+ ELT_SUB_FAM_EVT_EVEN
+
NULL
+
ELT_SUB_FAM_EVT_WIFE
+
WIFE
+
ELT_SUB_FAM_EVT,
+ ELT_SUB_FAM_EVT_EVEN
+
NULL
+
ELT_SUB_FAM_EVT_AGE
+
AGE
+
ELT_SUB_FAM_EVT_HUSB,
+ ELT_SUB_FAM_EVT_WIFE
+
STRING
+
ELT_SUB_FAM_EVT_EVEN
+
EVEN
+
REC_FAM
+
NULL
+
ELT_SUB_IDENT_REFN
+
REFN
+
REC_FAM, REC_INDI,
+ REC_OBJE, REC_NOTE,
+ REC_REPO, REC_SOUR
+

+
STRING
+
ELT_SUB_IDENT_REFN_TYPE
+
TYPE
+
ELT_SUB_IDENT_REFN
+
STRING
+
ELT_SUB_IDENT_RIN
+
RIN
+
REC_FAM, REC_INDI,
+ REC_OBJE, REC_NOTE,
+ REC_REPO, REC_SOUR
+

+
STRING
+
ELT_SUB_INDIV_ATTR
+
CAST, DSCR, EDUC,
+ IDNO, NATI, NCHR,
+ NMR, OCCU, PROP,
+ RELI, SSN, TITL

+
REC_INDI
+
STRING
+
ELT_SUB_INDIV_RESI
+
RESI
+
REC_INDI
+
NULL
+
ELT_SUB_INDIV_BIRT
+
BIRT, CHR
+
REC_INDI
+
NULL
+ STRING

+
ELT_SUB_INDIV_BIRT_FAMC
+
FAMC
+
ELT_SUB_INDIV_BIRT
+
XREF_PTR(FAM)
+
ELT_SUB_INDIV_GEN
+
DEAT, BURI, CREM,
+ BAPM, BARM, BASM,
+ BLES, CHRA, CONF,
+ FCOM, ORDN, NATU,
+ EMIG, IMMI, CENS,
+ PROB, WILL, GRAD,
+ RETI

+
REC_INDI
+
NULL
+ STRING

+
ELT_SUB_INDIV_ADOP
+
ADOP
+
REC_INDI
+
NULL
+ STRING

+
ELT_SUB_INDIV_ADOP_FAMC
+
FAMC
+
ELT_SUB_INDIV_ADOP
+
XREF_PTR(FAM)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IV_GEN,
+ ELT_SUB_INDIV_ADOP,
+ ELT_SUB_SOUR

+
NULL
+ XREF_PTR(OBJE)
+

+
ELT_SUB_MULTIM_OBJE_FORM
+
FORM
+
ELT_SUB_MULTIM_OBJE
+
STRING
+
ELT_SUB_MULTIM_OBJE_TITL
+
TITL
+
ELT_SUB_MULTIM_OBJE
+
STRING
+
ELT_SUB_MULTIM_OBJE_FILE
+
FILE
+
ELT_SUB_MULTIM_OBJE
+
STRING
+
ELT_SUB_NOTE
+
NOTE
+
REC_FAM, REC_INDI,
+ REC_OBJE, REC_REPO,
+ REC_SOUR, ELT_SOUR_DATA,
+ ELT_SUB_ASSO, ELT_SUB_CHAN,
+ ELT_SUB_FAMC,
ELT_SUB_FAM_EVT,
+ ELT_SUB_FAM_EVT_EVEN,
+ ELT_SUB_INDIV_ATTR,
+ ELT_SUB_INDIV_RESI
,
+ ELT_SUB_INDIV_BIRT,
+ ELT_SUB_INDIV_GEN,
+ ELT_SUB_INDIV_ADOP,
+ ELT_SUB_LIO_BAPL,
+ ELT_SUB_LIO_SLGC,
+ ELT_SUB_LSS_SLGS,
+ ELT_SUB_MULTIM_OBJE,
+ ELT_SUB_PERS_NAME,
+ ELT_SUB_PLAC,
+ ELT_SUB_SOUR,
+ ELT_SUB_REPO,
+ ELT_SUB_FAMS

+
NULL
+ STRING
+ XREF_PTR(NOTE)
+

+
ELT_SUB_PERS_NAME
+
NAME
+
REC_INDI
+
STRING
+
ELT_SUB_PERS_NAME_NPFX
Meaning
+
NPFX
Possible
-  xref types

+
ELT_SUB_PERS_NAME
+
STRING
Possible
- val types
-

-
REC_HEAD
+
ELT_SUB_PERS_NAME_GIVN
The header of the GEDCOM file
+
GIVN
NULL
+
ELT_SUB_PERS_NAME
+
STRING
NULL
-
REC_FAM
+
ELT_SUB_PERS_NAME_NICK
A record describing a family
+
NICK
XREF_PTR(FAM)
+
ELT_SUB_PERS_NAME
+
STRING
NULL
-
REC_INDI
+
ELT_SUB_PERS_NAME_SPFX
A record describing an individual
+
SPFX
XREF_PTR(INDI)
+
ELT_SUB_PERS_NAME
+
STRING
NULL
-
REC_OBJE
+
ELT_SUB_PERS_NAME_SURN
A record describing a multimedia object
+
SURN
XREF_PTR(OBJE)
+
ELT_SUB_PERS_NAME
+
STRING
NULL
-
REC_NOTE
+
ELT_SUB_PERS_NAME_NSFX
+
NSFX
A record describing a note
+
ELT_SUB_PERS_NAME
XREF_PTR(NOTE)
+
STRING
STRING
-
REC_REPO
+
ELT_SUB_PLAC
A record describing a source repository
+
PLAC
XREF_PTR(REPO)
+
ELT_SUB_FAM_EVT,
+ ELT_SUB_FAM_EVT_EVEN,
+ ELT_SUB_INDIV_ATTR,
+ ELT_SUB_INDIV_RESI

+
STRING
+
ELT_SUB_PLAC_FORM
+
FORM
+
ELT_SUB_PLAC
+
STRING
+
ELT_SUB_SOUR
+
SOUR
+
REC_FAM, REC_INDI,
+ REC_NOTE, ELT_SUB_ASSO
+
ELT_SUB_FAM_EVT,
+
ELT_SUB_FAM_EVT_EVEN,
+ ELT_SUB_INDIV_ATTR,
+ ELT_SUB_INDIV_RESI
,
+ ELT_SUB_INDIV_BIRT,
+ ELT_SUB_INDIV_GEN,
+ ELT_SUB_INDIV_ADOP,
+ ELT_SUB_LIO_BAPL,
+ ELT_SUB_LIO_SLGC,
+ ELT_SUB_LSS_SLGS,
+ ELT_SUB_NOTE,
+ ELT_SUB_PERS_NAME,
+ ELT_SUB_PLAC

+
STRING
+ XREF_PTR(SOUR)

+
ELT_SUB_SOUR_PAGE
+
PAGE
+
ELT_SUB_SOUR
+
STRING
+
ELT_SUB_SOUR_EVEN
+
EVEN
+
ELT_SUB_SOUR
+
STRING
+
ELT_SUB_SOUR_EVEN_ROLE
+
ROLE
+
ELT_SUB_SOUR_EVEN
+
STRING
+
ELT_SUB_SOUR_DATA
+
DATA
+
ELT_SUB_SOUR
+
NULL
+
ELT_SUB_SOUR_DATA_DATE
+
DATE
+
ELT_SUB_SOUR_DATA
+
DATE
+
ELT_SUB_SOUR_TEXT
+
TEXT
+
ELT_SUB_SOUR
+ ELT_SUB_SOUR_DATA

+
STRING
NULL
-
ELT_SUB_SOUR_QUAY
+
QUAY
+
ELT_SUB_SOUR
+
STRING
+
ELT_SUB_REPO
+
REPO
+
REC_SOUR
A record describing a source
+
XREF_PTR(REPO)
+
ELT_SUB_REPO_CALN
XREF_PTR(SOUR)
+
CALN
+
ELT_SUB_REPO
+
STRING
NULL
-
REC_SUBN
+
ELT_SUB_REPO_CALN_MEDI
A record describing the submission
+
MEDI
XREF_PTR(SUBN)
+
ELT_SUB_REPO_CALN
+
STRING
NULL
-
REC_SUBM
+
ELT_SUB_FAMS
A record describing the submitter
+
FAMS
+
REC_INDI
XREF_PTR(SUBM)
+
XREF_PTR(FAM)
NULL
-
REC_USER
+
ELT_USER
+
any tag starting
+ with an underscore

An application-specific record (the tag - in the start callback contains the actually used tag).
+
anywhere
NULL
-XREF_PTR(USER)
-

+ STRING
+ XREF_PTR(USER)
NULL
-STRING
-XREF_PTR(USER)

-
- -
-

Element identifiers

- The following table describes the identifiers to be used in the element - callbacks.  The last column gives the - Gedcom_val type of the val argument in the element - start callback.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Element
-
Possible
- tags
-

-
Used within
-
Possible
- val types
-

-
ELT_HEAD_SOUR
-
SOUR
-
REC_HEAD
-
STRING
-
ELT_HEAD_SOUR_VERS
-
VERS
-
ELT_HEAD_SOUR
-
STRING
-
ELT_HEAD_SOUR_NAME
-
NAME
-
ELT_HEAD_SOUR
-
STRING
-
ELT_HEAD_SOUR_CORP
-
CORP
-
ELT_HEAD_SOUR
-
STRING
-
ELT_HEAD_SOUR_DATA
-
DATA
-
ELT_HEAD_SOUR
-
STRING
-
ELT_HEAD_SOUR_DATA_DATE
-
DATE
-
ELT_HEAD_SOUR_DATA
-
DATE
-
ELT_HEAD_SOUR_DATA_COPR
-
COPR
-
ELT_HEAD_SOUR_DATA
-
STRING
-
ELT_HEAD_DEST
-
DEST
-
REC_HEAD
-
STRING
-
ELT_HEAD_DATE
-
DATE
-
REC_HEAD
-
DATE
-
ELT_HEAD_DATE_TIME
-
TIME
-
ELT_HEAD_DATE
-
STRING
-
ELT_HEAD_SUBM
-
SUBM
-
REC_HEAD
-
XREF_PTR(SUBM)
-
ELT_HEAD_SUBN
-
SUBN
-
REC_HEAD
-
XREF_PTR(SUBN)
-
ELT_HEAD_FILE
-
FILE
-
REC_HEAD
-
STRING
-
ELT_HEAD_COPR
-
COPR
-
REC_HEAD
-
STRING
-
ELT_HEAD_GEDC
-
GEDC
-
REC_HEAD
-
NULL
-
ELT_HEAD_GEDC_VERS
-
VERS
-
ELT_HEAD_GEDC
-
STRING
-
ELT_HEAD_GEDC_FORM
-
FORM
-
ELT_HEAD_GEDC
-
STRING
-
ELT_HEAD_CHAR
-
CHAR
-
REC_HEAD
-
STRING
-
ELT_HEAD_CHAR_VERS
-
VERS
-
ELT_HEAD_CHAR
-
STRING
-
ELT_HEAD_LANG
-
LANG
-
REC_HEAD
-
STRING
-
ELT_HEAD_PLAC
-
PLAC
-
REC_HEAD
-
NULL
-
ELT_HEAD_PLAC_FORM
-
FORM
-
ELT_HEAD_PLAC
-
STRING
-
ELT_HEAD_NOTE
-
NOTE
-
REC_HEAD
-
STRING
-
ELT_FAM_HUSB
-
HUSB
-
REC_FAM
-
XREF_PTR(INDI)
-
ELT_FAM_WIFE
-
WIFE
-
REC_FAM
-
XREF_PTR(INDI)
-
ELT_FAM_CHIL
-
CHIL
-
REC_FAM
-
XREF_PTR(INDI)
-
ELT_FAM_NCHI
-
NCHI
-
REC_FAM
-
STRING
-
ELT_FAM_SUBM
-
SUBM
-
REC_FAM
-
XREF_PTR(SUBM)
-
ELT_INDI_RESN
-
RESN
-
REC_INDI
-
STRING
-
ELT_INDI_SEX
-
SEX
-
REC_INDI
-
STRING
-
ELT_INDI_SUBM
-
SUBM
-
REC_INDI
-
XREF_PTR(SUBM)
-
ELT_INDI_ALIA
-
ALIA
-
REC_INDI
-
XREF_PTR(INDI)
-
ELT_INDI_ANCI
-
ANCI
-
REC_INDI
-
XREF_PTR(SUBM)
-
ELT_INDI_DESI
-
DESI
-
REC_INDI
-
XREF_PTR(SUBM)
-
ELT_INDI_RFN
-
RFN
-
REC_INDI
-
STRING
-
ELT_INDI_AFN
-
AFN
-
REC_INDI
-
STRING
-
ELT_OBJE_FORM
-
FORM
-
REC_OBJE
-
STRING
-
ELT_OBJE_TITL
-
TITL
-
REC_OBJE
-
STRING
-
ELT_OBJE_BLOB
-
BLOB
-
REC_OBJE
-
NULL
-
ELT_OBJE_BLOB_CONT
-
CONT
-
ELT_OBJE_BLOB
-
STRING
-
ELT_OBJE_OBJE
-
OBJE
-
REC_OBJE
-
XREF_PTR(OBJE)
-
ELT_REPO_NAME
-
NAME
-
REC_REPO
-
STRING
-
ELT_SOUR_DATA
-
DATA
-
REC_SOUR
-
NULL
-
ELT_SOUR_DATA_EVEN
-
EVEN
-
ELT_SOUR_DATA
-
STRING
-
ELT_SOUR_DATA_EVEN_DATE
-
DATE
-
ELT_SOUR_DATA_EVEN
-
DATE
-
ELT_SOUR_DATA_EVEN_PLAC
-
PLAC
-
ELT_SOUR_DATA_EVEN
-
STRING
-
ELT_SOUR_DATA_AGNC
-
AGNC
-
ELT_SOUR_DATA
-
STRING
-
ELT_SOUR_AUTH
-
AUTH
-
REC_SOUR
-
STRING
-
ELT_SOUR_TITL
-
TITL
-
REC_SOUR
-
STRING
-
ELT_SOUR_ABBR
-
ABBR
-
REC_SOUR
-
STRING
-
ELT_SOUR_PUBL
-
PUBL
-
REC_SOUR
-
STRING
-
ELT_SOUR_TEXT
-
TEXT
-
REC_SOUR
-
STRING
-
ELT_SUBN_SUBM
-
SUBM
-
REC_SUBN
-
XREF_PTR(SUBM)
-
ELT_SUBN_FAMF
-
FAMF
-
REC_SUBN
-
STRING
-
ELT_SUBN_TEMP
-
TEMP
-
REC_SUBN
-
STRING
-
ELT_SUBN_ANCE
-
ANCE
-
REC_SUBN
-
STRING
-
ELT_SUBN_DESC
-
DESC
-
REC_SUBN
-
STRING
-
ELT_SUBN_ORDI
-
ORDI
-
REC_SUBN
-
STRING
-
ELT_SUBN_RIN
-
RIN
-
REC_SUBN
-
STRING
-
ELT_SUBM_NAME
-
NAME
-
REC_SUBM
-
STRING
-
ELT_SUBM_LANG
-
LANG
-
REC_SUBM
-
STRING
-
ELT_SUBM_RFN
-
RFN
-
REC_SUBM
-
STRING
-
ELT_SUBM_RIN
-
RIN
-
REC_SUBM
-
STRING
-
ELT_SUB_ADDR
-
ADDR
-
ELT_HEAD_SOUR_CORP,
- REC_REPO, REC_SUBM,
-
ELT_SUB_FAM_EVT,
- ELT_SUB_FAM_EVT_EVEN,
- ELT_SUB_INDIV_ATTR,
- ELT_SUB_INDIV_RESI,
- ELT_SUB_INDIV_BIRT,
- ELT_SUB_INDIV_GEN,
- ELT_SUB_INDIV_ADOP
-

-
-
STRING
-
ELT_SUB_ADDR_CONT
-
CONT
-
ELT_SUB_ADDR
-
STRING
-
ELT_SUB_ADDR_ADR1
-
ADR1
-
ELT_SUB_ADDR
-
STRING
-
ELT_SUB_ADDR_ADR2
-
ADR2
-
ELT_SUB_ADDR
-
STRING
-
ELT_SUB_ADDR_CITY
-
CITY
-
ELT_SUB_ADDR
-
STRING
-
ELT_SUB_ADDR_STAE
-
STAE
-
ELT_SUB_ADDR
-
STRING
-
ELT_SUB_ADDR_POST
-
POST
-
ELT_SUB_ADDR
-
STRING
-
ELT_SUB_ADDR_CTRY
-
CTRY
-
ELT_SUB_ADDR
-
STRING
-
ELT_SUB_PHON
-
PHON
-
ELT_HEAD_SOUR_CORP,
- REC_REPO, REC_SUBM,
-
ELT_SUB_FAM_EVT,
-
ELT_SUB_FAM_EVT_EVEN,
- ELT_SUB_INDIV_ATTR,
- ELT_SUB_INDIV_RESI,
- ELT_SUB_INDIV_BIRT,
- ELT_SUB_INDIV_GEN,
- ELT_SUB_INDIV_ADOP
-

-
-
STRING
-
ELT_SUB_ASSO
-
ASSO
-
REC_INDI
-
XREF_PTR(INDI)
-
ELT_SUB_ASSO_TYPE
-
TYPE
-
ELT_SUB_ASSO
-
STRING
-
ELT_SUB_ASSO_RELA
-
RELA
-
ELT_SUB_ASSO
-
STRING
-
ELT_SUB_CHAN
-
CHAN
-
REC_FAM, REC_INDI,
- REC_OBJE, REC_NOTE,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_SUB_INDIV_GEN,
- ELT_SUB_INDIV_ADOP

-
-
-
STRING
-
ELT_SUB_EVT_AGNC
-
AGNC
-
ELT_SUB_FAM_EVT,
-
ELT_SUB_FAM_EVT_EVEN,
- ELT_SUB_INDIV_ATTR,
- ELT_SUB_INDIV_RESI
,
- ELT_SUB_INDIV_BIRT,
- ELT_SUB_INDIV_GEN,
- ELT_SUB_INDIV_ADOP

-
-
-
STRING
-
ELT_SUB_EVT_CAUS
-
CAUS
-
ELT_SUB_FAM_EVT,
-
ELT_SUB_FAM_EVT_EVEN,
- ELT_SUB_INDIV_ATTR,
- ELT_SUB_INDIV_RESI
,
- ELT_SUB_INDIV_BIRT,
- ELT_SUB_INDIV_GEN,
- ELT_SUB_INDIV_ADOP

-
-
-
STRING
-
ELT_SUB_FAM_EVT
-
ANUL, CENS, DIV,
- DIVF, ENGA, MARR,
- MARB, MARC, MARL,
- MARS

-
REC_FAM
-
NULL
- STRING

-
ELT_SUB_FAM_EVT_HUSB
-
HUSB
-
ELT_SUB_FAM_EVT,
- ELT_SUB_FAM_EVT_EVEN
-
NULL
-
ELT_SUB_FAM_EVT_WIFE
-
WIFE
-
ELT_SUB_FAM_EVT,
- ELT_SUB_FAM_EVT_EVEN
-
NULL
-
ELT_SUB_FAM_EVT_AGE
-
AGE
-
ELT_SUB_FAM_EVT_HUSB,
- ELT_SUB_FAM_EVT_WIFE
-
STRING
-
ELT_SUB_FAM_EVT_EVEN
-
EVEN
-
REC_FAM
-
NULL
-
ELT_SUB_IDENT_REFN
-
REFN
-
REC_FAM, REC_INDI,
- REC_OBJE, REC_NOTE,
- REC_REPO, REC_SOUR
-

-
STRING
-
ELT_SUB_IDENT_REFN_TYPE
-
TYPE
-
ELT_SUB_IDENT_REFN
-
STRING
-
ELT_SUB_IDENT_RIN
-
RIN
-
REC_FAM, REC_INDI,
- REC_OBJE, REC_NOTE,
- REC_REPO, REC_SOUR
-

-
STRING
-
ELT_SUB_INDIV_ATTR
-
CAST, DSCR, EDUC,
- IDNO, NATI, NCHR,
- NMR, OCCU, PROP,
- RELI, SSN, TITL

-
REC_INDI
-
STRING
-
ELT_SUB_INDIV_RESI
-
RESI
-
REC_INDI
-
NULL
-
ELT_SUB_INDIV_BIRT
-
BIRT, CHR
-
REC_INDI
-
NULL
- STRING

-
ELT_SUB_INDIV_BIRT_FAMC
-
FAMC
-
ELT_SUB_INDIV_BIRT
-
XREF_PTR(FAM)
-
ELT_SUB_INDIV_GEN
-
DEAT, BURI, CREM,
- BAPM, BARM, BASM,
- BLES, CHRA, CONF,
- FCOM, ORDN, NATU,
- EMIG, IMMI, CENS,
- PROB, WILL, GRAD,
- RETI

-
REC_INDI
-
NULL
- STRING

-
ELT_SUB_INDIV_ADOP
-
ADOP
-
REC_INDI
-
NULL
- STRING

-
ELT_SUB_INDIV_ADOP_FAMC
-
FAMC
-
ELT_SUB_INDIV_ADOP
-
XREF_PTR(FAM)
-
ELT_SUB_INDIV_ADOP_FAMC_ADOP
-
ADOP
-
ELT_SUB_INDIV_ADOP_FAMC
-
STRING
-
ELT_SUB_INDIV_EVEN
-
EVEN
-
REC_INDI
-
NULL
-
ELT_SUB_LIO_BAPL
-
BAPL, CONL, ENDL
-
REC_INDI
-
NULL
-
ELT_SUB_LIO_BAPL_STAT
-
STAT
-
ELT_SUB_LIO_BAPL,
- ELT_SUB_LIO_SLGC
-

-
STRING
-
ELT_SUB_LIO_BAPL_DATE
-
DATE
-
ELT_SUB_LIO_BAPL,
- ELT_SUB_LIO_SLGC
-

-
-
DATE
-
ELT_SUB_LIO_BAPL_TEMP
-
TEMP
-
ELT_SUB_LIO_BAPL,
- ELT_SUB_LIO_SLGC
-

-
-
STRING
-
ELT_SUB_LIO_BAPL_PLAC
-
PLAC
-
ELT_SUB_LIO_BAPL,
- ELT_SUB_LIO_SLGC
-

-
-
STRING
-
ELT_SUB_LIO_SLGC
-
SLGC
-
REC_INDI
-
NULL
-
ELT_SUB_LIO_SLGC_FAMC
-
FAMC
-
ELT_SUB_L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B_MULTIM_OBJE,
- ELT_SUB_PERS_NAME,
- ELT_SUB_PLAC,
- ELT_SUB_SOUR,
- ELT_SUB_REPO,
- ELT_SUB_FAMS

-
NULL
- STRING
-XREF_PTR(NOTE)
-

-
ELT_SUB_PERS_NAME
-
NAME
-
REC_INDI
-
STRING
-
ELT_SUB_PERS_NAME_NPFX
-
NPFX
-
ELT_SUB_PERS_NAME
-
STRING
-
ELT_SUB_PERS_NAME_GIVN
-
GIVN
-
ELT_SUB_PERS_NAME
-
STRING
-
ELT_SUB_PERS_NAME_NICK
-
NICK
-
ELT_SUB_PERS_NAME
-
STRING
-
ELT_SUB_PERS_NAME_SPFX
-
SPFX
-
ELT_SUB_PERS_NAME
-
STRING
-
ELT_SUB_PERS_NAME_SURN
-
SURN
-
ELT_SUB_PERS_NAME
-
STRING
-
ELT_SUB_PERS_NAME_NSFX
-
NSFX
-
ELT_SUB_PERS_NAME
-
STRING
-
ELT_SUB_PLAC
-
PLAC
-
ELT_SUB_FAM_EVT,
- ELT_SUB_FAM_EVT_EVEN,
- ELT_SUB_INDIV_ATTR,
- ELT_SUB_INDIV_RESI

-
STRING
-
ELT_SUB_PLAC_FORM
-
FORM
-
ELT_SUB_PLAC
-
STRING
-
ELT_SUB_SOUR
-
SOUR
-
REC_FAM, REC_INDI,
- REC_NOTE, ELT_SUB_ASSO
-
ELT_SUB_FAM_EVT,
-
ELT_SUB_FAM_EVT_EVEN,
- ELT_SUB_INDIV_ATTR,
- ELT_SUB_INDIV_RESI
,
- ELT_SUB_INDIV_BIRT,
- ELT_SUB_INDIV_GEN,
- ELT_SUB_INDIV_ADOP,
- ELT_SUB_LIO_BAPL,
- ELT_SUB_LIO_SLGC,
- ELT_SUB_LSS_SLGS,
- ELT_SUB_NOTE,
- ELT_SUB_PERS_NAME,
- ELT_SUB_PLAC

-
STRING
-XREF_PTR(SOUR)

-
ELT_SUB_SOUR_PAGE
-
PAGE
-
ELT_SUB_SOUR
-
STRING
-
ELT_SUB_SOUR_EVEN
-
EVEN
-
ELT_SUB_SOUR
-
STRING
-
ELT_SUB_SOUR_EVEN_ROLE
-
ROLE
-
ELT_SUB_SOUR_EVEN
-
STRING
-
ELT_SUB_SOUR_DATA
-
DATA
-
ELT_SUB_SOUR
-
NULL
-
ELT_SUB_SOUR_DATA_DATE
-
DATE
-
ELT_SUB_SOUR_DATA
-
DATE
-
ELT_SUB_SOUR_TEXT
-
TEXT
-
ELT_SUB_SOUR
- ELT_SUB_SOUR_DATA

-
STRING
-
ELT_SUB_SOUR_QUAY
-
QUAY
-
ELT_SUB_SOUR
-
STRING
-
ELT_SUB_REPO
-
REPO
-
REC_SOUR
-
XREF_PTR(REPO)
-
ELT_SUB_REPO_CALN
-
CALN
-
ELT_SUB_REPO
-
STRING
-
ELT_SUB_REPO_CALN_MEDI
-
MEDI
-
ELT_SUB_REPO_CALN
-
STRING
-
ELT_SUB_FAMS
-
FAMS
-
REC_INDI
-
XREF_PTR(FAM)
-
ELT_USER
-
any tag starting
- with an underscore

-
anywhere
-
NULL
- STRING
-XREF_PTR(USER)

-
- -
+ +

Gedcom_val types
-

- Currently, the specific Gedcom_val types are (with - val of type Gedcom_val):
-
- + + Currently, the specific Gedcom_val types are (with + val of type Gedcom_val):
+
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +

-
type checker
-
cast operator
-
null value
-
GEDCOM_IS_NULL(val)
-
N/A
-
string
-
GEDCOM_IS_STRING(val)
-
char* str = GEDCOM_STRING(val);
-
date
-
GEDCOM_IS_DATE(val)
-
struct date_value dv = GEDCOM_DATE(val);
xref pointer
-
GEDCOM_IS_XREF_PTR(val)
-
struct xref_value *xr = GEDCOM_XREF_PTR(val);
-

+
type checker
+
cast operator
+
null value
+
GEDCOM_IS_NULL(val)
+
N/A
+
string
+
GEDCOM_IS_STRING(val)
+
char* str = GEDCOM_STRING(val);
+
date
+
GEDCOM_IS_DATE(val)
+
struct date_value dv = GEDCOM_DATE(val);
xref pointer
+
GEDCOM_IS_XREF_PTR(val)
+
struct xref_value *xr = GEDCOM_XREF_PTR(val);
+
-
-
- The type checker returns a true or a false value according to the type - of the value, but this is in principle only necessary in the rare circumstances - that two types are possible, or where an optional value can be provided. -  In most cases, the type is fixed for a specific tag.
-
- The null value is used for when the GEDCOM spec doesn't allow a value, - or when an optional value is allowed but none is given.
-  
- 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.
-
- The date value is used for all elements that return a date.  See +
+
+ The type checker returns a true or a false value according to the +type of the value, but this is in principle only necessary in the rare +circumstances that two types are possible, or where an optional value +can be provided.  In most cases, the type is fixed for a specific +tag.
+
+ The null value is used for when the GEDCOM spec doesn't allow a value, + or when an optional value is allowed but none is given.
+  
+ 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.
+
+ The date value is used for all elements that return a date.  See here for the definition.
-
-The xref value is for cross-references between records in the file.  See +
+ The xref value is for cross-references between records in the file.  See here for the definition.
-
- +
+

struct date_value

- This struct describes a date as given in the GEDCOM file, and has the -following definition:
- + This struct describes a date as given in the GEDCOM file, and has the + following definition:
+
struct date_value {
-   Date_value_type  type;
-   struct date      date1;
-   struct date      date2;
-   char              phrase[MAX_PHRASE_LEN +   Date_value_type  type;
+   struct date      date1;
+   struct date      date2;
+   char              phrase[MAX_PHRASE_LEN + 1];
- };

-
- It depends on the first member, the type, which members are actually + };
+ + It depends on the first member, the type, which members are actually relevant:
-
- +
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + +
Date_value_type
-
Meaning
-
Relevant members
-
DV_NO_MODIFIER
-
just a simple date
-
date1
-
DV_BEFORE
-
a range (BEFORE date1)
-
date1
-
DV_AFTER
-
a range (AFTER date1)
-
date1
-
DV_BETWEEN
-
a range (BETWEEN date1 AND date2)
-
date1, date2
-
DV_FROM
-
a period (FROM date1)
-
date1
-
DV_TO
-
a period (TO date1)
-
date1
-
DV_FROM_TO
-
a period (FROM date1 TO date2)
-
date1, date2
-
DV_ABOUT
-
an approximation (ABOUT date1)
-
date1
-
DV_CALCULATED
-
an approximation (CALCULATED date1)
-
date1
-
DV_ESTIMATED
-
an approximation (ESTIMATED date1)
-
date1
-
DV_INTERPRETED
-
INTERPRETED date1 FROM a given free form date +
Date_value_type
+
Meaning
+
Relevant members
+
DV_NO_MODIFIER
+
just a simple date
+
date1
+
DV_BEFORE
+
a range (BEFORE date1)
+
date1
+
DV_AFTER
+
a range (AFTER date1)
+
date1
+
DV_BETWEEN
+
a range (BETWEEN date1 AND date2)
+
date1, date2
+
DV_FROM
+
a period (FROM date1)
+
date1
+
DV_TO
+
a period (TO date1)
+
date1
+
DV_FROM_TO
+
a period (FROM date1 TO date2)
+
date1, date2
+
DV_ABOUT
+
an approximation (ABOUT date1)
+
date1
+
DV_CALCULATED
+
an approximation (CALCULATED date1)
+
date1
+
DV_ESTIMATED
+
an approximation (ESTIMATED date1)
+
date1
+
DV_INTERPRETED
+
INTERPRETED date1 FROM a given free form date phrase
-
date1, phrase
-
DV_PHRASE
-
a free form date phrase
-
phrase
-
date1, phrase
+
DV_PHRASE
+
a free form date phrase
+
phrase
+
-
- +
+

struct date
-

- The date1 and date2 also have a strict syntax:
- + + The date1 and date2 also have a strict syntax:
+
struct date {
-   Calendar_type  cal;
-   char           day_str[MAX_DAY_LEN + +   Calendar_type  cal;
+   char           day_str[MAX_DAY_LEN + 1];
-   char           month_str[MAX_MONTH_LEN +   char           month_str[MAX_MONTH_LEN + 1];
-   char           year_str[MAX_YEAR_LEN +   char           year_str[MAX_YEAR_LEN + 1];
-
-   int            day;
-   int            month;
-   int            year;
-   Year_type      year_type;
-
-   Date_type      type;
-   long int       sdn1;
-   long int       sdn2;
- };

-
- The first four fields are the primary fields parsed from the value in -the GEDCOM file.  The day_str, month_str and - year_str are the literal parts of the date that denote +
+   int            day;
+   int            month;
+   int            year;
+   Year_type      year_type;
+
+   Date_type      type;
+   long int       sdn1;
+   long int       sdn2;
+ };
+ + The first four fields are the primary fields parsed from the value in + the GEDCOM file.  The day_str, month_str + and year_str are the literal parts of the date that denote the day, month and year (the day_str and month_str - can be empty) .  The calendar type cal is one of (see + can be empty) .  The calendar type cal is one of (see calendar overview LINK TBD):
- + - The next four fields are deduced from the first four:
- + The next four fields are deduced from the first four:
+ - It is possible that the year_str is given as e.g. "1677/78". -  This is coming from a date in a so called "annunciation style", where - the year began on 25 March: "20 March 1677/78" is 20 March 1677 in "annunciation - style" and 20 March 1678 in "circumcision style" (the current style).  See - calendar overview (LINK TBD).
-
- In this case, the year will contain the "circumcision style" + It is possible that the year_str is given as e.g. "1677/78". +  This is coming from a date in a so called "annunciation style", where + the year began on 25 March: "20 March 1677/78" is 20 March 1677 in "annunciation + style" and 20 March 1678 in "circumcision style" (the current style).  See + calendar overview (LINK TBD).
+
+ In this case, the year will contain the "circumcision style" year (1678 in the example), and year_type will be YEAR_DOUBLE. -  Normal dates will have a year_type equal to - YEAR_SINGLE .
-
- Finally, the last three fields are probably the most interesting values - for applications that want to process dates.  Basically, the date is - converted to a serial day number (aka Julian day), which is the unique day - number since November 25, 4714 BC in the Gregorian calendar.  The advantage - of these day numbers is that they are unique and independent of the calendar - system.  Furthermore, date differences can just be computed by subtracting - the serial day numbers.
-
- However, since dates in GEDCOM are not necessarily exact (e.g. "MAR 1990"), - it is not possible to represent all GEDCOM dates with 1 serial day number. -  Two cases can be distinguished:
- +  Normal dates will have a year_type equal to + YEAR_SINGLE .
+
+ Finally, the last three fields are probably the most interesting values + for applications that want to process dates.  Basically, the date +is converted to a serial day number (aka Julian day), which is the unique +day number since November 25, 4714 BC in the Gregorian calendar.  The +advantage of these day numbers is that they are unique and independent +of the calendar system.  Furthermore, date differences can just be +computed by subtracting the serial day numbers.
+
+ However, since dates in GEDCOM are not necessarily exact (e.g. "MAR +1990"), it is not possible to represent all GEDCOM dates with 1 serial +day number.  Two cases can be distinguished:
+ - -
+ +
These are represented by a serial day number in sdn1 - and a Date_type equal to DATE_EXACT.
-
-
- + and a Date_type equal to DATE_EXACT.
+
+ + - -
+ +
+
These are represented by 2 serial day numbers ( - sdn1 and sdn2) and a Date_type equal + sdn1 and sdn2) and a Date_type equal to DATE_BOUNDED.
-
- 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.
-
-
- +
+ 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.
+
+ +

struct xref_value

-This struct represents a cross-reference in the GEDCOM file (but note that -the Gedcom_val contains a pointer to such a struct, not the -struct itself).  It is defined as:
+ This struct represents a cross-reference in the GEDCOM file (but note that +the Gedcom_val contains a pointer to such a struct, not the struct +itself).  It is defined as:
+
struct xref_value {
-  Xref_type   type,
-  char*       string,
-  Gedcom_ctxt object
-};

-
-The Xref_type gives the type of the cross-reference and can +   Xref_type   type,
+   char*       string,
+   Gedcom_ctxt object
+ };
+ + The Xref_type gives the type of the cross-reference and can be one of:
+ -The string gives the actual cross-reference string from the -GEDCOM file, and the object is initially NULL, -but can be filled by the application with an object (of any type) that corresponds -with the cross-reference, and then later extracted when the cross-reference -is used or defined again in the file.  This relieves the application + The string gives the actual cross-reference string from the +GEDCOM file, and the object is initially NULL, but +can be filled by the application with an object (of any type) that corresponds +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.
-
-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 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).
+
+ +
$Id$
$Name$
-
- +
+ diff --git a/doc/links.html b/doc/links.html index c0018d7..c56ceb1 100644 --- a/doc/links.html +++ b/doc/links.html @@ -2,9 +2,10 @@ GEDCOM links + - -TO BE COMPLETED + + TO BE COMPLETED diff --git a/doc/parser.html b/doc/parser.html index 4ff35cd..a707693 100644 --- a/doc/parser.html +++ b/doc/parser.html @@ -1,124 +1,126 @@ - + The Gedcom parser library - - -
+ + +

The Gedcom parser library

- -
The intention of this page is to provide some explanation - of the gedcom parser, to aid development on and with it.  First, some -practical issues of testing with the parser will be explained.
-
- + +
The intention of this page is to provide some explanation + of the gedcom parser, to aid development on and with it.  First, +some practical issues of testing with the parser will be explained.
+
+

Basic testing
-

- You should be able to perform a basic test using the commands:
- + + You should be able to perform a basic test using the commands:
+
./configure
- make
- make check

-
- If everything goes OK, you'll see that some gedcom files are parsed, - and that each parse is successful.  Note that the used gedcom files - are made by Heiner - Eichmann and are an excellent way to test gedcom parsers thoroughly.
-
- + make
+ make check
+ + If everything goes OK, you'll see that some gedcom files are parsed, + and that each parse is successful.  Note that the used gedcom files + are made by Heiner + Eichmann and are an excellent way to test gedcom parsers thoroughly.
+
+

Preparing for further testing

- The basic testing described above doesn't show anything else than -"Parse succeeded", which is nice, but not very interesting.  Some -more detailed tests are possible, via the testgedcom program + The basic testing described above doesn't show anything else than +"Parse succeeded", which is nice, but not very interesting.  Some +more detailed tests are possible, via the testgedcom program that is generated by make test.  
-
- However, since the output that testgedcom generates is - in UTF-8 format (more on this later), some preparation is necessary to -have a full view on it.  Basically, you need a terminal that understands - and can display UTF-8 encoded characters, and you need to proper fonts installed - to display them.  I'll give some advice on this here, based on the - Red Hat 7.1 distribution that I use, with glibc 2.2 and XFree86 4.0.x.  Any - other distribution that has the same or newer versions for these components - should give the same results.
-
- For the first issue, the UTF-8 capable terminal, the safest bet is -to use xterm in its unicode mode (which is supported by the - xterm coming with XFree86 4.0.x).  UTF-8 capabilities - have only recently been added to gnome-terminal, so probably +
+ However, since the output that testgedcom generates +is in UTF-8 format (more on this later), some preparation is necessary +to have a full view on it.  Basically, you need a terminal that understands + and can display UTF-8 encoded characters, and you need to proper fonts +installed to display them.  I'll give some advice on this here, +based on the Red Hat 7.1 distribution that I use, with glibc 2.2 and XFree86 +4.0.x.  Any other distribution that has the same or newer versions +for these components should give the same results.
+
+ For the first issue, the UTF-8 capable terminal, the safest bet is + to use xterm in its unicode mode (which is supported by +the xterm coming with XFree86 4.0.x).  UTF-8 capabilities + have only recently been added to gnome-terminal, so probably that is not in your distribution yet (it certainly isn't in Red Hat 7.1).
-
- For the second issue, you'll need the ISO 10646-1 fonts.  These - come also with XFree86 4.0.x.
-
- The way to start xterm in unicode mode is then e.g. (put - everything on 1 line !):
- -
LANG=en_GB.UTF-8 xterm -bg 'black' -fg 'DarkGrey' -cm - -fn '-Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO10646-1'
-
- This first sets the LANG variable to a locale that - uses UTF-8, and then starts xterm with a proper Unicode font. -  Some sample UTF-8 plain text files can be found - here .  Just cat them on the command line -and see the result.
-
- +
+ For the second issue, you'll need the ISO 10646-1 fonts.  These + come also with XFree86 4.0.x.
+
+ The way to start xterm in unicode mode is then e.g. +(put everything on 1 line !):
+ +
LANG=en_GB.UTF-8 xterm -bg 'black' -fg 'DarkGrey' -cm + -fn '-Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO10646-1'
+
+ This first sets the LANG variable to a locale that + uses UTF-8, and then starts xterm with a proper Unicode font. +  Some sample UTF-8 plain text files can be found + here .  Just cat them on the command line + and see the result.
+
+

Testing the parser with debugging

- Given the UTF-8 capable terminal, you can now let the testgedcom - program print the values that it parses.  An example of a command - line is (in the gedcom directory):
- + Given the UTF-8 capable terminal, you can now let the testgedcom + program print the values that it parses.  An example of a command + line is (in the gedcom directory):
+
./testgedcom -dg t/ulhc.ged
-
- The -dg option instructs the parser to show its own debug - messages  (see ./testgedcom -h for the full set of options). -  If everything is OK, you'll see the values from the gedcom file, containing - a lot of special characters.
-
- For the ANSEL test file (t/ansel.ged), you have to set -the environment variable GCONV_PATH to the ansel - subdirectory of the gedcom directory:
- + + The -dg option instructs the parser to show its own debug + messages  (see ./testgedcom -h for the full set of options). +  If everything is OK, you'll see the values from the gedcom file, +containing a lot of special characters.
+
+ For the ANSEL test file (t/ansel.ged), you have to set + the environment variable GCONV_PATH to the ansel + subdirectory of the gedcom directory:
+
export GCONV_PATH=./ansel
- ./testgedcom -dg t/ansel.ged
-
- This is because for the ANSEL character set an extra module is needed - for the iconv library (more on this later).  But again, this should - show a lot of special characters.
-
- + ./testgedcom -dg t/ansel.ged
+ + This is because for the ANSEL character set an extra module is needed + for the iconv library (more on this later).  But again, this should + show a lot of special characters.
+
+

Testing the lexers separately

- The lexers themselves can be tested separately.  For the 1-byte - lexer (i.e. supporting the encodings with 1 byte per characters, such -as ASCII, ANSI and ANSEL), the sequence of commands would be:
- + The lexers themselves can be tested separately.  For the 1-byte + lexer (i.e. supporting the encodings with 1 byte per characters, such as + ASCII, ANSI and ANSEL), the sequence of commands would be:
+
make clean
- make test_1byte
-
- This will show all tokens in the t/allged.ged test file.  Similar - tests can be done using make test_hilo and make test_lohi - (for the unicode lexers).
-
- This concludes the testing setup.  Now for some explanations...
-
- + make test_1byte
+ + This will show all tokens in the t/allged.ged test file. + Similar tests can be done using make test_hilo and +make test_lohi (for the unicode lexers).
+
+ This concludes the testing setup.  Now for some explanations...
+
+ +

Structure of the parser

- I see the structure of a program using the gedcom parser as follows:
-
- Gedcom parsing scheme -
-
-
- TO BE COMPLETED...
- -
+ I see the structure of a program using the gedcom parser as follows:
+
+ Gedcom parsing scheme +
+
+
+ TO BE COMPLETED...
+ +
$Id$
$Name$
-
-
-
- +
+
+
+ + diff --git a/doc/usage.html b/doc/usage.html index fbdcf1d..762a4b0 100644 --- a/doc/usage.html +++ b/doc/usage.html @@ -2,450 +2,459 @@ Using the GEDCOM parser library - + - - + +

Using the GEDCOM parser library

-
- +
+

Index

- + - -
-

Overview
-

- The GEDCOM parser library is built as a callback-based parser (comparable - to the SAX interface of XML).  It comes with:
+
+

Overview
+

+ The GEDCOM parser library is built as a callback-based parser (comparable + to the SAX interface of XML).  It comes with:
+ - Next to these, there is also a data directory in $PREFIX/share/gedcom-parse - that contains some additional stuff, but which is not immediately important - at first.  I'll leave the description of the data directory for later.
-
- The very simplest call of the gedcom parser is simply the following -piece of code (include of the gedcom header is assumed, as everywhere in + Next to these, there is also a data directory in $PREFIX/share/gedcom-parse + that contains some additional stuff, but which is not immediately +important at first.  I'll leave the description of the data directory +for later.
+
+ The very simplest call of the gedcom parser is simply the following +piece of code (include of the gedcom header is assumed, as everywhere in this manual):
- +
int result;
- ...
- result = gedcom_parse_file("myfamily.ged");
-
- Although this will not provide much information, one thing it does is - parse the entire file and return the result.  The function returns -0 on success and 1 on failure.  No other information is available using + ...
+ result = gedcom_parse_file("myfamily.ged");
+ + Although this will not provide much information, one thing it does +is parse the entire file and return the result.  The function returns +0 on success and 1 on failure.  No other information is available using this function only.
-
- The next sections will refine this to be able to have meaningful errors - and the actual data that is in the file.
- -
+
+ The next sections will refine this to be able to have meaningful errors + and the actual data that is in the file.
+ +

Error handling

- Since this is a relatively simple topic, it is discussed before the actual - callback mechanism, although it also uses a callback...
-
- The library can be used in several different circumstances, both terminal-based - as GUI-based.  Therefore, it leaves the actual display of the error - message up to the application.  For this, the application needs to -register a callback before parsing the GEDCOM file, which will be called -by the library on errors, warnings and messages.
-
- A typical piece of code would be:
- -
void my_message_handler (Gedcom_msg_type type, + Since this is a relatively simple topic, it is discussed before the +actual callback mechanism, although it also uses a callback...
+
+ The library can be used in several different circumstances, both terminal-based + as GUI-based.  Therefore, it leaves the actual display of the error + message up to the application.  For this, the application needs to register + a callback before parsing the GEDCOM file, which will be called by the library + on errors, warnings and messages.
+
+ A typical piece of code would be:
+ +
void my_message_handler (Gedcom_msg_type type, char *msg)
- {
-   ...
- }
- ...
- gedcom_set_message_handler(my_message_handler);
- ...
- result = gedcom_parse_file("myfamily.ged");

-
- In the above piece of code, my_message_handler is the callback + {
+   ...
+ }
+ ...
+ gedcom_set_message_handler(my_message_handler);
+ ...
+ result = gedcom_parse_file("myfamily.ged");

+
+ In the above piece of code, my_message_handler is the callback that will be called for errors (type=ERROR), warnings ( - type=WARNING) and messages (type=MESSAGE).  The - callback must have the signature as in the example.  For errors, the + type=WARNING) and messages (type=MESSAGE).  The + callback must have the signature as in the example.  For errors, the msg passed to the callback will have the format:
- +
Error on line <lineno>: <actual_message>
-
- Note that the entire string will be properly internationalized, and encoded - in UTF-8 (see "Why UTF-8?"  LINK TBD).  Also, no newline - is appended, so that the application program can use it in any way it wants. -  Warnings are similar, but use "Warning" instead of "Error".  Messages - are plain text, without any prefix.
-
- With this in place, the resulting code will already show errors and warnings - produced by the parser, e.g. on the terminal if a simple printf - is used in the message handler.
- -
+ + Note that the entire string will be properly internationalized, and +encoded in UTF-8 (see "Why UTF-8?"  LINK TBD).  Also, +no newline is appended, so that the application program can use it in any +way it wants.  Warnings are similar, but use "Warning" instead of +"Error".  Messages are plain text, without any prefix.
+
+ With this in place, the resulting code will already show errors and +warnings produced by the parser, e.g. on the terminal if a simple +printf is used in the message handler.
+ +

Data callback mechanism

- The most important use of the parser is of course to get the data out -of the GEDCOM file.  As already mentioned, the parser uses a callback + The most important use of the parser is of course to get the data out + of the GEDCOM file.  As already mentioned, the parser uses a callback mechanism for that.  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 "end element" - callback (much like in a SAX interface for XML), i.e. when a line containing - a certain tag is parsed, the "start element" callback is called for that - tag, and when all its subordinate lines with their tags have been processed, - the "end element" callback is called for the original tag.  Since GEDCOM - is hierarchical, this results in properly nested calls to appropriate "start +
+ 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 "end element" + callback (much like in a SAX interface for XML), i.e. when a line containing + a certain tag is parsed, the "start element" callback is called for that + tag, and when all its subordinate lines with their tags have been processed, + the "end element" callback is called for the original tag.  Since GEDCOM + is hierarchical, this results in properly nested calls to appropriate "start element" and "end element" callbacks.
-
- However, it would be typical for a genealogy program to support only -a subset of the GEDCOM standard, certainly a program that is still under -development.  Moreover, under GEDCOM it is allowed for an application -to define its own tags, which will typically not  be supported by another -application.  Still, in that case, data preservation is important; -it would hardly be accepted that information that is not understood by -a certain program is just removed.
-
- Therefore, the second level of callbacks involves a "default callback". -  An application needs to subscribe to callbacks for tags it does support, - and need to provide a "default callback" which will be called for tags it - doesn't support.  The application can then choose to just store the -information that comes via the default callback in plain textual format.
-
- After this introduction, let's see what the API looks like...
-
- +
+ However, it would be typical for a genealogy program to support only +a subset of the GEDCOM standard, certainly a program that is still under +development.  Moreover, under GEDCOM it is allowed for an application +to define its own tags, which will typically not  be supported by another +application.  Still, in that case, data preservation is important; +it would hardly be accepted that information that is not understood by a +certain program is just removed.
+
+ Therefore, the second level of callbacks involves a "default callback". +  An application needs to subscribe to callbacks for tags it does support, + and need to provide a "default callback" which will be called for tags +it doesn't support.  The application can then choose to just store +the information that comes via the default callback in plain textual format.
+
+ After this introduction, let's see what the API looks like...
+
+

Start and end callbacks

- +

Callbacks for records
-

- As a simple example, we will get some information from the header of + + As a simple example, we will get some information from the header of a GEDCOM file.  First, have a look at the following piece of code:
- -
Gedcom_ctxt my_header_start_cb (int level, + +
Gedcom_ctxt my_header_start_cb (int level,
-                      +                                 Gedcom_val xref,
-                      +                                 char *tag,
-                      +                                 char *raw_value,
-                      +                                 int parsed_tag,
-                      +                                 Gedcom_val parsed_value)
- {
-   printf("The header starts\n");
-   return (Gedcom_ctxt)1;
- }
-
- void my_header_end_cb (Gedcom_ctxt self)
- {
-   printf("The header ends, context is %d\n", self);   /* context + {
+   printf("The header starts\n");
+   return (Gedcom_ctxt)1;
+ }
+
+ void my_header_end_cb (Gedcom_ctxt self)
+ {
+   printf("The header ends, context is %d\n", self);   /* context will print as "1" */
- }
-
- ...
- gedcom_subscribe_to_record(REC_HEAD, my_header_start_cb, - my_header_end_cb);
- ...
- result = gedcom_parse_file("myfamily.ged");

-
- Using the gedcom_subscribe_to_record function, the application - requests to use the specified callbacks as start and end callback. The -end callback is optional: you can pass NULL if you are not -interested in the end callback.  The identifiers to use as first argument -to the function (here REC_HEAD) are described in the - interface details.
-
- From the name of the function it becomes clear that this function is -specific to complete records.  For the separate elements in records -there is another function, which we'll see shortly.  Again, the callbacks + }
+
+ ...
+ gedcom_subscribe_to_record(REC_HEAD, my_header_start_cb, + my_header_end_cb);
+ ...
+ result = gedcom_parse_file("myfamily.ged");

+
+ Using the gedcom_subscribe_to_record function, the application + requests to use the specified callbacks as start and end callback. The end + callback is optional: you can pass NULL if you are not interested + in the end callback.  The identifiers to use as first argument to +the function (here REC_HEAD) are described in the + interface details.
+
+ From the name of the function it becomes clear that this function is +specific to complete records.  For the separate elements in records +there is another function, which we'll see shortly.  Again, the callbacks need to have the signatures as shown in the example.
-
- The Gedcom_ctxt type that is used as a result of the start - callback and as an argument to the end callback is vital for passing context - necessary for the application.  This type is meant to be opaque; in -fact, it's a void pointer, so you can pass anything via it.  The important - thing to know is that the context that the application returns in the start - callback will be passed in the end callback as an argument, and as we will - see shortly, also to all the directly subordinate elements of the record.
-
- The tag is the GEDCOM tag in string format, the parsed_tag - is an integer, for which symbolic values are defined as TAG_HEAD, - TAG_SOUR, TAG_DATA, ... and USERTAG - for the application-specific tags.  These values are defined in the -header gedcom-tags.h that is installed, and included via - gedcom.h (so no need to include gedcom-tags.h yourself).
-
- The example passes a simple integer as context, but an application could - e.g. pass a struct that will contain the information for the - header.  In the end callback, the application could then e.g. do some +
+ The Gedcom_ctxt type that is used as a result of the start + callback and as an argument to the end callback is vital for passing context + necessary for the application.  This type is meant to be opaque; in + fact, it's a void pointer, so you can pass anything via it.  The important + thing to know is that the context that the application returns in the start + callback will be passed in the end callback as an argument, and as we will + see shortly, also to all the directly subordinate elements of the record.
+
+ The tag is the GEDCOM tag in string format, the parsed_tag + is an integer, for which symbolic values are defined as TAG_HEAD, + TAG_SOUR, TAG_DATA, ... and USERTAG + for the application-specific tags.  These values are defined in the + header gedcom-tags.h that is installed, and included via + gedcom.h (so no need to include gedcom-tags.h yourself).
+
+ The example passes a simple integer as context, but an application could + e.g. pass a struct that will contain the information for the + header.  In the end callback, the application could then e.g. do some finalizing operations on the struct to put it in its database.
-
- (Note that the Gedcom_val type for the xref - and parsed_value arguments was not discussed, see further +
+ (Note that the Gedcom_val type for the xref + and parsed_value arguments was not discussed, see further for this)
-
- +
+

Callbacks for elements

- We will now retrieve the SOUR field (the name of the program that wrote - the file) from the header:
- -
Gedcom_ctxt my_header_source_start_cb(Gedcom_ctxt + We will now retrieve the SOUR field (the name of the program that wrote + the file) from the header:
+ +
Gedcom_ctxt my_header_source_start_cb(Gedcom_ctxt parent,
-                     -                  int   -      level,
-                     -                  char*   -    tag,
-                     -                  char*   -    raw_value,
-                       -                int     -    parsed_tag,
-                     -                  Gedcom_val - parsed_value)
- {
-   char *source = GEDCOM_STRING(parsed_value);
-   printf("This file was written by %s\n", source);
-   return parent;
- }
+                     +                   int   +       level,
+                     +                   char*   +     tag,
+                     +                   char*   +     raw_value,
+                       +                 int     +     parsed_tag,
+                     +                   Gedcom_val +  parsed_value)
+ {
+   char *source = GEDCOM_STRING(parsed_value);
+   printf("This file was written by %s\n", source);
+   return parent;
+ }
+
+ void my_header_source_end_cb(Gedcom_ctxt parent,
+                     +          Gedcom_ctxt self,
+                     +          Gedcom_val  parsed_value)
+ {
+   printf("End of the source description\n");
+ }
+
+ ...
+ gedcom_subscribe_to_element(ELT_HEAD_SOUR,
+                     +         my_header_source_start_cb,
+                     +         my_header_source_end_cb);
+ ...
+ result = gedcom_parse_file("myfamily.ged");

+
+ The subscription mechanism for elements is similar, only the signatures + of the callbacks differ.  The signature for the start callback shows + that the context of the parent line (e.g. the struct that +describes the header) is passed to this start callback.  The callback +itself returns here the same context, but this can be its own context object +of course.  The end callback is called with both the context of the +parent and the context of itself, which will be the same in the example. + Again, the list of identifiers to use as a first argument for the +subscription function are detailed in the + interface details .
+
+ If we look at the other arguments of the start callback, we see the +level number (the initial number of the line in the GEDCOM file), the tag +(e.g. "SOUR"), and then a raw value, a parsed tag and a parsed value.  The + raw value is just the raw string that occurs as value on the line next to + the tag (in UTF-8 encoding).  The parsed value is the meaningful value + that is parsed from that raw string.  The parsed tag is described in + the section for record callbacks.
+
+ The Gedcom_val type is meant to be an opaque type.  The + only thing that needs to be known about it is that it can contain specific + data types, which have to be retrieved from it using pre-defined macros. +  These data types are described in the + interface details.

- void my_header_source_end_cb(Gedcom_ctxt parent,
-                     -         Gedcom_ctxt self,
-                     -         Gedcom_val  parsed_value)
+ Some extra notes:
+ +
    +
  • The Gedcom_val argument of the end callback + is currently not used.  It is there for future enhancements.
  • +
  • There is also a Gedcom_val argument in +the start callback for records.  This argument is currently a string +value giving the pointer in string form.
  • + +
+ +

Default callbacks
+

+ As described above, an application doesn't always implement the entire + GEDCOM spec, and application-specific tags may have been added by other applications. +  To preserve this extra data anyway, a default callback can be registered + by the application, as in the following example:
+ +
void my_default_cb (Gedcom_ctxt parent, + int level, char* tag, char* raw_value, int parsed_tag)
{
-   printf("End of the source description\n");
+   ...
}
-
+
...
- gedcom_subscribe_to_element(ELT_HEAD_SOUR,
-                     -        my_header_source_start_cb,
-                     -        my_header_source_end_cb);
+ gedcom_set_default_callback(my_default_cb);
...
result = gedcom_parse_file("myfamily.ged");

-
- The subscription mechanism for elements is similar, only the signatures - of the callbacks differ.  The signature for the start callback shows - that the context of the parent line (e.g. the struct that describes - the header) is passed to this start callback.  The callback itself -returns here the same context, but this can be its own context object of -course.  The end callback is called with both the context of the parent -and the context of itself, which will be the same in the example.  Again, - the list of identifiers to use as a first argument for the subscription -function are detailed in the -interface details .
-
- If we look at the other arguments of the start callback, we see the level - number (the initial number of the line in the GEDCOM file), the tag (e.g. - "SOUR"), and then a raw value, a parsed tag and a parsed value.  The -raw value is just the raw string that occurs as value on the line next to -the tag (in UTF-8 encoding).  The parsed value is the meaningful value -that is parsed from that raw string.  The parsed tag is described in -the section for record callbacks.
-
- The Gedcom_val type is meant to be an opaque type.  The - only thing that needs to be known about it is that it can contain specific - data types, which have to be retrieved from it using pre-defined macros. -  These data types are described in the - interface details.
-
- Some extra notes:
- -
    -
  • The Gedcom_val argument of the end callback - is currently not used.  It is there for future enhancements.
  • -
  • There is also a Gedcom_val argument in the - start callback for records.  This argument is currently a string value - giving the pointer in string form.
  • - -
- -

Default callbacks
-

- As described above, an application doesn't always implement the entire - GEDCOM spec, and application-specific tags may have been added by other -applications.  To preserve this extra data anyway, a default callback -can be registered by the application, as in the following example:
- -
void my_default_cb (Gedcom_ctxt parent, - int level, char* tag, char* raw_value, int parsed_tag)
- {
-   ...
- }
-
- ...
- gedcom_set_default_callback(my_default_cb);
- ...
- result = gedcom_parse_file("myfamily.ged");

-
- This callback has a similar signature as the previous ones, -but it doesn't contain a parsed value.  However, it does contain the -parent context, that was returned by the application for the most specific -containing tag that the application supported.
-
- Suppose e.g. that this callback is called for some tags in the header -that are specific to some other application, then our application could -make sure that the parent context contains the struct or object that represents -the header, and use the default callback here to add the level, tag and raw_value - as plain text in a member of that struct or object, thus preserving the -information.  The application can then write this out when the data -is saved again in a GEDCOM file.  To make it more specific, consider -the following example:
- +
+ This callback has a similar signature as the previous ones, + but it doesn't contain a parsed value.  However, it does contain the + parent context, that was returned by the application for the most specific + containing tag that the application supported.
+
+ Suppose e.g. that this callback is called for some tags in the header +that are specific to some other application, then our application could make +sure that the parent context contains the struct or object that represents + the header, and use the default callback here to add the level, tag and +raw_value as plain text in a member of that struct or object, thus preserving +the information.  The application can then write this out when the +data is saved again in a GEDCOM file.  To make it more specific, consider + the following example:
+
struct header {
-   char* source;
-   ...
-   char* extra_text;
- };
-
- Gedcom_ctxt my_header_start_cb(int level, Gedcom_val xref, char* tag, +   char* source;
+   ...
+   char* extra_text;
+ };
+
+ Gedcom_ctxt my_header_start_cb(int level, Gedcom_val xref, char* tag, char *raw_value,
-                      +                                int parsed_tag, Gedcom_val parsed_value)
- {
-   struct header head = my_make_header_struct();
-   return (Gedcom_ctxt)head;
- }
-
- void my_default_cb(Gedcom_ctxt parent, int level, char* tag, char* raw_value, -int parsed_tag)
- {
-   struct header head = (struct header)parent;
-   my_header_add_to_extra_text(head, level, tag, raw_value);
- }
-
- gedcom_set_default_callback(my_default_cb);
- gedcom_subscribe_to_record(REC_HEAD, my_header_start, NULL);
- ...
- result = gedcom_parse_file(filename);

-
- Note that the default callback will be called for any tag that isn't specifically - subscribed upon by the application, and can thus be called in various contexts. -  For simplicity, the example above doesn't take this into account (the - parent could be of different types, depending -on the context).
- -
- + {
+   struct header head = my_make_header_struct();
+   return (Gedcom_ctxt)head;
+ }
+
+ void my_default_cb(Gedcom_ctxt parent, int level, char* tag, char* raw_value, + int parsed_tag)
+ {
+   struct header head = (struct header)parent;
+   my_header_add_to_extra_text(head, level, tag, raw_value);
+ }
+
+ gedcom_set_default_callback(my_default_cb);
+ gedcom_subscribe_to_record(REC_HEAD, my_header_start, NULL);
+ ...
+ result = gedcom_parse_file(filename);

+ + Note that the default callback will be called for any tag that isn't +specifically subscribed upon by the application, and can thus be called +in various contexts.  For simplicity, the example above doesn't take +this into account (the parent could be of different +types, depending on the context).
+ +
+

Other API functions
-

- Although the above describes the basic interface of libgedcom, there are - some other functions that allow to customize the behaviour of the library. -  These will be explained in the current section.
- + + Although the above describes the basic interface of libgedcom, there +are some other functions that allow to customize the behaviour of the library. +  These will be explained in the current section.
+

Debugging

- The library can generate various debugging output, not only from itself, - but also the debugging output generated by the yacc parser.  By default, - no debugging output is generated, but this can be customized using the following - function:
- -
void gedcom_set_debug_level (int level, - FILE* trace_output)
-
- The level can be one of the following values:
- + The library can generate various debugging output, not only from itself, + but also the debugging output generated by the yacc parser.  By default, + no debugging output is generated, but this can be customized using the +following function:
+ +
void gedcom_set_debug_level (int level, + FILE* trace_output)
+
+ The level can be one of the following values:
+ - If the trace_output is NULL, debugging information - will be written to stderr, otherwise the given file handle is - used (which must be open).
-
- + If the trace_output is NULL, debugging information + will be written to stderr, otherwise the given file handle +is used (which must be open).
+
+

Error treatment

- One of the previous sections already described the callback to be registered - to get error messages.  The library also allows to customize what happens - on an error, using the following function:
- -
void gedcom_set_error_handling (Gedcom_err_mech - mechanism)
-
- The mechanism can be one of:
- + One of the previous sections already described the callback to be registered + to get error messages.  The library also allows to customize what +happens on an error, using the following function:
+ +
void gedcom_set_error_handling (Gedcom_err_mech + mechanism)
+
+ The mechanism can be one of:
+ + - This doesn't influence the generation of error or warning messages, only - the behaviour of the parser and its return code.
-
- + This doesn't influence the generation of error or warning messages, only + the behaviour of the parser and its return code.
+
+ +

Compatibility mode
-

- Applications are not necessarily true to the GEDCOM spec (or use a different - version than 5.5).  The intention is that the library is resilient to - this, and goes in compatibility mode for files written by specific programs - (detected via the HEAD.SOUR tag).  This compatibility mode can be enabled - and disabled via the following function:
- + + Applications are not necessarily true to the GEDCOM spec (or use a different + version than 5.5).  The intention is that the library is resilient +to this, and goes in compatibility mode for files written by specific programs + (detected via the HEAD.SOUR tag).  This compatibility mode can be +enabled and disabled via the following function:
+ +
void gedcom_set_compat_handling - (int enable_compat)
-
- The argument can be:
- + (int enable_compat)
+ + The argument can be:
+ + - Note that, currently, no actual compatibility code is present, but this + Note that, currently, no actual compatibility code is present, but this is on the to-do list.
- -
- + + +
+
$Id$
$Name$
- +
                    
- + -- 2.30.2