summaryrefslogtreecommitdiff
path: root/source4/build/pidl/header.pm
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-11-12 00:48:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:44 -0500
commit79c5d73a71c35f5b16232072a7b52033cb9364cb (patch)
tree62aec59516dd088a0b71b4f86119497b621acb16 /source4/build/pidl/header.pm
parentc8b894b670a2e854c5a6af598ab1f02b142b3406 (diff)
downloadsamba-79c5d73a71c35f5b16232072a7b52033cb9364cb.tar.gz
samba-79c5d73a71c35f5b16232072a7b52033cb9364cb.tar.bz2
samba-79c5d73a71c35f5b16232072a7b52033cb9364cb.zip
r3689: Large number of COM updates:
- Work on server side and local COM support (should work, just no example classes yet) - Use vtables so that local and remote calls can be used transparently - Generate 'proxies and stubs' rather then heavily modified code in client.pm and server.pm. proxies (client side code) are generated in proxy.pm, stubs (server side dispatchers) are generated in stubs.pm - Support registering classes and interfaces - DCOM interfaces no longer have to be in the same IDL file as their base interface, which will allow us to split up dcom.idl (This used to be commit 7466947a23985f9bb15209b67880f7b94dc515c8)
Diffstat (limited to 'source4/build/pidl/header.pm')
-rw-r--r--source4/build/pidl/header.pm45
1 files changed, 34 insertions, 11 deletions
diff --git a/source4/build/pidl/header.pm b/source4/build/pidl/header.pm
index b981200781..188fdd4f72 100644
--- a/source4/build/pidl/header.pm
+++ b/source4/build/pidl/header.pm
@@ -298,22 +298,42 @@ sub HeaderFunction($)
#####################################################################
# output prototypes for a IDL function
-sub HeaderFnProto($)
+sub HeaderFnProto($$)
{
+ my $interface = shift;
my $fn = shift;
my $name = $fn->{NAME};
- my $firstarg = "dcerpc_pipe";
- if (util::has_property($fn, "object")) {
- $firstarg = "dcom_interface";
- }
-
$res .= "void ndr_print_$name(struct ndr_print *, const char *, int, struct $name *);\n";
- $res .= "struct rpc_request *dcerpc_$name\_send(struct $firstarg *, TALLOC_CTX *, struct $name *);\n";
- $res .= "NTSTATUS dcerpc_$name(struct $firstarg *, TALLOC_CTX *, struct $name *);\n";
+
+ if (util::has_property($interface, "object")) {
+ $res .= "NTSTATUS dcom_$interface->{NAME}_$name (struct dcom_interface_p *, TALLOC_CTX *mem_ctx, struct $name *);\n";
+ } else {
+ $res .= "NTSTATUS dcerpc_$name(struct dcerpc_pipe *, TALLOC_CTX *, struct $name *);\n";
+ $res .= "struct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *, TALLOC_CTX *, struct $name *);\n";
+ }
$res .= "\n";
}
+
+#####################################################################
+# generate vtable structure for DCOM interface
+sub HeaderVTable($)
+{
+ my $interface = shift;
+ $res .= "struct dcom_$interface->{NAME}_vtable {\n";
+ if (defined($interface->{BASE})) {
+ $res .= "\tstruct dcom_$interface->{BASE}\_vtable base;\n";
+ }
+
+ my $data = $interface->{DATA};
+ foreach my $d (@{$data}) {
+ $res .= "\tNTSTATUS (*$d->{NAME}) (struct dcom_interface_p *, TALLOC_CTX *mem_ctx, struct $d->{NAME} *);\n" if ($d->{TYPE} eq "FUNCTION");
+ }
+ $res .= "};\n\n";
+}
+
+
#####################################################################
# parse the interface definitions
sub HeaderInterface($)
@@ -379,11 +399,14 @@ sub HeaderInterface($)
HeaderTypedef($d);
($d->{TYPE} eq "TYPEDEF") &&
HeaderTypedefProto($d);
- ($d->{TYPE} eq "FUNCTION") &&
+ ($d->{TYPE} eq "FUNCTION") &&
HeaderFunction($d);
- ($d->{TYPE} eq "FUNCTION") &&
- HeaderFnProto($d);
+ ($d->{TYPE} eq "FUNCTION") &&
+ HeaderFnProto($interface, $d);
}
+
+ (util::has_property($interface, "object")) &&
+ HeaderVTable($interface);
$res .= "#endif /* _HEADER_NDR_$interface->{NAME} */\n";
}