From: Nikos Mavrogiannopoulos Date: Wed, 13 Dec 2017 09:11:57 +0000 (+0100) Subject: doc: getfuncs.pl: distinguish between different typedef types X-Git-Tag: gnutls_3_6_3~249 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d031d4b65c8edb64dbbeb88cb501bc0e4b56f144;p=thirdparty%2Fgnutls.git doc: getfuncs.pl: distinguish between different typedef types That allows to properly distinguish a struct from a one liner typedef. Signed-off-by: Nikos Mavrogiannopoulos --- diff --git a/doc/scripts/getfuncs.pl b/doc/scripts/getfuncs.pl index a041b23594..20eb391176 100755 --- a/doc/scripts/getfuncs.pl +++ b/doc/scripts/getfuncs.pl @@ -74,7 +74,11 @@ while ($line=) { $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; @@ -103,8 +107,8 @@ while ($line=) { $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; } @@ -126,6 +130,11 @@ while ($line=) { $state = 0; next; } + } elsif ($state == 6) { #typedef (not struct) + if ($line =~ m/;/) { + $state = 0; + next; + } } }