svn commit: samba r7254 - in branches/SAMBA_4_0/source/scripting/ejs: .

tpot at samba.org tpot at samba.org
Sat Jun 4 01:06:31 GMT 2005


Author: tpot
Date: 2005-06-04 01:06:30 +0000 (Sat, 04 Jun 2005)
New Revision: 7254

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7254

Log:
Add a mprWERROR() function with the same attributes as mprNTSTATUS.

Modified:
   branches/SAMBA_4_0/source/scripting/ejs/mprutil.c


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/ejs/mprutil.c
===================================================================
--- branches/SAMBA_4_0/source/scripting/ejs/mprutil.c	2005-06-04 00:20:32 UTC (rev 7253)
+++ branches/SAMBA_4_0/source/scripting/ejs/mprutil.c	2005-06-04 01:06:30 UTC (rev 7254)
@@ -189,3 +189,27 @@
 
 	return res;
 }
+
+/*
+  turn a WERROR into a MprVar object with lots of funky properties
+*/
+struct MprVar mprWERROR(WERROR status)
+{
+	struct MprVar res, val;
+
+	res = mprCreateObjVar("werror", MPR_DEFAULT_HASH_SIZE);
+
+	val = mprCreateStringVar(win_errstr(status), 1);
+	mprCreateProperty(&res, "errstr", &val);
+
+	val = mprCreateIntegerVar(W_ERROR_V(status));
+	mprCreateProperty(&res, "v", &val);
+
+	val = mprCreateBoolVar(W_ERROR_IS_OK(status));
+	mprCreateProperty(&res, "is_ok", &val);
+
+	val = mprCreateBoolVar(True);
+	mprCreateProperty(&res, "is_err", &val);
+
+	return res;
+}



More information about the samba-cvs mailing list