MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / lua_tolstring

Function lua_tolstring

ThirdParty/lua/lua/lapi.c:372–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 9

luaB_printFunction · 0.85
luaB_tonumberFunction · 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
luaO_tostringFunction · 0.85

Tested by

no test coverage detected