summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@samba.org>2006-10-02 02:38:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:20:28 -0500
commit882910a2a8f6e84509062d19720f4999af4761c4 (patch)
tree9a38ce747974e37bc40f6ad9fc35c48e2ee36fab
parentad60ec590765607077ae6141b4613a762f69a539 (diff)
downloadsamba-882910a2a8f6e84509062d19720f4999af4761c4.tar.gz
samba-882910a2a8f6e84509062d19720f4999af4761c4.tar.bz2
samba-882910a2a8f6e84509062d19720f4999af4761c4.zip
r19020: move jsonrpc_include to a more appropriate location in the file, and call the setup function for parsing literals.
(This used to be commit bb07f606dedde5c63f190229b8dbb85f3d1342f7)
-rw-r--r--source4/scripting/ejs/smbcalls.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/source4/scripting/ejs/smbcalls.c b/source4/scripting/ejs/smbcalls.c
index 85cc5f7027..839ec7b634 100644
--- a/source4/scripting/ejs/smbcalls.c
+++ b/source4/scripting/ejs/smbcalls.c
@@ -83,7 +83,7 @@ static int ejs_typeof_native(MprVarHandle eid, int argc, struct MprVar **argv)
{ MPR_TYPE_INT, "integer" },
{ MPR_TYPE_INT64, "integer64" },
{ MPR_TYPE_OBJECT, "object" },
- { MPR_TYPE_FUNCTION, "function" },
+ { MPR_TYPE_FUNCTION, "js_function" },
{ MPR_TYPE_STRING, "string" },
{ MPR_TYPE_STRING_CFUNCTION, "string_c_function" },
{ MPR_TYPE_PTR, "pointer" }
@@ -152,10 +152,20 @@ static int ejs_libinclude(int eid, int argc, char **argv)
}
/*
- jsonrpc_include() allows you to include jsonrpc files from a path
- based at "jsonrpc base =" in smb.conf.
+ return the current version
*/
-static int ejs_jsonrpc_include(int eid, int argc, char **argv)
+static int ejs_version(MprVarHandle eid, int argc, struct MprVar **argv)
+{
+ mpr_ReturnString(eid, SAMBA_VERSION_STRING);
+ return 0;
+}
+
+
+/*
+ * jsonrpc_include() allows you to include jsonrpc files from a path based at
+ * "jsonrpc base =" in smb.conf.
+ */
+static int jsonrpc_include(int eid, int argc, char **argv)
{
int ret = -1;
char *path;
@@ -192,14 +202,7 @@ static int ejs_jsonrpc_include(int eid, int argc, char **argv)
return 0;
}
-/*
- return the current version
-*/
-static int ejs_version(MprVarHandle eid, int argc, struct MprVar **argv)
-{
- mpr_ReturnString(eid, SAMBA_VERSION_STRING);
- return 0;
-}
+
static void (*ejs_exception_handler) (const char *) = NULL;
@@ -222,6 +225,7 @@ void smb_setup_ejs_functions(void (*exception_handler)(const char *))
smb_setup_ejs_options();
smb_setup_ejs_credentials();
smb_setup_ejs_param();
+ smb_setup_ejs_literal();
ejsnet_setup();
@@ -235,7 +239,7 @@ void smb_setup_ejs_functions(void (*exception_handler)(const char *))
ejsDefineCFunction(-1, "typeof", ejs_typeof, NULL, MPR_VAR_SCRIPT_HANDLE);
ejsDefineCFunction(-1, "nativeTypeOf", ejs_typeof_native, NULL, MPR_VAR_SCRIPT_HANDLE);
ejsDefineStringCFunction(-1, "libinclude", ejs_libinclude, NULL, MPR_VAR_SCRIPT_HANDLE);
- ejsDefineStringCFunction(-1, "jsonrpc_include", ejs_jsonrpc_include, NULL, MPR_VAR_SCRIPT_HANDLE);
ejsDefineCFunction(-1, "version", ejs_version, NULL, MPR_VAR_SCRIPT_HANDLE);
+ ejsDefineStringCFunction(-1, "jsonrpc_include", jsonrpc_include, NULL, MPR_VAR_SCRIPT_HANDLE);
}