kernel-doc (5e64fa9c441ff273f39527f4014d3c3e724d321a) | kernel-doc (86ae2e38d40ed6bf7c907d126053e6f4b1dc5b6e) |
---|---|
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 ## --- 45 unchanged lines hidden (view full) --- 54 -html Output HTML format. 55 -html5 Output HTML5 format. 56 -list Output symbol list format. This is for use by docproc. 57 -man Output troff manual page format. This is the default. 58 -rst Output reStructuredText format. 59 -text Output plain text format. 60 61Output selection (mutually exclusive): | 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 ## --- 45 unchanged lines hidden (view full) --- 54 -html Output HTML format. 55 -html5 Output HTML5 format. 56 -list Output symbol list format. This is for use by docproc. 57 -man Output troff manual page format. This is the default. 58 -rst Output reStructuredText format. 59 -text Output plain text format. 60 61Output selection (mutually exclusive): |
62 -export Only output documentation for symbols that have been 63 exported using EXPORT_SYMBOL() or EXPORT_SYMBOL_GPL() 64 in the same FILE. 65 -internal Only output documentation for symbols that have NOT been 66 exported using EXPORT_SYMBOL() or EXPORT_SYMBOL_GPL() 67 in the same FILE. |
|
62 -function NAME Only output documentation for the given function(s) 63 or DOC: section title(s). All other functions and DOC: 64 sections are ignored. May be specified multiple times. 65 -nofunction NAME Do NOT output documentation for the given function(s); 66 only output documentation for the other functions and 67 DOC: sections. May be specified multiple times. 68 69Output selection modifiers: --- 305 unchanged lines hidden (view full) --- 375my $doc_com_body = '\s*\* ?'; 376my $doc_decl = $doc_com . '(\w+)'; 377my $doc_sect = $doc_com . '([' . $doc_special . ']?[\w\s]+):(.*)'; 378my $doc_content = $doc_com_body . '(.*)'; 379my $doc_block = $doc_com . 'DOC:\s*(.*)?'; 380my $doc_split_start = '^\s*/\*\*\s*$'; 381my $doc_split_sect = '\s*\*\s*(@[\w\s]+):(.*)'; 382my $doc_split_end = '^\s*\*/\s*$'; | 68 -function NAME Only output documentation for the given function(s) 69 or DOC: section title(s). All other functions and DOC: 70 sections are ignored. May be specified multiple times. 71 -nofunction NAME Do NOT output documentation for the given function(s); 72 only output documentation for the other functions and 73 DOC: sections. May be specified multiple times. 74 75Output selection modifiers: --- 305 unchanged lines hidden (view full) --- 381my $doc_com_body = '\s*\* ?'; 382my $doc_decl = $doc_com . '(\w+)'; 383my $doc_sect = $doc_com . '([' . $doc_special . ']?[\w\s]+):(.*)'; 384my $doc_content = $doc_com_body . '(.*)'; 385my $doc_block = $doc_com . 'DOC:\s*(.*)?'; 386my $doc_split_start = '^\s*/\*\*\s*$'; 387my $doc_split_sect = '\s*\*\s*(@[\w\s]+):(.*)'; 388my $doc_split_end = '^\s*\*/\s*$'; |
389my $export_symbol = '^\s*EXPORT_SYMBOL(_GPL)?\s*\(\s*(\w+)\s*\)\s*;'; |
|
383 384my %constants; 385my %parameterdescs; 386my @parameterlist; 387my %sections; 388my @sectionlist; 389my $sectcheck; 390my $struct_actual; --- 48 unchanged lines hidden (view full) --- 439 } elsif ($cmd eq "-function") { # to only output specific functions 440 $function_only = 1; 441 $function = shift @ARGV; 442 $function_table{$function} = 1; 443 } elsif ($cmd eq "-nofunction") { # to only output specific functions 444 $function_only = 2; 445 $function = shift @ARGV; 446 $function_table{$function} = 1; | 390 391my %constants; 392my %parameterdescs; 393my @parameterlist; 394my %sections; 395my @sectionlist; 396my $sectcheck; 397my $struct_actual; --- 48 unchanged lines hidden (view full) --- 446 } elsif ($cmd eq "-function") { # to only output specific functions 447 $function_only = 1; 448 $function = shift @ARGV; 449 $function_table{$function} = 1; 450 } elsif ($cmd eq "-nofunction") { # to only output specific functions 451 $function_only = 2; 452 $function = shift @ARGV; 453 $function_table{$function} = 1; |
454 } elsif ($cmd eq "-export") { # only exported symbols 455 $function_only = 3; 456 %function_table = () 457 } elsif ($cmd eq "-internal") { # only non-exported symbols 458 $function_only = 4; 459 %function_table = () |
|
447 } elsif ($cmd eq "-v") { 448 $verbose = 1; 449 } elsif (($cmd eq "-h") || ($cmd eq "--help")) { 450 usage(); 451 } elsif ($cmd eq '-no-doc-sections') { 452 $no_doc_sections = 1; 453 } elsif ($cmd eq '-show-not-found') { 454 $show_not_found = 1; --- 1511 unchanged lines hidden (view full) --- 1966# calls the generated, variable output_ function name based on 1967# functype and output_mode 1968sub output_declaration { 1969 no strict 'refs'; 1970 my $name = shift; 1971 my $functype = shift; 1972 my $func = "output_${functype}_$output_mode"; 1973 if (($function_only==0) || | 460 } elsif ($cmd eq "-v") { 461 $verbose = 1; 462 } elsif (($cmd eq "-h") || ($cmd eq "--help")) { 463 usage(); 464 } elsif ($cmd eq '-no-doc-sections') { 465 $no_doc_sections = 1; 466 } elsif ($cmd eq '-show-not-found') { 467 $show_not_found = 1; --- 1511 unchanged lines hidden (view full) --- 1979# calls the generated, variable output_ function name based on 1980# functype and output_mode 1981sub output_declaration { 1982 no strict 'refs'; 1983 my $name = shift; 1984 my $functype = shift; 1985 my $func = "output_${functype}_$output_mode"; 1986 if (($function_only==0) || |
1974 ( $function_only == 1 && defined($function_table{$name})) || 1975 ( $function_only == 2 && !($functype eq "function" && defined($function_table{$name})))) | 1987 ( ($function_only == 1 || $function_only == 3) && 1988 defined($function_table{$name})) || 1989 ( ($function_only == 2 || $function_only == 4) && 1990 !($functype eq "function" && defined($function_table{$name})))) |
1976 { 1977 &$func(@_); 1978 $section_counter++; 1979 } 1980} 1981 1982## 1983# generic output function - calls the right one based on current output mode. --- 686 unchanged lines hidden (view full) --- 2670 } 2671 2672 if (!open(IN,"<$file")) { 2673 print STDERR "Error: Cannot open file $file\n"; 2674 ++$errors; 2675 return; 2676 } 2677 | 1991 { 1992 &$func(@_); 1993 $section_counter++; 1994 } 1995} 1996 1997## 1998# generic output function - calls the right one based on current output mode. --- 686 unchanged lines hidden (view full) --- 2685 } 2686 2687 if (!open(IN,"<$file")) { 2688 print STDERR "Error: Cannot open file $file\n"; 2689 ++$errors; 2690 return; 2691 } 2692 |
2693 # two passes for -export and -internal 2694 if ($function_only == 3 || $function_only == 4) { 2695 while (<IN>) { 2696 if (/$export_symbol/o) { 2697 $function_table{$2} = 1; 2698 } 2699 } 2700 seek(IN, 0, 0); 2701 } 2702 |
|
2678 $. = 1; 2679 2680 $section_counter = 0; 2681 while (<IN>) { 2682 while (s/\\\s*$//) { 2683 $_ .= <IN>; 2684 } 2685 if ($state == 0) { --- 287 unchanged lines hidden --- | 2703 $. = 1; 2704 2705 $section_counter = 0; 2706 while (<IN>) { 2707 while (s/\\\s*$//) { 2708 $_ .= <IN>; 2709 } 2710 if ($state == 0) { --- 287 unchanged lines hidden --- |