#!/usr/bin/perl use strict; use Data::Dump qw(dump); my $pathdir_help="."; my @files; my @stak; my %function_help; my %useref; my %section; my %ignorehtml=( 'pgbench.html', ); my @keys_name=( '' ,'overlaps' ); my @keys=( "
true' #overlaps end
);
my %others_func=(
'FUNCTIONS-DATETIME-DELAY'=>'pg_sleep'
,'FUNCTIONS-CASE'=>'case'
,'FUNCTIONS-COMPARISONS-IN-SCALAR'=>'in'
,'id-1.5.8.30.15'=>'not in'
,'FUNCTIONS-NULLIF'=>'nullif'
,'FUNCTIONS-COALESCE-NVL-IFNULL'=>'coalesce'
,'FUNCTIONS-GREATEST-LEAST'=>'greatest'
,'greatest'=>'least'
,'FUNCTIONS-LIKE'=>'like'
,'FUNCTIONS-SIMILARTO-REGEXP'=>'similar to'
,'id-1.5.8.30.16' => 'any'
,'id-1.5.8.30.17' => 'all'
,'ROW-WISE-COMPARISON' => 'is distinct from'
);
my %tags=(
'pclass="func_signature"' => '',
'pclass="func_signature"/p' => '',
'codeclass="token"' => '',
'codeclass="token"/code' => '',
'p' => '',
'p/p' => '
',
'ul' => '',
'ul/ul' => '
',
'liclass="listitem"' => '',
'divclass="note"/div' => '
',
'divclass="warning"' => '',
'divclass="warning"/div' => '
',
'divclass="tip"'=>'',
'divclass="tip"/div'=>'',
'div' => '',
'div/div' => '',
'h3class="title"' =>'',
'h3class="title"/h3' =>'
',
'a' => '',
'a/a' => '',
'sup' => '',
'sup/sup' => '',
'em' => '',
'em/em' => '',
'emclass="replaceable"' => '',
'emclass="replaceable"/em' => '',
'emclass="lineannotation"' => '',
'emclass="lineannotation"/em' => '',
'spanclass="lineannotation"' => '',
'spanclass="lineannotation"/span' => '',
'acronymclass="acronym"' => '',
'acronymclass="acronym"/acronym' => '',
'spanclass="quote"' => '',
'spanclass="quote"/span' => '',
'spanclass="productname"' => '',
'spanclass="productname"/span' => '',
'spanclass="emphasis"' => '',
'spanclass="emphasis"/span' => '',
'spanclass="refentrytitle"' => '',
'spanclass="refentrytitle"/span' => '',
'spanclass="symbol_font"' => '',
'spanclass="symbol_font"/span' => '',
'code' => '',
'code/code' => '',
'preclass="programlisting"' => '
', 'preclass="programlisting"/pre' => '', 'preclass="screen"' => '
', 'preclass="screen"/pre' => '', 'preclass="synopsis"' => '', 'preclass="synopsis"/pre' => '', 'spanclass="optional"' => '', 'spanclass="optional"/span' => '', 'spanclass="systemitem"' => '', 'spanclass="systemitem"/span' => '', 'spanclass="application"' => '', 'spanclass="application"/span' => '', 'codeclass="filename"' => '', 'codeclass="filename"/code' => '', 'codeclass="computeroutput"' => '', 'codeclass="computeroutput"/code' => '', 'emclass="parameter"' => '', 'emclass="parameter"/em' => '', 'emclass="firstterm"' => '', 'emclass="firstterm"/em' => '', 'codeclass="varname"' => '', 'codeclass="varname"/code' => '', 'codeclass="structname"' => '', 'codeclass="structname"/code' => '', 'codeclass="structfield"' => '', 'codeclass="structfield"/code' => '', 'codeclass="literal"' => '', 'codeclass="literal"/code' => '', 'codeclass="function"' => '', 'codeclass="function"/code' => '', 'codeclass="returnvalue"' => '', 'codeclass="returnvalue"/code' => '', 'codeclass="type"' => '', 'codeclass="type"/code' => '', 'codeclass="command"' => '', 'codeclass="command"/code' => '', ); opendir(DIR, $pathdir_help) or die "can't opendir $pathdir_help: $!"; while (defined(my $file = readdir(DIR))) { next if (!($file =~ /html$/)); push @files, $file; } closedir(DIR); my $TDcount=0; foreach my $file (sort @files) { #open my $info, $file or die "Could not open $file: $!"; if (exists $ignorehtml{$file}) {next;} my $fileContent; open(my $F, '<', $file) or die $!; binmode($F); { local $/; $fileContent = <$F>; } close($F); my $pos=0; my $lvl=0; my $cc=0; my $val=""; my $se="div"; #div id=href $pos=0; while ($pos>-1) { my $n1=index($fileContent,"id=\"",$pos); if ($n1 > -1) { my $n2=index($fileContent,"\"",$n1+4); my $id_name=substr($fileContent,$n1+4,$n2-$n1-4); my $nn=$n1; while (substr($fileContent,$nn,1) ne "<") { $nn--; } $nn++; ($se)= substr($fileContent,$nn,40) =~ /(\S+)/; #print "se=$se id_name=$id_name tag=\n40 sim=".substr($fileContent,$nn,40); $n2++; $pos=$n2; #if (exists $ref{$id_name}) if (uc($id_name) eq $id_name || (exists $others_func{$id_name} && $se ne "a")) { my @st=(); my $n3=$pos; while ($n1 > -1) { $n1=$pos; $n1=index($fileContent,$se,$pos); if ($n1 >-1) { #print "$n1\n"; if (substr($fileContent,$n1-1,1) eq "<") { #