kernel-doc (e314ba3130940cb58b533b20969a6ee9b12435ed) kernel-doc (12ae6779332181432a7feda740735ffa5bb3d32d)
1#!/usr/bin/perl -w
2
3use strict;
4
5## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ##
6## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ##
7## Copyright (C) 2001 Simon Huggins ##
8## Copyright (C) 2005-2012 Randy Dunlap ##

--- 267 unchanged lines hidden (view full) ---

276# 'function', 'struct', 'union', 'enum', 'typedef'
277my $decl_type;
278
279my $doc_special = "\@\%\$\&";
280
281my $doc_start = '^/\*\*\s*$'; # Allow whitespace at end of comment start.
282my $doc_end = '\*/';
283my $doc_com = '\s*\*\s*';
1#!/usr/bin/perl -w
2
3use strict;
4
5## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ##
6## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ##
7## Copyright (C) 2001 Simon Huggins ##
8## Copyright (C) 2005-2012 Randy Dunlap ##

--- 267 unchanged lines hidden (view full) ---

276# 'function', 'struct', 'union', 'enum', 'typedef'
277my $decl_type;
278
279my $doc_special = "\@\%\$\&";
280
281my $doc_start = '^/\*\*\s*$'; # Allow whitespace at end of comment start.
282my $doc_end = '\*/';
283my $doc_com = '\s*\*\s*';
284my $doc_com_body = '\s*\* ?';
284my $doc_decl = $doc_com . '(\w+)';
285my $doc_sect = $doc_com . '([' . $doc_special . ']?[\w\s]+):(.*)';
285my $doc_decl = $doc_com . '(\w+)';
286my $doc_sect = $doc_com . '([' . $doc_special . ']?[\w\s]+):(.*)';
286my $doc_content = $doc_com . '(.*)';
287my $doc_content = $doc_com_body . '(.*)';
287my $doc_block = $doc_com . 'DOC:\s*(.*)?';
288
289my %constants;
290my %parameterdescs;
291my @parameterlist;
292my %sections;
293my @sectionlist;
294my $sectcheck;

--- 160 unchanged lines hidden (view full) ---

455 $contents =~ s/\\\\\\/\&/g;
456 }
457# print STDERR "contents b4:$contents\n";
458 eval $dohighlight;
459 die $@ if $@;
460# print STDERR "contents af:$contents\n";
461
462 foreach $line (split "\n", $contents) {
288my $doc_block = $doc_com . 'DOC:\s*(.*)?';
289
290my %constants;
291my %parameterdescs;
292my @parameterlist;
293my %sections;
294my @sectionlist;
295my $sectcheck;

--- 160 unchanged lines hidden (view full) ---

456 $contents =~ s/\\\\\\/\&/g;
457 }
458# print STDERR "contents b4:$contents\n";
459 eval $dohighlight;
460 die $@ if $@;
461# print STDERR "contents af:$contents\n";
462
463 foreach $line (split "\n", $contents) {
464 if (! $output_preformatted) {
465 $line =~ s/^\s*//;
466 }
463 if ($line eq ""){
464 if (! $output_preformatted) {
465 print $lineprefix, local_unescape($blankline);
466 }
467 } else {
468 $line =~ s/\\\\\\/\&/g;
469 if ($output_mode eq "man" && substr($line, 0, 1) eq ".") {
470 print "\\&$line";

--- 1609 unchanged lines hidden (view full) ---

2080 }
2081
2082 $state = 2;
2083 if (/-(.*)/) {
2084 # strip leading/trailing/multiple spaces
2085 $descr= $1;
2086 $descr =~ s/^\s*//;
2087 $descr =~ s/\s*$//;
467 if ($line eq ""){
468 if (! $output_preformatted) {
469 print $lineprefix, local_unescape($blankline);
470 }
471 } else {
472 $line =~ s/\\\\\\/\&/g;
473 if ($output_mode eq "man" && substr($line, 0, 1) eq ".") {
474 print "\\&$line";

--- 1609 unchanged lines hidden (view full) ---

2084 }
2085
2086 $state = 2;
2087 if (/-(.*)/) {
2088 # strip leading/trailing/multiple spaces
2089 $descr= $1;
2090 $descr =~ s/^\s*//;
2091 $descr =~ s/\s*$//;
2088 $descr =~ s/\s+/ /;
2092 $descr =~ s/\s+/ /g;
2089 $declaration_purpose = xml_escape($descr);
2090 $in_purpose = 1;
2091 } else {
2092 $declaration_purpose = "";
2093 }
2094
2095 if (($declaration_purpose eq "") && $verbose) {
2096 print STDERR "Warning(${file}:$.): missing initial short description on line:\n";

--- 75 unchanged lines hidden (view full) ---

2172 } else {
2173 $contents .= "\n";
2174 }
2175 $in_purpose = 0;
2176 } elsif ($in_purpose == 1) {
2177 # Continued declaration purpose
2178 chomp($declaration_purpose);
2179 $declaration_purpose .= " " . xml_escape($1);
2093 $declaration_purpose = xml_escape($descr);
2094 $in_purpose = 1;
2095 } else {
2096 $declaration_purpose = "";
2097 }
2098
2099 if (($declaration_purpose eq "") && $verbose) {
2100 print STDERR "Warning(${file}:$.): missing initial short description on line:\n";

--- 75 unchanged lines hidden (view full) ---

2176 } else {
2177 $contents .= "\n";
2178 }
2179 $in_purpose = 0;
2180 } elsif ($in_purpose == 1) {
2181 # Continued declaration purpose
2182 chomp($declaration_purpose);
2183 $declaration_purpose .= " " . xml_escape($1);
2184 $declaration_purpose =~ s/\s+/ /g;
2180 } else {
2181 $contents .= $1 . "\n";
2182 }
2183 } else {
2184 # i dont know - bad line? ignore.
2185 print STDERR "Warning(${file}:$.): bad line: $_";
2186 ++$warnings;
2187 }

--- 120 unchanged lines hidden ---
2185 } else {
2186 $contents .= $1 . "\n";
2187 }
2188 } else {
2189 # i dont know - bad line? ignore.
2190 print STDERR "Warning(${file}:$.): bad line: $_";
2191 ++$warnings;
2192 }

--- 120 unchanged lines hidden ---