kernel-doc (9645ae84ef52d61bc48732a25e57554fc1a9754a) kernel-doc (e946c43a116526e3d947dc03aeb165c1effd9f8f)
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 ##

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

252my %highlights = %highlights_man;
253my $blankline = $blankline_man;
254my $modulename = "Kernel API";
255my $function_only = 0;
256my $man_date = ('January', 'February', 'March', 'April', 'May', 'June',
257 'July', 'August', 'September', 'October',
258 'November', 'December')[(localtime)[4]] .
259 " " . ((localtime)[5]+1900);
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 ##

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

252my %highlights = %highlights_man;
253my $blankline = $blankline_man;
254my $modulename = "Kernel API";
255my $function_only = 0;
256my $man_date = ('January', 'February', 'March', 'April', 'May', 'June',
257 'July', 'August', 'September', 'October',
258 'November', 'December')[(localtime)[4]] .
259 " " . ((localtime)[5]+1900);
260my $show_not_found = 0;
260
261# Essentially these are globals.
262# They probably want to be tidied up, made more localised or something.
263# CAVEAT EMPTOR! Some of the others I localised may not want to be, which
264# could cause "use of undefined value" or other bugs.
265my ($function, %function_table, %parametertypes, $declaration_purpose);
266my ($type, $declaration_name, $return_type);
267my ($newsection, $newcontents, $prototype, $brcount, %source_map);

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

364 $function = shift @ARGV;
365 $function_table{$function} = 1;
366 } elsif ($cmd eq "-v") {
367 $verbose = 1;
368 } elsif (($cmd eq "-h") || ($cmd eq "--help")) {
369 usage();
370 } elsif ($cmd eq '-no-doc-sections') {
371 $no_doc_sections = 1;
261
262# Essentially these are globals.
263# They probably want to be tidied up, made more localised or something.
264# CAVEAT EMPTOR! Some of the others I localised may not want to be, which
265# could cause "use of undefined value" or other bugs.
266my ($function, %function_table, %parametertypes, $declaration_purpose);
267my ($type, $declaration_name, $return_type);
268my ($newsection, $newcontents, $prototype, $brcount, %source_map);

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

365 $function = shift @ARGV;
366 $function_table{$function} = 1;
367 } elsif ($cmd eq "-v") {
368 $verbose = 1;
369 } elsif (($cmd eq "-h") || ($cmd eq "--help")) {
370 usage();
371 } elsif ($cmd eq '-no-doc-sections') {
372 $no_doc_sections = 1;
373 } elsif ($cmd eq '-show-not-found') {
374 $show_not_found = 1;
372 }
373}
374
375# continue execution near EOF;
376
377sub usage {
378 print "Usage: $0 [ -docbook | -html | -html5 | -text | -man | -list ]\n";
379 print " [ -no-doc-sections ]\n";

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

2120 $prototype =~ m/^(\w+\s+\w+\s+\w+\s+\w+\s*\*)\s*([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
2121 $prototype =~ m/^(\w+\s+\w+\s*\*\s*\w+\s*\*\s*)\s*([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/) {
2122 $return_type = $1;
2123 $declaration_name = $2;
2124 my $args = $3;
2125
2126 create_parameterlist($args, ',', $file);
2127 } else {
375 }
376}
377
378# continue execution near EOF;
379
380sub usage {
381 print "Usage: $0 [ -docbook | -html | -html5 | -text | -man | -list ]\n";
382 print " [ -no-doc-sections ]\n";

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

2123 $prototype =~ m/^(\w+\s+\w+\s+\w+\s+\w+\s*\*)\s*([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
2124 $prototype =~ m/^(\w+\s+\w+\s*\*\s*\w+\s*\*\s*)\s*([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/) {
2125 $return_type = $1;
2126 $declaration_name = $2;
2127 my $args = $3;
2128
2129 create_parameterlist($args, ',', $file);
2130 } else {
2128 print STDERR "Warning(${file}:$.): cannot understand function prototype: '$prototype'\n";
2131 print STDERR "Error(${file}:$.): cannot understand prototype: '$prototype'\n";
2132 ++$errors;
2129 return;
2130 }
2131
2132 my $prms = join " ", @parameterlist;
2133 check_sections($file, $declaration_name, "function", $sectcheck, $prms, "");
2134
2135 # This check emits a lot of warnings at the moment, because many
2136 # functions don't have a 'Return' doc section. So until the number

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

2530 {
2531 $contents .= $1 . "\n";
2532 }
2533 }
2534 }
2535 }
2536 if ($initial_section_counter == $section_counter) {
2537 print STDERR "Warning(${file}): no structured comments found\n";
2133 return;
2134 }
2135
2136 my $prms = join " ", @parameterlist;
2137 check_sections($file, $declaration_name, "function", $sectcheck, $prms, "");
2138
2139 # This check emits a lot of warnings at the moment, because many
2140 # functions don't have a 'Return' doc section. So until the number

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

2534 {
2535 $contents .= $1 . "\n";
2536 }
2537 }
2538 }
2539 }
2540 if ($initial_section_counter == $section_counter) {
2541 print STDERR "Warning(${file}): no structured comments found\n";
2542 if (($function_only == 1) && ($show_not_found == 1)) {
2543 print STDERR " Was looking for '$_'.\n" for keys %function_table;
2544 }
2538 if ($output_mode eq "xml") {
2539 # The template wants at least one RefEntry here; make one.
2540 print "<refentry>\n";
2541 print " <refnamediv>\n";
2542 print " <refname>\n";
2543 print " ${file}\n";
2544 print " </refname>\n";
2545 print " <refpurpose>\n";

--- 58 unchanged lines hidden ---
2545 if ($output_mode eq "xml") {
2546 # The template wants at least one RefEntry here; make one.
2547 print "<refentry>\n";
2548 print " <refnamediv>\n";
2549 print " <refname>\n";
2550 print " ${file}\n";
2551 print " </refname>\n";
2552 print " <refpurpose>\n";

--- 58 unchanged lines hidden ---