Author: derrell Date: 2006-10-02 02:38:02 +0000 (Mon, 02 Oct 2006) New Revision: 19020
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19020 Log: move jsonrpc_include to a more appropriate location in the file, and call the setup function for parsing literals. Modified: branches/SAMBA_4_0/source/scripting/ejs/smbcalls.c Changeset: Modified: branches/SAMBA_4_0/source/scripting/ejs/smbcalls.c =================================================================== --- branches/SAMBA_4_0/source/scripting/ejs/smbcalls.c 2006-10-02 02:36:27 UTC (rev 19019) +++ branches/SAMBA_4_0/source/scripting/ejs/smbcalls.c 2006-10-02 02:38:02 UTC (rev 19020) @@ -83,7 +83,7 @@ { 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,11 +152,21 @@ } /* - 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; char *emsg; @@ -192,15 +202,8 @@ 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; _PUBLIC_ void ejs_exception(const char *reason) @@ -222,6 +225,7 @@ smb_setup_ejs_options(); smb_setup_ejs_credentials(); smb_setup_ejs_param(); + smb_setup_ejs_literal(); ejsnet_setup(); @@ -235,7 +239,7 @@ 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); }