From 828ea25fe9634f9af1b1725cf9e91b820c157d02 Mon Sep 17 00:00:00 2001 From: Peter Verthez Date: Sun, 27 Oct 2002 15:50:57 +0000 Subject: [PATCH] Use of functions in portability.c (to have platform-independent output). --- t/src/dump_gom.c | 280 ++++++++++++++++++++++------------------------- 1 file changed, 132 insertions(+), 148 deletions(-) diff --git a/t/src/dump_gom.c b/t/src/dump_gom.c index 525ef0f..ff292df 100644 --- a/t/src/dump_gom.c +++ b/t/src/dump_gom.c @@ -21,31 +21,13 @@ /* $Id$ */ /* $Name$ */ +#include #include "dump_gom.h" #include "output.h" +#include "portability.h" #include "gom.h" #include "gedcom.h" -char* null_str = "(null)"; -char* non_null_ptr = "0x"; -char* null_ptr = "0x"; - -char* chk(char* input) -{ - if (input) - return input; - else - return null_str; -} - -char* ptr_val(void* ptr) -{ - if (ptr) - return non_null_ptr; - else - return null_ptr; -} - char* make_prefix(int depth) { char* prefix = (char*)calloc(depth+1, sizeof(char)); @@ -63,7 +45,7 @@ void dump_user_data(int st, int prefix_depth, struct user_data* data) for (data; data; data = data->next) { output(st, "%sData: \n", prefix); output(st, "%s %d, %s, %s\n", prefix, - data->level, chk(data->tag), chk(data->str_value)); + data->level, str_val(data->tag), str_val(data->str_value)); output(st, "%s reference: ", prefix); dump_xref(st, prefix_depth + 4, data->xref_value); } @@ -79,13 +61,13 @@ void dump_address(int st, int prefix_depth, struct address* addr) char* prefix = make_prefix(prefix_depth); if (addr) { output(st, "\n"); - output(st, "%sFull label: %s\n", prefix, chk(addr->full_label)); - output(st, "%sLine 1: %s\n", prefix, chk(addr->line1)); - output(st, "%sLine 2: %s\n", prefix, chk(addr->line2)); - output(st, "%sCity: %s\n", prefix, chk(addr->city)); - output(st, "%sState: %s\n", prefix, chk(addr->state)); - output(st, "%sPostal: %s\n", prefix, chk(addr->postal)); - output(st, "%sCountry: %s\n", prefix, chk(addr->country)); + output(st, "%sFull label: %s\n", prefix, str_val(addr->full_label)); + output(st, "%sLine 1: %s\n", prefix, str_val(addr->line1)); + output(st, "%sLine 2: %s\n", prefix, str_val(addr->line2)); + output(st, "%sCity: %s\n", prefix, str_val(addr->city)); + output(st, "%sState: %s\n", prefix, str_val(addr->state)); + output(st, "%sPostal: %s\n", prefix, str_val(addr->postal)); + output(st, "%sCountry: %s\n", prefix, str_val(addr->country)); output(st, "%sUser data:", prefix); dump_user_data(st, prefix_depth + 2, addr->extra); } @@ -103,21 +85,21 @@ void dump_date(int st, int prefix_depth, struct date_value* dv) output(st, "%stype: %d\n", prefix, dv->type); output(st, "%sdate1:\n", prefix); output(st, "%s calendar type: %d\n", prefix, dv->date1.cal); - output(st, "%s day: %s\n", prefix, chk(dv->date1.day_str)); - output(st, "%s month: %s\n", prefix, chk(dv->date1.month_str)); - output(st, "%s year: %s\n", prefix, chk(dv->date1.year_str)); + output(st, "%s day: %s\n", prefix, str_val(dv->date1.day_str)); + output(st, "%s month: %s\n", prefix, str_val(dv->date1.month_str)); + output(st, "%s year: %s\n", prefix, str_val(dv->date1.year_str)); output(st, "%s date type: %d\n", prefix, dv->date1.type); output(st, "%s sdn1: %ld\n", prefix, dv->date1.sdn1); output(st, "%s sdn2: %ld\n", prefix, dv->date1.sdn2); output(st, "%sdate2:\n", prefix); output(st, "%s calendar type: %d\n", prefix, dv->date2.cal); - output(st, "%s day: %s\n", prefix, chk(dv->date2.day_str)); - output(st, "%s month: %s\n", prefix, chk(dv->date2.month_str)); - output(st, "%s year: %s\n", prefix, chk(dv->date2.year_str)); + output(st, "%s day: %s\n", prefix, str_val(dv->date2.day_str)); + output(st, "%s month: %s\n", prefix, str_val(dv->date2.month_str)); + output(st, "%s year: %s\n", prefix, str_val(dv->date2.year_str)); output(st, "%s date type: %d\n", prefix, dv->date2.type); output(st, "%s sdn1: %ld\n", prefix, dv->date2.sdn1); output(st, "%s sdn2: %ld\n", prefix, dv->date2.sdn2); - output(st, "%sphrase: %s\n", prefix, chk(dv->phrase)); + output(st, "%sphrase: %s\n", prefix, str_val(dv->phrase)); } else { output(st, "%s\n", ptr_val(dv)); @@ -135,7 +117,7 @@ void dump_age(int st, int prefix_depth, struct age_value* age) output(st, "%syears: %d\n", prefix, age->years); output(st, "%smonths: %d\n", prefix, age->months); output(st, "%sdays: %d\n", prefix, age->days); - output(st, "%sphrase: %s\n", prefix, chk(age->phrase)); + output(st, "%sphrase: %s\n", prefix, str_val(age->phrase)); } else { output(st, "%s\n", ptr_val(age)); @@ -149,7 +131,7 @@ void dump_xref(int st, int prefix_depth, struct xref_value* xr) if (xr) { output(st, "\n"); output(st, "%stype: %d\n", prefix, xr->type); - output(st, "%sxref: %s\n", prefix, chk(xr->string)); + output(st, "%sxref: %s\n", prefix, str_val(xr->string)); output(st, "%sobject: %s\n", prefix, ptr_val(xr->object)); } else { @@ -182,7 +164,7 @@ void dump_texts(int st, int prefix_depth, struct text* t) if (t) { output(st, "\n"); for (t; t; t = t->next) { - output(st, "%sText: %s\n", prefix, chk(t->text)); + output(st, "%sText: %s\n", prefix, str_val(t->text)); output(st, "%sUser data:", prefix); dump_user_data(st, prefix_depth + 2, t->extra); } @@ -199,8 +181,8 @@ void dump_user_ref(int st, int prefix_depth, struct user_ref_number* ref) if (ref) { output(st, "\n"); for (ref; ref; ref = ref->next) { - output(st, "%sValue: %s\n", prefix, chk(ref->value)); - output(st, "%sType: %s\n", prefix, chk(ref->type)); + output(st, "%sValue: %s\n", prefix, str_val(ref->value)); + output(st, "%sType: %s\n", prefix, str_val(ref->type)); output(st, "%sUser data:", prefix); dump_user_data(st, prefix_depth + 2, ref->extra); } @@ -220,7 +202,7 @@ void dump_note_sub(int st, int prefix_depth, struct note_sub* note) output(st, "\n"); for (note; note; note = note->next) { output(st, "%sNote: \n", prefix); - output(st, "%s text: %s\n", prefix, chk(note->text)); + output(st, "%s text: %s\n", prefix, str_val(note->text)); output(st, "%s reference: ", prefix); dump_xref(st, prefix_depth + 4, note->reference); output(st, "%s citations: ", prefix); @@ -244,9 +226,9 @@ void dump_mm_links(int st, int prefix_depth, struct multimedia_link* link) output(st, "%slink: \n", prefix); output(st, "%s reference: ", prefix); dump_xref(st, prefix_depth + 4, link->reference); - output(st, "%s Form: %s\n", prefix, chk(link->form)); - output(st, "%s Title: %s\n", prefix, chk(link->title)); - output(st, "%s File: %s\n", prefix, chk(link->file)); + output(st, "%s Form: %s\n", prefix, str_val(link->form)); + output(st, "%s Title: %s\n", prefix, str_val(link->title)); + output(st, "%s File: %s\n", prefix, str_val(link->file)); output(st, "%s notes: ", prefix); dump_note_sub(st, prefix_depth + 4, link->note); output(st, "%s User data:", prefix); @@ -266,17 +248,17 @@ void dump_citations(int st, int prefix_depth, struct source_citation* cit) output(st, "\n"); for (cit; cit; cit = cit->next) { output(st, "%sCitation: \n", prefix); - output(st, "%s description: %s\n", prefix, chk(cit->description)); + output(st, "%s description: %s\n", prefix, str_val(cit->description)); output(st, "%s reference: ", prefix); dump_xref(st, prefix_depth + 4, cit->reference); - output(st, "%s page: %s\n", prefix, chk(cit->page)); - output(st, "%s event: %s\n", prefix, chk(cit->event)); - output(st, "%s role: %s\n", prefix, chk(cit->role)); + output(st, "%s page: %s\n", prefix, str_val(cit->page)); + output(st, "%s event: %s\n", prefix, str_val(cit->event)); + output(st, "%s role: %s\n", prefix, str_val(cit->role)); output(st, "%s Date: ", prefix); dump_date(st, prefix_depth + 4, cit->date); output(st, "%s texts: ", prefix, prefix); dump_texts(st, prefix_depth + 4, cit->text); - output(st, "%s quality: %s\n", prefix, chk(cit->quality)); + output(st, "%s quality: %s\n", prefix, str_val(cit->quality)); output(st, "%s multimedia links: ", prefix); dump_mm_links(st, prefix_depth + 4, cit->mm_link); output(st, "%s notes: ", prefix); @@ -297,12 +279,12 @@ void dump_lds(int st, int prefix_depth, struct lds_event* lds) if (lds) { output(st, "\n"); for (lds; lds; lds = lds->next) { - output(st, "%sDate status: %s\n", prefix, chk(lds->date_status)); + output(st, "%sDate status: %s\n", prefix, str_val(lds->date_status)); output(st, "%sDate: ", prefix); dump_date(st, prefix_depth + 2, lds->date); - output(st, "%sTemple code: %s\n", prefix, chk(lds->temple_code)); + output(st, "%sTemple code: %s\n", prefix, str_val(lds->temple_code)); output(st, "%sPlace living ordinance: %s\n", prefix, - chk(lds->place_living_ordinance)); + str_val(lds->place_living_ordinance)); output(st, "%scitations: ", prefix); dump_citations(st, prefix_depth + 2, lds->citation); output(st, "%snotes: ", prefix); @@ -326,7 +308,7 @@ void dump_change_date(int st, int prefix_depth, struct change_date* chan) output(st, "\n"); output(st, "%sDate: ", prefix); dump_date(st, prefix_depth + 2, chan->date); - output(st, "%sTime: %s\n", prefix, chk(chan->time)); + output(st, "%sTime: %s\n", prefix, str_val(chan->time)); output(st, "%snotes: ", prefix); dump_note_sub(st, prefix_depth + 2, chan->note); output(st, "%sUser data:", prefix); @@ -345,13 +327,14 @@ void dump_personal_name(int st, int prefix_depth, struct personal_name* name) output(st, "\n"); for (name; name; name = name->next) { output(st, "%sName: \n", prefix); - output(st, "%s Name: %s\n", prefix, chk(name->name)); - output(st, "%s Prefix: %s\n", prefix, chk(name->prefix)); - output(st, "%s Given: %s\n", prefix, chk(name->given)); - output(st, "%s Nickname: %s\n", prefix, chk(name->nickname)); - output(st, "%s Surname prefix: %s\n", prefix,chk(name->surname_prefix)); - output(st, "%s Surname: %s\n", prefix, chk(name->surname)); - output(st, "%s Suffix: %s\n", prefix, chk(name->suffix)); + output(st, "%s Name: %s\n", prefix, str_val(name->name)); + output(st, "%s Prefix: %s\n", prefix, str_val(name->prefix)); + output(st, "%s Given: %s\n", prefix, str_val(name->given)); + output(st, "%s Nickname: %s\n", prefix, str_val(name->nickname)); + output(st, "%s Surname prefix: %s\n", prefix, + str_val(name->surname_prefix)); + output(st, "%s Surname: %s\n", prefix, str_val(name->surname)); + output(st, "%s Suffix: %s\n", prefix, str_val(name->suffix)); output(st, "%s citations: ", prefix); dump_citations(st, prefix_depth + 4, name->citation); output(st, "%s notes: ", prefix); @@ -372,7 +355,7 @@ void dump_pedigree(int st, int prefix_depth, struct pedigree* p) if (p) { output(st, "\n"); for (p; p; p = p->next) { - output(st, "%sPedigree: %s\n", prefix, chk(p->pedigree)); + output(st, "%sPedigree: %s\n", prefix, str_val(p->pedigree)); output(st, "%sUser data:", prefix); dump_user_data(st, prefix_depth + 2, p->extra); } @@ -415,8 +398,8 @@ void dump_association(int st, int prefix_depth, struct association *assoc) output(st, "%sAssociation:\n", prefix); output(st, "%s To:\n", prefix); dump_xref(st, prefix_depth + 4, assoc->to); - output(st, "%s Type: %s\n", prefix, chk(assoc->type)); - output(st, "%s Relation: %s\n", chk(assoc->relation)); + output(st, "%s Type: %s\n", prefix, str_val(assoc->type)); + output(st, "%s Relation: %s\n", str_val(assoc->relation)); output(st, "%s citations: ", prefix); dump_citations(st, prefix_depth + 4, assoc->citation); output(st, "%s notes: ", prefix); @@ -436,8 +419,9 @@ void dump_place(int st, int prefix_depth, struct place* place) char* prefix = make_prefix(prefix_depth); if (place) { output(st, "\n"); - output(st, "%svalue: %s\n", prefix, chk(place->value)); - output(st, "%splace_hierarchy: %s\n", prefix, chk(place->place_hierarchy)); + output(st, "%svalue: %s\n", prefix, str_val(place->value)); + output(st, "%splace_hierarchy: %s\n", prefix, + str_val(place->place_hierarchy)); output(st, "%scitations: ", prefix); dump_citations(st, prefix_depth + 2, place->citation); output(st, "%snotes: ", prefix); @@ -459,10 +443,10 @@ void dump_source_events(int st, int prefix_depth, struct source_event* evt) for (evt; evt; evt = evt->next) { output(st, "%sEvent:\n", prefix); output(st, "%s Recorded events: %s\n", prefix, - chk(evt->recorded_events)); + str_val(evt->recorded_events)); output(st, "%s Date period: ", prefix); dump_date(st, prefix_depth + 4, evt->date_period); - output(st, "%s Jurisdiction: %s\n", prefix, chk(evt->jurisdiction)); + output(st, "%s Jurisdiction: %s\n", prefix, str_val(evt->jurisdiction)); output(st, "%s User data:", prefix); dump_user_data(st, prefix_depth + 4, evt->extra); } @@ -481,8 +465,8 @@ void dump_source_descriptions(int st, int prefix_depth, output(st, "\n"); for (desc; desc; desc = desc->next) { output(st, "%sSource description:\n", prefix); - output(st, "%s Call number: %s\n", prefix, chk(desc->call_number)); - output(st, "%s Media: %s\n", prefix, chk(desc->media)); + output(st, "%s Call number: %s\n", prefix, str_val(desc->call_number)); + output(st, "%s Media: %s\n", prefix, str_val(desc->media)); output(st, "%s User data:", prefix); dump_user_data(st, prefix_depth + 4, desc->extra); } @@ -500,22 +484,22 @@ void dump_events(int st, int prefix_depth, struct event *evt) output(st, "\n"); for (evt; evt; evt = evt->next) { output(st, "%sEvent: %d (%s)\n", prefix, evt->event, - chk(evt->event_name)); - output(st, "%s Value: %s\n", prefix, chk(evt->val)); - output(st, "%s Type: %s\n", prefix, chk(evt->type)); + str_val(evt->event_name)); + output(st, "%s Value: %s\n", prefix, str_val(evt->val)); + output(st, "%s Type: %s\n", prefix, str_val(evt->type)); output(st, "%s Date: ", prefix); dump_date(st, prefix_depth + 4, evt->date); output(st, "%s Place: ", prefix); dump_place(st, prefix_depth + 4, evt->place); output(st, "%s Address: ", prefix); dump_address(st, prefix_depth + 4, evt->address); - output(st, "%s Phone 1: %s\n", prefix, chk(evt->phone[0])); - output(st, "%s Phone 2: %s\n", prefix, chk(evt->phone[1])); - output(st, "%s Phone 3: %s\n", prefix, chk(evt->phone[2])); + output(st, "%s Phone 1: %s\n", prefix, str_val(evt->phone[0])); + output(st, "%s Phone 2: %s\n", prefix, str_val(evt->phone[1])); + output(st, "%s Phone 3: %s\n", prefix, str_val(evt->phone[2])); output(st, "%s Age: ", prefix); dump_age(st, prefix_depth + 4, evt->age); - output(st, "%s Agency: %s\n", prefix, chk(evt->agency)); - output(st, "%s Cause: %s\n", prefix, chk(evt->cause)); + output(st, "%s Agency: %s\n", prefix, str_val(evt->agency)); + output(st, "%s Cause: %s\n", prefix, str_val(evt->cause)); output(st, "%s citations: ", prefix); dump_citations(st, prefix_depth + 4, evt->citation); output(st, "%s multimedia links: ", prefix); @@ -529,7 +513,7 @@ void dump_events(int st, int prefix_depth, struct event *evt) output(st, "%s Family: ", prefix); dump_xref(st, prefix_depth + 4, evt->family); output(st, "%s Adoption parent: %s\n", prefix, - chk(evt->adoption_parent)); + str_val(evt->adoption_parent)); output(st, "%s User data:", prefix); dump_user_data(st, prefix_depth + 4, evt->extra); } @@ -545,42 +529,42 @@ void dump_header() struct header* header = gom_get_header(); output(1, "=== HEADER ===\n"); output(0, "Source:\n"); - output(0, " ID: %s\n", chk(header->source.id)); - output(0, " Name: %s\n", chk(header->source.name)); - output(0, " Version: %s\n", chk(header->source.version)); + output(0, " ID: %s\n", str_val(header->source.id)); + output(0, " Name: %s\n", str_val(header->source.name)); + output(0, " Version: %s\n", str_val(header->source.version)); output(0, " Corporation:\n"); - output(0, " Name: %s\n", chk(header->source.corporation.name)); + output(0, " Name: %s\n", str_val(header->source.corporation.name)); output(0, " Address: "); dump_address(0, 6, header->source.corporation.address); - output(0, " Phone 1: %s\n", chk(header->source.corporation.phone[0])); - output(0, " Phone 2: %s\n", chk(header->source.corporation.phone[1])); - output(0, " Phone 3: %s\n", chk(header->source.corporation.phone[2])); + output(0, " Phone 1: %s\n", str_val(header->source.corporation.phone[0])); + output(0, " Phone 2: %s\n", str_val(header->source.corporation.phone[1])); + output(0, " Phone 3: %s\n", str_val(header->source.corporation.phone[2])); output(0, " Data:\n"); - output(0, " Name: %s\n", chk(header->source.data.name)); + output(0, " Name: %s\n", str_val(header->source.data.name)); output(0, " Date: "); dump_date(0, 6, header->source.data.date); - output(0, " Copyright: %s\n", chk(header->source.data.copyright)); - output(0, "Destination: %s\n", chk(header->destination)); + output(0, " Copyright: %s\n", str_val(header->source.data.copyright)); + output(0, "Destination: %s\n", str_val(header->destination)); output(0, "Date: "); dump_date(0, 2, header->date); - output(0, "Time: %s\n", chk(header->time)); + output(0, "Time: %s\n", str_val(header->time)); output(0, "Submitter: "); dump_xref(0, 2, header->submitter); output(0, "Submission: "); dump_xref(0, 2, header->submission); - output(0, "File name: %s\n", chk(header->filename)); - output(0, "Copyright: %s\n", chk(header->copyright)); + output(0, "File name: %s\n", str_val(header->filename)); + output(0, "Copyright: %s\n", str_val(header->copyright)); output(0, "Gedcom:\n"); - output(0, " Version: %s\n", chk(header->gedcom.version)); - output(0, " Form: %s\n", chk(header->gedcom.form)); + output(0, " Version: %s\n", str_val(header->gedcom.version)); + output(0, " Form: %s\n", str_val(header->gedcom.form)); output(0, "Character set:\n"); - output(0, " Name: %s\n", chk(header->charset.name)); - output(0, " Version: %s\n", chk(header->charset.version)); - output(0, "Language: %s\n", chk(header->language)); - output(0, "Place hierarchy: %s\n", chk(header->place_hierarchy)); + output(0, " Name: %s\n", str_val(header->charset.name)); + output(0, " Version: %s\n", str_val(header->charset.version)); + output(0, "Language: %s\n", str_val(header->language)); + output(0, "Place hierarchy: %s\n", str_val(header->place_hierarchy)); output(0, "Note:\n"); output(0, "====\n"); - output(0, "%s\n", chk(header->note)); + output(0, "%s\n", str_val(header->note)); output(0, "====\n"); output(0, "User data:"); dump_user_data(0, 2, header->extra); @@ -590,18 +574,18 @@ void dump_submission() { struct submission* subn = gom_get_submission(); if (subn) { - output(1, "=== SUBMISSION (%s) ===\n", chk(subn->xrefstr)); + output(1, "=== SUBMISSION (%s) ===\n", str_val(subn->xrefstr)); output(0, "Submitter: "); dump_xref(0, 2, subn->submitter); - output(0, "Family file: %s\n", chk(subn->family_file)); - output(0, "Temple code: %s\n", chk(subn->temple_code)); + output(0, "Family file: %s\n", str_val(subn->family_file)); + output(0, "Temple code: %s\n", str_val(subn->temple_code)); output(0, "Nr of ancestor generations: %s\n", - chk(subn->nr_of_ancestor_gens)); + str_val(subn->nr_of_ancestor_gens)); output(0, "Nr of descendant generations: %s\n", - chk(subn->nr_of_descendant_gens)); + str_val(subn->nr_of_descendant_gens)); output(0, "Ordinance process flag: %s\n", - chk(subn->ordinance_process_flag)); - output(0, "Record id: %s\n", chk(subn->record_id)); + str_val(subn->ordinance_process_flag)); + output(0, "Record id: %s\n", str_val(subn->record_id)); output(0, "User data:"); dump_user_data(0, 2, subn->extra); } @@ -611,7 +595,7 @@ void dump_families() { struct family* fam = gom_get_first_family(); for (fam; fam; fam = fam->next) { - output(1, "=== FAMILY (%s) ===\n", chk(fam->xrefstr)); + output(1, "=== FAMILY (%s) ===\n", str_val(fam->xrefstr)); output(0, "Family events: "); dump_events(0, 2, fam->event); output(0, "Husband: "); @@ -620,7 +604,7 @@ void dump_families() dump_xref(0, 2, fam->wife); output(0, "Children: "); dump_xref_list(0, 2, fam->children); - output(0, "Number of children: %s\n", chk(fam->nr_of_children)); + output(0, "Number of children: %s\n", str_val(fam->nr_of_children)); output(0, "Submitters: "); dump_xref_list(0, 2, fam->submitters); output(0, "LDS spouse sealings: "); @@ -633,7 +617,7 @@ void dump_families() dump_note_sub(0, 2, fam->note); output(0, "user refs: "); dump_user_ref(0, 2, fam->ref); - output(0, "Record ID: %s\n", chk(fam->record_id)); + output(0, "Record ID: %s\n", str_val(fam->record_id)); output(0, "change date: "); dump_change_date(0, 2, fam->change_date); output(0, "User data:"); @@ -645,11 +629,11 @@ void dump_individuals() { struct individual* indiv = gom_get_first_individual(); for (indiv; indiv; indiv = indiv->next) { - output(1, "=== INDIVIDUAL (%s) ===\n", chk(indiv->xrefstr)); - output(0, "Restriction notice: %s\n", chk(indiv->restriction_notice)); + output(1, "=== INDIVIDUAL (%s) ===\n", str_val(indiv->xrefstr)); + output(0, "Restriction notice: %s\n", str_val(indiv->restriction_notice)); output(0, "names: "); dump_personal_name(0, 2, indiv->name); - output(0, "Sex: %s\n", chk(indiv->sex)); + output(0, "Sex: %s\n", str_val(indiv->sex)); output(0, "Individual events: "); dump_events(0, 2, indiv->event); output(0, "Individual attributes: "); @@ -676,11 +660,11 @@ void dump_individuals() dump_mm_links(0, 2, indiv->mm_link); output(0, "notes: "); dump_note_sub(0, 2, indiv->note); - output(0, "Record file nr: %s\n", chk(indiv->record_file_nr)); - output(0, "Ancestral file nr: %s\n", chk(indiv->ancestral_file_nr)); + output(0, "Record file nr: %s\n", str_val(indiv->record_file_nr)); + output(0, "Ancestral file nr: %s\n", str_val(indiv->ancestral_file_nr)); output(0, "user refs: "); dump_user_ref(0, 2, indiv->ref); - output(0, "Record ID: %s\n", chk(indiv->record_id)); + output(0, "Record ID: %s\n", str_val(indiv->record_id)); output(0, "change date: "); dump_change_date(0, 2, indiv->change_date); output(0, "User data:"); @@ -692,17 +676,17 @@ void dump_multimedia() { struct multimedia* obj = gom_get_first_multimedia(); for (obj; obj; obj = obj->next) { - output(1, "=== MULTIMEDIA (%s) ===\n", chk(obj->xrefstr)); - output(0, "Form: %s\n", chk(obj->form)); - output(0, "Title: %s\n", chk(obj->title)); + output(1, "=== MULTIMEDIA (%s) ===\n", str_val(obj->xrefstr)); + output(0, "Form: %s\n", str_val(obj->form)); + output(0, "Title: %s\n", str_val(obj->title)); output(0, "notes: "); dump_note_sub(0, 2, obj->note); - output(0, "Data: %s\n", chk(obj->data)); + output(0, "Data: %s\n", str_val(obj->data)); output(0, "Continued: "); dump_xref(0, 2, obj->continued); output(0, "user refs: "); dump_user_ref(0, 2, obj->ref); - output(0, "Record ID: %s\n", chk(obj->record_id)); + output(0, "Record ID: %s\n", str_val(obj->record_id)); output(0, "change date: "); dump_change_date(0, 2, obj->change_date); output(0, "User data:"); @@ -714,13 +698,13 @@ void dump_notes() { struct note* note = gom_get_first_note(); for (note; note; note = note->next) { - output(1, "=== NOTE (%s) ===\n", chk(note->xrefstr)); - output(0, "Text: %s\n", chk(note->text)); + output(1, "=== NOTE (%s) ===\n", str_val(note->xrefstr)); + output(0, "Text: %s\n", str_val(note->text)); output(0, "citations: "); dump_citations(0, 2, note->citation); output(0, "user refs: "); dump_user_ref(0, 2, note->ref); - output(0, "Record ID: %s\n", chk(note->record_id)); + output(0, "Record ID: %s\n", str_val(note->record_id)); output(0, "change date: "); dump_change_date(0, 2, note->change_date); output(0, "User data:"); @@ -732,18 +716,18 @@ void dump_repositories() { struct repository* repo = gom_get_first_repository(); for (repo; repo; repo = repo->next) { - output(1, "=== REPOSITORY (%s) ===\n", chk(repo->xrefstr)); - output(0, "Name: %s\n", chk(repo->name)); + output(1, "=== REPOSITORY (%s) ===\n", str_val(repo->xrefstr)); + output(0, "Name: %s\n", str_val(repo->name)); output(0, "Address: "); dump_address(0, 2, repo->address); - output(0, "Phone 1: %s\n", chk(repo->phone[0])); - output(0, "Phone 2: %s\n", chk(repo->phone[1])); - output(0, "Phone 3: %s\n", chk(repo->phone[2])); + output(0, "Phone 1: %s\n", str_val(repo->phone[0])); + output(0, "Phone 2: %s\n", str_val(repo->phone[1])); + output(0, "Phone 3: %s\n", str_val(repo->phone[2])); output(0, "notes: "); dump_note_sub(0, 2, repo->note); output(0, "user refs: "); dump_user_ref(0, 2, repo->ref); - output(0, "Record ID: %s\n", chk(repo->record_id)); + output(0, "Record ID: %s\n", str_val(repo->record_id)); output(0, "change date: "); dump_change_date(0, 2, repo->change_date); output(0, "User data:"); @@ -755,18 +739,18 @@ void dump_sources() { struct source* sour = gom_get_first_source(); for (sour; sour; sour = sour->next) { - output(1, "=== SOURCE (%s) ===\n", chk(sour->xrefstr)); + output(1, "=== SOURCE (%s) ===\n", str_val(sour->xrefstr)); output(0, "Data: \n"); output(0, " events: "); dump_source_events(0, 4, sour->data.event); - output(0, " Agency: %s\n", chk(sour->data.agency)); + output(0, " Agency: %s\n", str_val(sour->data.agency)); output(0, " notes: "); dump_note_sub(0, 4, sour->data.note); - output(0, "Author: %s\n", chk(sour->author)); - output(0, "Title: %s\n", chk(sour->title)); - output(0, "Abbreviation: %s\n", chk(sour->abbreviation)); - output(0, "Publication: %s\n", chk(sour->publication)); - output(0, "Text: %s\n", chk(sour->text)); + output(0, "Author: %s\n", str_val(sour->author)); + output(0, "Title: %s\n", str_val(sour->title)); + output(0, "Abbreviation: %s\n", str_val(sour->abbreviation)); + output(0, "Publication: %s\n", str_val(sour->publication)); + output(0, "Text: %s\n", str_val(sour->text)); output(0, "Repository:\n"); output(0, " Link: "); dump_xref(0, 4, sour->repository.link); @@ -780,7 +764,7 @@ void dump_sources() dump_note_sub(0, 2, sour->note); output(0, "user refs: "); dump_user_ref(0, 2, sour->ref); - output(0, "Record ID: %s\n", chk(sour->record_id)); + output(0, "Record ID: %s\n", str_val(sour->record_id)); output(0, "change date: "); dump_change_date(0, 2, sour->change_date); output(0, "User data:"); @@ -792,20 +776,20 @@ void dump_submitters() { struct submitter* subm = gom_get_first_submitter(); for (subm; subm; subm = subm->next) { - output(1, "=== SUBMITTER (%s) ===\n", chk(subm->xrefstr)); - output(0, "Name: %s\n", chk(subm->name)); + output(1, "=== SUBMITTER (%s) ===\n", str_val(subm->xrefstr)); + output(0, "Name: %s\n", str_val(subm->name)); output(0, "Address: "); dump_address(0, 2, subm->address); - output(0, "Phone 1: %s\n", chk(subm->phone[0])); - output(0, "Phone 2: %s\n", chk(subm->phone[1])); - output(0, "Phone 3: %s\n", chk(subm->phone[2])); + output(0, "Phone 1: %s\n", str_val(subm->phone[0])); + output(0, "Phone 2: %s\n", str_val(subm->phone[1])); + output(0, "Phone 3: %s\n", str_val(subm->phone[2])); output(0, "multimedia links: "); dump_mm_links(0, 2, subm->mm_link); - output(0, "Language 1: %s\n", chk(subm->language[0])); - output(0, "Language 2: %s\n", chk(subm->language[1])); - output(0, "Language 3: %s\n", chk(subm->language[2])); - output(0, "Record file nr: %s\n", chk(subm->record_file_nr)); - output(0, "Record ID: %s\n", chk(subm->record_id)); + output(0, "Language 1: %s\n", str_val(subm->language[0])); + output(0, "Language 2: %s\n", str_val(subm->language[1])); + output(0, "Language 3: %s\n", str_val(subm->language[2])); + output(0, "Record file nr: %s\n", str_val(subm->record_file_nr)); + output(0, "Record ID: %s\n", str_val(subm->record_id)); output(0, "change date: "); dump_change_date(0, 2, subm->change_date); output(0, "User data:"); @@ -817,9 +801,9 @@ void dump_user_records() { struct user_rec* rec = gom_get_first_user_rec(); for (rec; rec; rec = rec->next) { - output(1, "=== USER RECORD (%s) ===\n", chk(rec->xrefstr)); + output(1, "=== USER RECORD (%s) ===\n", str_val(rec->xrefstr)); output(0, "Tag: %s\n", rec->tag); - output(0, "String value: %s\n", chk(rec->str_value)); + output(0, "String value: %s\n", str_val(rec->str_value)); output(0, "Xref value: "); dump_xref(0, 2, rec->xref_value); output(0, "User data:"); -- 2.30.2