summaryrefslogtreecommitdiff
path: root/src/honeysuckle/hs_traceback.c
diff options
context:
space:
mode:
authorsanine-a <sanine.not@pm.me>2023-04-07 13:59:47 -0500
committersanine-a <sanine.not@pm.me>2023-04-07 13:59:47 -0500
commitd377b707b67b477ee5b22b08c714be34f3e82aa3 (patch)
treec898711c17f3834b255731ffc1250de71fe4c8c2 /src/honeysuckle/hs_traceback.c
parent6e31ca0c2e31e33f824aef1b4d68a91b64721fa7 (diff)
switch to cargs and remove honeysuckle
Diffstat (limited to 'src/honeysuckle/hs_traceback.c')
-rw-r--r--src/honeysuckle/hs_traceback.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/src/honeysuckle/hs_traceback.c b/src/honeysuckle/hs_traceback.c
deleted file mode 100644
index 1830721..0000000
--- a/src/honeysuckle/hs_traceback.c
+++ /dev/null
@@ -1,37 +0,0 @@
-#include "honeysuckle.h"
-
-int hs_traceback(lua_State *L)
-{
- if (!lua_isstring(L, 1))
- /* 'message' is not a string, keep intact */
- return 1;
-
- lua_getglobal(L, "debug");
- if (!lua_istable(L, -1)) {
- lua_pop(L, 1);
- return 1;
- }
-
- lua_getfield(L, -1, "traceback");
- if (!lua_isfunction(L, -1)) {
- lua_pop(L, 2);
- return 1;
- }
-
- lua_pushvalue(L, 1);
- lua_pushinteger(L, 2);
- lua_call(L, 2, 1);
- return 1;
-}
-
-
-int hs_call(lua_State *L, int nargs, int nret)
-{
- int traceback_pos = lua_gettop(L) - nargs;
- lua_pushcfunction(L, hs_traceback);
- lua_insert(L, traceback_pos);
-
- int result = lua_pcall(L, nargs, nret, traceback_pos);
- lua_remove(L, traceback_pos);
- return result;
-}