luaclass: add luaA_checkudataornil

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-09-04 16:24:14 +02:00
parent db45624809
commit af44734bd4
1 changed files with 8 additions and 0 deletions

View File

@ -83,6 +83,14 @@ int luaA_class_new(lua_State *, lua_class_t *);
void * luaA_checkudata(lua_State *, int, lua_class_t *); void * luaA_checkudata(lua_State *, int, lua_class_t *);
void * luaA_toudata(lua_State *L, int ud, lua_class_t *); void * luaA_toudata(lua_State *L, int ud, lua_class_t *);
static inline void *
luaA_checkudataornil(lua_State *L, int udx, lua_class_t *class)
{
if(lua_isnil(L, udx))
return NULL;
return luaA_checkudata(L, udx, class);
}
#define LUA_CLASS_FUNCS(prefix, lua_class) \ #define LUA_CLASS_FUNCS(prefix, lua_class) \
static inline int \ static inline int \
luaA_##prefix##_class_add_signal(lua_State *L) \ luaA_##prefix##_class_add_signal(lua_State *L) \