kernel-doc (03699f271de1f4df6369cd379506539cd7d590d3) | kernel-doc (632ce1377dbbdabff575d33bec9c79d75ef0395a) |
---|---|
1#!/usr/bin/env perl 2# SPDX-License-Identifier: GPL-2.0 3 4use warnings; 5use strict; 6 7## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## 8## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ## --- 242 unchanged lines hidden (view full) --- 251 '\s*(\@[.\w]+|\@\.\.\.|description|context|returns?|notes?|examples?)\s*:([^:].*)?$'; 252my $doc_content = $doc_com_body . '(.*)'; 253my $doc_block = $doc_com . 'DOC:\s*(.*)?'; 254my $doc_inline_start = '^\s*/\*\*\s*$'; 255my $doc_inline_sect = '\s*\*\s*(@\s*[\w][\w\.]*\s*):(.*)'; 256my $doc_inline_end = '^\s*\*/\s*$'; 257my $doc_inline_oneline = '^\s*/\*\*\s*(@[\w\s]+):\s*(.*)\s*\*/\s*$'; 258my $export_symbol = '^\s*EXPORT_SYMBOL(_GPL)?\s*\(\s*(\w+)\s*\)\s*;'; | 1#!/usr/bin/env perl 2# SPDX-License-Identifier: GPL-2.0 3 4use warnings; 5use strict; 6 7## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## 8## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ## --- 242 unchanged lines hidden (view full) --- 251 '\s*(\@[.\w]+|\@\.\.\.|description|context|returns?|notes?|examples?)\s*:([^:].*)?$'; 252my $doc_content = $doc_com_body . '(.*)'; 253my $doc_block = $doc_com . 'DOC:\s*(.*)?'; 254my $doc_inline_start = '^\s*/\*\*\s*$'; 255my $doc_inline_sect = '\s*\*\s*(@\s*[\w][\w\.]*\s*):(.*)'; 256my $doc_inline_end = '^\s*\*/\s*$'; 257my $doc_inline_oneline = '^\s*/\*\*\s*(@[\w\s]+):\s*(.*)\s*\*/\s*$'; 258my $export_symbol = '^\s*EXPORT_SYMBOL(_GPL)?\s*\(\s*(\w+)\s*\)\s*;'; |
259my $export_symbol_ns = '^\s*EXPORT_SYMBOL_NS(_GPL)?\s*\(\s*(\w+)\s*,\s*\w+\)\s*;'; |
|
259my $function_pointer = qr{([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)}; 260my $attribute = qr{__attribute__\s*\(\([a-z0-9,_\*\s\(\)]*\)\)}i; 261 262my %parameterdescs; 263my %parameterdesc_start_lines; 264my @parameterlist; 265my %sections; 266my @sectionlist; --- 1176 unchanged lines hidden (view full) --- 1443 my $arg_expr = qr{\([^\),]+}; 1444 while ($args =~ /$arg_expr,/) { 1445 $args =~ s/($arg_expr),/$1#/g; 1446 } 1447 1448 foreach my $arg (split($splitter, $args)) { 1449 # strip comments 1450 $arg =~ s/\/\*.*\*\///; | 260my $function_pointer = qr{([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)}; 261my $attribute = qr{__attribute__\s*\(\([a-z0-9,_\*\s\(\)]*\)\)}i; 262 263my %parameterdescs; 264my %parameterdesc_start_lines; 265my @parameterlist; 266my %sections; 267my @sectionlist; --- 1176 unchanged lines hidden (view full) --- 1444 my $arg_expr = qr{\([^\),]+}; 1445 while ($args =~ /$arg_expr,/) { 1446 $args =~ s/($arg_expr),/$1#/g; 1447 } 1448 1449 foreach my $arg (split($splitter, $args)) { 1450 # strip comments 1451 $arg =~ s/\/\*.*\*\///; |
1451 # ignore argument attributes 1452 $arg =~ s/\sPOS0?\s/ /; | |
1453 # strip leading/trailing spaces 1454 $arg =~ s/^\s*//; 1455 $arg =~ s/\s*$//; 1456 $arg =~ s/\s+/ /; 1457 1458 if ($arg =~ /^#/) { 1459 # Treat preprocessor directive as a typeless variable just to fill 1460 # corresponding data structures "correctly". Catch it later in --- 193 unchanged lines hidden (view full) --- 1654 $prototype =~ s/^static +//; 1655 $prototype =~ s/^extern +//; 1656 $prototype =~ s/^asmlinkage +//; 1657 $prototype =~ s/^inline +//; 1658 $prototype =~ s/^__inline__ +//; 1659 $prototype =~ s/^__inline +//; 1660 $prototype =~ s/^__always_inline +//; 1661 $prototype =~ s/^noinline +//; | 1452 # strip leading/trailing spaces 1453 $arg =~ s/^\s*//; 1454 $arg =~ s/\s*$//; 1455 $arg =~ s/\s+/ /; 1456 1457 if ($arg =~ /^#/) { 1458 # Treat preprocessor directive as a typeless variable just to fill 1459 # corresponding data structures "correctly". Catch it later in --- 193 unchanged lines hidden (view full) --- 1653 $prototype =~ s/^static +//; 1654 $prototype =~ s/^extern +//; 1655 $prototype =~ s/^asmlinkage +//; 1656 $prototype =~ s/^inline +//; 1657 $prototype =~ s/^__inline__ +//; 1658 $prototype =~ s/^__inline +//; 1659 $prototype =~ s/^__always_inline +//; 1660 $prototype =~ s/^noinline +//; |
1662 $prototype =~ s/^__FORTIFY_INLINE +//; | |
1663 $prototype =~ s/__init +//; 1664 $prototype =~ s/__init_or_module +//; 1665 $prototype =~ s/__deprecated +//; 1666 $prototype =~ s/__flatten +//; 1667 $prototype =~ s/__meminit +//; 1668 $prototype =~ s/__must_check +//; 1669 $prototype =~ s/__weak +//; 1670 $prototype =~ s/__sched +//; 1671 $prototype =~ s/__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +//; | 1661 $prototype =~ s/__init +//; 1662 $prototype =~ s/__init_or_module +//; 1663 $prototype =~ s/__deprecated +//; 1664 $prototype =~ s/__flatten +//; 1665 $prototype =~ s/__meminit +//; 1666 $prototype =~ s/__must_check +//; 1667 $prototype =~ s/__weak +//; 1668 $prototype =~ s/__sched +//; 1669 $prototype =~ s/__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +//; |
1672 $prototype =~ s/__(?:re)?alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) +//; 1673 $prototype =~ s/__diagnose_as\s*\(\s*\S+\s*(?:,\s*\d+\s*)*\) +//; | 1670 $prototype =~ s/__alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) +//; |
1674 my $define = $prototype =~ s/^#\s*define\s+//; #ak added 1675 $prototype =~ s/__attribute_const__ +//; 1676 $prototype =~ s/__attribute__\s*\(\( 1677 (?: 1678 [\w\s]++ # attribute name 1679 (?:\([^)]*+\))? # attribute arguments 1680 \s*+,? # optional comma at the end 1681 )+ --- 265 unchanged lines hidden (view full) --- 1947 return; 1948 } 1949 1950 while (<IN>) { 1951 if (/$export_symbol/) { 1952 next if (defined($nosymbol_table{$2})); 1953 $function_table{$2} = 1; 1954 } | 1671 my $define = $prototype =~ s/^#\s*define\s+//; #ak added 1672 $prototype =~ s/__attribute_const__ +//; 1673 $prototype =~ s/__attribute__\s*\(\( 1674 (?: 1675 [\w\s]++ # attribute name 1676 (?:\([^)]*+\))? # attribute arguments 1677 \s*+,? # optional comma at the end 1678 )+ --- 265 unchanged lines hidden (view full) --- 1944 return; 1945 } 1946 1947 while (<IN>) { 1948 if (/$export_symbol/) { 1949 next if (defined($nosymbol_table{$2})); 1950 $function_table{$2} = 1; 1951 } |
1952 if (/$export_symbol_ns/) { 1953 next if (defined($nosymbol_table{$2})); 1954 $function_table{$2} = 1; 1955 } |
|
1955 } 1956 1957 close(IN); 1958} 1959 1960# 1961# Parsers for the various processing states. 1962# --- 455 unchanged lines hidden (view full) --- 2418 2419=head2 Output selection (mutually exclusive): 2420 2421=over 8 2422 2423=item -export 2424 2425Only output documentation for the symbols that have been exported using | 1956 } 1957 1958 close(IN); 1959} 1960 1961# 1962# Parsers for the various processing states. 1963# --- 455 unchanged lines hidden (view full) --- 2419 2420=head2 Output selection (mutually exclusive): 2421 2422=over 8 2423 2424=item -export 2425 2426Only output documentation for the symbols that have been exported using |
2426EXPORT_SYMBOL() or EXPORT_SYMBOL_GPL() in any input FILE or -export-file FILE. | 2427EXPORT_SYMBOL() and related macros in any input FILE or -export-file FILE. |
2427 2428=item -internal 2429 2430Only output documentation for the symbols that have NOT been exported using | 2428 2429=item -internal 2430 2431Only output documentation for the symbols that have NOT been exported using |
2431EXPORT_SYMBOL() or EXPORT_SYMBOL_GPL() in any input FILE or -export-file FILE. | 2432EXPORT_SYMBOL() and related macros in any input FILE or -export-file FILE. |
2432 2433=item -function NAME 2434 2435Only output documentation for the given function or DOC: section title. 2436All other functions and DOC: sections are ignored. 2437 2438May be specified multiple times. 2439 --- 10 unchanged lines hidden (view full) --- 2450=over 8 2451 2452=item -no-doc-sections 2453 2454Do not output DOC: sections. 2455 2456=item -export-file FILE 2457 | 2433 2434=item -function NAME 2435 2436Only output documentation for the given function or DOC: section title. 2437All other functions and DOC: sections are ignored. 2438 2439May be specified multiple times. 2440 --- 10 unchanged lines hidden (view full) --- 2451=over 8 2452 2453=item -no-doc-sections 2454 2455Do not output DOC: sections. 2456 2457=item -export-file FILE 2458 |
2458Specify an additional FILE in which to look for EXPORT_SYMBOL() and 2459EXPORT_SYMBOL_GPL(). | 2459Specify an additional FILE in which to look for EXPORT_SYMBOL information. |
2460 2461To be used with -export or -internal. 2462 2463May be specified multiple times. 2464 2465=back 2466 2467=head3 reStructuredText only --- 28 unchanged lines hidden --- | 2460 2461To be used with -export or -internal. 2462 2463May be specified multiple times. 2464 2465=back 2466 2467=head3 reStructuredText only --- 28 unchanged lines hidden --- |