summaryrefslogtreecommitdiff
path: root/lib/talloc/script
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2010-02-08 10:02:49 -0500
committerSimo Sorce <idra@samba.org>2010-02-08 10:02:49 -0500
commit1422a9465482deeba1218755e1d4d0a02e6abc3f (patch)
treedcffee0fab067b7781ceafe9bf4aca9a0cee02bc /lib/talloc/script
parentaa72950b3d08c1964cd734e7b49ef43c959a2fcc (diff)
downloadsamba-1422a9465482deeba1218755e1d4d0a02e6abc3f.tar.gz
samba-1422a9465482deeba1218755e1d4d0a02e6abc3f.tar.bz2
samba-1422a9465482deeba1218755e1d4d0a02e6abc3f.zip
talloc: Fix abi checks and ifdefs
teach the abi check scripts to skip the DOXYGEN sections fix the header to use #ifdef DOXYGEN and not #if DOXYGEN
Diffstat (limited to 'lib/talloc/script')
-rwxr-xr-xlib/talloc/script/mksigs.pl16
-rw-r--r--lib/talloc/script/mksyms.awk16
2 files changed, 30 insertions, 2 deletions
diff --git a/lib/talloc/script/mksigs.pl b/lib/talloc/script/mksigs.pl
index 755cd79603..dfe36bc138 100755
--- a/lib/talloc/script/mksigs.pl
+++ b/lib/talloc/script/mksigs.pl
@@ -27,6 +27,7 @@ use strict;
use warnings;
my $in_comment = 0;
+my $in_doxygen = 0;
my $extern_C_block = 0;
while (my $LINE = <>) {
@@ -41,6 +42,14 @@ while (my $LINE = <>) {
}
}
+ # find end of DOXYGEN section
+ if ($in_doxygen) {
+ if ($LINE =~ /^#\s*else(?:\s+.*)?$/) {
+ $in_doxygen = 0;
+ }
+ next;
+ }
+
# strip C++-style comments
$LINE =~ s/^(.*?)\/\/.*$/$1/;
@@ -69,6 +78,13 @@ while (my $LINE = <>) {
$LINE .= " " . $LINE2;
}
+ # remove DOXYGEN sections
+ if ($LINE =~ /^#\s*ifdef\s+DOXYGEN(?:\s+.*)?$/) {
+ $in_doxygen = 1;
+ next;
+ }
+
+
# remove all preprocessor directives
next if ($LINE =~ /^#/);
diff --git a/lib/talloc/script/mksyms.awk b/lib/talloc/script/mksyms.awk
index 8775faff3f..83497a7a06 100644
--- a/lib/talloc/script/mksyms.awk
+++ b/lib/talloc/script/mksyms.awk
@@ -8,6 +8,7 @@
#
BEGIN {
inheader=0;
+ indoxygen=0;
}
END {
@@ -20,9 +21,15 @@ END {
}
next;
}
+ if (indoxygen) {
+ if (match($0,"^#[ \t]*else[ \t]*.*$")) {
+ indoxygen = 0;
+ }
+ next;
+ }
}
-/^static/ || /^[ \t]*typedef/ || !/^[a-zA-Z\_]/ {
+/^static/ || /^[ \t]*typedef/ || !/^[a-zA-Z\_\#]/ {
next;
}
@@ -33,11 +40,16 @@ END {
next;
}
+/^#[ \t]*ifdef[ \t]*DOXYGEN[ \t]*.*$/ {
+ indoxygen=1;
+ next;
+}
+
# look for function headers:
{
gotstart = 0;
if ($0 ~ /^[A-Za-z_][A-Za-z0-9_]+/) {
- gotstart = 1;
+ gotstart = 1;
}
if(!gotstart) {
next;