xrefs = hash_create(HASHCOUNT_T_MAX, NULL, NULL);
hash_set_allocator(xrefs, xref_alloc, xref_free, NULL);
}
xrefs = hash_create(HASHCOUNT_T_MAX, NULL, NULL);
hash_set_allocator(xrefs, xref_alloc, xref_free, NULL);
}
struct xref_value *gedcom_parse_xref(char *raw_value,
Xref_ctxt ctxt, Xref_type xref_type)
{
struct xref_value *gedcom_parse_xref(char *raw_value,
Xref_ctxt ctxt, Xref_type xref_type)
{
xr->xref.string = strdup(raw_value);
hash_alloc_insert(xrefs, key, xr);
}
xr->xref.string = strdup(raw_value);
hash_alloc_insert(xrefs, key, xr);
}
gedcom_error(_("Cross-reference %s previously defined as pointer to %s, "
"on line %d"),
xr->xref.string, xref_type_str[xr->defined_type],
xr->defined_line);
gedcom_error(_("Cross-reference %s previously defined as pointer to %s, "
"on line %d"),
xr->xref.string, xref_type_str[xr->defined_type],
xr->defined_line);
- return NULL;
- }
-
- if ((ctxt == XREF_USED && xr->used_type != xref_type)
- || (ctxt == XREF_DEFINED &&
- (xr->used_type != XREF_NONE && xr->used_type != xref_type))) {
+ clear_xref_node(xr);
+ }
+ else if ((ctxt == XREF_USED && xr->used_type != xref_type)
+ || (ctxt == XREF_DEFINED &&
+ (xr->used_type != XREF_NONE && xr->used_type != xref_type))) {
gedcom_error(_("Cross-reference %s previously used as pointer to %s, "
"on line %d"),
xr->xref.string, xref_type_str[xr->used_type], xr->used_line);
gedcom_error(_("Cross-reference %s previously used as pointer to %s, "
"on line %d"),
xr->xref.string, xref_type_str[xr->used_type], xr->used_line);