From ebfbb2a7abe33e47af48d69164c37f4c24b7f8ed Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 24 Dec 2005 22:11:44 +0000 Subject: r12463: Rename 'Samba' namespace to 'Samba4' (This used to be commit f25358270d44a5642adbb85ecaa50b2e5730d7f0) --- source4/pidl/lib/Parse/Pidl/Samba4/SWIG.pm | 79 ++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 source4/pidl/lib/Parse/Pidl/Samba4/SWIG.pm (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/SWIG.pm') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/SWIG.pm b/source4/pidl/lib/Parse/Pidl/Samba4/SWIG.pm new file mode 100644 index 0000000000..b6c268edeb --- /dev/null +++ b/source4/pidl/lib/Parse/Pidl/Samba4/SWIG.pm @@ -0,0 +1,79 @@ +################################################### +# Samba4 parser generator for swig wrappers +# Copyright tpot@samba.org 2004,2005 +# released under the GNU GPL + +package Parse::Pidl::Samba4::SWIG; + +use vars qw($VERSION); +$VERSION = '0.01'; + +use strict; + +sub pidl($) +{ + print OUT shift; +} + +##################################################################### +# rewrite autogenerated header file +sub RewriteHeader($$$) +{ + my($idl) = shift; + my($input) = shift; + my($output) = shift; + + open(IN, "<$input") || die "can't open $input for reading"; + open(OUT, ">$output") || die "can't open $output for writing"; + + pidl "%{\n"; + pidl "#define data_in in\n"; + pidl "#define data_out out\n"; + pidl "%}\n\n"; + + while() { + + # Rename dom_sid2 to dom_sid as we don't care about the difference + # for the swig wrappers. + + s/dom_sid2/dom_sid/g; + + # Copy structure and union definitions + + if (/^(struct|union) .*? {$/ .. /^\};$/) { + s/\} (in|out);/\} data_$1;/; # "in" is a Python keyword + pidl $_; + next; + } + + # Copy dcerpc functions + + pidl $_ if /^NTSTATUS dcerpc_.*?\(struct dcerpc_pipe/; + + # Copy interface definitions + + pidl $_ + if /^\#define DCERPC_.*?_UUID/ or /^\#define DCERPC_.*?_VERSION/; + } + + close(OUT); +} + +##################################################################### +# rewrite autogenerated header file +sub RewriteC($$$) +{ + my($idl) = shift; + my($input) = shift; + my($output) = shift; + + open(IN, "<$input") || die "can't open $input for reading"; + open(OUT, ">>$output") || die "can't open $output for writing"; + + while() { + } + + close(OUT); +} + +1; -- cgit