MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / docall

Function docall

xrepo/packages/l/lua/port/lua/src/lua.c:153–164  ·  view source on GitHub ↗

** Interface to 'lua_pcall', which sets appropriate message function ** and C-signal handler. Used to run all chunks. */

Source from the content-addressed store, hash-verified

151** and C-signal handler. Used to run all chunks.
152*/
153static int docall (lua_State *L, int narg, int nres) {
154 int status;
155 int base = lua_gettop(L) - narg; /* function index */
156 lua_pushcfunction(L, msghandler); /* push message handler */
157 lua_insert(L, base); /* put it under function and args */
158 globalL = L; /* to be available to 'laction' */
159 setsignal(SIGINT, laction); /* set C-signal handler */
160 status = lua_pcall(L, narg, nres, base);
161 setsignal(SIGINT, SIG_DFL); /* reset C-signal handler */
162 lua_remove(L, base); /* remove message handler from the stack */
163 return status;
164}
165
166
167static void print_version (void) {

Callers 4

dochunkFunction · 0.85
dolibraryFunction · 0.85
handle_scriptFunction · 0.85
doREPLFunction · 0.85

Calls 5

lua_insertFunction · 0.85
setsignalFunction · 0.85
lua_pcallFunction · 0.85
lua_removeFunction · 0.85
lua_gettopFunction · 0.70

Tested by

no test coverage detected