diff options
Diffstat (limited to 'src/auxiliar.c')
-rw-r--r-- | src/auxiliar.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/auxiliar.c b/src/auxiliar.c index 9514970..3396fc1 100644 --- a/src/auxiliar.c +++ b/src/auxiliar.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <stdio.h> | 8 | #include <stdio.h> |
9 | 9 | ||
10 | #include "auxiliar.h" | 10 | #include "auxiliar.h" |
11 | #include "lua_typeerror.h" | ||
11 | 12 | ||
12 | /*=========================================================================*\ | 13 | /*=========================================================================*\ |
13 | * Exported functions | 14 | * Exported functions |
@@ -24,7 +25,7 @@ int auxiliar_open(lua_State *L) { | |||
24 | * Creates a new class with given methods | 25 | * Creates a new class with given methods |
25 | * Methods whose names start with __ are passed directly to the metatable. | 26 | * Methods whose names start with __ are passed directly to the metatable. |
26 | \*-------------------------------------------------------------------------*/ | 27 | \*-------------------------------------------------------------------------*/ |
27 | void auxiliar_newclass(lua_State *L, const char *classname, luaL_reg *func) { | 28 | void auxiliar_newclass(lua_State *L, const char *classname, luaL_Reg *func) { |
28 | luaL_newmetatable(L, classname); /* mt */ | 29 | luaL_newmetatable(L, classname); /* mt */ |
29 | /* create __index table to place methods */ | 30 | /* create __index table to place methods */ |
30 | lua_pushstring(L, "__index"); /* mt,"__index" */ | 31 | lua_pushstring(L, "__index"); /* mt,"__index" */ |
@@ -81,7 +82,7 @@ void auxiliar_add2group(lua_State *L, const char *classname, const char *groupna | |||
81 | \*-------------------------------------------------------------------------*/ | 82 | \*-------------------------------------------------------------------------*/ |
82 | int auxiliar_checkboolean(lua_State *L, int objidx) { | 83 | int auxiliar_checkboolean(lua_State *L, int objidx) { |
83 | if (!lua_isboolean(L, objidx)) | 84 | if (!lua_isboolean(L, objidx)) |
84 | luaL_typerror(L, objidx, lua_typename(L, LUA_TBOOLEAN)); | 85 | luaL_typeerror(L, objidx, lua_typename(L, LUA_TBOOLEAN)); |
85 | return lua_toboolean(L, objidx); | 86 | return lua_toboolean(L, objidx); |
86 | } | 87 | } |
87 | 88 | ||