MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / cson_push_value

Function cson_push_value

lua/sp.c:5300–5317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5298
5299static int cson_to_table(Lua, cson_value *);
5300static int cson_push_value(Lua lua, cson_value *v)
5301{
5302 if (cson_value_is_null(v)) {
5303 luabb_pushnull(lua, DBTYPES_INTEGER);
5304 } else if (cson_value_is_bool(v)) {
5305 lua_pushboolean(lua, cson_value_get_bool(v));
5306 } else if (cson_value_is_integer(v)) {
5307 lua_pushinteger(lua, cson_value_get_integer(v));
5308 } else if (cson_value_is_double(v)) {
5309 lua_pushnumber(lua, cson_value_get_double(v));
5310 } else if (cson_value_is_string(v)) {
5311 lua_pushstring(lua, cson_value_get_cstr(v));
5312 } else if (cson_value_is_array(v) || cson_value_is_object(v)) {
5313 lua_newtable(lua);
5314 return cson_to_table(lua, v);
5315 }
5316 return 0;
5317}
5318
5319static int cson_to_table(Lua lua, cson_value *v)
5320{

Callers 1

cson_to_tableFunction · 0.85

Calls 15

cson_value_is_nullFunction · 0.85
luabb_pushnullFunction · 0.85
cson_value_is_boolFunction · 0.85
lua_pushbooleanFunction · 0.85
cson_value_get_boolFunction · 0.85
cson_value_is_integerFunction · 0.85
lua_pushintegerFunction · 0.85
cson_value_get_integerFunction · 0.85
cson_value_is_doubleFunction · 0.85
lua_pushnumberFunction · 0.85
cson_value_get_doubleFunction · 0.85
cson_value_is_stringFunction · 0.85

Tested by

no test coverage detected