summaryrefslogtreecommitdiff
path: root/src/core/lua_bridge.h
diff options
context:
space:
mode:
authorCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-05-11 15:07:55 -0500
committerCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-05-11 15:07:55 -0500
commitcebb280fe546190e55e071b6adbf37cd47950f34 (patch)
tree6e7a7605f8832b1c1bd7e467884a8792a5e1fab4 /src/core/lua_bridge.h
initial commit
Diffstat (limited to 'src/core/lua_bridge.h')
-rw-r--r--src/core/lua_bridge.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/core/lua_bridge.h b/src/core/lua_bridge.h
new file mode 100644
index 0000000..9ff9123
--- /dev/null
+++ b/src/core/lua_bridge.h
@@ -0,0 +1,26 @@
+#ifndef LEMACS_LUA_BRIDGE_H
+#define LEMACS_LUA_BRIDGE_H
+
+#include <stdbool.h>
+
+#include <lua.h>
+
+#include "core/editor.h"
+
+typedef struct {
+ lua_State *L;
+ Editor *editor;
+ char runtime_init_path[1024];
+} LuaBridge;
+
+bool lua_bridge_init(LuaBridge *bridge, Editor *editor);
+void lua_bridge_free(LuaBridge *bridge);
+
+bool lua_bridge_load_runtime(LuaBridge *bridge, const char *init_script_path);
+bool lua_bridge_load_optional_init(LuaBridge *bridge, const char *script_path);
+bool lua_bridge_call_key(LuaBridge *bridge, const char *key_name);
+bool lua_bridge_call_tick(LuaBridge *bridge);
+bool lua_bridge_call_open_file(LuaBridge *bridge, const char *path);
+bool lua_bridge_call_text(LuaBridge *bridge, const char *text);
+
+#endif