Changeset 3138 for code/branches/pch/src/tolua/tolua_is.c
- Timestamp:
- Jun 10, 2009, 4:01:42 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pch/src/tolua/tolua_is.c
r3127 r3138 86 86 } 87 87 88 TOLUA_API void tolua_error (lua_State* L, c onst char* msg, tolua_Error* err)88 TOLUA_API void tolua_error (lua_State* L, char* msg, tolua_Error* err) 89 89 { 90 90 if (msg[0] == '#') … … 117 117 118 118 /* the equivalent of lua_is* for usertable */ 119 static int lua_isusertable (lua_State* L, int lo, const c onst char* type)119 static int lua_isusertable (lua_State* L, int lo, const char* type) 120 120 { 121 121 int r = 0; … … 213 213 return 0; 214 214 } 215 TOLUA_API int tolua_isvalue (lua_State* L, int lo, int def, tolua_Error* err) 216 { 217 if (def || abs(lo)<=lua_gettop(L)) /* any valid index */ 218 return 1; 219 err->index = lo; 220 err->array = 0; 221 err->type = "value"; 222 return 0; 223 } 215 224 216 225 TOLUA_API int tolua_isboolean (lua_State* L, int lo, int def, tolua_Error* err) … … 284 293 err->array = 0; 285 294 err->type = "userdata"; 286 return 0;287 }288 289 TOLUA_API int tolua_isvaluenil (lua_State* L, int lo, tolua_Error* err) {290 291 if (lua_gettop(L)<abs(lo))292 return 0; /* somebody else should chack this */293 if (!lua_isnil(L, lo))294 return 0;295 296 err->index = lo;297 err->array = 0;298 err->type = "value";299 return 1;300 };301 302 TOLUA_API int tolua_isvalue (lua_State* L, int lo, int def, tolua_Error* err)303 {304 if (def || abs(lo)<=lua_gettop(L)) /* any valid index */305 return 1;306 err->index = lo;307 err->array = 0;308 err->type = "value";309 295 return 0; 310 296 }
Note: See TracChangeset
for help on using the changeset viewer.