summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2005-08-05 01:04:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:31:15 -0500
commit36a2b361778a8c73b2e79087bf46d52e45d6afbf (patch)
treee83f80dc0f4ea7b43c31119e9d174ddd9d0374c8
parent02edb56c799d9c6db82fe861d588242f7c14df13 (diff)
downloadsamba-36a2b361778a8c73b2e79087bf46d52e45d6afbf.tar.gz
samba-36a2b361778a8c73b2e79087bf46d52e45d6afbf.tar.bz2
samba-36a2b361778a8c73b2e79087bf46d52e45d6afbf.zip
r9089: Start generating module init and top level ejs functions for smb_interfaces.
(This used to be commit 0aee33c3de6ba94ec563725a56b7dfbddd0d521a)
-rwxr-xr-xsource4/script/build_smb_interfaces.pl30
1 files changed, 28 insertions, 2 deletions
diff --git a/source4/script/build_smb_interfaces.pl b/source4/script/build_smb_interfaces.pl
index 075786fb04..cc942ea3d3 100755
--- a/source4/script/build_smb_interfaces.pl
+++ b/source4/script/build_smb_interfaces.pl
@@ -46,13 +46,16 @@ sub pushpull_for($)
print FILE "NTSTATUS ejs_push_$name(struct ejs_rpc *ejs, struct MprVar *v, const char *name, const uint32_t *r)\n";
print FILE "{\n";
- print FILE "\tNDR_CHECK(ejs_push_struct_start(ejs, &v, name));\n";
+ print FILE "\tNDR_CHECK(ejs_push_struct_start(ejs, &v, \"output\"));\n";
print FILE "\n\treturn NT_STATUS_OK;\n";
print FILE "}\n\n";
print FILE "NTSTATUS ejs_pull_$name(struct ejs_rpc *ejs, struct MprVar *v, const char *name, const uint32_t *r)\n";
print FILE "{\n";
+
+ print FILE "\tNDR_CHECK(ejs_pull_struct_start(ejs, &v, \"input\"));\n";
+
print FILE "\treturn NT_STATUS_OK;\n";
print FILE "}\n\n";
}
@@ -87,7 +90,30 @@ print FILE "/* EJS wrapper functions auto-generated by build_smb_interfaces.pl *
# Top level functions
foreach my $x (@{$header}) {
- pushpull_for($x);
+ next, if $x->{STRUCT_NAME} eq "";
+ print FILE "static int ejs_$x->{STRUCT_NAME}(int eid, int argc, struct MprVar **argv)\n";
+ print FILE "{\n";
+ print FILE "\tejsSetErrorMsg(eid, \"Not implemented\");\n";
+ print FILE "\treturn -1;\n";
+ print FILE "}\n\n";
}
+# Module initialisation
+
+print FILE "static int ejs_${basename}_init(int eid, int argc, struct MprVar **argv)\n";
+print FILE "{\n";
+print FILE "\tstruct MprVar *obj = mprInitObject(eid, \"${basename}\", argc, argtv);\n\n";
+
+foreach my $x (@{$header}) {
+ next, if $x->{STRUCT_NAME} eq "";
+ print FILE "\tmprSetCFunction(obj, \"$x->{STRUCT_NAME}\", ejs_$x->{STRUCT_NAME});\n";
+}
+
+print FILE "}\n\n";
+
+print FILE "NTSTATUS ejs_init_${basename}(void)\n";
+print FILE "{\n";
+print FILE "\treturn smbcalls_register_ejs(\"${basename}_init\", ejs_${basename}_init);\n";
+print FILE "}\n";
+
close(FILE);