diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-12 05:53:51 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:20:08 -0500 |
commit | 9f86e202865807ed898eff684d7cf3be7daae0fc (patch) | |
tree | 3f00468ba059e780c51b611ae7ebf5dd0d608648 /source4/scripting/ejs/mprutil.c | |
parent | 1bb2b0603126188e639d7adb6309166c64b5e9df (diff) | |
download | samba-9f86e202865807ed898eff684d7cf3be7daae0fc.tar.gz samba-9f86e202865807ed898eff684d7cf3be7daae0fc.tar.xz samba-9f86e202865807ed898eff684d7cf3be7daae0fc.zip |
r8340: - added sys_gmtime()
- added sys_unlink()
- added sys_file_load() and sys_file_save()
- use mprString() instead of mprCreateStringVar() to cope with NULL strings
- removed smbcalls_irpc.c as its not needed any more
- allow ldbAdd() and ldbModify() to take multiple ldif records
- added a sprintf() function to ejs. Quite complex, but very useful!
(This used to be commit 625628a3f6e78349d2240ebcc79081f350672070)
Diffstat (limited to 'source4/scripting/ejs/mprutil.c')
-rw-r--r-- | source4/scripting/ejs/mprutil.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source4/scripting/ejs/mprutil.c b/source4/scripting/ejs/mprutil.c index 95571da2457..30dec22af1f 100644 --- a/source4/scripting/ejs/mprutil.c +++ b/source4/scripting/ejs/mprutil.c @@ -114,7 +114,7 @@ struct MprVar mprList(const char *name, const char **list) var = mprObject(name); for (i=0;list && list[i];i++) { - mprAddArray(&var, i, mprCreateStringVar(list[i], 1)); + mprAddArray(&var, i, mprString(list[i])); } if (i==0) { mprSetVar(&var, "length", mprCreateIntegerVar(i)); @@ -130,7 +130,7 @@ struct MprVar mprString(const char *s) if (s == NULL) { return mprCreatePtrVar(NULL); } - return mprCreateStringVar(s, 1); + return mprCreateStringVar(s, True); } /* @@ -143,7 +143,7 @@ struct MprVar mprData(const uint8_t *p, size_t length) if (s == NULL) { return mprCreateUndefinedVar(); } - var = mprCreateStringVar(s, 1); + var = mprString(s); talloc_free(s); return var; } @@ -183,7 +183,7 @@ struct MprVar mprLdbMessage(struct ldb_message *msg) /* add the dn if it is not already specified */ if (mprGetProperty(&var, "dn", 0) == 0) { - mprSetVar(&var, "dn", mprCreateStringVar(msg->dn, 1)); + mprSetVar(&var, "dn", mprString(msg->dn)); } return var; @@ -290,7 +290,7 @@ struct MprVar mprNTSTATUS(NTSTATUS status) res = mprObject("ntstatus"); - mprSetVar(&res, "errstr", mprCreateStringVar(nt_errstr(status), 1)); + mprSetVar(&res, "errstr", mprString(nt_errstr(status))); mprSetVar(&res, "v", mprCreateIntegerVar(NT_STATUS_V(status))); mprSetVar(&res, "is_ok", mprCreateBoolVar(NT_STATUS_IS_OK(status))); mprSetVar(&res, "is_err", mprCreateBoolVar(NT_STATUS_IS_ERR(status))); @@ -307,7 +307,7 @@ struct MprVar mprWERROR(WERROR status) res = mprObject("werror"); - mprSetVar(&res, "errstr", mprCreateStringVar(win_errstr(status), 1)); + mprSetVar(&res, "errstr", mprString(win_errstr(status))); mprSetVar(&res, "v", mprCreateIntegerVar(W_ERROR_V(status))); mprSetVar(&res, "is_ok", mprCreateBoolVar(W_ERROR_IS_OK(status))); mprSetVar(&res, "is_err", mprCreateBoolVar(!W_ERROR_IS_OK(status))); @@ -363,7 +363,7 @@ void *mprGetPtr(struct MprVar *v, const char *propname) */ void mpr_ReturnString(int eid, const char *s) { - mpr_Return(eid, mprCreateStringVar(s, False)); + mpr_Return(eid, mprString(s)); } |