diff options
Diffstat (limited to 'source4/build/pidl')
-rwxr-xr-x | source4/build/pidl/pidl.pl | 12 | ||||
-rw-r--r-- | source4/build/pidl/swig.pm | 24 |
2 files changed, 35 insertions, 1 deletions
diff --git a/source4/build/pidl/pidl.pl b/source4/build/pidl/pidl.pl index c45b17c3c4..5c3f8e5054 100755 --- a/source4/build/pidl/pidl.pl +++ b/source4/build/pidl/pidl.pl @@ -22,6 +22,7 @@ use eparser; use validator; use util; use template; +use swig; my($opt_help) = 0; my($opt_parse) = 0; @@ -33,6 +34,7 @@ my($opt_server) = 0; my($opt_parser) = 0; my($opt_eparser) = 0; my($opt_keep) = 0; +my($opt_swig) = 0; my($opt_output); my $idl_parser = new idl; @@ -86,7 +88,8 @@ GetOptions ( 'parser' => \$opt_parser, 'eparser' => \$opt_eparser, 'diff' => \$opt_diff, - 'keep' => \$opt_keep + 'keep' => \$opt_keep, + 'swig' => \$opt_swig ); if ($opt_help) { @@ -155,6 +158,13 @@ sub process_file($) close(OUT); } + if ($opt_swig) { + my($filename) = $output; + $filename =~ s/\/ndr_/\//; + $filename = util::ChangeExtension($filename, ".i"); + util::FileSave($filename, IdlSwig::Parse($pidl)); + } + if ($opt_diff) { my($tempfile) = util::ChangeExtension($output, ".tmp"); util::FileSave($tempfile, IdlDump::Dump($pidl)); diff --git a/source4/build/pidl/swig.pm b/source4/build/pidl/swig.pm new file mode 100644 index 0000000000..124b6e593e --- /dev/null +++ b/source4/build/pidl/swig.pm @@ -0,0 +1,24 @@ +################################################### +# Samba4 parser generator for swig wrappers +# Copyright tpot@samba.org 2004 +# released under the GNU GPL + +package IdlSwig; + +use strict; + +sub Parse($) +{ + my($idl) = shift; + my($res) = ""; + + $res = "/* header auto-generated by pidl */\n\n"; + + foreach my $x (@{$idl}) { +# ($x->{TYPE} eq "INTERFACE") && HeaderInterface($x); + } + + return $res; +} + +1; |