MCPcopy Create free account
hub / github.com/DFHack/dfhack / checkaddr

Function checkaddr

library/LuaApi.cpp:3464–3477  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3462/***** Internal module *****/
3463
3464static void *checkaddr(lua_State *L, int idx, bool allow_null = false)
3465{
3466 luaL_checkany(L, idx);
3467 void *rv;
3468 if (lua_isnil(L, idx))
3469 rv = NULL;
3470 else if (lua_type(L, idx) == LUA_TNUMBER)
3471 rv = (void*)lua_tounsigned(L, idx);
3472 else
3473 rv = Lua::CheckDFObject(L, NULL, idx);
3474 if (!rv && !allow_null)
3475 luaL_argerror(L, idx, "null pointer");
3476 return rv;
3477}
3478
3479static md5wrapper md5_wrap;
3480

Callers 7

internal_setAddressFunction · 0.85
internal_patchMemoryFunction · 0.85
internal_patchBytesFunction · 0.85
internal_memmoveFunction · 0.85
internal_memcmpFunction · 0.85
internal_memscanFunction · 0.85
internal_diffscanFunction · 0.85

Calls 4

luaL_checkanyFunction · 0.85
lua_typeFunction · 0.85
CheckDFObjectFunction · 0.85
luaL_argerrorFunction · 0.85

Tested by

no test coverage detected