MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / lua_tolstring

Function lua_tolstring

src/Chain/libraries/glua/lapi.cpp:376–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374
375
376LUA_API const char *lua_tolstring(lua_State *L, int idx, size_t *len) {
377 StkId o = index2addr(L, idx);
378 if (!ttisstring(o)) {
379 if (!cvt2str(o)) { /* not convertible? */
380 if (len != nullptr) *len = 0;
381 return nullptr;
382 }
383 lua_lock(L); /* 'luaO_tostring' may create a new string */
384 luaC_checkGC(L);
385 o = index2addr(L, idx); /* previous call may reallocate the stack */
386 luaO_tostring(L, o);
387 lua_unlock(L);
388 }
389 if (len != nullptr)
390 *len = vslen(o);
391 return svalue(o);
392}
393
394
395LUA_API size_t lua_rawlen(lua_State *L, int idx) {

Callers 15

lualib_http_requestFunction · 0.85
lualib_http_acceptFunction · 0.85
lualib_net_writeFunction · 0.85
add_sFunction · 0.85
geterrorobjstrFunction · 0.85
luaL_checklstringFunction · 0.85
luaL_addvalueFunction · 0.85
luaL_tolstringFunction · 0.85
tojsonstring_with_nestedFunction · 0.85
luaB_printFunction · 0.85
luaB_pprintFunction · 0.85

Calls 2

index2addrFunction · 0.85
luaO_tostringFunction · 0.85

Tested by

no test coverage detected