MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / lua_tolstring

Function lua_tolstring

Source/Misc/lua/src/lua.c:2192–2207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2190
2191
2192LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) {
2193StkId o = index2adr(L, idx);
2194if (!ttisstring(o)) {
2195lua_lock(L); /* `luaV_tostring' may create a new string */
2196if (!luaV_tostring(L, o)) { /* conversion failed? */
2197if (len != NULL) *len = 0;
2198lua_unlock(L);
2199return NULL;
2200}
2201luaC_checkGC(L);
2202o = index2adr(L, idx); /* previous call may reallocate the stack */
2203lua_unlock(L);
2204}
2205if (len != NULL) *len = tsvalue(o)->len;
2206return svalue(o);
2207}
2208
2209
2210LUA_API size_t lua_objlen (lua_State *L, int idx) {

Callers 12

usb.cFile · 0.85
luaL_tolstringFunction · 0.85
object.hppFile · 0.85
luaL_checklstringFunction · 0.85
luaL_addvalueFunction · 0.85
generic_readerFunction · 0.85
gmatch_auxFunction · 0.85
add_sFunction · 0.85

Calls 2

index2adrFunction · 0.85
luaV_tostringFunction · 0.85

Tested by

no test coverage detected