MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / writer

Function writer

third-party/lua-5.5.0/src/lstrlib.c:211–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209
210
211static int writer (lua_State *L, const void *b, size_t size, void *ud) {
212 struct str_Writer *state = (struct str_Writer *)ud;
213 if (!state->init) {
214 state->init = 1;
215 luaL_buffinit(L, &state->B);
216 }
217 if (b == NULL) { /* finishing dump? */
218 luaL_pushresult(&state->B); /* push result */
219 lua_replace(L, 1); /* move it to reserved slot */
220 }
221 else
222 luaL_addlstring(&state->B, (const char *)b, size);
223 return 0;
224}
225
226
227static int str_dump (lua_State *L) {

Callers

nothing calls this directly

Calls 4

luaL_buffinitFunction · 0.70
luaL_pushresultFunction · 0.70
luaL_addlstringFunction · 0.70
lua_replaceFunction · 0.50

Tested by

no test coverage detected