MCPcopy Create free account
hub / github.com/F-Stack/f-stack / lua_tolstring

Function lua_tolstring

freebsd/contrib/openzfs/module/lua/lapi.c:386–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 5

gmatch_auxFunction · 0.70
add_sFunction · 0.70
luaL_checklstringFunction · 0.70
luaL_addvalueFunction · 0.70
luaL_tolstringFunction · 0.70

Calls 2

index2addrFunction · 0.85
luaV_tostringFunction · 0.70

Tested by

no test coverage detected