From: Nikos Mavrogiannopoulos Date: Sun, 17 Nov 2013 16:44:22 +0000 (+0100) Subject: made more clever to ignore inline function body. X-Git-Tag: gnutls_3_3_0pre0~576 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38d95b77c7fe6574e3bba3e17f03bfc9dda8f3dc;p=thirdparty%2Fgnutls.git made more clever to ignore inline function body. --- 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=) { $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=) { $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=) { function_print($prototype); } + } elsif ($state == 4) { #inline function to be skipped + if ($line =~ m/\}/) { + $state = 0; + next; + } } }