--- /dev/null
+#!/usr/bin/perl -w
+# $Id$
+# $Name$
+
+use strict;
+use diagnostics;
+
+my $inputfile ="$ENV{srcdir}/../include/gom.h";
+my $outputfile ="gomxref.html";
+my $ext_link = "interface.html";
+
+my $main_structs = "";
+my $sub_structs="";
+my $index = "";
+my $section = "";
+
+open INPUT, $inputfile or die "Can't read $inputfile\n";
+open OUTPUT, ">$outputfile" or die "Can't read $outputfile\n";
+
+while (<INPUT>)
+{
+ $section = "sub" if m|/\* Sub-structures \*/|;
+ $section = "main" if m|/\* Main structures \*/|;
+ $section = "" if m|/\* Functions \*/|;
+ next if m|/\*|;
+
+ if ($section ne "") {
+ if (m|^struct (.*) \{|) {
+ s|^struct (.*?) \{|<a name="$1"><B>struct $1</B></a> \{|;
+ if ($section eq "main") {
+ $index .= " <LI><a href=\"#$1\">struct $1</a><br>\n";
+ }
+ }
+ elsif (m|struct (.*?) \*|) {
+ my $link = "";
+ my $structname = $1;
+ if ($structname =~ /^(date|age|xref)_value$/) {
+ $link = $ext_link;
+ }
+ s|struct (.*?) \*|<a href="$link#$1">struct $1</a> \*|;
+ }
+
+ if ($section eq "sub") {
+ $sub_structs .= "$_";
+ }
+ else {
+ $main_structs .= "$_";
+ }
+ }
+}
+
+print OUTPUT "<center><h1>Gedcom object model in C</h1></center>\n";
+print OUTPUT <<END_OF_TEXT;
+This page provides a cross-reference of all objects in the Gedcom object
+model for C. The following links are fast links to the main structures
+in the Gedcom object model:
+END_OF_TEXT
+print OUTPUT "\n";
+print OUTPUT "<UL>\n";
+print OUTPUT $index;
+print OUTPUT "</UL>\n";
+print OUTPUT "<hr>\n";
+print OUTPUT "<h2>Main structures</h2>\n";
+print OUTPUT "<CODE><PRE>\n";
+print OUTPUT $main_structs;
+print OUTPUT "</PRE></CODE>\n";
+print OUTPUT "<hr>\n";
+print OUTPUT "<h2>Sub-structures</h2>\n";
+print OUTPUT "<CODE><PRE>\n";
+print OUTPUT $sub_structs;
+print OUTPUT "</PRE></CODE>\n";
+
+close OUTPUT;
+close INPUT;