/* tolua: funcitons to convert to C types ** Support code for Lua bindings. ** Written by Waldemar Celes ** TeCGraf/PUC-Rio ** Apr 2003 ** $Id: $ */ /* This code is free software; you can redistribute it and/or modify it. ** The software provided hereunder is on an "as is" basis, and ** the author has no obligation to provide maintenance, support, updates, ** enhancements, or modifications. */ #include "tolua++.h" #include #include TOLUA_API lua_Number tolua_tonumber(lua_State *L, int narg, lua_Number def) { return lua_gettop(L) < abs(narg) ? def : lua_tonumber(L, narg); } TOLUA_API const char *tolua_tostring(lua_State *L, int narg, const char *def) { return lua_gettop(L) < abs(narg) ? def : lua_tostring(L, narg); } TOLUA_API void *tolua_touserdata(lua_State *L, int narg, void *def) { /* return lua_gettop(L)