Commit 4ff916a0 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

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: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 6c4c7dad
......@@ -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/_/-/;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment