From 18fa5ea9ef2d9a20d076790123c131d2dbdc9c22 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sun, 29 May 2005 22:10:51 +0000 Subject: r7081: Add mprToInt() function. (This used to be commit 790a46f53bd5b6994cbf6aed670df1407a44e2f3) --- source4/scripting/ejs/mprutil.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source4/scripting/ejs/mprutil.c') 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 @@ -132,6 +132,15 @@ const char *mprToString(const struct MprVar *v) return v->string; } +/* + 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 -- cgit