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

Function lua_tolstring

third-party/lua-5.3.5/src/lapi.c:373–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 11

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

Calls 2

index2addrFunction · 0.70
luaO_tostringFunction · 0.70

Tested by

no test coverage detected