MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / luaL_addvalue

Function luaL_addvalue

lua/lauxlib.c:502–517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

500
501
502LUALIB_API void luaL_addvalue (luaL_Buffer *B) {
503 lua_State *L = B->L;
504 size_t vl;
505 const char *s = lua_tolstring(L, -1, &vl);
506 if (vl <= bufffree(B)) { /* fit into buffer? */
507 memcpy(B->p, s, vl); /* put it there */
508 B->p += vl;
509 lua_pop(L, 1); /* remove from stack */
510 }
511 else {
512 if (emptybuffer(B))
513 lua_insert(L, -2); /* put buffer before new value */
514 B->lvl++; /* add new value into B stack */
515 adjuststack(B);
516 }
517}
518
519
520LUALIB_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