return gedcom_new_model();
}
+int gom_write_file(const char* file_name, int *total_conv_fails)
+{
+ Gedcom_write_hndl hndl;
+ int result = 1;
+
+ hndl = gedcom_write_open(file_name);
+ if (hndl) {
+ result = write_header(hndl);
+ result |= gedcom_write_close(hndl, total_conv_fails);
+ }
+
+ return result;
+}
+
Gom_ctxt make_gom_ctxt(int ctxt_type, OBJ_TYPE obj_type, void *ctxt_ptr)
{
Gom_ctxt ctxt = (Gom_ctxt)malloc(sizeof(struct Gom_ctxt_struct));
level, tag, raw_value);
}
-void def_rec_end(Gedcom_rec rec UNUSED, Gedcom_ctxt self)
+void def_rec_end(Gedcom_rec rec UNUSED, Gedcom_ctxt self,
+ Gedcom_val parsed_value UNUSED)
{
Gom_ctxt ctxt = (Gom_ctxt)self;
destroy_gom_ctxt(ctxt);
xr->type = XREF_ANY;
}
-char* concat_strings(NL_TYPE type, char *str1, const char *str2)
-{
- if (str1 != NULL && str2 != NULL) {
- char *newp;
- char *wp;
- size_t len1 = strlen(str1);
- size_t len2 = strlen(str2);
- size_t len = len1 + len2 + 1;
- if (type == WITH_NL)
- len++;
- newp = (char*) realloc(str1, len);
- if (newp == NULL)
- return NULL;
- wp = newp + len1;
- str1 = newp;
- if (type == WITH_NL)
- *wp++ = '\n';
- wp = memcpy (wp, str2, len2);
- wp += len2;
- *wp++ = '\0';
- }
-
- return str1;
-}
-
struct date_value* dup_date(struct date_value dv)
{
struct date_value* dv_ptr;