kernel-doc (b112e0f73fe8e9e69e60bc9d6d16217795259c3c) | kernel-doc (4b44595a7b8e0ebf3fce108df65d8cd6a6cf4910) |
---|---|
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-2007 Randy Dunlap ## --- 32 unchanged lines hidden (view full) --- 41# 42# This will read a 'c' file and scan for embedded comments in the 43# style of gnome comments (+minor extensions - see below). 44# 45 46# Note: This only supports 'c'. 47 48# usage: | 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-2007 Randy Dunlap ## --- 32 unchanged lines hidden (view full) --- 41# 42# This will read a 'c' file and scan for embedded comments in the 43# style of gnome comments (+minor extensions - see below). 44# 45 46# Note: This only supports 'c'. 47 48# usage: |
49# kernel-doc [ -docbook | -html | -text | -man ] | 49# kernel-doc [ -docbook | -html | -text | -man ] [ -no-doc-sections ] |
50# [ -function funcname [ -function funcname ...] ] c file(s)s > outputfile 51# or 52# [ -nofunction funcname [ -function funcname ...] ] c file(s)s > outputfile 53# 54# Set output format using one of -docbook -html -text or -man. Default is man. 55# | 50# [ -function funcname [ -function funcname ...] ] c file(s)s > outputfile 51# or 52# [ -nofunction funcname [ -function funcname ...] ] c file(s)s > outputfile 53# 54# Set output format using one of -docbook -html -text or -man. Default is man. 55# |
56# -no-doc-sections 57# Do not output DOC: sections 58# |
|
56# -function funcname 57# If set, then only generate documentation for the given function(s) or 58# DOC: section titles. All other functions and DOC: sections are ignored. 59# 60# -nofunction funcname 61# If set, then only generate documentation for the other function(s)/DOC: 62# sections. Cannot be used together with -function (yes, that's a bug -- 63# perl hackers can fix it 8)) --- 142 unchanged lines hidden (view full) --- 206my %highlights_text = ( $type_constant, "\$1", 207 $type_func, "\$1", 208 $type_struct, "\$1", 209 $type_param, "\$1" ); 210my $blankline_text = ""; 211 212 213sub usage { | 59# -function funcname 60# If set, then only generate documentation for the given function(s) or 61# DOC: section titles. All other functions and DOC: sections are ignored. 62# 63# -nofunction funcname 64# If set, then only generate documentation for the other function(s)/DOC: 65# sections. Cannot be used together with -function (yes, that's a bug -- 66# perl hackers can fix it 8)) --- 142 unchanged lines hidden (view full) --- 209my %highlights_text = ( $type_constant, "\$1", 210 $type_func, "\$1", 211 $type_struct, "\$1", 212 $type_param, "\$1" ); 213my $blankline_text = ""; 214 215 216sub usage { |
214 print "Usage: $0 [ -v ] [ -docbook | -html | -text | -man ]\n"; | 217 print "Usage: $0 [ -v ] [ -docbook | -html | -text | -man ] [ -no-doc-sections ]\n"; |
215 print " [ -function funcname [ -function funcname ...] ]\n"; 216 print " [ -nofunction funcname [ -nofunction funcname ...] ]\n"; 217 print " c source file(s) > outputfile\n"; 218 exit 1; 219} 220 221# read arguments 222if ($#ARGV==-1) { 223 usage(); 224} 225 226my $verbose = 0; 227my $output_mode = "man"; | 218 print " [ -function funcname [ -function funcname ...] ]\n"; 219 print " [ -nofunction funcname [ -nofunction funcname ...] ]\n"; 220 print " c source file(s) > outputfile\n"; 221 exit 1; 222} 223 224# read arguments 225if ($#ARGV==-1) { 226 usage(); 227} 228 229my $verbose = 0; 230my $output_mode = "man"; |
231my $no_doc_sections = 0; |
|
228my %highlights = %highlights_man; 229my $blankline = $blankline_man; 230my $modulename = "Kernel API"; 231my $function_only = 0; 232my $man_date = ('January', 'February', 'March', 'April', 'May', 'June', 233 'July', 'August', 'September', 'October', 234 'November', 'December')[(localtime)[4]] . 235 " " . ((localtime)[5]+1900); --- 88 unchanged lines hidden (view full) --- 324 $function = shift @ARGV; 325 $function_table{$function} = 1; 326 } elsif ($cmd eq "-v") { 327 $verbose = 1; 328 } elsif (($cmd eq "-h") || ($cmd eq "--help")) { 329 usage(); 330 } elsif ($cmd eq '-filelist') { 331 $filelist = shift @ARGV; | 232my %highlights = %highlights_man; 233my $blankline = $blankline_man; 234my $modulename = "Kernel API"; 235my $function_only = 0; 236my $man_date = ('January', 'February', 'March', 'April', 'May', 'June', 237 'July', 'August', 'September', 'October', 238 'November', 'December')[(localtime)[4]] . 239 " " . ((localtime)[5]+1900); --- 88 unchanged lines hidden (view full) --- 328 $function = shift @ARGV; 329 $function_table{$function} = 1; 330 } elsif ($cmd eq "-v") { 331 $verbose = 1; 332 } elsif (($cmd eq "-h") || ($cmd eq "--help")) { 333 usage(); 334 } elsif ($cmd eq '-filelist') { 335 $filelist = shift @ARGV; |
336 } elsif ($cmd eq '-no-doc-sections') { 337 $no_doc_sections = 1; |
|
332 } 333} 334 335# get kernel version from env 336sub get_kernel_version() { 337 my $version = 'unknown kernel version'; 338 339 if (defined($ENV{'KERNELVERSION'})) { --- 35 unchanged lines hidden (view full) --- 375 376## 377# dump DOC: section after checking that it should go out 378# 379sub dump_doc_section { 380 my $name = shift; 381 my $contents = join "\n", @_; 382 | 338 } 339} 340 341# get kernel version from env 342sub get_kernel_version() { 343 my $version = 'unknown kernel version'; 344 345 if (defined($ENV{'KERNELVERSION'})) { --- 35 unchanged lines hidden (view full) --- 381 382## 383# dump DOC: section after checking that it should go out 384# 385sub dump_doc_section { 386 my $name = shift; 387 my $contents = join "\n", @_; 388 |
389 if ($no_doc_sections) { 390 return; 391 } 392 |
|
383 if (($function_only == 0) || 384 ( $function_only == 1 && defined($function_table{$name})) || 385 ( $function_only == 2 && !defined($function_table{$name}))) 386 { 387 dump_section $name, $contents; 388 output_blockhead({'sectionlist' => \@sectionlist, 389 'sections' => \%sections, 390 'module' => $modulename, --- 1640 unchanged lines hidden --- | 393 if (($function_only == 0) || 394 ( $function_only == 1 && defined($function_table{$name})) || 395 ( $function_only == 2 && !defined($function_table{$name}))) 396 { 397 dump_section $name, $contents; 398 output_blockhead({'sectionlist' => \@sectionlist, 399 'sections' => \%sections, 400 'module' => $modulename, --- 1640 unchanged lines hidden --- |