kernel-doc (56afb0f8823650f53a5f0e96d69a282e8892c61b) kernel-doc (52dc5aec9fe2eb591f1490278ae767448860118b)
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-2008 Randy Dunlap ##

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

1406 dump_struct(@_);
1407}
1408
1409sub dump_struct($$) {
1410 my $x = shift;
1411 my $file = shift;
1412 my $nested;
1413
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-2008 Randy Dunlap ##

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

1406 dump_struct(@_);
1407}
1408
1409sub dump_struct($$) {
1410 my $x = shift;
1411 my $file = shift;
1412 my $nested;
1413
1414 if ($x =~/(struct|union)\s+(\w+)\s*{(.*)}/) {
1414 if ($x =~ /(struct|union)\s+(\w+)\s*{(.*)}/) {
1415 #my $decl_type = $1;
1415 $declaration_name = $2;
1416 my $members = $3;
1417
1418 # ignore embedded structs or unions
1419 $members =~ s/({.*})//g;
1420 $nested = $1;
1421
1422 # ignore members marked private:
1416 $declaration_name = $2;
1417 my $members = $3;
1418
1419 # ignore embedded structs or unions
1420 $members =~ s/({.*})//g;
1421 $nested = $1;
1422
1423 # ignore members marked private:
1423 $members =~ s/\/\*.*?private:.*?public:.*?\*\///gos;
1424 $members =~ s/\/\*.*?private:.*//gos;
1424 $members =~ s/\/\*\s*private:.*?\/\*\s*public:.*?\*\///gos;
1425 $members =~ s/\/\*\s*private:.*//gos;
1425 # strip comments:
1426 $members =~ s/\/\*.*?\*\///gos;
1427 $nested =~ s/\/\*.*?\*\///gos;
1428
1429 create_parameterlist($members, ';', $file);
1430 check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested);
1431
1432 output_declaration($declaration_name,

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

1822 @sectionlist = ();
1823 $sectcheck = "";
1824 $struct_actual = "";
1825 $prototype = "";
1826
1827 $state = 0;
1828}
1829
1426 # strip comments:
1427 $members =~ s/\/\*.*?\*\///gos;
1428 $nested =~ s/\/\*.*?\*\///gos;
1429
1430 create_parameterlist($members, ';', $file);
1431 check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested);
1432
1433 output_declaration($declaration_name,

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

1823 @sectionlist = ();
1824 $sectcheck = "";
1825 $struct_actual = "";
1826 $prototype = "";
1827
1828 $state = 0;
1829}
1830
1830sub tracepoint_munge($) {
1831 my $file = shift;
1832 my $tracepointname = 0;
1833 my $tracepointargs = 0;
1834
1835 if($prototype =~ m/TRACE_EVENT\((.*?),/) {
1836 $tracepointname = $1;
1837 }
1838 if($prototype =~ m/TP_PROTO\((.*?)\)/) {
1839 $tracepointargs = $1;
1840 }
1841 if (($tracepointname eq 0) || ($tracepointargs eq 0)) {
1842 print STDERR "Warning(${file}:$.): Unrecognized tracepoint format: \n".
1843 "$prototype\n";
1844 } else {
1845 $prototype = "static inline void trace_$tracepointname($tracepointargs)";
1846 }
1847}
1848
1849sub syscall_munge() {
1850 my $void = 0;
1851
1852 $prototype =~ s@[\r\n\t]+@ @gos; # strip newlines/CR's/tabs
1853## if ($prototype =~ m/SYSCALL_DEFINE0\s*\(\s*(a-zA-Z0-9_)*\s*\)/) {
1854 if ($prototype =~ m/SYSCALL_DEFINE0/) {
1855 $void = 1;
1856## $prototype = "long sys_$1(void)";

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

1895
1896 if (($x =~ /\{/) || ($x =~ /\#\s*define/) || ($x =~ /;/)) {
1897 $prototype =~ s@/\*.*?\*/@@gos; # strip comments.
1898 $prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's.
1899 $prototype =~ s@^\s+@@gos; # strip leading spaces
1900 if ($prototype =~ /SYSCALL_DEFINE/) {
1901 syscall_munge();
1902 }
1831sub syscall_munge() {
1832 my $void = 0;
1833
1834 $prototype =~ s@[\r\n\t]+@ @gos; # strip newlines/CR's/tabs
1835## if ($prototype =~ m/SYSCALL_DEFINE0\s*\(\s*(a-zA-Z0-9_)*\s*\)/) {
1836 if ($prototype =~ m/SYSCALL_DEFINE0/) {
1837 $void = 1;
1838## $prototype = "long sys_$1(void)";

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

1877
1878 if (($x =~ /\{/) || ($x =~ /\#\s*define/) || ($x =~ /;/)) {
1879 $prototype =~ s@/\*.*?\*/@@gos; # strip comments.
1880 $prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's.
1881 $prototype =~ s@^\s+@@gos; # strip leading spaces
1882 if ($prototype =~ /SYSCALL_DEFINE/) {
1883 syscall_munge();
1884 }
1903 if ($prototype =~ /TRACE_EVENT/) {
1904 tracepoint_munge($file);
1905 }
1906 dump_function($prototype, $file);
1907 reset_state();
1908 }
1909}
1910
1911sub process_state3_type($$) {
1912 my $x = shift;
1913 my $file = shift;

--- 285 unchanged lines hidden ---
1885 dump_function($prototype, $file);
1886 reset_state();
1887 }
1888}
1889
1890sub process_state3_type($$) {
1891 my $x = shift;
1892 my $file = shift;

--- 285 unchanged lines hidden ---