MCPcopy Create free account
hub / github.com/crownengine/crown / reader_func

Function reader_func

3rdparty/luajit/src/lib_base.c:387–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

385}
386
387static const char *reader_func(lua_State *L, void *ud, size_t *size)
388{
389 UNUSED(ud);
390 luaL_checkstack(L, 2, "too many nested functions");
391 copyTV(L, L->top++, L->base);
392 lua_call(L, 0, 1); /* Call user-supplied function. */
393 L->top--;
394 if (tvisnil(L->top)) {
395 *size = 0;
396 return NULL;
397 } else if (tvisstr(L->top) || tvisnumber(L->top)) {
398 copyTV(L, L->base+4, L->top); /* Anchor string in reserved stack slot. */
399 return lua_tolstring(L, 5, size);
400 } else {
401 lj_err_caller(L, LJ_ERR_RDRSTR);
402 return NULL;
403 }
404}
405
406LJLIB_CF(load)
407{

Callers

nothing calls this directly

Calls 5

copyTVFunction · 0.85
lj_err_callerFunction · 0.85
luaL_checkstackFunction · 0.70
lua_callFunction · 0.70
lua_tolstringFunction · 0.70

Tested by

no test coverage detected