void lua_add_num_field (const char *name, double value) { assert (name && strlen (name)); my_lua_checkstack (luaState, 3); lua_pushstring (luaState, name); lua_pushnumber (luaState, value); lua_settable (luaState, -3); }
void lua_add_string_field_arr (int num, const char *value) { if (!value || !strlen (value)) { return; } my_lua_checkstack (luaState, 3); lua_pushnumber (luaState, num); lua_pushstring (luaState, value); lua_settable (luaState, -3); }
void lua_add_string_field (const char *name, const char *value) { assert (name && strlen (name)); if (!value || !strlen (value)) { return; } my_lua_checkstack (luaState, 3); lua_pushstring (luaState, name); lua_pushstring (luaState, value); lua_settable (luaState, -3); }