1 ###################################################
2 # Samba4 parser generator for swig wrappers
3 # Copyright tpot@samba.org 2004,2005
4 # released under the GNU GPL
6 package Parse::Pidl::Samba4::SWIG;
18 #####################################################################
19 # rewrite autogenerated header file
20 sub RewriteHeader($$$)
26 open(IN, "<$input") || die "can't open $input for reading";
27 open(OUT, ">$output") || die "can't open $output for writing";
30 pidl "#define data_in in\n";
31 pidl "#define data_out out\n";
36 # Rename dom_sid2 to dom_sid as we don't care about the difference
37 # for the swig wrappers.
41 # Copy structure and union definitions
43 if (/^(struct|union) .*? {$/ .. /^\};$/) {
44 s/\} (in|out);/\} data_$1;/; # "in" is a Python keyword
49 # Copy dcerpc functions
51 pidl $_ if /^NTSTATUS dcerpc_.*?\(struct dcerpc_pipe/;
53 # Copy interface definitions
56 if /^\#define DCERPC_.*?_UUID/ or /^\#define DCERPC_.*?_VERSION/;
62 #####################################################################
63 # rewrite autogenerated header file
70 open(IN, "<$input") || die "can't open $input for reading";
71 open(OUT, ">>$output") || die "can't open $output for writing";