kernel-doc (50d228345a03c882dfe11928ab41b42458b3f922) | kernel-doc (d38c8cfb057183f619dc8534030bb64b63f78043) |
---|---|
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> ## --- 1251 unchanged lines hidden (view full) --- 1260 } 1261 } 1262 die("Please add the new output type at show_warnings()"); 1263} 1264 1265sub dump_enum($$) { 1266 my $x = shift; 1267 my $file = shift; | 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> ## --- 1251 unchanged lines hidden (view full) --- 1260 } 1261 } 1262 die("Please add the new output type at show_warnings()"); 1263} 1264 1265sub dump_enum($$) { 1266 my $x = shift; 1267 my $file = shift; |
1268 my $members; |
|
1268 | 1269 |
1270 |
|
1269 $x =~ s@/\*.*?\*/@@gos; # strip comments. 1270 # strip #define macros inside enums 1271 $x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos; 1272 | 1271 $x =~ s@/\*.*?\*/@@gos; # strip comments. 1272 # strip #define macros inside enums 1273 $x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos; 1274 |
1273 if ($x =~ /enum\s+(\w*)\s*\{(.*)\}/) { | 1275 if ($x =~ /typedef\s+enum\s*\{(.*)\}\s*(\w*)\s*;/) { 1276 $declaration_name = $2; 1277 $members = $1; 1278 } elsif ($x =~ /enum\s+(\w*)\s*\{(.*)\}/) { |
1274 $declaration_name = $1; | 1279 $declaration_name = $1; |
1275 my $members = $2; | 1280 $members = $2; 1281 } 1282 1283 if ($declaration_name) { |
1276 my %_members; 1277 1278 $members =~ s/\s+$//; 1279 1280 foreach my $arg (split ',', $members) { 1281 $arg =~ s/^\s*(\w+).*/$1/; 1282 push @parameterlist, $arg; 1283 if (!$parameterdescs{$arg}) { --- 18 unchanged lines hidden (view full) --- 1302 {'enum' => $declaration_name, 1303 'module' => $modulename, 1304 'parameterlist' => \@parameterlist, 1305 'parameterdescs' => \%parameterdescs, 1306 'sectionlist' => \@sectionlist, 1307 'sections' => \%sections, 1308 'purpose' => $declaration_purpose 1309 }); | 1284 my %_members; 1285 1286 $members =~ s/\s+$//; 1287 1288 foreach my $arg (split ',', $members) { 1289 $arg =~ s/^\s*(\w+).*/$1/; 1290 push @parameterlist, $arg; 1291 if (!$parameterdescs{$arg}) { --- 18 unchanged lines hidden (view full) --- 1310 {'enum' => $declaration_name, 1311 'module' => $modulename, 1312 'parameterlist' => \@parameterlist, 1313 'parameterdescs' => \%parameterdescs, 1314 'sectionlist' => \@sectionlist, 1315 'sections' => \%sections, 1316 'purpose' => $declaration_purpose 1317 }); |
1310 } 1311 else { | 1318 } else { |
1312 print STDERR "${file}:$.: error: Cannot parse enum!\n"; 1313 ++$errors; 1314 } 1315} 1316 1317sub dump_typedef($$) { 1318 my $x = shift; 1319 my $file = shift; --- 970 unchanged lines hidden --- | 1319 print STDERR "${file}:$.: error: Cannot parse enum!\n"; 1320 ++$errors; 1321 } 1322} 1323 1324sub dump_typedef($$) { 1325 my $x = shift; 1326 my $file = shift; --- 970 unchanged lines hidden --- |