about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-03-16 20:31:43 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-03-16 20:31:43 -0700
commited5efcd8a091376e96760ae5e2f103b92eb8d572 (patch)
treea882d060de7b962aedfb429e4e0fe0a0ff3557f0 /src
parent709cc25130de225d3c89cc4ac5ab669cdc8b9dcb (diff)
downloadteliva-ed5efcd8a091376e96760ae5e2f103b92eb8d572.tar.gz
drop a forward decl
Diffstat (limited to 'src')
-rw-r--r--src/teliva.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/teliva.c b/src/teliva.c
index 549d99b..1bc06d5 100644
--- a/src/teliva.c
+++ b/src/teliva.c
@@ -320,14 +320,6 @@ void append_string_to_array(lua_State* L, int array_index, const char* s) {
   lua_rawseti(L, array_index, new_index);
 }
 
-static void save_caller_as(lua_State* L, const char* name, const char* caller_name);
-void save_caller(lua_State* L, const char* name, int call_graph_depth) {
-  lua_Debug ar;
-  lua_getstack(L, 1, &ar);
-  lua_getinfo(L, "n", &ar);
-  if (ar.name) save_caller_as(L, name, ar.name);
-}
-
 static void save_caller_as(lua_State* L, const char* name, const char* caller_name) {
   // push table of caller tables
   luaL_newmetatable(L, "__teliva_caller");
@@ -349,6 +341,13 @@ static void save_caller_as(lua_State* L, const char* name, const char* caller_na
   lua_pop(L, 1);  // table of caller tables
 }
 
+void save_caller(lua_State* L, const char* name, int call_graph_depth) {
+  lua_Debug ar;
+  lua_getstack(L, 1, &ar);
+  lua_getinfo(L, "n", &ar);
+  if (ar.name) save_caller_as(L, name, ar.name);
+}
+
 static void clear_caller(lua_State* L) {
   int oldtop = lua_gettop(L);
   luaL_newmetatable(L, "__teliva_caller");