# -*-perl-*- #/*@@ # @file grdoc_varindex # @date Sun Apr 21 12:33:19 1996 # @author Paul Walker # @desc # Makes the variable and parameter index. Assumes that the associate # arrays %[vp](type|file) have been correctly constructed. #

# These arrays need a little explanation. type is obvious. But # file contains a space delimited list of the files and or routines # in which the parameter and or header was used. This will get parsed # out with resolve_XRef (see grdoc_parse) and turned into a comma separated # list. All this happens in makeVPTable # @enddesc # @comment # $Id: grdoc_varindex,v 1.6 1996/04/21 17:55:38 pwalker Exp $ # @endcomment #@@*/ #/*@@ # @routine grdoc_varindex # @date Sun Apr 21 12:52:36 1996 # @author Paul Walker # @desc # Makes the variable description page and parameter description # page. A future improvement would to be not to make V or P # if there were no V or P's, but that would be a change to # @seeroutine navigation also. # @enddesc # @calls html_head, navigation, makeVPTable, html_foot # @calledby main #@@*/ sub grdoc_varindex { $grdocoutflag = ""; $grdocoutflag = "+" if $opt_O; open (OUT, "> $opt_o/Vars.html") || die "$opt_o/Vars.html: $!\n"; &html_head("Variable Listing"); print OUT "

$opt_c

\n"; print OUT "

Variable Listing

"; &navigation("./"); print OUT "

"; print OUT "\n"; print OUT ""; print OUT ""; print OUT "\n"; &makeVPTable("v"); if ($opt_O) { print OUT "Note: $grdocoutflag indicates routines which "; print OUT "update (or output or return) the variable in question

"; } print OUT "

VariableTypeFile/Routine
\n"; print OUT "

"; &navigation("./"); &html_foot("Variable Listing"); close OUT; open (OUT, "> $opt_o/Pars.html") || die "$opt_o/Pars.html: $!\n"; &html_head("Parameter Listing"); print OUT "

$opt_c

\n"; print OUT "

Parameter Listing

"; &navigation("./"); print OUT "

"; print OUT "\n"; print OUT ""; print OUT ""; print OUT "\n"; &makeVPTable("p"); print OUT "
ParameterTypeFile/Routine
\n"; print OUT "

"; &navigation("./"); &html_foot("Parameter Listing"); close OUT; } #/*@@ # @routine makeVPTable # @date Sun Apr 21 12:54:07 1996 # @author Paul Walker # @desc # Makes a table of variables or parameters based on which vars or pars # were read in pass2. Note the eval early on to select which one # we do. # @enddesc # @calls resolve_XRefs # @calledby grdoc_varindex # @var which # @vdesc "v" means use variables, "p" means use params. # @vtype char # @vio in # @endvar #@@*/ sub makeVPTable { local ($which) = @_[0]; local (%xtype, %xfile); eval "\%xtype = \%${which}type"; eval "\%xfile = \%${which}file"; foreach $X (sort cialph keys %xtype) { print OUT "$X$xtype{$X} "; print OUT ""; $rco = ""; $hl = ""; foreach $XR (sort cialph split(' ',$xfile{$X})) { if ($XR =~ m:GRDOCVARISOUT:) { $hl = $grdocoutflag; } else { print OUT "$rco$hl"; print OUT &resolve_XRefs("\@seefile $XR", "norich"); $hl = ""; $rco = ", "; } } print OUT " \n"; } } 1;