MCPcopy Create free account
hub / github.com/Overload-Technologies/Overload / sethook

Function sethook

Dependencies/lua/src/ltests.c:1878–1893  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1876
1877
1878static int sethook (lua_State *L) {
1879 if (lua_isnoneornil(L, 1))
1880 lua_sethook(L, NULL, 0, 0); /* turn off hooks */
1881 else {
1882 const char *scpt = luaL_checkstring(L, 1);
1883 const char *smask = luaL_checkstring(L, 2);
1884 int count = cast_int(luaL_optinteger(L, 3, 0));
1885 int mask = 0;
1886 if (strchr(smask, 'c')) mask |= LUA_MASKCALL;
1887 if (strchr(smask, 'r')) mask |= LUA_MASKRET;
1888 if (strchr(smask, 'l')) mask |= LUA_MASKLINE;
1889 if (count > 0) mask |= LUA_MASKCOUNT;
1890 sethookaux(L, mask, count, scpt);
1891 }
1892 return 0;
1893}
1894
1895
1896static int coresume (lua_State *L) {

Callers

nothing calls this directly

Calls 3

lua_sethookFunction · 0.85
luaL_optintegerFunction · 0.85
sethookauxFunction · 0.85

Tested by

no test coverage detected