summaryrefslogtreecommitdiff
path: root/source4/build/pidl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-11-19 20:21:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:06:01 -0500
commitd95a256d1b7f579666c852740d32ba0f446a4c66 (patch)
tree13cbb67f8da922ae2db861d59a70c6369029ba75 /source4/build/pidl
parentb307f188258e5a6991856e1b1f7f72f77007a36b (diff)
downloadsamba-d95a256d1b7f579666c852740d32ba0f446a4c66.tar.gz
samba-d95a256d1b7f579666c852740d32ba0f446a4c66.tar.bz2
samba-d95a256d1b7f579666c852740d32ba0f446a4c66.zip
r3881: Split up the LIBNDR_GEN subsystem into NDR_* and RPC_NDR_* subsystems.
This reduces the total size of the samba binaries from 119 Mb to 73 Mb. Next step will be to have the build system obtain some of this information by itself, so that we don't have to write ~10 lines per interface manually. (This used to be commit 16d905f6b0cbec591eebc44ee2ac9516a5730378)
Diffstat (limited to 'source4/build/pidl')
-rwxr-xr-xsource4/build/pidl/pidl.pl27
-rw-r--r--source4/build/pidl/stub.pm12
2 files changed, 28 insertions, 11 deletions
diff --git a/source4/build/pidl/pidl.pl b/source4/build/pidl/pidl.pl
index 8388bcfd4c..c430c75236 100755
--- a/source4/build/pidl/pidl.pl
+++ b/source4/build/pidl/pidl.pl
@@ -168,18 +168,35 @@ sub process_file($)
}
if ($opt_server) {
- my($server) = util::ChangeExtension($output, "_s.c");
- my $res = "";
+ my $h_filename = util::ChangeExtension($output, ".h");
+ my $plain = "";
+ my $dcom = "";
+
foreach my $x (@{$pidl}) {
next if ($x->{TYPE} ne "INTERFACE");
if (util::has_property($x, "object")) {
- $res .= IdlStub::ParseInterface($x);
+ $dcom .= IdlStub::ParseInterface($x);
} else {
- $res .= IdlServer::ParseInterface($x);
+ $plain .= IdlServer::ParseInterface($x);
}
}
- util::FileSave($server, $res);
+
+ if ($plain ne "") {
+ util::FileSave(util::ChangeExtension($output, "_s.c"), $plain);
+ }
+
+ if ($dcom ne "") {
+ $dcom = "
+#include \"includes.h\"
+#include \"$h_filename\"
+#include \"rpc_server/dcerpc_server.h\"
+#include \"rpc_server/common/common.h\"
+
+$dcom
+";
+ util::FileSave(util::ChangeExtension($output, "_d.c"), $dcom);
+ }
}
if ($opt_parser) {
diff --git a/source4/build/pidl/stub.pm b/source4/build/pidl/stub.pm
index 1cfb3cb11e..2bcece8416 100644
--- a/source4/build/pidl/stub.pm
+++ b/source4/build/pidl/stub.pm
@@ -27,12 +27,13 @@ sub gen_dispatch_switch($)
next if ($d->{TYPE} ne "FUNCTION");
pidl "\tcase $count: {\n";
+ pidl "\t\tNTSTATUS result;\n";
pidl "\t\tstruct $d->{NAME} *r2 = r;\n";
pidl "\t\tif (DEBUGLEVEL > 10) {\n";
pidl "\t\t\tNDR_PRINT_FUNCTION_DEBUG($d->{NAME}, NDR_IN, r2);\n";
pidl "\t\t}\n";
if ($d->{RETURN_TYPE} && $d->{RETURN_TYPE} ne "void") {
- pidl "\t\tr2->out.result = vtable->$d->{NAME}(iface, mem_ctx, r2);\n";
+ pidl "\t\tresult = vtable->$d->{NAME}(iface, mem_ctx, r2);\n";
} else {
pidl "\t\tvtable->$d->{NAME}(iface, mem_ctx, r2);\n";
}
@@ -89,8 +90,8 @@ static NTSTATUS $name\__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_C
{
uint16 opnum = dce_call->pkt.u.request.opnum;
struct GUID ipid = dce_call->pkt.u.request.object.object;
- struct dcom_interface_p *iface = dcoms_get_ifacep(&ipid);
- struct dcom_$name\_vtable *vtable = if->vtable;
+ struct dcom_interface_p *iface = dcom_get_iface_p(&ipid);
+ const struct dcom_$name\_vtable *vtable = iface->vtable;
dce_call->fault_code = 0;
@@ -193,7 +194,7 @@ NTSTATUS dcerpc_server_$name\_init(void)
ep_server.interface_by_name = $name\__op_interface_by_name;
/* register ourselves with the DCERPC subsystem. */
- ret = register_backend(\"dcerpc\", &ep_server);
+ ret = dcerpc_register_ep_server(&ep_server);
if (!NT_STATUS_IS_OK(ret)) {
DEBUG(0,(\"Failed to register \'$name\' endpoint server!\\n\"));
@@ -209,7 +210,7 @@ NTSTATUS dcerpc_server_$name\_init(void)
sub ParseInterface($)
{
my($interface) = shift;
- $res = "/* dcerpc server boilerplate generated by pidl */\n\n";
+ $res = "/* dcom interface stub generated by pidl */\n\n";
Boilerplate_Iface($interface);
Boilerplate_Ep_Server($interface);
@@ -218,4 +219,3 @@ sub ParseInterface($)
}
1;
-