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

Function lua_tolstring

third-party/lua-5.5.0/src/lapi.c:415–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

413
414
415LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) {
416 TValue *o;
417 lua_lock(L);
418 o = index2value(L, idx);
419 if (!ttisstring(o)) {
420 if (!cvt2str(o)) { /* not convertible? */
421 if (len != NULL) *len = 0;
422 lua_unlock(L);
423 return NULL;
424 }
425 luaO_tostring(L, o);
426 luaC_checkGC(L);
427 o = index2value(L, idx); /* previous call may reallocate the stack */
428 }
429 lua_unlock(L);
430 if (len != NULL)
431 return getlstr(tsvalue(o), *len);
432 else
433 return getstr(tsvalue(o));
434}
435
436
437LUA_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