From f66f8671b738b063b4085e2ff35632503547fb1c Mon Sep 17 00:00:00 2001 From: Peter Verthez Date: Wed, 11 Sep 2002 19:09:50 +0000 Subject: [PATCH] Generating documentation for gedcom object model. --- doc/make_xref | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100755 doc/make_xref diff --git a/doc/make_xref b/doc/make_xref new file mode 100755 index 0000000..fac7ebd --- /dev/null +++ b/doc/make_xref @@ -0,0 +1,74 @@ +#!/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 () +{ + $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 (.*?) \{|struct $1 \{|; + if ($section eq "main") { + $index .= "
  • struct $1
    \n"; + } + } + elsif (m|struct (.*?) \*|) { + my $link = ""; + my $structname = $1; + if ($structname =~ /^(date|age|xref)_value$/) { + $link = $ext_link; + } + s|struct (.*?) \*|struct $1 \*|; + } + + if ($section eq "sub") { + $sub_structs .= "$_"; + } + else { + $main_structs .= "$_"; + } + } +} + +print OUTPUT "

    Gedcom object model in C

    \n"; +print OUTPUT <\n"; +print OUTPUT $index; +print OUTPUT "\n"; +print OUTPUT "
    \n"; +print OUTPUT "

    Main structures

    \n"; +print OUTPUT "
    \n";
    +print OUTPUT $main_structs;
    +print OUTPUT "
    \n"; +print OUTPUT "
    \n"; +print OUTPUT "

    Sub-structures

    \n"; +print OUTPUT "
    \n";
    +print OUTPUT $sub_structs;
    +print OUTPUT "
    \n"; + +close OUTPUT; +close INPUT; -- 2.30.2