| 1876 | |
| 1877 | |
| 1878 | static 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 | |
| 1896 | static int coresume (lua_State *L) { |
nothing calls this directly
no test coverage detected