]> git.karo-electronics.de Git - linux-beck.git/commitdiff
doc-rst: parse-headers: fix multiline typedef handler
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Thu, 7 Jul 2016 11:09:37 +0000 (08:09 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Thu, 7 Jul 2016 11:12:57 +0000 (08:12 -0300)
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>
Documentation/sphinx/parse-headers.pl

index b657cadb53aecce47fb936d4f3cf8d677a61ddb7..b703f1a7f432afcc7487829c73bf362b5154358a 100755 (executable)
@@ -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/_/-/;