kernel-doc (151c468b44a89a9f3173ab8575690014b7249893) | kernel-doc (7c0d7e87a16fe615e7913a3d56ce7bd26104ef0b) |
---|---|
1#!/usr/bin/env perl 2 3use warnings; 4use strict; 5 6## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## 7## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ## 8## Copyright (C) 2001 Simon Huggins ## --- 1027 unchanged lines hidden (view full) --- 1036 while ($members =~ m/(struct|union)([^{};]+){([^{}]*)}([^{}\;]*)\;/) { 1037 my $newmember = "$1 $4;"; 1038 my $id = $4; 1039 my $content = $3; 1040 $id =~ s/[:\[].*//; 1041 $id =~ s/^\*+//; 1042 foreach my $arg (split /;/, $content) { 1043 next if ($arg =~ m/^\s*$/); | 1#!/usr/bin/env perl 2 3use warnings; 4use strict; 5 6## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## 7## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ## 8## Copyright (C) 2001 Simon Huggins ## --- 1027 unchanged lines hidden (view full) --- 1036 while ($members =~ m/(struct|union)([^{};]+){([^{}]*)}([^{}\;]*)\;/) { 1037 my $newmember = "$1 $4;"; 1038 my $id = $4; 1039 my $content = $3; 1040 $id =~ s/[:\[].*//; 1041 $id =~ s/^\*+//; 1042 foreach my $arg (split /;/, $content) { 1043 next if ($arg =~ m/^\s*$/); |
1044 my $type = $arg; 1045 my $name = $arg; 1046 $type =~ s/\s\S+$//; 1047 $name =~ s/.*\s//; 1048 $name =~ s/[:\[].*//; 1049 $name =~ s/^\*+//; 1050 next if (($name =~ m/^\s*$/)); 1051 if ($id =~ m/^\s*$/) { 1052 # anonymous struct/union 1053 $newmember .= "$type $name;"; | 1044 if ($arg =~ m/^([^\(]+\(\*?\s*)([\w\.]*)(\s*\).*)/) { 1045 # pointer-to-function 1046 my $type = $1; 1047 my $name = $2; 1048 my $extra = $3; 1049 next if (!$name); 1050 if ($id =~ m/^\s*$/) { 1051 # anonymous struct/union 1052 $newmember .= "$type$name$extra;"; 1053 } else { 1054 $newmember .= "$type$id.$name$extra;"; 1055 } |
1054 } else { | 1056 } else { |
1055 $newmember .= "$type $id.$name;"; | 1057 my $type = $arg; 1058 my $name = $arg; 1059 $type =~ s/\s\S+$//; 1060 $name =~ s/.*\s+//; 1061 $name =~ s/[:\[].*//; 1062 $name =~ s/^\*+//; 1063 next if (($name =~ m/^\s*$/)); 1064 if ($id =~ m/^\s*$/) { 1065 # anonymous struct/union 1066 $newmember .= "$type $name;"; 1067 } else { 1068 $newmember .= "$type $id.$name;"; 1069 } |
1056 } 1057 } 1058 $members =~ s/(struct|union)([^{};]+){([^{}]*)}([^{}\;]*)\;/$newmember/; 1059 $cont = 1; 1060 }; 1061 }; 1062 1063 # Ignore other nested elements, like enums --- 181 unchanged lines hidden (view full) --- 1245 if ($arg =~ /^#/) { 1246 # Treat preprocessor directive as a typeless variable just to fill 1247 # corresponding data structures "correctly". Catch it later in 1248 # output_* subs. 1249 push_parameter($arg, "", $file); 1250 } elsif ($arg =~ m/\(.+\)\s*\(/) { 1251 # pointer-to-function 1252 $arg =~ tr/#/,/; | 1070 } 1071 } 1072 $members =~ s/(struct|union)([^{};]+){([^{}]*)}([^{}\;]*)\;/$newmember/; 1073 $cont = 1; 1074 }; 1075 }; 1076 1077 # Ignore other nested elements, like enums --- 181 unchanged lines hidden (view full) --- 1259 if ($arg =~ /^#/) { 1260 # Treat preprocessor directive as a typeless variable just to fill 1261 # corresponding data structures "correctly". Catch it later in 1262 # output_* subs. 1263 push_parameter($arg, "", $file); 1264 } elsif ($arg =~ m/\(.+\)\s*\(/) { 1265 # pointer-to-function 1266 $arg =~ tr/#/,/; |
1253 $arg =~ m/[^\(]+\(\*?\s*(\w*)\s*\)/; | 1267 $arg =~ m/[^\(]+\(\*?\s*([\w\.]*)\s*\)/; |
1254 $param = $1; 1255 $type = $arg; 1256 $type =~ s/([^\(]+\(\*?)\s*$param/$1/; 1257 save_struct_actual($param); 1258 push_parameter($param, $type, $file, $declaration_name); 1259 } elsif ($arg) { 1260 $arg =~ s/\s*:\s*/:/g; 1261 $arg =~ s/\s*\[/\[/g; --- 821 unchanged lines hidden --- | 1268 $param = $1; 1269 $type = $arg; 1270 $type =~ s/([^\(]+\(\*?)\s*$param/$1/; 1271 save_struct_actual($param); 1272 push_parameter($param, $type, $file, $declaration_name); 1273 } elsif ($arg) { 1274 $arg =~ s/\s*:\s*/:/g; 1275 $arg =~ s/\s*\[/\[/g; --- 821 unchanged lines hidden --- |