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

Function lua_pushcclosure

other_src/lua/src/lapi.cpp:518–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

516
517
518LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
519 Closure *cl;
520 lua_lock(L);
521 luaC_checkGC(L);
522 api_checknelems(L, n);
523 cl = luaF_newCclosure(L, n, getcurrenv(L));
524 cl->c.f = fn;
525 L->top -= n;
526 while (n--)
527 setobj2n(L, &cl->c.upvalue[n], L->top+n);
528 setclvalue(L, L->top, cl);
529 lua_assert(iswhite(obj2gco(cl)));
530 api_incr_top(L);
531 lua_unlock(L);
532}
533
534
535LUA_API void lua_pushboolean (lua_State *L, int b) {

Callers 6

gmatchFunction · 0.70
aux_linesFunction · 0.70
luaI_openlibFunction · 0.70
luaB_cowrapFunction · 0.70
auxopenFunction · 0.70
base_openFunction · 0.70

Calls 2

luaF_newCclosureFunction · 0.70
getcurrenvFunction · 0.70

Tested by

no test coverage detected