*/
#include "includes.h"
-#include "lib/ejs/ejs.h"
+#include "lib/appweb/ejs/ejs.h"
#include "scripting/ejs/smbcalls.h"
/*
{ MPR_TYPE_FUNCTION, "function" },
{ MPR_TYPE_STRING, "string" },
{ MPR_TYPE_STRING_CFUNCTION, "function" },
- { MPR_TYPE_PTR, "C pointer" }
+ { MPR_TYPE_PTR, "pointer" }
};
int i;
const char *type = NULL;
return 0;
}
-/*
- return the list of configured network interfaces
-*/
-static int ejs_IfaceList(MprVarHandle eid, int argc, struct MprVar **argv)
-{
- int i, count = iface_count();
- struct MprVar ret = mprObject("interfaces");
- for (i=0;i<count;i++) {
- mprAddArray(&ret, i, mprString(iface_n_ip(i)));
- }
- mpr_Return(eid, ret);
- return 0;
-}
-
-
/*
libinclude() allows you to include js files using a search path specified
in "js include =" in smb.conf.
const char **js_include = lp_js_include();
if (js_include == NULL || js_include[0] == NULL) {
+ ejsSetErrorMsg(eid, "js include path not set");
return -1;
}
smb_setup_ejs_options();
smb_setup_ejs_nss();
smb_setup_ejs_string();
+ smb_setup_ejs_random();
+ smb_setup_ejs_system();
+ smb_setup_ejs_credentials();
+ smb_setup_ejs_samba3();
+ smb_setup_ejs_datablob();
ejsDefineCFunction(-1, "typeof", ejs_typeof, NULL, MPR_VAR_SCRIPT_HANDLE);
- ejsDefineCFunction(-1, "IfaceList", ejs_IfaceList, NULL, MPR_VAR_SCRIPT_HANDLE);
ejsDefineStringCFunction(-1, "libinclude", ejs_libinclude, NULL, MPR_VAR_SCRIPT_HANDLE);
}
-/*
- setup constants that can be used from ejs
-*/
-void smb_setup_ejs_constants(int eid)
-{
- smb_setup_ejs_rpc_constants(eid);
-}