That allows to properly distinguish a struct from a one liner
typedef.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
$line =~ m/^\s*typedef/) {
next if ($line =~ m/;/);
- $state = 2;
+ if ($line =~ m/\{/) {
+ $state = 2;
+ } else {
+ $state = 6;
+ }
next;
} elsif ($line =~ m/^\s*extern\s+"C"/) {
next;
$state = 0;
next;
}
- } elsif ($state == 2) { #struct||enum||typedef
- if ($line =~ m/;/) {
+ } elsif ($state == 2) { #struct||enum||typedef struct
+ if ($line =~ m/\}/) {
$state = 0;
next;
}
$state = 0;
next;
}
+ } elsif ($state == 6) { #typedef (not struct)
+ if ($line =~ m/;/) {
+ $state = 0;
+ next;
+ }
}
}