diff options
Diffstat (limited to 'lib/tdb')
-rwxr-xr-x | lib/tdb/script/mksigs.pl | 15 | ||||
-rw-r--r-- | lib/tdb/script/mksyms.awk | 6 |
2 files changed, 13 insertions, 8 deletions
diff --git a/lib/tdb/script/mksigs.pl b/lib/tdb/script/mksigs.pl index 28a2e747a0..755cd79603 100755 --- a/lib/tdb/script/mksigs.pl +++ b/lib/tdb/script/mksigs.pl @@ -118,10 +118,6 @@ while (my $LINE = <>) { } } - next if ($LINE =~ /^typedef\s/); - next if ($LINE =~ /^enum\s+[^\{\(]+\s+\{/); - next if ($LINE =~ /^struct\s+[^\{\(]+\s+\{.*\}\s*;/); - # concetenate function prototypes that stretch over multiple lines $REST = $LINE; my $parenthesis = 0; @@ -155,10 +151,16 @@ while (my $LINE = <>) { } } + next if ($LINE =~ /^typedef\s/); + next if ($LINE =~ /^enum\s+[^\{\(]+\s+\{/); + next if ($LINE =~ /^struct\s+[^\{\(]+\s+\{.*\}\s*;/); + next if ($LINE =~ /^struct\s+[a-zA-Z0-9_]+\s*;/); + # remove trailing spaces $LINE =~ s/(.*?)\s*$/$1/; - $LINE =~ s/^(.*\))\s+PRINTF_ATTRIBUTE\(.*\);$/$1;/; + $LINE =~ s/^(.*\))\s+PRINTF_ATTRIBUTE\([^\)]*\)(\s*[;,])/$1$2/; + $LINE =~ s/^(.*\))\s*[a-zA-Z0-9_]+\s*;$/$1;/; # remove parameter names - slightly too coarse probably $LINE =~ s/([\s\(]\*?)[_0-9a-zA-Z]+\s*([,\)])/$1$2/g; @@ -174,5 +176,8 @@ while (my $LINE = <>) { # normalize unsigned $LINE =~ s/([\s,\(])unsigned([,\)])/$1unsigned int$2/g; + # normalize bool + $LINE =~ s/(\b)bool(\b)/_Bool/g; + print $LINE . "\n"; } diff --git a/lib/tdb/script/mksyms.awk b/lib/tdb/script/mksyms.awk index a30bea4d34..ca14da0f21 100644 --- a/lib/tdb/script/mksyms.awk +++ b/lib/tdb/script/mksyms.awk @@ -28,7 +28,7 @@ END { current_file=FILENAME } if (inheader) { - if (match($0,"[)][ \t]*[;][ \t]*$")) { + if (match($0,"[)][^()]*[;][ \t]*$")) { inheader = 0; } next; @@ -57,10 +57,10 @@ END { } } -/[_A-Za-z0-9]+[ \t]*[(].*[)][ \t]*;[ \t]*$/ { +/[_A-Za-z0-9]+[ \t]*[(].*[)][^()]*;[ \t]*$/ { sub(/[(].*$/, ""); gsub(/[^ \t]+[ \t]+/, ""); - gsub(/^[*]/, ""); + gsub(/^[*]+/, ""); printf "\t\t%s;\n",$0; next; } |