summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2005-05-29 22:10:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:13 -0500
commit18fa5ea9ef2d9a20d076790123c131d2dbdc9c22 (patch)
tree26513fdd7d0f054e0dac56c1cfeeef0dccc011f7 /source4
parent0b2f972c8a5205f648ed747b04c5232c694afd30 (diff)
downloadsamba-18fa5ea9ef2d9a20d076790123c131d2dbdc9c22.tar.gz
samba-18fa5ea9ef2d9a20d076790123c131d2dbdc9c22.tar.bz2
samba-18fa5ea9ef2d9a20d076790123c131d2dbdc9c22.zip
r7081: Add mprToInt() function.
(This used to be commit 790a46f53bd5b6994cbf6aed670df1407a44e2f3)
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/ejs/mprutil.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/scripting/ejs/mprutil.c b/source4/scripting/ejs/mprutil.c
index a1e26ecb2c..3e47fdf9a3 100644
--- a/source4/scripting/ejs/mprutil.c
+++ b/source4/scripting/ejs/mprutil.c
@@ -133,6 +133,15 @@ const char *mprToString(const struct MprVar *v)
}
/*
+ turn a MprVar integer variable into an int
+ */
+int mprToInt(const struct MprVar *v)
+{
+ if (v->type != MPR_TYPE_INT) return 0;
+ return v->integer;
+}
+
+/*
turn a MprVar object variable into a string list
this assumes the object variable consists only of strings
*/