summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-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);