aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kernel-doc
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2012-10-09 18:35:22 -0400
committerJ. Bruce Fields <bfields@redhat.com>2012-10-09 18:35:22 -0400
commitf474af7051212b4efc8267583fad9c4ebf33ccff (patch)
tree1aa46ebc8065a341f247c2a2d9af2f624ad1d4f8 /scripts/kernel-doc
parent0d22f68f02c10d5d10ec5712917e5828b001a822 (diff)
parente3dd9a52cb5552c46c2a4ca7ccdfb4dab5c72457 (diff)
nfs: disintegrate UAPI for nfs
This is to complete part of the Userspace API (UAPI) disintegration for which the preparatory patches were pulled recently. After these patches, userspace headers will be segregated into: include/uapi/linux/.../foo.h for the userspace interface stuff, and: include/linux/.../foo.h for the strictly kernel internal stuff. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'scripts/kernel-doc')
-rwxr-xr-xscripts/kernel-doc24
1 files changed, 21 insertions, 3 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 9b0c0b8b4ab4..01e8a8e22602 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -230,6 +230,7 @@ my $dohighlight = "";
230 230
231my $verbose = 0; 231my $verbose = 0;
232my $output_mode = "man"; 232my $output_mode = "man";
233my $output_preformatted = 0;
233my $no_doc_sections = 0; 234my $no_doc_sections = 0;
234my %highlights = %highlights_man; 235my %highlights = %highlights_man;
235my $blankline = $blankline_man; 236my $blankline = $blankline_man;
@@ -280,9 +281,10 @@ my $doc_special = "\@\%\$\&";
280my $doc_start = '^/\*\*\s*$'; # Allow whitespace at end of comment start. 281my $doc_start = '^/\*\*\s*$'; # Allow whitespace at end of comment start.
281my $doc_end = '\*/'; 282my $doc_end = '\*/';
282my $doc_com = '\s*\*\s*'; 283my $doc_com = '\s*\*\s*';
284my $doc_com_body = '\s*\* ?';
283my $doc_decl = $doc_com . '(\w+)'; 285my $doc_decl = $doc_com . '(\w+)';
284my $doc_sect = $doc_com . '([' . $doc_special . ']?[\w\s]+):(.*)'; 286my $doc_sect = $doc_com . '([' . $doc_special . ']?[\w\s]+):(.*)';
285my $doc_content = $doc_com . '(.*)'; 287my $doc_content = $doc_com_body . '(.*)';
286my $doc_block = $doc_com . 'DOC:\s*(.*)?'; 288my $doc_block = $doc_com . 'DOC:\s*(.*)?';
287 289
288my %constants; 290my %constants;
@@ -459,8 +461,13 @@ sub output_highlight {
459# print STDERR "contents af:$contents\n"; 461# print STDERR "contents af:$contents\n";
460 462
461 foreach $line (split "\n", $contents) { 463 foreach $line (split "\n", $contents) {
464 if (! $output_preformatted) {
465 $line =~ s/^\s*//;
466 }
462 if ($line eq ""){ 467 if ($line eq ""){
463 print $lineprefix, local_unescape($blankline); 468 if (! $output_preformatted) {
469 print $lineprefix, local_unescape($blankline);
470 }
464 } else { 471 } else {
465 $line =~ s/\\\\\\/\&/g; 472 $line =~ s/\\\\\\/\&/g;
466 if ($output_mode eq "man" && substr($line, 0, 1) eq ".") { 473 if ($output_mode eq "man" && substr($line, 0, 1) eq ".") {
@@ -643,10 +650,12 @@ sub output_section_xml(%) {
643 print "<title>$section</title>\n"; 650 print "<title>$section</title>\n";
644 if ($section =~ m/EXAMPLE/i) { 651 if ($section =~ m/EXAMPLE/i) {
645 print "<informalexample><programlisting>\n"; 652 print "<informalexample><programlisting>\n";
653 $output_preformatted = 1;
646 } else { 654 } else {
647 print "<para>\n"; 655 print "<para>\n";
648 } 656 }
649 output_highlight($args{'sections'}{$section}); 657 output_highlight($args{'sections'}{$section});
658 $output_preformatted = 0;
650 if ($section =~ m/EXAMPLE/i) { 659 if ($section =~ m/EXAMPLE/i) {
651 print "</programlisting></informalexample>\n"; 660 print "</programlisting></informalexample>\n";
652 } else { 661 } else {
@@ -949,10 +958,12 @@ sub output_blockhead_xml(%) {
949 } 958 }
950 if ($section =~ m/EXAMPLE/i) { 959 if ($section =~ m/EXAMPLE/i) {
951 print "<example><para>\n"; 960 print "<example><para>\n";
961 $output_preformatted = 1;
952 } else { 962 } else {
953 print "<para>\n"; 963 print "<para>\n";
954 } 964 }
955 output_highlight($args{'sections'}{$section}); 965 output_highlight($args{'sections'}{$section});
966 $output_preformatted = 0;
956 if ($section =~ m/EXAMPLE/i) { 967 if ($section =~ m/EXAMPLE/i) {
957 print "</para></example>\n"; 968 print "</para></example>\n";
958 } else { 969 } else {
@@ -1028,10 +1039,12 @@ sub output_function_gnome {
1028 print "<simplesect>\n <title>$section</title>\n"; 1039 print "<simplesect>\n <title>$section</title>\n";
1029 if ($section =~ m/EXAMPLE/i) { 1040 if ($section =~ m/EXAMPLE/i) {
1030 print "<example><programlisting>\n"; 1041 print "<example><programlisting>\n";
1042 $output_preformatted = 1;
1031 } else { 1043 } else {
1032 } 1044 }
1033 print "<para>\n"; 1045 print "<para>\n";
1034 output_highlight($args{'sections'}{$section}); 1046 output_highlight($args{'sections'}{$section});
1047 $output_preformatted = 0;
1035 print "</para>\n"; 1048 print "</para>\n";
1036 if ($section =~ m/EXAMPLE/i) { 1049 if ($section =~ m/EXAMPLE/i) {
1037 print "</programlisting></example>\n"; 1050 print "</programlisting></example>\n";
@@ -1786,6 +1799,7 @@ sub dump_function($$) {
1786 $prototype =~ s/__init +//; 1799 $prototype =~ s/__init +//;
1787 $prototype =~ s/__init_or_module +//; 1800 $prototype =~ s/__init_or_module +//;
1788 $prototype =~ s/__must_check +//; 1801 $prototype =~ s/__must_check +//;
1802 $prototype =~ s/__weak +//;
1789 $prototype =~ s/^#\s*define\s+//; #ak added 1803 $prototype =~ s/^#\s*define\s+//; #ak added
1790 $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//; 1804 $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//;
1791 1805
@@ -2045,6 +2059,9 @@ sub process_file($) {
2045 2059
2046 $section_counter = 0; 2060 $section_counter = 0;
2047 while (<IN>) { 2061 while (<IN>) {
2062 while (s/\\\s*$//) {
2063 $_ .= <IN>;
2064 }
2048 if ($state == 0) { 2065 if ($state == 0) {
2049 if (/$doc_start/o) { 2066 if (/$doc_start/o) {
2050 $state = 1; # next line is always the function name 2067 $state = 1; # next line is always the function name
@@ -2072,7 +2089,7 @@ sub process_file($) {
2072 $descr= $1; 2089 $descr= $1;
2073 $descr =~ s/^\s*//; 2090 $descr =~ s/^\s*//;
2074 $descr =~ s/\s*$//; 2091 $descr =~ s/\s*$//;
2075 $descr =~ s/\s+/ /; 2092 $descr =~ s/\s+/ /g;
2076 $declaration_purpose = xml_escape($descr); 2093 $declaration_purpose = xml_escape($descr);
2077 $in_purpose = 1; 2094 $in_purpose = 1;
2078 } else { 2095 } else {
@@ -2164,6 +2181,7 @@ sub process_file($) {
2164 # Continued declaration purpose 2181 # Continued declaration purpose
2165 chomp($declaration_purpose); 2182 chomp($declaration_purpose);
2166 $declaration_purpose .= " " . xml_escape($1); 2183 $declaration_purpose .= " " . xml_escape($1);
2184 $declaration_purpose =~ s/\s+/ /g;
2167 } else { 2185 } else {
2168 $contents .= $1 . "\n"; 2186 $contents .= $1 . "\n";
2169 } 2187 }