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

Function lua_tolstring

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

Source from the content-addressed store, hash-verified

387
388
389LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) {
390 StkId o = index2addr(L, idx);
391 if (!ttisstring(o)) {
392 lua_lock(L); /* `luaV_tostring' may create a new string */
393 if (!luaV_tostring(L, o)) { /* conversion failed? */
394 if (len != NULL) *len = 0;
395 lua_unlock(L);
396 return NULL;
397 }
398 luaC_checkGC(L);
399 o = index2addr(L, idx); /* previous call may reallocate the stack */
400 lua_unlock(L);
401 }
402 if (len != NULL) *len = tsvalue(o)->len;
403 return svalue(o);
404}
405
406
407LUA_API size_t lua_rawlen (lua_State *L, int idx) {

Callers 10

incompleteFunction · 0.70
loadlineFunction · 0.70
luaB_printFunction · 0.70
generic_readerFunction · 0.70
luaB_loadFunction · 0.70
gmatch_auxFunction · 0.70
add_sFunction · 0.70
luaL_checklstringFunction · 0.70
luaL_addvalueFunction · 0.70
luaL_tolstringFunction · 0.70

Calls 2

index2addrFunction · 0.70
luaV_tostringFunction · 0.70

Tested by

no test coverage detected