diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-09-10 16:29:32 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-09-10 16:29:32 +0000 |
commit | b6e138a640075a6ff2bc9bca718d5d5d38e6140e (patch) | |
tree | 8f8fcf5f52d00cd78218ccb219e30629d33c2c8e /doc/scripts | |
parent | ca59a02bceb071930f14d7c021cdf3a196b85b36 (diff) | |
download | gnutls-b6e138a640075a6ff2bc9bca718d5d5d38e6140e.tar.gz |
Added Simon Josefsson's patch for gdoc. Now gdoc supports texinfo output.
Diffstat (limited to 'doc/scripts')
-rwxr-xr-x | doc/scripts/gdoc | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/doc/scripts/gdoc b/doc/scripts/gdoc index 9597148bb2..f8a5b6b098 100755 --- a/doc/scripts/gdoc +++ b/doc/scripts/gdoc @@ -2,6 +2,7 @@ ## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## ## hacked to allow -tex option --nmav ## +## hacked to allow -texinfo option --jas ## ## ## ## This software falls under the GNU Public License. Please read ## ## the COPYING file for more information ## @@ -16,7 +17,7 @@ # Note: This only supports 'c'. # usage: -# gdoc [ -docbook | -html | -text | -man | -tex ] +# gdoc [ -docbook | -html | -text | -man | -tex | -texinfo ] # [ -function funcname [ -function funcname ...] ] c file(s)s > outputfile # # Set output format using one of -docbook -html -text or -man. Default is man. @@ -103,6 +104,12 @@ $type_env = "(\\\$\\w+)"; $type_param, "<tt><b>\$1</b></tt>" ); $blankline_html = "<p>"; +%highlights_texinfo = ( $type_constant, "@var{\$1}", + $type_func, "@code{\$1}", + $type_struct, "@code{\$1}", + $type_param, "@code{\$1}" ); +$blankline_texinfo = ""; + %highlights_tex = ( $type_constant, "{\\\\it \$1}", $type_func, "{\\\\bf \$1}", $type_struct, "{\\\\it \$1}", @@ -133,7 +140,7 @@ $blankline_text = ""; sub usage { - print "Usage: $0 [ -v ] [ -docbook | -html | -text | -man | -tex ]\n"; + print "Usage: $0 [ -v ] [ -docbook | -html | -text | -man | -tex | -texinfo ]\n"; print " [ -function funcname [ -function funcname ...] ]\n"; print " c source file(s) > outputfile\n"; exit 1; @@ -164,6 +171,10 @@ while ($ARGV[0] =~ m/^-(.*)/) { $output_mode = "tex"; %highlights = %highlights_tex; $blankline = $blankline_tex; + } elsif ($cmd eq "-texinfo") { + $output_mode = "texinfo"; + %highlights = %highlights_texinfo; + $blankline = $blankline_texinfo; } elsif ($cmd eq "-text") { $output_mode = "text"; %highlights = %highlights_text; @@ -242,6 +253,39 @@ sub output_highlight { } } +# output in texinfo +sub output_texinfo { + my %args = %{$_[0]}; + my ($parameter, $section); + my $count; + print "\n\n"; + + print "\@deftypefun "; + + print $args{'functiontype'}; + print "\@code{".$args{'function'}."} "; + print "("; + $count = 0; + foreach $parameter (@{$args{'parameterlist'}}) { + print $args{'parametertypes'}{$parameter}." \@var{".$parameter."}"; + if ($count != $#{$args{'parameterlist'}}) { + $count++; + print ", "; + } + } + print ")\n"; + foreach $parameter (@{$args{'parameterlist'}}) { + if ($args{'parameters'}{$parameter}) { + print "\@var{".$parameter."}: "; + output_highlight($args{'parameters'}{$parameter}); + print "\n"; + } + } + foreach $section (@{$args{'sectionlist'}}) { + output_highlight($args{'sections'}{$section}); + } + print "\@end deftypefun\n"; +} # output in html sub output_html { |