summaryrefslogtreecommitdiff
path: root/libiberty/maint-tool
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2001-10-15 22:50:13 -0400
committerDJ Delorie <dj@gcc.gnu.org>2001-10-15 22:50:13 -0400
commitaac04c15d761628889f138b16219bce27f25bbb2 (patch)
tree58903ff3e4335306b7c9f5c24e8baf3b9a9922a8 /libiberty/maint-tool
parent2d4368e6cd739fadc7e3cc1111f30f2941e8a8a3 (diff)
downloadgcc-aac04c15d761628889f138b16219bce27f25bbb2.tar.gz
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
Diffstat (limited to 'libiberty/maint-tool')
-rw-r--r--libiberty/maint-tool105
1 files changed, 105 insertions, 0 deletions
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 (<T>) {
+ if (/^\@deftype[^\(]* ([^\s\(]+) *\(/) {
+ $documented{$1} = 1;
+ }
+ }
+ close(T);
+ }
+ if ($file =~ /\.c$/) {
+ open(C, "$srcdir/$file");
+ while (<C>) {
+ if (/\@undocumented (\S+)/) {
+ $documented{$1} = 1;
+ }
+ if (/^static /) {
+ if (! /[\(;]/) {
+ s/[\r\n]+$/ /;
+ $_ .= <C>;
+ }
+ while ($_ =~ /\([^\)]*$/) {
+ s/[\r\n]+$/ /;
+ $_ .= <C>;
+ }
+ }
+ 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 (<TAGS>) {
+ s/[\r\n]+$//;
+ if (/^\014$/) {
+ $filename = <TAGS>;
+ $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;
+ }
+}