diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-11-17 17:44:22 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-11-17 17:45:08 +0100 |
commit | 38d95b77c7fe6574e3bba3e17f03bfc9dda8f3dc (patch) | |
tree | 0bca4d63f397ba8bbd362737932c46badb71b320 | |
parent | 2245d17ed1ffcf59db68cd6a7c7c8045f3ee2488 (diff) | |
download | gnutls-38d95b77c7fe6574e3bba3e17f03bfc9dda8f3dc.tar.gz |
made more clever to ignore inline function body.
-rwxr-xr-x | doc/scripts/getfuncs.pl | 21 |
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; + } } } |