summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-12-13 10:11:57 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2018-02-19 15:29:37 +0100
commitd031d4b65c8edb64dbbeb88cb501bc0e4b56f144 (patch)
treee3960d5fc72985e2724197750e8691873aaa5172
parent8ceba39ce15476ecd6f002562c725b3ecf990cd8 (diff)
downloadgnutls-d031d4b65c8edb64dbbeb88cb501bc0e4b56f144.tar.gz
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 <nmav@redhat.com>
-rwxr-xr-xdoc/scripts/getfuncs.pl15
1 files changed, 12 insertions, 3 deletions
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=<STDIN>) {
$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=<STDIN>) {
$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=<STDIN>) {
$state = 0;
next;
}
+ } elsif ($state == 6) { #typedef (not struct)
+ if ($line =~ m/;/) {
+ $state = 0;
+ next;
+ }
}
}