]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
doc: getfuncs.pl: distinguish between different typedef types
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Wed, 13 Dec 2017 09:11:57 +0000 (10:11 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Mon, 19 Feb 2018 14:29:37 +0000 (15:29 +0100)
That allows to properly distinguish a struct from a one liner
typedef.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
doc/scripts/getfuncs.pl

index a041b235941b133b389fa363af82621774b1dac5..20eb3911765c93dc2b640a708494a6a0fa4ea891 100755 (executable)
@@ -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;
+    }
   }
 
 }