summaryrefslogtreecommitdiff
path: root/src/core/lua_bridge.h
diff options
context:
space:
mode:
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