Created
May 17, 2009 06:20
-
-
Save dylanwh/112938 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Class-related functions {{{ */ | |
gpointer ms_lua_toclass(LuaState *L, const char *class, int index)/*{{{*/ | |
{ | |
gpointer p = lua_touserdata(L, index); | |
if (p == NULL) luaL_typerror(L, index, class); | |
return p; | |
}/*}}}*/ | |
gpointer ms_lua_checkclass(LuaState *L, const char *class, int index)/*{{{*/ | |
{ | |
luaL_checktype(L, index, LUA_TUSERDATA); | |
gpointer p = luaL_checkudata(L, index, class); | |
if (p == NULL) luaL_typerror(L, index, class); | |
return p; | |
}/*}}}*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment