summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-11-17 17:44:22 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-11-17 17:44:22 +0100
commit4d2493b2cb5ef737669e9d6f1d531e84d7105b0a (patch)
treea442a3f25566cdad8713a3ab489082836c55251b
parentbb8e9c66d705fbf8b029501eddf6c59a7731a3a5 (diff)
downloadgnutls-4d2493b2cb5ef737669e9d6f1d531e84d7105b0a.tar.gz
made more clever to ignore inline function body.
-rwxr-xr-xdoc/scripts/getfuncs.pl21
1 files changed, 17 insertions, 4 deletions
diff --git a/doc/scripts/getfuncs.pl b/doc/scripts/getfuncs.pl
index e7a0387a1b..69137405f0 100755
--- a/doc/scripts/getfuncs.pl
+++ b/doc/scripts/getfuncs.pl
@@ -31,8 +31,9 @@ $state = 0;
# 0: scanning
# 1: comment
-# 2: struct||enum
+# 2: struct||enum||typedef func
# 3: function
+# 4: inline function { }
sub function_print {
my $prototype = shift @_;
@@ -71,11 +72,18 @@ while ($line=<STDIN>) {
$state = 1;
next;
} elsif ($line =~ m/^\s*typedef\s+enum/ || $line =~ m/^\s*enum/ ||
- $line =~ m/^\s*struct/ || $line =~ m/^\s*typedef\s+struct/) {
+ $line =~ m/^\s*struct/ || $line =~ m/^\s*typedef\s+struct/ ||
+ $line =~ m/^\s*typedef/) {
next if ($line =~ m/;/);
$state = 2;
next;
+ } elsif ($line =~ m/^\s*extern\s+"C"/) {
+ next;
+ } elsif ($line =~ m/^\s*\{/) {
+ next if ($line =~ m/\}/);
+ $state = 4;
+ next;
} elsif ($line !~ m/^\s*extern/ && $line !~ m/^\s*typedef/ && $line !~ m/doc-skip/ && $line =~ m/^\s*\w/) {
$state = 3;
@@ -93,12 +101,12 @@ while ($line=<STDIN>) {
$state = 0;
next;
}
- } elsif ($state == 2) { #struct||enum
+ } elsif ($state == 2) { #struct||enum||typedef
if ($line =~ m/;/) {
$state = 0;
next;
}
- } elsif ($state == 3) {
+ } elsif ($state == 3) { #possible function
$prototype .= $line;
if ($line =~ m/;/) {
@@ -106,6 +114,11 @@ while ($line=<STDIN>) {
function_print($prototype);
}
+ } elsif ($state == 4) { #inline function to be skipped
+ if ($line =~ m/\}/) {
+ $state = 0;
+ next;
+ }
}
}