MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / lua_tolstring

Function lua_tolstring

other_src/lua/src/lapi.cpp:344–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342
343
344LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) {
345 StkId o = index2adr(L, idx);
346 if (!ttisstring(o)) {
347 lua_lock(L); /* `luaV_tostring' may create a new string */
348 if (!luaV_tostring(L, o)) { /* conversion failed? */
349 if (len != NULL) *len = 0;
350 lua_unlock(L);
351 return NULL;
352 }
353 luaC_checkGC(L);
354 o = index2adr(L, idx); /* previous call may reallocate the stack */
355 lua_unlock(L);
356 }
357 if (len != NULL) *len = tsvalue(o)->len;
358 return svalue(o);
359}
360
361
362LUA_API const char *lua_tohstring (lua_State *L,

Callers 15

getpattFunction · 0.70
stringcapFunction · 0.70
gmatch_auxFunction · 0.70
add_sFunction · 0.70
luaL_checklstringFunction · 0.70
luaL_addvalueFunction · 0.70
generic_readerFunction · 0.70
incompleteFunction · 0.70
lua_tostdstringFunction · 0.50
ParseMethod · 0.50
UnpackTypeFunction · 0.50
SwapBy2Method · 0.50

Calls 2

index2adrFunction · 0.70
luaV_tostringFunction · 0.70

Tested by

no test coverage detected