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

Function luaL_addvalue

Source/Misc/lua/src/lua.c:10666–10681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10664
10665
10666LUALIB_API void luaL_addvalue (luaL_Buffer *B) {
10667lua_State *L = B->L;
10668size_t vl;
10669const char *s = lua_tolstring(L, -1, &vl);
10670if (vl <= bufffree(B)) { /* fit into buffer? */
10671memcpy(B->p, s, vl); /* put it there */
10672B->p += vl;
10673lua_pop(L, 1); /* remove from stack */
10674}
10675else {
10676if (emptybuffer(B))
10677lua_insert(L, -2); /* put buffer before new value */
10678B->lvl++; /* add new value into B stack */
10679adjuststack(B);
10680}
10681}
10682
10683
10684LUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B) {

Callers 4

add_sFunction · 0.85
add_valueFunction · 0.85
str_formatFunction · 0.85
addfieldFunction · 0.85

Calls 4

lua_tolstringFunction · 0.85
emptybufferFunction · 0.85
lua_insertFunction · 0.85
adjuststackFunction · 0.85

Tested by

no test coverage detected