diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-11-18 20:53:23 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:58 -0500 |
commit | a0fa682faa309bda812008ea3a084cf54f65310b (patch) | |
tree | 5841de49e8c7c212a9ac97cd82c06e7b4d9591c3 /source4/build/pidl/pidl.pl | |
parent | be01250d1a5ef9611164e5ca741e07255f770b4d (diff) | |
download | samba-a0fa682faa309bda812008ea3a084cf54f65310b.tar.gz samba-a0fa682faa309bda812008ea3a084cf54f65310b.tar.bz2 samba-a0fa682faa309bda812008ea3a084cf54f65310b.zip |
r3861: - Put ndr and rpc client code in seperate files
- Add some const
(This used to be commit a00bda88e1b6abdc36e5aa8c2a35f64855f67c96)
Diffstat (limited to 'source4/build/pidl/pidl.pl')
-rwxr-xr-x | source4/build/pidl/pidl.pl | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/source4/build/pidl/pidl.pl b/source4/build/pidl/pidl.pl index bb7f1f8ed6..8388bcfd4c 100755 --- a/source4/build/pidl/pidl.pl +++ b/source4/build/pidl/pidl.pl @@ -17,6 +17,8 @@ use idl; use dump; use header; use server; +use client; +use proxy; use stub; use parser; use eparser; @@ -31,6 +33,7 @@ my($opt_dump) = 0; my($opt_diff) = 0; my($opt_header) = 0; my($opt_template) = 0; +my($opt_client) = 0; my($opt_server) = 0; my($opt_parser) = 0; my($opt_eparser) = 0; @@ -68,6 +71,7 @@ sub ShowHelp() --dump dump a pidl file back to idl --header create a C header file --parser create a C parser + --client create a C client --server create server boilerplate --template print a template for a pipe --eparser create an ethereal parser @@ -88,6 +92,7 @@ GetOptions ( 'server' => \$opt_server, 'template' => \$opt_template, 'parser' => \$opt_parser, + 'client' => \$opt_client, 'eparser' => \$opt_eparser, 'diff' => \$opt_diff, 'keep' => \$opt_keep, @@ -138,6 +143,30 @@ sub process_file($) util::FileSave($header, IdlHeader::Parse($pidl)); } + if ($opt_client) { + my ($client) = util::ChangeExtension($output, "_c.c"); + my $res = ""; + my $h_filename = util::ChangeExtension($output, ".h"); + my $need_dcom_register = 0; + + $res .= "#include \"includes.h\"\n"; + $res .= "#include \"$h_filename\"\n\n"; + + foreach my $x (@{$pidl}) { + if (util::has_property($x, "object")) { + $res .= IdlProxy::ParseInterface($x); + $need_dcom_register = 1; + } else { + $res .= IdlClient::ParseInterface($x); + } + } + + if ($need_dcom_register) { + $res .= IdlProxy::RegistrationFunction($pidl, $basename); + } + util::FileSave($client, $res); + } + if ($opt_server) { my($server) = util::ChangeExtension($output, "_s.c"); my $res = ""; |