[SCM] Samba Shared Repository - branch master updated - tevent-0-9-8-222-g6b92981

Michael Adam obnox at samba.org
Fri Sep 11 07:32:39 MDT 2009


The branch, master has been updated
       via  6b9298191a72c20e0e81298d06871181dd3b7826 (commit)
       via  7165f29aeaf6607bfaab90c4d5e9eca280b4a27d (commit)
       via  f98470e3a4add69858e50ded0c7e01393b314473 (commit)
       via  085c07b7431c7b96b30d29e3753dbd5fa71ff9ce (commit)
       via  636f8b5e5b4c8c42edb626a6bd7ef497477237d7 (commit)
       via  aa7748484fa23da36c843115c5624a090d08dbad (commit)
       via  1e2393c17829a14ce409091c35fa78b9373c57fb (commit)
       via  1f1a900dd7d2a95a248805cfbbdeed47c666c4b4 (commit)
       via  095a11226ea1b23609e62ad803ff6b65cb113405 (commit)
       via  4fb82727b1258f89aadbf8d320d9aea6ba74d92c (commit)
       via  cf67b1bff784ce7a2371a5d3e3839db96569d7ea (commit)
       via  40c670f8cbb4ea5485d4933fba658bb46720aa9d (commit)
       via  f0e276cff896bb40941357a27c0ff1cd772ba8b4 (commit)
       via  31ee07293420a6faae53ad71e3517a332cd45006 (commit)
       via  ffc72b92078a07d020456028b31fbbdd9e802c54 (commit)
       via  4530fcd820af41080d820159605880d33fd48476 (commit)
      from  9da49338043dedbf17c99ceed24c2934514d0157 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 6b9298191a72c20e0e81298d06871181dd3b7826
Author: Michael Adam <obnox at samba.org>
Date:   Fri Sep 11 15:08:37 2009 +0200

    tevent:signatures: add _tevent_req_cancel and tevent_req_set_cancel_fn
    
    introduced in 45e4be0d96abdc729252df1e97bb9a56302e5a4a
    
    Michael

commit 7165f29aeaf6607bfaab90c4d5e9eca280b4a27d
Author: Michael Adam <obnox at samba.org>
Date:   Fri Sep 11 14:57:59 2009 +0200

    tevent:exports: add _tevent_req_cancel and tevent_req_set_cancel_fn.
    
    These were added in 45e4be0d96abdc729252df1e97bb9a56302e5a4a
    
    Michael

commit f98470e3a4add69858e50ded0c7e01393b314473
Author: Michael Adam <obnox at samba.org>
Date:   Fri Sep 11 15:20:34 2009 +0200

    tevent:mksigs: allow PRINTF_ATTRIBUTE(..) macros function types as funcion args
    
    Michael

commit 085c07b7431c7b96b30d29e3753dbd5fa71ff9ce
Author: Michael Adam <obnox at samba.org>
Date:   Fri Sep 11 15:16:03 2009 +0200

    tevent:mksigs: normalize bool -> _Bool
    
    Michael

commit 636f8b5e5b4c8c42edb626a6bd7ef497477237d7
Author: Michael Adam <obnox at samba.org>
Date:   Fri Sep 11 15:11:16 2009 +0200

    tevent:mksigs: ignore symbols (like _DEPRECATED_) after closing function parentheses
    
    Michael

commit aa7748484fa23da36c843115c5624a090d08dbad
Author: Michael Adam <obnox at samba.org>
Date:   Fri Sep 11 15:01:46 2009 +0200

    tevent:mksigs: correctly ignode multiline function typedefs
    
    by first concatenating multilint parentheses and removing typefes afterwards.
    
    Michael

commit 1e2393c17829a14ce409091c35fa78b9373c57fb
Author: Michael Adam <obnox at samba.org>
Date:   Fri Sep 11 14:55:52 2009 +0200

    tevent:mksigs: ignore struct forward declarations.
    
    Michael

commit 1f1a900dd7d2a95a248805cfbbdeed47c666c4b4
Author: Michael Adam <obnox at samba.org>
Date:   Fri Sep 11 14:54:30 2009 +0200

    tevent:mksyms: allow characters after closing functions parenthesis.
    
    Michael

commit 095a11226ea1b23609e62ad803ff6b65cb113405
Author: Michael Adam <obnox at samba.org>
Date:   Fri Sep 11 14:54:02 2009 +0200

    tevent:mksyms: allow double pointer return value of functions.
    
    Michael

commit 4fb82727b1258f89aadbf8d320d9aea6ba74d92c
Author: Michael Adam <obnox at samba.org>
Date:   Fri Sep 11 14:00:25 2009 +0200

    tevent: add abi_checks to "make test"
    
    Michael

commit cf67b1bff784ce7a2371a5d3e3839db96569d7ea
Author: Michael Adam <obnox at samba.org>
Date:   Fri Sep 11 13:39:44 2009 +0200

    tevent: remove filese generated by "make abi_checks" in "make clean".
    
    Michael

commit 40c670f8cbb4ea5485d4933fba658bb46720aa9d
Author: Michael Adam <obnox at samba.org>
Date:   Fri Sep 11 13:39:15 2009 +0200

    tevent: add a make target "make abi_checks"
    
    Michael

commit f0e276cff896bb40941357a27c0ff1cd772ba8b4
Author: Michael Adam <obnox at samba.org>
Date:   Fri Aug 28 16:04:47 2009 +0200

    tevent: move the original abi_checks script to script/abi_checks_gcc.sh
    
    Michael

commit 31ee07293420a6faae53ad71e3517a332cd45006
Author: Michael Adam <obnox at samba.org>
Date:   Fri Aug 28 15:53:12 2009 +0200

    tevent: add script/abi_checks.sh. check for abi changes without gcc magic.
    
    USAGE: abi_checks.sh LIBRARY_NAME header1 [header2 ...]
    
    This creates symbol signature lists using the mksyms and mksigs scripts
    and compares them with the checked in lists.
    
    Michael

commit ffc72b92078a07d020456028b31fbbdd9e802c54
Author: Michael Adam <obnox at samba.org>
Date:   Fri Aug 28 15:08:19 2009 +0200

    tevent: add script to extract signatures from header files.
    
    This produces output like the output gcc produces when
    invoked with the -aux-info switch.
    
    Run like this: cat include/tevent.h | ./script/mksigs.pl
    
    This simple parser is probably too coarse to handle all
    possible header files, but it treats tevent.h correctly...
    
    Michael

commit 4530fcd820af41080d820159605880d33fd48476
Author: Michael Adam <obnox at samba.org>
Date:   Fri Aug 28 15:01:17 2009 +0200

    tevent: add scripts to extract library symbols (exports file) from headers
    
    Michael

-----------------------------------------------------------------------

Summary of changes:
 lib/tevent/script/abi_checks.sh                    |   91 ++++++++++
 .../{abi_checks.sh => script/abi_checks_gcc.sh}    |    0 
 lib/tevent/script/mksigs.pl                        |  183 ++++++++++++++++++++
 lib/tevent/script/mksyms.awk                       |   76 ++++++++
 lib/{talloc => tevent}/script/mksyms.sh            |    0 
 lib/tevent/tevent.exports                          |    2 +
 lib/tevent/tevent.mk                               |    8 +
 lib/tevent/tevent.signatures                       |    2 +
 8 files changed, 362 insertions(+), 0 deletions(-)
 create mode 100755 lib/tevent/script/abi_checks.sh
 rename lib/tevent/{abi_checks.sh => script/abi_checks_gcc.sh} (100%)
 create mode 100755 lib/tevent/script/mksigs.pl
 create mode 100644 lib/tevent/script/mksyms.awk
 copy lib/{talloc => tevent}/script/mksyms.sh (100%)


Changeset truncated at 500 lines:

diff --git a/lib/tevent/script/abi_checks.sh b/lib/tevent/script/abi_checks.sh
new file mode 100755
index 0000000..c34a659
--- /dev/null
+++ b/lib/tevent/script/abi_checks.sh
@@ -0,0 +1,91 @@
+#!/bin/sh
+
+#
+# abi_checks.sh - check for possible abi changes
+#
+# Copyright (C) 2009 Micheal Adam <obnox at samba.org>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 3 of the License, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, see <http://www.gnu.org/licenses/>.
+#
+
+#
+# USAGE: abi_checks.sh LIBNAME header1 [header2 ...]
+#
+# This script creates symbol and signature lists from the provided header
+# files with the aid of the mksyms.sh and mksigs.pl scripts (saved as
+# $LIBNAME.exports.check and $LIBNAME.sigatures.check). It then compares
+# the resulting files with the files $LIBNAME.exports and $LIBNME.signatures
+# which it expects to find in the current directory.
+#
+
+LANG=C; export LANG
+LC_ALL=C; export LC_ALL
+LC_COLLATE=C; export LC_COLLATE
+
+script=$0
+dir_name=$(dirname ${script})
+
+if test x"$1" = "x" ; then
+	echo "USAGE: ${script} libname header [header ...]"
+	exit 1
+fi
+
+libname="$1"
+shift
+
+if test x"$1" = "x" ; then
+	echo "USAGE: ${script} libname header [header ...]"
+	exit 1
+fi
+
+headers="$*"
+
+exports_file=${libname}.exports
+exports_file_check=${exports_file}.check
+signatures_file=${libname}.signatures
+signatures_file_check=${signatures_file}.check
+
+
+${dir_name}/mksyms.sh awk ${exports_file_check} ${headers} 2>&1 > /dev/null
+
+cat ${headers} | ${dir_name}/mksigs.pl > ${signatures_file_check} 2> /dev/null
+
+normalize_exports_file() {
+	filename=$1
+	cat ${filename} \
+	| sed -e 's/^[ \t]*//g' \
+	| sed -e 's/^$//g' \
+	| sed -e 's/^#.*$//g' \
+	| sort | uniq > ${filename}.sort
+}
+
+normalize_exports_file ${exports_file}
+normalize_exports_file ${exports_file_check}
+
+normalize_exports_file ${signatures_file}
+normalize_exports_file ${signatures_file_check}
+
+diff -u ${exports_file}.sort ${exports_file_check}.sort
+if test "x$?" != "x0" ; then
+	echo "WARNING: possible ABI change detected in exports!"
+else
+	echo "exports check: OK"
+fi
+
+diff -u ${signatures_file}.sort ${signatures_file_check}.sort
+if test "x$?" != "x0" ; then
+	echo "WARNING: possible ABI change detected in signatures!"
+else
+	echo "signatures check: OK"
+fi
diff --git a/lib/tevent/abi_checks.sh b/lib/tevent/script/abi_checks_gcc.sh
similarity index 100%
rename from lib/tevent/abi_checks.sh
rename to lib/tevent/script/abi_checks_gcc.sh
diff --git a/lib/tevent/script/mksigs.pl b/lib/tevent/script/mksigs.pl
new file mode 100755
index 0000000..755cd79
--- /dev/null
+++ b/lib/tevent/script/mksigs.pl
@@ -0,0 +1,183 @@
+#!/usr/bin/perl
+
+# mksigs.pl - extract signatures from C headers
+#
+# Copyright (C) Michael Adam 2009
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 3 of the License, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, see <http://www.gnu.org/licenses/>.
+
+# USAGE:  cat $header_files | mksigs.pl > $signature_file
+#
+# The header files to parse are read from stdin.
+# The output is in a form as produced by gcc with the -aux-info switch
+# and printed to stdout.
+
+use strict;
+use warnings;
+
+my $in_comment = 0;
+my $extern_C_block = 0;
+
+while (my $LINE = <>) {
+	# find end of started multi-line-comment
+	if ($in_comment) {
+		if ($LINE =~ /^.*?\*\/(.*)$/) {
+			$LINE = $1;
+			$in_comment = 0;
+		} else {
+			# whole line within comment
+			next;
+		}
+	}
+
+	# strip C++-style comments
+	$LINE =~ s/^(.*?)\/\/.*$/$1/;
+
+	# strip in-line-comments:
+	while ($LINE =~ /\/\*.*?\*\//) {
+		$LINE =~ s/\/\*.*?\*\///;
+	}
+
+	# find starts of multi-line-comments
+	if ($LINE =~ /^(.*)\/\*/) {
+		$in_comment = 1;
+		$LINE = $1;
+	}
+
+	# skip empty lines
+	next if $LINE =~ /^\s*$/;
+
+	# remove leading spaces
+	$LINE =~ s/^\s*(.*)$/$1/;
+
+	# concatenate lines split with "\" (usually macro defines)
+	while ($LINE =~ /^(.*?)\s+\\$/) {
+		my $LINE2 = <>;
+		$LINE = $1;
+		$LINE2 =~ s/^\s*(.*)$/$1/;
+		$LINE .= " " . $LINE2;
+	}
+
+	# remove all preprocessor directives
+	next if ($LINE =~ /^#/);
+
+	if ($LINE =~ /^extern\s+"C"\s+\{/) {
+		$extern_C_block = 1;
+		next;
+	}
+
+	if (($LINE =~ /^[^\{]*\}/) and $extern_C_block) {
+		$extern_C_block = 0;
+		next;
+	}
+
+	$LINE =~ s/^extern\s//;
+
+	# concatenate braces stretched over multiple lines
+	# (from structs or enums)
+	my $REST = $LINE;
+	my $braces = 0;
+	while (($REST =~ /[\{\}]/) or ($braces)) {
+		while ($REST =~ /[\{\}]/) {
+			# collect opening
+			while ($REST =~ /^[^\{\}]*\{(.*)$/) {
+				$braces++;
+				$REST = $1;
+			}
+
+			# collect closing
+			while ($REST =~ /^[^\{\}]*\}(.*)$/) {
+				$braces--;
+				$REST = $1;
+			}
+		}
+
+		# concatenate if not balanced
+		if ($braces) {
+			if (my $LINE2 = <>) {
+				$LINE2 =~ s/^\s*(.*)$/$1/;
+				chomp($LINE);
+				$LINE .= " " . $LINE2;
+				chomp $REST;
+				$REST .= " " . $LINE2;
+			} else {
+				print "ERROR: unbalanced braces ($braces)\n";
+				last;
+			}
+		}
+	}
+
+	# concetenate function prototypes that stretch over multiple lines
+	$REST = $LINE;
+	my $parenthesis = 0;
+	while (($REST =~ /[\(\)]/) or ($parenthesis)) {
+		while ($REST =~ /[\(\)]/) {
+			# collect opening
+			while ($REST =~ /^[^\(\)]*\((.*)$/) {
+				$parenthesis++;
+				$REST = $1;
+			}
+
+			# collect closing
+			while ($REST =~ /^[^\(\)]*\)(.*)$/) {
+				$parenthesis--;
+				$REST = $1;
+			}
+		}
+
+		# concatenate if not balanced
+		if ($parenthesis) {
+			if (my $LINE2 = <>) {
+				$LINE2 =~ s/^\s*(.*)$/$1/;
+				chomp($LINE);
+				$LINE .= " " . $LINE2;
+				chomp($REST);
+				$REST .= " " . $LINE2;
+			} else {
+				print "ERROR: unbalanced parantheses ($parenthesis)\n";
+				last;
+			}
+		}
+	}
+
+	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\([^\)]*\)(\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;
+
+	# remedy (void) from last line
+	$LINE =~ s/\(\)/(void)/g;
+
+	# normalize spaces
+	$LINE =~ s/\s*\)\s*/)/g;
+	$LINE =~ s/\s*\(\s*/ (/g;
+	$LINE =~ s/\s*,\s*/, /g;
+
+	# 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/tevent/script/mksyms.awk b/lib/tevent/script/mksyms.awk
new file mode 100644
index 0000000..ca14da0
--- /dev/null
+++ b/lib/tevent/script/mksyms.awk
@@ -0,0 +1,76 @@
+#
+# mksyms.awk
+#
+# Extract symbols to export from C-header files.
+# output in version-script format for linking shared libraries.
+#
+# Copyright (C) 2008 Micheal Adam <obnox at samba.org>
+#
+BEGIN {
+	inheader=0;
+	current_file="";
+	print "#"
+	print "# This file is automatically generated with \"make symbols\". DO NOT EDIT "
+	print "#"
+	print "{"
+	print "\tglobal:"
+}
+
+END {
+	print""
+	print "\tlocal: *;"
+	print "};"
+}
+
+{
+	if (FILENAME!=current_file) {
+		print "\t\t# The following definitions come from",FILENAME
+		current_file=FILENAME
+	}
+	if (inheader) {
+		if (match($0,"[)][^()]*[;][ \t]*$")) {
+			inheader = 0;
+		}
+		next;
+	}
+}
+
+/^static/ || /^[ \t]*typedef/ || !/^[a-zA-Z\_]/ {
+	next;
+}
+
+/^extern[ \t]+[^()]+[;][ \t]*$/ {
+	gsub(/[^ \t]+[ \t]+/, "");
+	sub(/[;][ \t]*$/, "");
+	printf "\t\t%s;\n", $0;
+	next;
+}
+
+# look for function headers:
+{
+	gotstart = 0;
+	if ($0 ~ /^[A-Za-z_][A-Za-z0-9_]+/) {
+	gotstart = 1;
+	}
+	if(!gotstart) {
+		next;
+	}
+}
+
+/[_A-Za-z0-9]+[ \t]*[(].*[)][^()]*;[ \t]*$/ {
+	sub(/[(].*$/, "");
+	gsub(/[^ \t]+[ \t]+/, "");
+	gsub(/^[*]+/, "");
+	printf "\t\t%s;\n",$0;
+	next;
+}
+
+/[_A-Za-z0-9]+[ \t]*[(]/ {
+	inheader=1;
+	sub(/[(].*$/, "");
+	gsub(/[^ \t]+[ \t]+/, "");
+	gsub(/^[*]/, "");
+	printf "\t\t%s;\n",$0;
+	next;
+}
+
diff --git a/lib/talloc/script/mksyms.sh b/lib/tevent/script/mksyms.sh
similarity index 100%
copy from lib/talloc/script/mksyms.sh
copy to lib/tevent/script/mksyms.sh
diff --git a/lib/tevent/tevent.exports b/lib/tevent/tevent.exports
index b1554df..01d547a 100644
--- a/lib/tevent/tevent.exports
+++ b/lib/tevent/tevent.exports
@@ -55,6 +55,8 @@
            tevent_timeval_zero;
            tevent_wakeup_recv;
            tevent_wakeup_send;
+           _tevent_req_cancel;
+           tevent_req_set_cancel_fn;
 
     local: *;
 };
diff --git a/lib/tevent/tevent.mk b/lib/tevent/tevent.mk
index 480366e..694d082 100644
--- a/lib/tevent/tevent.mk
+++ b/lib/tevent/tevent.mk
@@ -29,6 +29,14 @@ installlibs:: installdirs
 
 install:: all installdirs installheaders installlibs $(PYTHON_INSTALL_TARGET)
 
+abi_checks::
+	@echo ABI checks:
+	@./script/abi_checks.sh tevent tevent.h
+
+test:: abi_checks
+
 clean::
 	rm -f $(TEVENT_SOBASE) $(TEVENT_SONAME) $(TEVENT_SOLIB) $(TEVENT_STLIB)
 	rm -f tevent.pc
+	rm -f tevent.exports.sort tevent.exports.check tevent.exports.check.sort
+	rm -f tevent.signatures.sort tevent.signatures.check tevent.signatures.check.sort
diff --git a/lib/tevent/tevent.signatures b/lib/tevent/tevent.signatures
index 75f43af..c752b9e 100644
--- a/lib/tevent/tevent.signatures
+++ b/lib/tevent/tevent.signatures
@@ -53,3 +53,5 @@ void tevent_req_set_print_fn (struct tevent_req *, tevent_req_print_fn);
 void _tevent_schedule_immediate (struct tevent_immediate *, struct tevent_context *, tevent_immediate_handler_t, void *, const char *, const char *);
 void tevent_set_abort_fn (void (*) (const char *));
 void tevent_set_default_backend (const char *);
+_Bool _tevent_req_cancel (struct tevent_req *, const char *);
+void tevent_req_set_cancel_fn (struct tevent_req *, tevent_req_cancel_fn);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list