kernel-doc (1ad560e43c911e19751df65dd2af21341d02eac5) | kernel-doc (88c2b57da4ce3c8b5f849dc5356bdea9e2ed1134) |
---|---|
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 ## --- 47 unchanged lines hidden (view full) --- 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() | 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 ## --- 47 unchanged lines hidden (view full) --- 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. | 64 in the same FILE or any -export-file FILE. |
65 -internal Only output documentation for symbols that have NOT been 66 exported using EXPORT_SYMBOL() or EXPORT_SYMBOL_GPL() | 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. | 67 in the same FILE or any -export-file FILE. |
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: 76 -no-doc-sections Do not output DOC: sections. 77 -enable-lineno Enable output of #define LINENO lines. Only works with 78 reStructuredText format. | 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: 76 -no-doc-sections Do not output DOC: sections. 77 -enable-lineno Enable output of #define LINENO lines. Only works with 78 reStructuredText format. |
79 -export-file FILE Specify an additional FILE in which to look for 80 EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL(). To be used with 81 -export or -internal. May be specified multiple times. |
|
79 80Other parameters: 81 -v Verbose output, more warnings and other information. 82 -h Print this help. 83 84EOF 85 print $message; 86 exit 1; --- 244 unchanged lines hidden (view full) --- 331 OUTPUT_INCLUDE => 1, # output only specified symbols 332 OUTPUT_EXCLUDE => 2, # output everything except specified symbols 333 OUTPUT_EXPORTED => 3, # output exported symbols 334 OUTPUT_INTERNAL => 4, # output non-exported symbols 335}; 336my $output_selection = OUTPUT_ALL; 337my $show_not_found = 0; 338 | 82 83Other parameters: 84 -v Verbose output, more warnings and other information. 85 -h Print this help. 86 87EOF 88 print $message; 89 exit 1; --- 244 unchanged lines hidden (view full) --- 334 OUTPUT_INCLUDE => 1, # output only specified symbols 335 OUTPUT_EXCLUDE => 2, # output everything except specified symbols 336 OUTPUT_EXPORTED => 3, # output exported symbols 337 OUTPUT_INTERNAL => 4, # output non-exported symbols 338}; 339my $output_selection = OUTPUT_ALL; 340my $show_not_found = 0; 341 |
342my @export_file_list; 343 |
|
339my @build_time; 340if (defined($ENV{'KBUILD_BUILD_TIMESTAMP'}) && 341 (my $seconds = `date -d"${ENV{'KBUILD_BUILD_TIMESTAMP'}}" +%s`) ne '') { 342 @build_time = gmtime($seconds); 343} else { 344 @build_time = localtime; 345} 346 --- 136 unchanged lines hidden (view full) --- 483 $function = shift @ARGV; 484 $function_table{$function} = 1; 485 } elsif ($cmd eq "-export") { # only exported symbols 486 $output_selection = OUTPUT_EXPORTED; 487 %function_table = (); 488 } elsif ($cmd eq "-internal") { # only non-exported symbols 489 $output_selection = OUTPUT_INTERNAL; 490 %function_table = (); | 344my @build_time; 345if (defined($ENV{'KBUILD_BUILD_TIMESTAMP'}) && 346 (my $seconds = `date -d"${ENV{'KBUILD_BUILD_TIMESTAMP'}}" +%s`) ne '') { 347 @build_time = gmtime($seconds); 348} else { 349 @build_time = localtime; 350} 351 --- 136 unchanged lines hidden (view full) --- 488 $function = shift @ARGV; 489 $function_table{$function} = 1; 490 } elsif ($cmd eq "-export") { # only exported symbols 491 $output_selection = OUTPUT_EXPORTED; 492 %function_table = (); 493 } elsif ($cmd eq "-internal") { # only non-exported symbols 494 $output_selection = OUTPUT_INTERNAL; 495 %function_table = (); |
496 } elsif ($cmd eq "-export-file") { 497 my $file = shift @ARGV; 498 push(@export_file_list, $file); |
|
491 } elsif ($cmd eq "-v") { 492 $verbose = 1; 493 } elsif (($cmd eq "-h") || ($cmd eq "--help")) { 494 usage(); 495 } elsif ($cmd eq '-no-doc-sections') { 496 $no_doc_sections = 1; 497 } elsif ($cmd eq '-enable-lineno') { 498 $enable_lineno = 1; --- 2243 unchanged lines hidden (view full) --- 2742 2743 if (defined($source_map{$file})) { 2744 $file = $source_map{$file}; 2745 } 2746 2747 return $file; 2748} 2749 | 499 } elsif ($cmd eq "-v") { 500 $verbose = 1; 501 } elsif (($cmd eq "-h") || ($cmd eq "--help")) { 502 usage(); 503 } elsif ($cmd eq '-no-doc-sections') { 504 $no_doc_sections = 1; 505 } elsif ($cmd eq '-enable-lineno') { 506 $enable_lineno = 1; --- 2243 unchanged lines hidden (view full) --- 2750 2751 if (defined($source_map{$file})) { 2752 $file = $source_map{$file}; 2753 } 2754 2755 return $file; 2756} 2757 |
2758sub process_export_file($) { 2759 my ($orig_file) = @_; 2760 my $file = map_filename($orig_file); 2761 2762 if (!open(IN,"<$file")) { 2763 print STDERR "Error: Cannot open file $file\n"; 2764 ++$errors; 2765 return; 2766 } 2767 2768 while (<IN>) { 2769 if (/$export_symbol/) { 2770 $function_table{$2} = 1; 2771 } 2772 } 2773 2774 close(IN); 2775} 2776 |
|
2750sub process_file($) { 2751 my $file; 2752 my $identifier; 2753 my $func; 2754 my $descr; 2755 my $in_purpose = 0; 2756 my $initial_section_counter = $section_counter; 2757 my ($orig_file) = @_; --- 318 unchanged lines hidden (view full) --- 3076 chop(); 3077 ($relname, $absname) = (split())[0..1]; 3078 $relname =~ s:^/+::; 3079 $source_map{$relname} = $absname; 3080 } 3081 close(SOURCE_MAP); 3082} 3083 | 2777sub process_file($) { 2778 my $file; 2779 my $identifier; 2780 my $func; 2781 my $descr; 2782 my $in_purpose = 0; 2783 my $initial_section_counter = $section_counter; 2784 my ($orig_file) = @_; --- 318 unchanged lines hidden (view full) --- 3103 chop(); 3104 ($relname, $absname) = (split())[0..1]; 3105 $relname =~ s:^/+::; 3106 $source_map{$relname} = $absname; 3107 } 3108 close(SOURCE_MAP); 3109} 3110 |
3111if ($output_selection == OUTPUT_EXPORTED || 3112 $output_selection == OUTPUT_INTERNAL) { 3113 foreach (@export_file_list) { 3114 chomp; 3115 process_export_file($_); 3116 } 3117} 3118 |
|
3084foreach (@ARGV) { 3085 chomp; 3086 process_file($_); 3087} 3088if ($verbose && $errors) { 3089 print STDERR "$errors errors\n"; 3090} 3091if ($verbose && $warnings) { 3092 print STDERR "$warnings warnings\n"; 3093} 3094 3095exit($errors); | 3119foreach (@ARGV) { 3120 chomp; 3121 process_file($_); 3122} 3123if ($verbose && $errors) { 3124 print STDERR "$errors errors\n"; 3125} 3126if ($verbose && $warnings) { 3127 print STDERR "$warnings warnings\n"; 3128} 3129 3130exit($errors); |