diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-05-30 09:07:21 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:17:16 -0500 |
commit | 2a20e42c2637a6d53d74f3c68a4f420f8cb77a27 (patch) | |
tree | cec1b76d704f47c085b4a1f645350b0e6848e7f2 /source4/build/pidl/ndr_client.pm | |
parent | 9ab8ed3bab065afb0ba98277b7e4728b24caabe0 (diff) | |
download | samba-2a20e42c2637a6d53d74f3c68a4f420f8cb77a27.tar.gz samba-2a20e42c2637a6d53d74f3c68a4f420f8cb77a27.tar.bz2 samba-2a20e42c2637a6d53d74f3c68a4f420f8cb77a27.zip |
r7098: - make use of the NDR table instead of the IDL table in the client and server generation
- add 'noid' property to allow functions to be not present in the function table,
and not generate client and server functions for them
- print out a warning about [id()] not being correctly supported yet
metze
(This used to be commit 189730d1430e7f728d62dd5dc52f2a90c1a556d7)
Diffstat (limited to 'source4/build/pidl/ndr_client.pm')
-rw-r--r-- | source4/build/pidl/ndr_client.pm | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/source4/build/pidl/ndr_client.pm b/source4/build/pidl/ndr_client.pm index ca6fc22465..eb7d73b991 100644 --- a/source4/build/pidl/ndr_client.pm +++ b/source4/build/pidl/ndr_client.pm @@ -42,7 +42,8 @@ NTSTATUS dcerpc_$name(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name * NDR_PRINT_OUT_DEBUG($name, r); } "; - if ($fn->{RETURN_TYPE} eq "NTSTATUS") { + + if (defined($fn->{RETURN_TYPE}) and $fn->{RETURN_TYPE} eq "NTSTATUS") { $res .= "\tif (NT_STATUS_IS_OK(status)) status = r->out.result;\n"; } $res .= @@ -59,15 +60,40 @@ my %done; sub ParseInterface($) { my($interface) = shift; - my($data) = $interface->{DATA}; - $res = "/* Client functions generated by pidl */\n\n"; - - foreach my $d (@{$data}) { - if (($d->{TYPE} eq "FUNCTION") and not $done{$d->{NAME}}) { - ParseFunction($interface, $d); - } - $done{$d->{NAME}} = 1; + $res .= "/* $interface->{NAME} - client functions generated by pidl */\n\n"; + + foreach my $fn (@{$interface->{FUNCTIONS}}) { + next if not defined($fn->{OPNUM}); + next if defined($done{$fn->{NAME}}); + ParseFunction($interface, $fn); + $done{$fn->{NAME}} = 1; + } + + return $res; +} + +sub Parse($$) +{ + my($ndr) = shift; + my($filename) = shift; + + my $h_filename = $filename; + $res = ""; + + if ($h_filename =~ /(.*)\.c/) { + $h_filename = "$1.h"; } + + $res .= "/* client functions auto-generated by pidl */\n"; + $res .= "\n"; + $res .= "#include \"includes.h\"\n"; + $res .= "#include \"$h_filename\"\n"; + $res .= "\n"; + + foreach my $x (@{$ndr}) { + ($x->{TYPE} eq "INTERFACE") && ParseInterface($x); + } + return $res; } |