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

Function get_char_field

library/LuaApi.cpp:206–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206static bool get_char_field(lua_State *L, char *pf, int idx, const char *name, char defval)
207{
208 lua_getfield(L, idx, name);
209
210 if (lua_type(L, -1) == LUA_TSTRING)
211 {
212 *pf = lua_tostring(L, -1)[0];
213 lua_pop(L, 1);
214 return true;
215 }
216 else
217 {
218 lua_pop(L, 1);
219 return get_int_field(L, pf, idx, name, defval);
220 }
221}
222
223static bool get_bool_field(lua_State *L, bool *pf, int idx, const char *name, bool defval) {
224 lua_getfield(L, idx, name);

Callers 1

decode_penFunction · 0.85

Calls 3

lua_getfieldFunction · 0.85
lua_typeFunction · 0.85
get_int_fieldFunction · 0.70

Tested by

no test coverage detected