MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / lua_tolstring

Function lua_tolstring

third-party/lua-5.4.6/src/lapi.c:405–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403
404
405LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) {
406 TValue *o;
407 lua_lock(L);
408 o = index2value(L, idx);
409 if (!ttisstring(o)) {
410 if (!cvt2str(o)) { /* not convertible? */
411 if (len != NULL) *len = 0;
412 lua_unlock(L);
413 return NULL;
414 }
415 luaO_tostring(L, o);
416 luaC_checkGC(L);
417 o = index2value(L, idx); /* previous call may reallocate the stack */
418 }
419 if (len != NULL)
420 *len = tsslen(tsvalue(o));
421 lua_unlock(L);
422 return getstr(tsvalue(o));
423}
424
425
426LUA_API lua_Unsigned lua_rawlen (lua_State *L, int idx) {

Callers 11

incompleteFunction · 0.70
multilineFunction · 0.70
luaB_tonumberFunction · 0.70
generic_readerFunction · 0.70
luaB_loadFunction · 0.70
tonumFunction · 0.70
add_sFunction · 0.70
addliteralFunction · 0.70
luaL_checklstringFunction · 0.70
luaL_addvalueFunction · 0.70
luaL_tolstringFunction · 0.70

Calls 2

index2valueFunction · 0.70
luaO_tostringFunction · 0.70

Tested by

no test coverage detected