From: Tim Potter Date: Sun, 29 May 2005 22:10:51 +0000 (+0000) Subject: r7081: Add mprToInt() function. X-Git-Tag: samba-misc-tags/initial-v4-0-unstable~9112 X-Git-Url: http://git.samba.org/?p=samba.git;a=commitdiff_plain;h=790a46f53bd5b6994cbf6aed670df1407a44e2f3 r7081: Add mprToInt() function. --- diff --git a/source/scripting/ejs/mprutil.c b/source/scripting/ejs/mprutil.c index a1e26ecb2c0..3e47fdf9a36 100644 --- a/source/scripting/ejs/mprutil.c +++ b/source/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