kernel-doc (1f3a66889c4c80c821f3eadf899c140e91452f8e) kernel-doc (eda603f6cdba4b14dbf80531fab2fe545232e7a0)
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-2009 Randy Dunlap ##

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

39#
40# This will read a 'c' file and scan for embedded comments in the
41# style of gnome comments (+minor extensions - see below).
42#
43
44# Note: This only supports 'c'.
45
46# 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-2009 Randy Dunlap ##

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

39#
40# This will read a 'c' file and scan for embedded comments in the
41# style of gnome comments (+minor extensions - see below).
42#
43
44# Note: This only supports 'c'.
45
46# usage:
47# kernel-doc [ -docbook | -html | -text | -man ] [ -no-doc-sections ]
47# kernel-doc [ -docbook | -html | -text | -man | -list ] [ -no-doc-sections ]
48# [ -function funcname [ -function funcname ...] ] c file(s)s > outputfile
49# or
50# [ -nofunction funcname [ -function funcname ...] ] c file(s)s > outputfile
51#
52# Set output format using one of -docbook -html -text or -man. Default is man.
48# [ -function funcname [ -function funcname ...] ] c file(s)s > outputfile
49# or
50# [ -nofunction funcname [ -function funcname ...] ] c file(s)s > outputfile
51#
52# Set output format using one of -docbook -html -text or -man. Default is man.
53# The -list format is for internal use by docproc.
53#
54# -no-doc-sections
55# Do not output DOC: sections
56#
57# -function funcname
58# If set, then only generate documentation for the given function(s) or
59# DOC: section titles. All other functions and DOC: sections are ignored.
60#

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

205
206# text-mode
207my %highlights_text = ( $type_constant, "\$1",
208 $type_func, "\$1",
209 $type_struct, "\$1",
210 $type_param, "\$1" );
211my $blankline_text = "";
212
54#
55# -no-doc-sections
56# Do not output DOC: sections
57#
58# -function funcname
59# If set, then only generate documentation for the given function(s) or
60# DOC: section titles. All other functions and DOC: sections are ignored.
61#

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

206
207# text-mode
208my %highlights_text = ( $type_constant, "\$1",
209 $type_func, "\$1",
210 $type_struct, "\$1",
211 $type_param, "\$1" );
212my $blankline_text = "";
213
214# list mode
215my %highlights_list = ( $type_constant, "\$1",
216 $type_func, "\$1",
217 $type_struct, "\$1",
218 $type_param, "\$1" );
219my $blankline_list = "";
213
214sub usage {
220
221sub usage {
215 print "Usage: $0 [ -v ] [ -docbook | -html | -text | -man ] [ -no-doc-sections ]\n";
222 print "Usage: $0 [ -v ] [ -docbook | -html | -text | -man | -list ]\n";
223 print " [ -no-doc-sections ]\n";
216 print " [ -function funcname [ -function funcname ...] ]\n";
217 print " [ -nofunction funcname [ -nofunction funcname ...] ]\n";
218 print " c source file(s) > outputfile\n";
219 print " -v : verbose output, more warnings & other info listed\n";
220 exit 1;
221}
222
223# read arguments

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

313 } elsif ($cmd eq "-text") {
314 $output_mode = "text";
315 %highlights = %highlights_text;
316 $blankline = $blankline_text;
317 } elsif ($cmd eq "-docbook") {
318 $output_mode = "xml";
319 %highlights = %highlights_xml;
320 $blankline = $blankline_xml;
224 print " [ -function funcname [ -function funcname ...] ]\n";
225 print " [ -nofunction funcname [ -nofunction funcname ...] ]\n";
226 print " c source file(s) > outputfile\n";
227 print " -v : verbose output, more warnings & other info listed\n";
228 exit 1;
229}
230
231# read arguments

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

321 } elsif ($cmd eq "-text") {
322 $output_mode = "text";
323 %highlights = %highlights_text;
324 $blankline = $blankline_text;
325 } elsif ($cmd eq "-docbook") {
326 $output_mode = "xml";
327 %highlights = %highlights_xml;
328 $blankline = $blankline_xml;
329 } elsif ($cmd eq "-list") {
330 $output_mode = "list";
331 %highlights = %highlights_list;
332 $blankline = $blankline_list;
321 } elsif ($cmd eq "-gnome") {
322 $output_mode = "gnome";
323 %highlights = %highlights_gnome;
324 $blankline = $blankline_gnome;
325 } elsif ($cmd eq "-module") { # not needed for XML, inherits from calling document
326 $modulename = shift @ARGV;
327 } elsif ($cmd eq "-function") { # to only output specific functions
328 $function_only = 1;

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

1356
1357 foreach $section (@{$args{'sectionlist'}}) {
1358 print " $section:\n";
1359 print " -> ";
1360 output_highlight($args{'sections'}{$section});
1361 }
1362}
1363
333 } elsif ($cmd eq "-gnome") {
334 $output_mode = "gnome";
335 %highlights = %highlights_gnome;
336 $blankline = $blankline_gnome;
337 } elsif ($cmd eq "-module") { # not needed for XML, inherits from calling document
338 $modulename = shift @ARGV;
339 } elsif ($cmd eq "-function") { # to only output specific functions
340 $function_only = 1;

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

1368
1369 foreach $section (@{$args{'sectionlist'}}) {
1370 print " $section:\n";
1371 print " -> ";
1372 output_highlight($args{'sections'}{$section});
1373 }
1374}
1375
1376## list mode output functions
1377
1378sub output_function_list(%) {
1379 my %args = %{$_[0]};
1380
1381 print $args{'function'} . "\n";
1382}
1383
1384# output enum in list
1385sub output_enum_list(%) {
1386 my %args = %{$_[0]};
1387 print $args{'enum'} . "\n";
1388}
1389
1390# output typedef in list
1391sub output_typedef_list(%) {
1392 my %args = %{$_[0]};
1393 print $args{'typedef'} . "\n";
1394}
1395
1396# output struct as list
1397sub output_struct_list(%) {
1398 my %args = %{$_[0]};
1399
1400 print $args{'struct'} . "\n";
1401}
1402
1403sub output_blockhead_list(%) {
1404 my %args = %{$_[0]};
1405 my ($parameter, $section);
1406
1407 foreach $section (@{$args{'sectionlist'}}) {
1408 print "DOC: $section\n";
1409 }
1410}
1411
1364##
1365# generic output function for all types (function, struct/union, typedef, enum);
1366# calls the generated, variable output_ function name based on
1367# functype and output_mode
1368sub output_declaration {
1369 no strict 'refs';
1370 my $name = shift;
1371 my $functype = shift;

--- 862 unchanged lines hidden ---
1412##
1413# generic output function for all types (function, struct/union, typedef, enum);
1414# calls the generated, variable output_ function name based on
1415# functype and output_mode
1416sub output_declaration {
1417 no strict 'refs';
1418 my $name = shift;
1419 my $functype = shift;

--- 862 unchanged lines hidden ---