From aac04c15d761628889f138b16219bce27f25bbb2 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Mon, 15 Oct 2001 22:50:13 -0400 Subject: Makefile.in (TEXIFILES): Add fnmatch.txh. * Makefile.in (TEXIFILES): Add fnmatch.txh. (maint-undoc): New. maint-tool: Add "undoc" tool. * alloca.c, argv.c, asprintf.c, choose-temp.c, concat.c, fdmatch.c, ffs.c, getruntime.c, insque.c, lbasename.c, make-temp-file.c, mkstemps.c, pexecute.c, random.c, spaces.c, strerror.s, strsignal.c, strtol.c, vasprintf.c: Add or update documentation. * fnmatch.txh: New. * functions.texi: Regenerate. From-SVN: r46274 --- libiberty/maint-tool | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) (limited to 'libiberty/maint-tool') diff --git a/libiberty/maint-tool b/libiberty/maint-tool index 97088009f8d..75b0c508cd9 100644 --- a/libiberty/maint-tool +++ b/libiberty/maint-tool @@ -35,9 +35,17 @@ if ($mode eq "-s") { } &missing() if $mode eq "missing"; +&undoc() if $mode eq "undoc"; exit 0; +format STDOUT = +^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~ +$out + ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~ +$out +. + ###################################################################### sub missing { @@ -73,3 +81,100 @@ sub missing { } } } + +###################################################################### + +sub undoc { + + opendir(S, $srcdir); + while ($file = readdir S) { + if ($file =~ /\.texi$/) { + open(T, "$srcdir/$file"); + while () { + if (/^\@deftype[^\(]* ([^\s\(]+) *\(/) { + $documented{$1} = 1; + } + } + close(T); + } + if ($file =~ /\.c$/) { + open(C, "$srcdir/$file"); + while () { + if (/\@undocumented (\S+)/) { + $documented{$1} = 1; + } + if (/^static /) { + if (! /[\(;]/) { + s/[\r\n]+$/ /; + $_ .= ; + } + while ($_ =~ /\([^\)]*$/) { + s/[\r\n]+$/ /; + $_ .= ; + } + } + s/ VPARAMS([ \(])/$1/; + s/PREFIX\(([^\)]*)\)/byte_$1/; + if (/^static [^\(]* ([^\s\(]+) *\(.*\)$/) { + $documented{$1} = 1; + } + } + } + } + closedir(D); + + # $out = join(' ', sort keys %documented); + # write; + # print "\n"; + + system "etags $srcdir/*.c $srcdir/../include/*.h"; + open(TAGS, "TAGS"); + while () { + s/[\r\n]+$//; + if (/^\014$/) { + $filename = ; + $filename =~ s/[\r\n]+$//; + $filename =~ s/,\d+$//; + $filename =~ s@.*[/\\]@@; + next; + } + if ($filename =~ /\.c$/ ) { + next unless /^[_a-zA-Z]/; + } else { + next unless /^\# *define/; + s/\# *define *//; + } + next if $filename =~ /mpw\.c/; + + s/ VPARAMS//; + s/ *\177.*//; + s/,$//; + s/DEFUN\(//; + s/\(//; + + next if /^static /; + next if /\s/; + next if /^_/; + next if $documented{$_}; + next if /_H_?$/; + + if ($seen_in{$_} ne $filename) { + $saw{$_} ++; + } + $seen_in{$_} = $filename; + } + + for $k (keys %saw) { + delete $saw{$k} if $saw{$k} > 1; + } + + for $k (sort keys %saw) { + $fromfile{$seen_in{$k}} .= " " if $fromfile{$seen_in{$k}}; + $fromfile{$seen_in{$k}} .= $k; + } + + for $f (sort keys %fromfile) { + $out = "$f: $fromfile{$f}"; + write; + } +} -- cgit v1.2.1