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

Function luaL_addvalue

other_src/lua/src/lauxlib.cpp:479–494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

477
478
479LUALIB_API void luaL_addvalue (luaL_Buffer *B) {
480 lua_State *L = B->L;
481 size_t vl;
482 const char *s = lua_tolstring(L, -1, &vl);
483 if (vl <= bufffree(B)) { /* fit into buffer? */
484 memcpy(B->p, s, vl); /* put it there */
485 B->p += vl;
486 lua_pop(L, 1); /* remove from stack */
487 }
488 else {
489 if (emptybuffer(B))
490 lua_insert(L, -2); /* put buffer before new value */
491 B->lvl++; /* add new value into B stack */
492 adjuststack(B);
493 }
494}
495
496
497LUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B) {

Callers 5

addfieldFunction · 0.70
addonestringFunction · 0.70
add_sFunction · 0.70
add_valueFunction · 0.70
str_formatFunction · 0.70

Calls 4

lua_tolstringFunction · 0.70
emptybufferFunction · 0.70
lua_insertFunction · 0.70
adjuststackFunction · 0.70

Tested by

no test coverage detected