aboutsummaryrefslogtreecommitdiff
path: root/src/auxiliar.c
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-02-04 14:29:11 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-02-04 14:29:11 +0000
commit0b2542d1a61fc5425ff65ab3dbf7ba7de174763f (patch)
tree8a6188e11db0c9ef6891c31e8a1bebca050b23b2 /src/auxiliar.c
parentf67864f86c7d703325e86b14d0ba33992c52891b (diff)
downloadluasocket-0b2542d1a61fc5425ff65ab3dbf7ba7de174763f.tar.gz
luasocket-0b2542d1a61fc5425ff65ab3dbf7ba7de174763f.tar.bz2
luasocket-0b2542d1a61fc5425ff65ab3dbf7ba7de174763f.zip
Worked on the manual.
Implemented stuffing (needs test) Added cddb and qp examples.
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}