Lines Matching +full:non +full:- +full:descriptive
2 # SPDX-License-Identifier: GPL-2.0
11 ## Copyright (C) 2005-2012 Randy Dunlap ##
23 kernel-doc - Print formatted kernel documentation to stdout
27 …kernel-doc [-h] [-v] [-Werror] [-Wall] [-Wreturn] [-Wshort-desc[ription]] [-Wcontents-before-secti…
28 [ -man |
29 -rst [-sphinx-version VERSION] [-enable-lineno] |
30 -none
33 -export |
34 -internal |
35 [-function NAME] ... |
36 [-nosymbol NAME] ...
38 [-no-doc-sections]
39 [-export-file FILE] ...
42 Run `kernel-doc -h` for details.
51 See Documentation/doc-guide/kernel-doc.rst for the documentation comment syntax.
65 my $type_constant2 = '\%([-_*\w]+)';
67 my $type_param = '\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)';
68 my $type_param_ref = '([\!~\*]?)\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)';
70 my $type_fp_param2 = '\@(\w+->\S+)\(\)'; # Special RST handling for structs with func ptr params
76 my $type_member = '\&([_\w]+)(\.|->)([_\w]+)';
99 # rst-mode
122 if ($#ARGV == -1) {
124 -message => "No arguments!\n",
125 -exitval => 1,
126 -verbose => 99,
127 -sections => 'SYNOPSIS',
128 -output => \*STDERR,
154 OUTPUT_INTERNAL => 3, # output non-exported symbols
163 (my $seconds = `date -d "${ENV{'KBUILD_BUILD_TIMESTAMP'}}" +%s`) ne '') {
191 if ($kcflags =~ /(\s|^)-Werror(\s|$)/) {
202 # other environment variables are converted to command-line
206 # docbook v3.1 requires a non-zero sequence of RefEntry's; see:
207 # https://www.oasis-open.org/docbook/documentation/reference/html/refentry.html
219 STATE_BODY_MAYBE => 2, # body - or maybe more description
236 STATE_INLINE_ERROR => 4, # error - Comment without header was found.
238 # proper kernel-doc and ignore the rest.
246 # Name of the kernel-doc identifier for non-DOC markups
258 # @{section-name}:
272 my $attribute = qr{__attribute__\s*\(\([a-z0-9,_\*\s\(\)]*\)\)}i;
293 my $undescribed = "-- undescribed --";
297 while ($ARGV[0] =~ m/^--?(.*)/) {
322 } elsif ($cmd eq "internal") { # only non-exported symbols
325 } elsif ($cmd eq "export-file") {
334 } elsif ($cmd eq "Wshort-desc" or $cmd eq "Wshort-description") {
336 } elsif ($cmd eq "Wcontents-before-sections") {
343 pod2usage(-exitval => 0, -verbose => 2);
344 } elsif ($cmd eq 'no-doc-sections') {
346 } elsif ($cmd eq 'enable-lineno') {
348 } elsif ($cmd eq 'show-not-found') {
349 $show_not_found = 1; # A no-op but don't fail
350 } elsif ($cmd eq "sphinx-version") {
370 -message => "Argument unknown!\n",
371 -exitval => 1,
372 -verbose => 99,
373 -sections => 'SYNOPSIS',
374 -output => \*STDERR,
379 -message => "FILE argument missing\n",
380 -exitval => 1,
381 -verbose => 99,
382 -sections => 'SYNOPSIS',
383 -output => \*STDERR,
395 return "$_/$_[0]" if(-x "$_/$_[0]");
403 my $cmd = "sphinx-build";
405 my $cmd = "sphinx-build3";
416 open IN, "$cmd --version 2>&1 |";
418 if (m/^\s*sphinx-build\s+([\d]+)\.([\d\.]+)(\+\/[\da-f]+)?$/) {
517 'content-only' => ($output_selection != OUTPUT_ALL), });
573 my $paramcount = $#{$args{'parameterlist'}}; # -1 is empty
578 print $args{'function'} . " \\- " . $args{'purpose'} . "\n";
595 # pointer-to-function
605 $paramcount = $#{$args{'parameterlist'}}; # -1 is empty
632 print "enum " . $args{'enum'} . " \\- " . $args{'purpose'} . "\n";
671 print $args{'type'} . " " . $args{'struct'} . " \\- " . $args{'purpose'} . "\n";
706 print "typedef " . $args{'typedef'} . " \\- " . $args{'purpose'} . "\n";
754 # Apply the RST highlights to a sub-block of text.
768 my $sphinx_cblock = '^\.\.\ +code-block::';
786 # If this is the first non-blank line in a literal
831 my $paramcount = $#{$args{'parameterlist'}}; # -1 is empty
851 # pointer-to-function
901 # Put our descriptive text into a container (thus an HTML <div>) to help
1103 # generic output function - calls the right one based on current output mode.
1167 # - first eat non-declaration parameters and rewrite for final match
1168 # - then remove macro, outer parens, and trailing semicolon
1181 … $members =~ s/DECLARE_HASHTABLE\s*\($args,\s*$args\)/unsigned long $1\[1 << (($2) - 1)\]/gos;
1208 # pointer-to-function
1278 $level-- if ($clause =~ m/(\})/ && $level > 1);
1361 emit_warning("${file}:$.", "wrong kernel-doc identifier on line:\n");
1518 # pointer-to-function
1527 # array-of-pointers
1562 if ($type ne "") { # skip unnamed bit-fields
1770 # - parport_register_device (function pointer parameters)
1771 # - atomic_set (macro)
1772 # - pci_match_device, __copy_to_user (long return type)
1773 my $name = qr{[a-zA-Z0-9_~:]+};
1781 # This is an object-like macro, it has no return type and no parameter
1783 # Function-like macros are not allowed to have spaces between
1812 # -Wreturn mode.
1898 ## if ($prototype =~ m/SYSCALL_DEFINE0\s*\(\s*(a-zA-Z0-9_)*\s*\)/) {
1911 # now delete all of the odd-number commas in $prototype
1916 $len = 0; # skip the for-loop
1932 $x =~ s@\/\/.*$@@gos; # strip C99-style comments to end of line
1969 $x =~ s@\/\/.*$@@gos; # strip C99-style comments to end of line
1983 ($2 eq '}') && $brcount--;
2053 # STATE_NAME: Looking for the "name - description" line
2073 # test for pointer declaration type, foo * bar() - desc
2076 my $decl_end = qr{[-:].*};
2085 # Look for foo() or static void foo() - description; or misspelt
2102 if (/[-:](.*)/) {
2115 …"This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/ker…
2124 emit_warning("${file}:$.", "wrong kernel-doc identifier on line:\n$_");
2132 … emit_warning("${file}:$.", "Cannot understand $_ on line $. - I thought it was a doc line\n");
2195 if ($_ =~ m'\s*\*\s*[a-zA-Z_0-9:\.]+\*/') {
2239 # i dont know - bad line? ignore.
2334 emit_warning("${file}:$.", "Incorrect use of kernel-doc format: $_");
2360 while ($_ =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) {};
2456 =item -man
2460 =item -rst
2464 =item -none
2476 =item -sphinx-version VERSION
2480 If not specified, kernel-doc will auto-detect using the sphinx-build version
2489 =item -export
2492 EXPORT_SYMBOL() and related macros in any input FILE or -export-file FILE.
2494 =item -internal
2497 EXPORT_SYMBOL() and related macros in any input FILE or -export-file FILE.
2499 =item -function NAME
2506 =item -nosymbol NAME
2518 =item -no-doc-sections
2522 =item -export-file FILE
2526 To be used with -export or -internal.
2536 =item -enable-lineno
2546 =item -h, -help
2550 =item -v
2554 =item -Werror