MCPcopy Create free account
hub / github.com/InoriRus/Kyty / lua_tolstring

Function lua_tolstring

source/3rdparty/lua/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 8

luaB_printFunction · 0.85
generic_readerFunction · 0.85
luaB_loadFunction · 0.85
gmatch_auxFunction · 0.85
add_sFunction · 0.85
luaL_checklstringFunction · 0.85
luaL_addvalueFunction · 0.85
luaL_tolstringFunction · 0.85

Calls 2

index2addrFunction · 0.85
luaV_tostringFunction · 0.85

Tested by

no test coverage detected