aboutsummaryrefslogtreecommitdiff
path: root/src/auxiliar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/auxiliar.c')
-rw-r--r--src/auxiliar.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/auxiliar.c b/src/auxiliar.c
index 9a249b6..812d7fc 100644
--- a/src/auxiliar.c
+++ b/src/auxiliar.c
@@ -37,9 +37,9 @@ error:
37/*-------------------------------------------------------------------------*\ 37/*-------------------------------------------------------------------------*\
38* Initializes the module 38* Initializes the module
39\*-------------------------------------------------------------------------*/ 39\*-------------------------------------------------------------------------*/
40void aux_open(lua_State *L) 40int aux_open(lua_State *L)
41{ 41{
42 ; 42 return 0;
43} 43}
44 44
45/*-------------------------------------------------------------------------*\ 45/*-------------------------------------------------------------------------*\
@@ -159,3 +159,13 @@ void *aux_getclassudata(lua_State *L, const char *classname, int objidx)
159 return luaL_checkudata(L, objidx, classname); 159 return luaL_checkudata(L, objidx, classname);
160} 160}
161 161
162/*-------------------------------------------------------------------------*\
163* Accept "false" as nil
164\*-------------------------------------------------------------------------*/
165const char *aux_optlstring(lua_State *L, int n, const char *v, size_t *l)
166{
167 if (lua_isnil(L, n) || (lua_isboolean(L, n) && !lua_toboolean(L, n))) {
168 *l = 0;
169 return NULL;
170 } else return luaL_optlstring(L, n, v, l);
171}