1 /* Test program for the Gedcom library.
2 Copyright (C) 2001, 2002 The Genes Development Team
3 This file is part of the Gedcom parser library.
4 Contributed by Peter Verthez <Peter.Verthez@advalvas.be>, 2001.
6 The Gedcom parser library is free software; you can redistribute it
7 and/or modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The Gedcom parser library is distributed in the hope that it will be
12 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the Gedcom parser library; if not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
27 #include "portability.h"
31 char* make_prefix(int depth)
33 char* prefix = (char*)calloc(depth+1, sizeof(char));
34 memset(prefix, ' ', depth);
38 void dump_xref(int st, int prefix_depth, struct xref_value* xr);
40 void dump_user_data(int st, int prefix_depth, struct user_data* data)
42 char* prefix = make_prefix(prefix_depth);
45 for (data; data; data = data->next) {
46 output(st, "%sData: \n", prefix);
47 output(st, "%s %d, '%s', '%s'\n", prefix,
48 data->level, str_val(data->tag), str_val(data->str_value));
49 output(st, "%s reference: ", prefix);
50 dump_xref(st, prefix_depth + 4, data->xref_value);
54 output(st, "%s\n", ptr_val(data));
59 void dump_address(int st, int prefix_depth, struct address* addr)
61 char* prefix = make_prefix(prefix_depth);
64 output(st, "%sFull label: '%s'\n", prefix, str_val(addr->full_label));
65 output(st, "%sLine 1: '%s'\n", prefix, str_val(addr->line1));
66 output(st, "%sLine 2: '%s'\n", prefix, str_val(addr->line2));
67 output(st, "%sCity: '%s'\n", prefix, str_val(addr->city));
68 output(st, "%sState: '%s'\n", prefix, str_val(addr->state));
69 output(st, "%sPostal: '%s'\n", prefix, str_val(addr->postal));
70 output(st, "%sCountry: '%s'\n", prefix, str_val(addr->country));
71 output(st, "%sUser data: ", prefix);
72 dump_user_data(st, prefix_depth + 2, addr->extra);
75 output(st, "%s\n", ptr_val(addr));
80 void dump_date(int st, int prefix_depth, struct date_value* dv)
82 char* prefix = make_prefix(prefix_depth);
85 output(st, "%stype: %d\n", prefix, dv->type);
86 output(st, "%sdate1:\n", prefix);
87 output(st, "%s calendar type: %d\n", prefix, dv->date1.cal);
88 output(st, "%s day: '%s', %d\n", prefix,
89 str_val(dv->date1.day_str), dv->date1.day);
90 output(st, "%s month: '%s', %d\n", prefix,
91 str_val(dv->date1.month_str), dv->date1.month);
92 output(st, "%s year: '%s', %d\n", prefix,
93 str_val(dv->date1.year_str), dv->date1.year);
94 output(st, "%s year type: %d\n", prefix, dv->date1.year_type);
95 output(st, "%s date type: %d\n", prefix, dv->date1.type);
96 output(st, "%s sdn1: %ld\n", prefix, dv->date1.sdn1);
97 output(st, "%s sdn2: %ld\n", prefix, dv->date1.sdn2);
98 output(st, "%sdate2:\n", prefix);
99 output(st, "%s calendar type: %d\n", prefix, dv->date2.cal);
100 output(st, "%s day: '%s', %d\n", prefix,
101 str_val(dv->date2.day_str), dv->date2.day);
102 output(st, "%s month: '%s', %d\n", prefix,
103 str_val(dv->date2.month_str), dv->date2.month);
104 output(st, "%s year: '%s', %d\n", prefix,
105 str_val(dv->date2.year_str), dv->date2.year);
106 output(st, "%s year type: %d\n", prefix, dv->date2.year_type);
107 output(st, "%s date type: %d\n", prefix, dv->date2.type);
108 output(st, "%s sdn1: %ld\n", prefix, dv->date2.sdn1);
109 output(st, "%s sdn2: %ld\n", prefix, dv->date2.sdn2);
110 output(st, "%sphrase: '%s'\n", prefix, str_val(dv->phrase));
113 output(st, "%s\n", ptr_val(dv));
118 void show_date(struct date_value* dv)
123 void dump_age(int st, int prefix_depth, struct age_value* age)
125 char* prefix = make_prefix(prefix_depth);
128 output(st, "%stype: %d\n", prefix, age->type);
129 output(st, "%smodifier: %d\n", prefix, age->mod);
130 output(st, "%syears: %d\n", prefix, age->years);
131 output(st, "%smonths: %d\n", prefix, age->months);
132 output(st, "%sdays: %d\n", prefix, age->days);
133 output(st, "%sphrase: '%s'\n", prefix, str_val(age->phrase));
136 output(st, "%s\n", ptr_val(age));
141 void dump_xref(int st, int prefix_depth, struct xref_value* xr)
143 char* prefix = make_prefix(prefix_depth);
146 output(st, "%stype: %d\n", prefix, xr->type);
147 output(st, "%sxref: '%s'\n", prefix, str_val(xr->string));
148 output(st, "%sobject: %s\n", prefix, ptr_val(xr->object));
151 output(st, "%s\n", ptr_val(xr));
156 void dump_xref_list(int st, int prefix_depth, struct xref_list* xr)
158 char* prefix = make_prefix(prefix_depth);
161 for (xr; xr; xr = xr->next) {
162 output(st, "%sreference: ", prefix);
163 dump_xref(st, prefix_depth + 2, xr->xref);
164 output(st, "%sUser data: ", prefix);
165 dump_user_data(st, prefix_depth + 2, xr->extra);
169 output(st, "%s\n", ptr_val(xr));
174 void dump_texts(int st, int prefix_depth, struct text* t)
176 char* prefix = make_prefix(prefix_depth);
179 for (t; t; t = t->next) {
180 output(st, "%sText: '%s'\n", prefix, str_val(t->text));
181 output(st, "%sUser data: ", prefix);
182 dump_user_data(st, prefix_depth + 2, t->extra);
186 output(st, "%s\n", ptr_val(t));
191 void dump_user_ref(int st, int prefix_depth, struct user_ref_number* ref)
193 char* prefix = make_prefix(prefix_depth);
196 for (ref; ref; ref = ref->next) {
197 output(st, "%sValue: '%s'\n", prefix, str_val(ref->value));
198 output(st, "%sType: '%s'\n", prefix, str_val(ref->type));
199 output(st, "%sUser data: ", prefix);
200 dump_user_data(st, prefix_depth + 2, ref->extra);
204 output(st, "%s\n", ptr_val(ref));
209 void dump_citations(int st, int prefix_depth, struct source_citation* cit);
211 void dump_note_sub(int st, int prefix_depth, struct note_sub* note)
213 char* prefix = make_prefix(prefix_depth);
216 for (note; note; note = note->next) {
217 output(st, "%sNote: \n", prefix);
218 output(st, "%s text: '%s'\n", prefix, str_val(note->text));
219 output(st, "%s reference: ", prefix);
220 dump_xref(st, prefix_depth + 4, note->reference);
221 output(st, "%s citations: ", prefix);
222 dump_citations(st, prefix_depth + 4, note->citation);
223 output(st, "%s User data: ", prefix);
224 dump_user_data(st, prefix_depth + 4, note->extra);
228 output(st, "%s\n", ptr_val(note));
233 void dump_mm_links(int st, int prefix_depth, struct multimedia_link* link)
235 char* prefix = make_prefix(prefix_depth);
238 for (link; link; link = link->next) {
239 output(st, "%slink: \n", prefix);
240 output(st, "%s reference: ", prefix);
241 dump_xref(st, prefix_depth + 4, link->reference);
242 output(st, "%s Form: '%s'\n", prefix, str_val(link->form));
243 output(st, "%s Title: '%s'\n", prefix, str_val(link->title));
244 output(st, "%s File: '%s'\n", prefix, str_val(link->file));
245 output(st, "%s notes: ", prefix);
246 dump_note_sub(st, prefix_depth + 4, link->note);
247 output(st, "%s User data: ", prefix);
248 dump_user_data(st, prefix_depth + 4, link->extra);
252 output(st, "%s\n", ptr_val(link));
257 void dump_citations(int st, int prefix_depth, struct source_citation* cit)
259 char* prefix = make_prefix(prefix_depth);
262 for (cit; cit; cit = cit->next) {
263 output(st, "%sCitation: \n", prefix);
264 output(st, "%s description: '%s'\n", prefix, str_val(cit->description));
265 output(st, "%s reference: ", prefix);
266 dump_xref(st, prefix_depth + 4, cit->reference);
267 output(st, "%s page: '%s'\n", prefix, str_val(cit->page));
268 output(st, "%s event: '%s'\n", prefix, str_val(cit->event));
269 output(st, "%s role: '%s'\n", prefix, str_val(cit->role));
270 output(st, "%s Date: ", prefix);
271 dump_date(st, prefix_depth + 4, cit->date);
272 output(st, "%s texts: ", prefix, prefix);
273 dump_texts(st, prefix_depth + 4, cit->text);
274 output(st, "%s quality: '%s'\n", prefix, str_val(cit->quality));
275 output(st, "%s multimedia links: ", prefix);
276 dump_mm_links(st, prefix_depth + 4, cit->mm_link);
277 output(st, "%s notes: ", prefix);
278 dump_note_sub(st, prefix_depth + 4, cit->note);
279 output(st, "%s User data: ", prefix);
280 dump_user_data(st, prefix_depth + 4, cit->extra);
284 output(st, "%s\n", ptr_val(cit));
289 void dump_lds(int st, int prefix_depth, struct lds_event* lds)
291 char* prefix = make_prefix(prefix_depth);
294 for (lds; lds; lds = lds->next) {
295 output(st, "%sDate status: '%s'\n", prefix, str_val(lds->date_status));
296 output(st, "%sDate: ", prefix);
297 dump_date(st, prefix_depth + 2, lds->date);
298 output(st, "%sTemple code: '%s'\n", prefix, str_val(lds->temple_code));
299 output(st, "%sPlace living ordinance: '%s'\n", prefix,
300 str_val(lds->place_living_ordinance));
301 output(st, "%scitations: ", prefix);
302 dump_citations(st, prefix_depth + 2, lds->citation);
303 output(st, "%snotes: ", prefix);
304 dump_note_sub(st, prefix_depth + 2, lds->note);
305 output(st, "%sfamily: ", prefix);
306 dump_xref(st, prefix_depth + 2, lds->family);
307 output(st, "%sUser data: ", prefix);
308 dump_user_data(st, prefix_depth + 2, lds->extra);
312 output(st, "%s\n", ptr_val(lds));
317 void dump_change_date(int st, int prefix_depth, struct change_date* chan)
319 char* prefix = make_prefix(prefix_depth);
322 output(st, "%sDate: ", prefix);
323 dump_date(st, prefix_depth + 2, chan->date);
324 output(st, "%sTime: '%s'\n", prefix, str_val(chan->time));
325 output(st, "%snotes: ", prefix);
326 dump_note_sub(st, prefix_depth + 2, chan->note);
327 output(st, "%sUser data: ", prefix);
328 dump_user_data(st, prefix_depth + 2, chan->extra);
331 output(st, "%s\n", ptr_val(chan));
336 void dump_personal_name(int st, int prefix_depth, struct personal_name* name)
338 char* prefix = make_prefix(prefix_depth);
341 for (name; name; name = name->next) {
342 output(st, "%sName: \n", prefix);
343 output(st, "%s Name: '%s'\n", prefix, str_val(name->name));
344 output(st, "%s Prefix: '%s'\n", prefix, str_val(name->prefix));
345 output(st, "%s Given: '%s'\n", prefix, str_val(name->given));
346 output(st, "%s Nickname: '%s'\n", prefix, str_val(name->nickname));
347 output(st, "%s Surname prefix: '%s'\n", prefix,
348 str_val(name->surname_prefix));
349 output(st, "%s Surname: '%s'\n", prefix, str_val(name->surname));
350 output(st, "%s Suffix: '%s'\n", prefix, str_val(name->suffix));
351 output(st, "%s citations: ", prefix);
352 dump_citations(st, prefix_depth + 4, name->citation);
353 output(st, "%s notes: ", prefix);
354 dump_note_sub(st, prefix_depth + 4, name->note);
355 output(st, "%s User data: ", prefix);
356 dump_user_data(st, prefix_depth + 4, name->extra);
360 output(st, "%s\n", ptr_val(name));
365 void dump_pedigree(int st, int prefix_depth, struct pedigree* p)
367 char* prefix = make_prefix(prefix_depth);
370 for (p; p; p = p->next) {
371 output(st, "%sPedigree: '%s'\n", prefix, str_val(p->pedigree));
372 output(st, "%sUser data: ", prefix);
373 dump_user_data(st, prefix_depth + 2, p->extra);
377 output(st, "%s\n", ptr_val(p));
382 void dump_family_link(int st, int prefix_depth, struct family_link *link)
384 char* prefix = make_prefix(prefix_depth);
387 for (link; link; link = link->next) {
388 output(st, "%sFamily:\n", prefix);
389 output(st, "%s Family: ", prefix);
390 dump_xref(st, prefix_depth + 4, link->family);
391 output(st, "%s pedigrees: ", prefix);
392 dump_pedigree(st, prefix_depth + 4, link->pedigree);
393 output(st, "%s notes: ", prefix);
394 dump_note_sub(st, prefix_depth + 4, link->note);
395 output(st, "%s User data: ", prefix);
396 dump_user_data(st, prefix_depth + 4, link->extra);
400 output(st, "%s\n", ptr_val(link));
405 void dump_association(int st, int prefix_depth, struct association *assoc)
407 char* prefix = make_prefix(prefix_depth);
410 for (assoc; assoc; assoc = assoc->next) {
411 output(st, "%sAssociation:\n", prefix);
412 output(st, "%s To:\n", prefix);
413 dump_xref(st, prefix_depth + 4, assoc->to);
414 output(st, "%s Type: '%s'\n", prefix, str_val(assoc->type));
415 output(st, "%s Relation: '%s'\n", str_val(assoc->relation));
416 output(st, "%s citations: ", prefix);
417 dump_citations(st, prefix_depth + 4, assoc->citation);
418 output(st, "%s notes: ", prefix);
419 dump_note_sub(st, prefix_depth + 4, assoc->note);
420 output(st, "%s User data: ", prefix);
421 dump_user_data(st, prefix_depth + 4, assoc->extra);
425 output(st, "%s\n", ptr_val(assoc));
430 void dump_place(int st, int prefix_depth, struct place* place)
432 char* prefix = make_prefix(prefix_depth);
435 output(st, "%svalue: '%s'\n", prefix, str_val(place->value));
436 output(st, "%splace_hierarchy: '%s'\n", prefix,
437 str_val(place->place_hierarchy));
438 output(st, "%scitations: ", prefix);
439 dump_citations(st, prefix_depth + 2, place->citation);
440 output(st, "%snotes: ", prefix);
441 dump_note_sub(st, prefix_depth + 2, place->note);
442 output(st, "%sUser data: ", prefix);
443 dump_user_data(st, prefix_depth + 2, place->extra);
446 output(st, "%s\n", ptr_val(place));
451 void dump_source_events(int st, int prefix_depth, struct source_event* evt)
453 char* prefix = make_prefix(prefix_depth);
456 for (evt; evt; evt = evt->next) {
457 output(st, "%sEvent:\n", prefix);
458 output(st, "%s Recorded events: '%s'\n", prefix,
459 str_val(evt->recorded_events));
460 output(st, "%s Date period: ", prefix);
461 dump_date(st, prefix_depth + 4, evt->date_period);
462 output(st, "%s Jurisdiction: '%s'\n", prefix, str_val(evt->jurisdiction));
463 output(st, "%s User data: ", prefix);
464 dump_user_data(st, prefix_depth + 4, evt->extra);
468 output(st, "%s\n", ptr_val(evt));
473 void dump_source_descriptions(int st, int prefix_depth,
474 struct source_description* desc)
476 char* prefix = make_prefix(prefix_depth);
479 for (desc; desc; desc = desc->next) {
480 output(st, "%sSource description:\n", prefix);
481 output(st, "%s Call number: '%s'\n", prefix, str_val(desc->call_number));
482 output(st, "%s Media: '%s'\n", prefix, str_val(desc->media));
483 output(st, "%s User data: ", prefix);
484 dump_user_data(st, prefix_depth + 4, desc->extra);
488 output(st, "%s\n", ptr_val(desc));
493 void dump_events(int st, int prefix_depth, struct event *evt)
495 char* prefix = make_prefix(prefix_depth);
498 for (evt; evt; evt = evt->next) {
499 output(st, "%sEvent: %d (%s)\n", prefix, evt->event,
500 str_val(evt->event_name));
501 output(st, "%s Value: '%s'\n", prefix, str_val(evt->val));
502 output(st, "%s Type: '%s'\n", prefix, str_val(evt->type));
503 output(st, "%s Date: ", prefix);
504 dump_date(st, prefix_depth + 4, evt->date);
505 output(st, "%s Place: ", prefix);
506 dump_place(st, prefix_depth + 4, evt->place);
507 output(st, "%s Address: ", prefix);
508 dump_address(st, prefix_depth + 4, evt->address);
509 output(st, "%s Phone 1: '%s'\n", prefix, str_val(evt->phone[0]));
510 output(st, "%s Phone 2: '%s'\n", prefix, str_val(evt->phone[1]));
511 output(st, "%s Phone 3: '%s'\n", prefix, str_val(evt->phone[2]));
512 output(st, "%s Age: ", prefix);
513 dump_age(st, prefix_depth + 4, evt->age);
514 output(st, "%s Agency: '%s'\n", prefix, str_val(evt->agency));
515 output(st, "%s Cause: '%s'\n", prefix, str_val(evt->cause));
516 output(st, "%s citations: ", prefix);
517 dump_citations(st, prefix_depth + 4, evt->citation);
518 output(st, "%s multimedia links: ", prefix);
519 dump_mm_links(st, prefix_depth + 4, evt->mm_link);
520 output(st, "%s notes: ", prefix);
521 dump_note_sub(st, prefix_depth + 4, evt->note);
522 output(st, "%s Age of husband: ", prefix);
523 dump_age(st, prefix_depth + 4, evt->husband_age);
524 output(st, "%s Age of wife: ", prefix);
525 dump_age(st, prefix_depth + 4, evt->wife_age);
526 output(st, "%s Family: ", prefix);
527 dump_xref(st, prefix_depth + 4, evt->family);
528 output(st, "%s Adoption parent: '%s'\n", prefix,
529 str_val(evt->adoption_parent));
530 output(st, "%s User data: ", prefix);
531 dump_user_data(st, prefix_depth + 4, evt->extra);
535 output(st, "%s\n", ptr_val(evt));
542 struct header* header = gom_get_header();
543 output(1, "=== HEADER ===\n");
544 output(0, "Source:\n");
545 output(0, " ID: '%s'\n", str_val(header->source.id));
546 output(0, " Name: '%s'\n", str_val(header->source.name));
547 output(0, " Version: '%s'\n", str_val(header->source.version));
548 output(0, " Corporation:\n");
549 output(0, " Name: '%s'\n", str_val(header->source.corporation.name));
550 output(0, " Address: ");
551 dump_address(0, 6, header->source.corporation.address);
552 output(0, " Phone 1: '%s'\n", str_val(header->source.corporation.phone[0]));
553 output(0, " Phone 2: '%s'\n", str_val(header->source.corporation.phone[1]));
554 output(0, " Phone 3: '%s'\n", str_val(header->source.corporation.phone[2]));
555 output(0, " Data:\n");
556 output(0, " Name: '%s'\n", str_val(header->source.data.name));
557 output(0, " Date: ");
558 dump_date(0, 6, header->source.data.date);
559 output(0, " Copyright: '%s'\n", str_val(header->source.data.copyright));
560 output(0, "Destination: '%s'\n", str_val(header->destination));
562 dump_date(0, 2, header->date);
563 output(0, "Time: '%s'\n", str_val(header->time));
564 output(0, "Submitter: ");
565 dump_xref(0, 2, header->submitter);
566 output(0, "Submission: ");
567 dump_xref(0, 2, header->submission);
568 output(0, "File name: '%s'\n", str_val(header->filename));
569 output(0, "Copyright: '%s'\n", str_val(header->copyright));
570 output(0, "Gedcom:\n");
571 output(0, " Version: '%s'\n", str_val(header->gedcom.version));
572 output(0, " Form: '%s'\n", str_val(header->gedcom.form));
573 output(0, "Character set:\n");
574 output(0, " Name: '%s'\n", str_val(header->charset.name));
575 output(0, " Version: '%s'\n", str_val(header->charset.version));
576 output(0, "Language: '%s'\n", str_val(header->language));
577 output(0, "Place hierarchy: '%s'\n", str_val(header->place_hierarchy));
578 output(0, "Note:\n");
580 output(0, "%s\n", str_val(header->note));
582 output(0, "User data: ");
583 dump_user_data(0, 2, header->extra);
586 void dump_submission()
588 struct submission* subn = gom_get_submission();
590 output(1, "=== SUBMISSION (%s) ===\n", str_val(subn->xrefstr));
591 output(0, "Submitter: ");
592 dump_xref(0, 2, subn->submitter);
593 output(0, "Family file: '%s'\n", str_val(subn->family_file));
594 output(0, "Temple code: '%s'\n", str_val(subn->temple_code));
595 output(0, "Nr of ancestor generations: '%s'\n",
596 str_val(subn->nr_of_ancestor_gens));
597 output(0, "Nr of descendant generations: '%s'\n",
598 str_val(subn->nr_of_descendant_gens));
599 output(0, "Ordinance process flag: '%s'\n",
600 str_val(subn->ordinance_process_flag));
601 output(0, "Record id: '%s'\n", str_val(subn->record_id));
602 output(0, "User data: ");
603 dump_user_data(0, 2, subn->extra);
609 struct family* fam = gom_get_first_family();
610 for (fam; fam; fam = fam->next) {
611 output(1, "=== FAMILY (%s) ===\n", str_val(fam->xrefstr));
612 output(0, "Family events: ");
613 dump_events(0, 2, fam->event);
614 output(0, "Husband: ");
615 dump_xref(0, 2, fam->husband);
617 dump_xref(0, 2, fam->wife);
618 output(0, "Children: ");
619 dump_xref_list(0, 2, fam->children);
620 output(0, "Number of children: '%s'\n", str_val(fam->nr_of_children));
621 output(0, "Submitters: ");
622 dump_xref_list(0, 2, fam->submitters);
623 output(0, "LDS spouse sealings: ");
624 dump_lds(0, 2, fam->lds_spouse_sealing);
625 output(0, "citations: ");
626 dump_citations(0, 2, fam->citation);
627 output(0, "multimedia links: ");
628 dump_mm_links(0, 2, fam->mm_link);
629 output(0, "notes: ");
630 dump_note_sub(0, 2, fam->note);
631 output(0, "user refs: ");
632 dump_user_ref(0, 2, fam->ref);
633 output(0, "Record ID: '%s'\n", str_val(fam->record_id));
634 output(0, "change date: ");
635 dump_change_date(0, 2, fam->change_date);
636 output(0, "User data: ");
637 dump_user_data(0, 2, fam->extra);
641 void dump_individuals()
643 struct individual* indiv = gom_get_first_individual();
644 for (indiv; indiv; indiv = indiv->next) {
645 output(1, "=== INDIVIDUAL (%s) ===\n", str_val(indiv->xrefstr));
646 output(0, "Restriction notice: '%s'\n", str_val(indiv->restriction_notice));
647 output(0, "names: ");
648 dump_personal_name(0, 2, indiv->name);
649 output(0, "Sex: '%s'\n", str_val(indiv->sex));
650 output(0, "Individual events: ");
651 dump_events(0, 2, indiv->event);
652 output(0, "Individual attributes: ");
653 dump_events(0, 2, indiv->attribute);
654 output(0, "LDS individual ordinance: ");
655 dump_lds(0, 2, indiv->lds_individual_ordinance);
656 output(0, "Child to family links: ");
657 dump_family_link(0, 2, indiv->child_to_family);
658 output(0, "Spouse to family links: ");
659 dump_family_link(0, 2, indiv->spouse_to_family);
660 output(0, "Submitters: ");
661 dump_xref_list(0, 2, indiv->submitters);
662 output(0, "Associations: ");
663 dump_association(0, 2, indiv->association);
664 output(0, "Aliases: ");
665 dump_xref_list(0, 2, indiv->alias);
666 output(0, "Ancestor interest: ");
667 dump_xref_list(0, 2, indiv->ancestor_interest);
668 output(0, "Descendant interest: ");
669 dump_xref_list(0, 2, indiv->descendant_interest);
670 output(0, "citations: ");
671 dump_citations(0, 2, indiv->citation);
672 output(0, "multimedia links: ");
673 dump_mm_links(0, 2, indiv->mm_link);
674 output(0, "notes: ");
675 dump_note_sub(0, 2, indiv->note);
676 output(0, "Record file nr: '%s'\n", str_val(indiv->record_file_nr));
677 output(0, "Ancestral file nr: '%s'\n", str_val(indiv->ancestral_file_nr));
678 output(0, "user refs: ");
679 dump_user_ref(0, 2, indiv->ref);
680 output(0, "Record ID: '%s'\n", str_val(indiv->record_id));
681 output(0, "change date: ");
682 dump_change_date(0, 2, indiv->change_date);
683 output(0, "User data: ");
684 dump_user_data(0, 2, indiv->extra);
688 void dump_multimedia()
690 struct multimedia* obj = gom_get_first_multimedia();
691 for (obj; obj; obj = obj->next) {
692 output(1, "=== MULTIMEDIA (%s) ===\n", str_val(obj->xrefstr));
693 output(0, "Form: '%s'\n", str_val(obj->form));
694 output(0, "Title: '%s'\n", str_val(obj->title));
695 output(0, "notes: ");
696 dump_note_sub(0, 2, obj->note);
697 output(0, "Data: '%s'\n", str_val(obj->data));
698 output(0, "Continued: ");
699 dump_xref(0, 2, obj->continued);
700 output(0, "user refs: ");
701 dump_user_ref(0, 2, obj->ref);
702 output(0, "Record ID: '%s'\n", str_val(obj->record_id));
703 output(0, "change date: ");
704 dump_change_date(0, 2, obj->change_date);
705 output(0, "User data: ");
706 dump_user_data(0, 2, obj->extra);
712 struct note* note = gom_get_first_note();
713 for (note; note; note = note->next) {
714 output(1, "=== NOTE (%s) ===\n", str_val(note->xrefstr));
715 output(0, "Text: '%s'\n", str_val(note->text));
716 output(0, "citations: ");
717 dump_citations(0, 2, note->citation);
718 output(0, "user refs: ");
719 dump_user_ref(0, 2, note->ref);
720 output(0, "Record ID: '%s'\n", str_val(note->record_id));
721 output(0, "change date: ");
722 dump_change_date(0, 2, note->change_date);
723 output(0, "User data: ");
724 dump_user_data(0, 2, note->extra);
728 void dump_repositories()
730 struct repository* repo = gom_get_first_repository();
731 for (repo; repo; repo = repo->next) {
732 output(1, "=== REPOSITORY (%s) ===\n", str_val(repo->xrefstr));
733 output(0, "Name: '%s'\n", str_val(repo->name));
734 output(0, "Address: ");
735 dump_address(0, 2, repo->address);
736 output(0, "Phone 1: '%s'\n", str_val(repo->phone[0]));
737 output(0, "Phone 2: '%s'\n", str_val(repo->phone[1]));
738 output(0, "Phone 3: '%s'\n", str_val(repo->phone[2]));
739 output(0, "notes: ");
740 dump_note_sub(0, 2, repo->note);
741 output(0, "user refs: ");
742 dump_user_ref(0, 2, repo->ref);
743 output(0, "Record ID: '%s'\n", str_val(repo->record_id));
744 output(0, "change date: ");
745 dump_change_date(0, 2, repo->change_date);
746 output(0, "User data: ");
747 dump_user_data(0, 2, repo->extra);
753 struct source* sour = gom_get_first_source();
754 for (sour; sour; sour = sour->next) {
755 output(1, "=== SOURCE (%s) ===\n", str_val(sour->xrefstr));
756 output(0, "Data: \n");
757 output(0, " events: ");
758 dump_source_events(0, 4, sour->data.event);
759 output(0, " Agency: '%s'\n", str_val(sour->data.agency));
760 output(0, " notes: ");
761 dump_note_sub(0, 4, sour->data.note);
762 output(0, "Author: '%s'\n", str_val(sour->author));
763 output(0, "Title: '%s'\n", str_val(sour->title));
764 output(0, "Abbreviation: '%s'\n", str_val(sour->abbreviation));
765 output(0, "Publication: '%s'\n", str_val(sour->publication));
766 output(0, "Text: '%s'\n", str_val(sour->text));
767 output(0, "Repository:\n");
768 output(0, " Link: ");
769 dump_xref(0, 4, sour->repository.link);
770 output(0, " notes: ");
771 dump_note_sub(0, 4, sour->repository.note);
772 output(0, " source descriptions: ");
773 dump_source_descriptions(0, 4, sour->repository.description);
774 output(0, "multimedia links: ");
775 dump_mm_links(0, 2, sour->mm_link);
776 output(0, "notes: ");
777 dump_note_sub(0, 2, sour->note);
778 output(0, "user refs: ");
779 dump_user_ref(0, 2, sour->ref);
780 output(0, "Record ID: '%s'\n", str_val(sour->record_id));
781 output(0, "change date: ");
782 dump_change_date(0, 2, sour->change_date);
783 output(0, "User data: ");
784 dump_user_data(0, 2, sour->extra);
788 void dump_submitters()
790 struct submitter* subm = gom_get_first_submitter();
791 for (subm; subm; subm = subm->next) {
792 output(1, "=== SUBMITTER (%s) ===\n", str_val(subm->xrefstr));
793 output(0, "Name: '%s'\n", str_val(subm->name));
794 output(0, "Address: ");
795 dump_address(0, 2, subm->address);
796 output(0, "Phone 1: '%s'\n", str_val(subm->phone[0]));
797 output(0, "Phone 2: '%s'\n", str_val(subm->phone[1]));
798 output(0, "Phone 3: '%s'\n", str_val(subm->phone[2]));
799 output(0, "multimedia links: ");
800 dump_mm_links(0, 2, subm->mm_link);
801 output(0, "Language 1: '%s'\n", str_val(subm->language[0]));
802 output(0, "Language 2: '%s'\n", str_val(subm->language[1]));
803 output(0, "Language 3: '%s'\n", str_val(subm->language[2]));
804 output(0, "Record file nr: '%s'\n", str_val(subm->record_file_nr));
805 output(0, "Record ID: '%s'\n", str_val(subm->record_id));
806 output(0, "change date: ");
807 dump_change_date(0, 2, subm->change_date);
808 output(0, "User data: ");
809 dump_user_data(0, 2, subm->extra);
813 void dump_user_records()
815 struct user_rec* rec = gom_get_first_user_rec();
816 for (rec; rec; rec = rec->next) {
817 output(1, "=== USER RECORD (%s) ===\n", str_val(rec->xrefstr));
818 output(0, "Tag: '%s'\n", rec->tag);
819 output(0, "String value: '%s'\n", str_val(rec->str_value));
820 output(0, "Xref value: ");
821 dump_xref(0, 2, rec->xref_value);
822 output(0, "User data: ");
823 dump_user_data(0, 2, rec->extra);