| 204 | } |
| 205 | |
| 206 | static 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 | |
| 223 | static bool get_bool_field(lua_State *L, bool *pf, int idx, const char *name, bool defval) { |
| 224 | lua_getfield(L, idx, name); |
no test coverage detected