Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.4.6 /scripts/kernel-doc

Filename:/scripts/kernel-doc
Lines Added:37
Lines Deleted:2
Also changed in: (Previous) 2.4.6-pre9  2.4.6-pre8  2.4.6-pre7  2.4.6-pre6  2.4.6-pre5  2.4.5-ac24 
(Following) 2.4.9-ac16  2.4.9-ac17  2.4.9-ac18  2.4.10-ac1  2.4.10-ac2  2.4.10-ac3 

Location
[  2.4.6
  [  scripts
     o  kernel-doc

Patch

diff -u --recursive --new-file v2.4.5/linux/scripts/kernel-doc linux/scripts/kernel-doc
--- v2.4.5/linux/scripts/kernel-doc   Wed Apr 25 16:31:16 2001
+++ linux/scripts/kernel-doc   Mon Jul  2 13:56:40 2001
@@ -18,10 +18,19 @@
 #       Functions prototyped as foo(void) same as foo()
 #       Stop eval'ing where we don't need to.
 # -- huggie@earth.li
+
+# 27/06/2001 -  Allowed whitespace after initial "/**" and
+#               allowed comments before function declarations.
+# -- Christian Kreibich <ck@whoop.org>
+
 # Still to do:
 #    - add perldoc documentation
 #    - Look more closely at some of the scarier bits :)
 
+# 26/05/2001 -    Support for separate source and object trees.
+#      Return error code.
+#       Keith Owens <kaos@ocs.com.au>
+
 #
 # This will read a 'c' file and scan for embedded comments in the
 # style of gnome comments (+minor extensions - see below).
@@ -97,6 +106,8 @@
 # '@parameter' - name of a parameter
 # '%CONST' - name of a constant.
 
+my $errors = 0;
+
 # match expressions used to find embedded type information
 my $type_constant = '\%([-_\w]+)';
 my $type_func = '(\w+)\(\)';
@@ -198,6 +209,7 @@
 my @parameterlist = ();
 my %sections = ();
 my @sectionlist = ();
+my %source_map = ();
 
 my $contents = "";
 my $section_default = "Description";   # default section
@@ -776,6 +788,7 @@
             if (defined $type && $type && !defined $parameters{$param}) {
            $parameters{$param} = "-- undescribed --";
            print STDERR "Warning($file:$.): Function parameter '$param' not described in '$function_name'\n";
+      ++$errors;
        }
 
        push @parameterlist, $param;
@@ -784,6 +797,7 @@
    }
     } else {
    print STDERR "Error($.): cannot understand prototype: '$prototype'\n";
+   ++$errors;
    return;
     }
 
@@ -816,7 +830,7 @@
 
 $doc_special = "\@\%\$\&";
 
-$doc_start = "^/\\*\\*\$";
+$doc_start = "^/\\*\\*\\s*\$"; # Allow whitespace at end of comment start.
 $doc_end = "\\*/";
 $doc_com = "\\s*\\*\\s*";
 $doc_func = $doc_com."(\\w+):?";
@@ -837,6 +851,19 @@
 
 sub process_file($);
 
+# Read the file that maps relative names to absolute names for
+# separate source and object directories and for shadow trees.
+if (open(SOURCE_MAP, "<.tmp_filelist.txt")) {
+   my ($relname, $absname);
+   while(<SOURCE_MAP>) {
+      chop();
+      ($relname, $absname) = (split())[0..1];
+      $relname =~ s:^/+::;
+      $source_map{$relname} = $absname;
+   }
+   close(SOURCE_MAP);
+}
+
 if ($filelist) {
    open(FLIST,"<$filelist") or die "Can't open file list $filelist";
    while(<FLIST>) {
@@ -850,11 +877,17 @@
     process_file($_);
 }
 
+exit($errors);
+
 sub process_file($) {
     my ($file) = @_;
+    if (defined($source_map{$file})) {
+   $file = $source_map{$file};
+    }
 
     if (!open(IN,"<$file")) {
    print STDERR "Error: Cannot open file $file\n";
+   ++$errors;
    return;
     }
 
@@ -887,6 +920,7 @@
        } else {
       print STDERR "WARN($.): Cannot understand $_ on line $.",
       " - I thought it was a doc line\n";
+      ++$errors;
       $state = 0;
        }
    } elsif ($state == 2) {   # look for head: lines, and include content
@@ -937,6 +971,7 @@
        } else {
       # i dont know - bad line?  ignore.
       print STDERR "WARNING($.): bad line: $_"; 
+      ++$errors;
        }
    } elsif ($state == 3) {   # scanning for function { (end of prototype)
        if (m#\s*/\*\s+MACDOC\s*#io) {
@@ -945,7 +980,7 @@
        elsif (/([^\{]*)/) {
       $prototype .= $1;
        }
-       if (/\{/ || /\#/) { # added for #define AK
+       if (/\{/ || /\#/ || /;/) { # added for #define AK, ';' added for declarations.
       $prototype =~ s@/\*.*?\*/@@gos;   # strip comments.
       $prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's.
       $prototype =~ s@^ +@@gos; # strip leading spaces


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.