MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / lua_tolstring

Function lua_tolstring

3rd/lua-5.4.3/src/lapi.c:399–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397
398
399LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) {
400 TValue *o;
401 lua_lock(L);
402 o = index2value(L, idx);
403 if (!ttisstring(o)) {
404 if (!cvt2str(o)) { /* not convertible? */
405 if (len != NULL) *len = 0;
406 lua_unlock(L);
407 return NULL;
408 }
409 luaO_tostring(L, o);
410 luaC_checkGC(L);
411 o = index2value(L, idx); /* previous call may reallocate the stack */
412 }
413 if (len != NULL)
414 *len = vslen(o);
415 lua_unlock(L);
416 return svalue(o);
417}
418
419
420LUA_API lua_Unsigned lua_rawlen (lua_State *L, int idx) {

Callers 11

incompleteFunction · 0.85
multilineFunction · 0.85
luaB_tonumberFunction · 0.85
generic_readerFunction · 0.85
luaB_loadFunction · 0.85
tonumFunction · 0.85
add_sFunction · 0.85
addliteralFunction · 0.85
luaL_checklstringFunction · 0.85
luaL_addvalueFunction · 0.85
luaL_tolstringFunction · 0.85

Calls 2

index2valueFunction · 0.85
luaO_tostringFunction · 0.85

Tested by

no test coverage detected