MCPcopy Create free account
hub / github.com/DFHack/dfhack / lua_tolstring

Function lua_tolstring

depends/lua/src/lapi.c:373–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 14

lua_writeMethod · 0.85
write_fieldFunction · 0.85
doRunLuaFunctionMethod · 0.85
incompleteFunction · 0.85
multilineFunction · 0.85
luaB_printFunction · 0.85
luaB_tonumberFunction · 0.85
generic_readerFunction · 0.85
luaB_loadFunction · 0.85
add_sFunction · 0.85
addliteralFunction · 0.85
luaL_checklstringFunction · 0.85

Calls 2

index2addrFunction · 0.85
luaO_tostringFunction · 0.85

Tested by

no test coverage detected