summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-07-07 13:09:37 +0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-07-07 13:12:57 +0200
commit4ff916a0c901559d4913bfdb2e5f676c9856b969 (patch)
treefd626c02a16fa772ad3b05dd05d1106596b6dea3 /Documentation
parentdoc-rst: parse-headers: better handle typedefs (diff)
downloadlinux-4ff916a0c901559d4913bfdb2e5f676c9856b969.tar.xz
linux-4ff916a0c901559d4913bfdb2e5f676c9856b969.zip
doc-rst: parse-headers: fix multiline typedef handler
The typedef handler should do two things to be generic: 1) parse typedef enums; 2) accept both possible syntaxes: typedef struct foo { .. } foo_t; typedef struct { .. } foo_t; Unfortunately, this is needed to parse some legacy DVB files, like dvb/audio.h. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'Documentation')
-rwxr-xr-xDocumentation/sphinx/parse-headers.pl7
1 files changed, 4 insertions, 3 deletions
diff --git a/Documentation/sphinx/parse-headers.pl b/Documentation/sphinx/parse-headers.pl
index b657cadb53ae..b703f1a7f432 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -109,10 +109,11 @@ close IN;
# Handle multi-line typedefs
#
-my @matches = $data =~ m/typedef\s+struct\s+\S+\s*\{[^\}]+\}\s*(\S+)\s*\;/g;
+my @matches = ($data =~ m/typedef\s+struct\s+\S+?\s*\{[^\}]+\}\s*(\S+)\s*\;/g,
+ $data =~ m/typedef\s+enum\s+\S+?\s*\{[^\}]+\}\s*(\S+)\s*\;/g,);
foreach my $m (@matches) {
- my $s = $1;
- my $n = $1;
+ my $s = $m;
+ my $n = $m;
$n =~ tr/A-Z/a-z/;
$n =~ tr/_/-/;