vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
vis-lua.h
(1009B)
1 #ifndef VIS_LUA_H
2 #define VIS_LUA_H
3
4 #if CONFIG_LUA
5 #include <lua.h>
6 #include <lualib.h>
7 #include <lauxlib.h>
8
9 #else
10 typedef struct lua_State lua_State;
11 typedef void* lua_CFunction;
12 #endif
13
14 #include "vis.h"
15 #include "vis-subprocess.h"
16
17 /* add a directory to consider when loading lua files */
18 bool vis_lua_path_add(Vis*, const char *path);
19 /* get semicolon separated list of paths to load lua files
20 * (*lpath = package.path) and Lua C modules (*cpath = package.cpath)
21 * both these pointers need to be free(3)-ed by the caller */
22 bool vis_lua_paths_get(Vis*, char **lpath, char **cpath);
23
24 /* various event handlers, triggered by the vis core */
25 #if !CONFIG_LUA
26 #define vis_event_mode_insert_input vis_insert_key
27 #define vis_event_mode_replace_input vis_replace_key
28 #else
29 void vis_event_mode_insert_input(Vis*, const char *key, size_t len);
30 void vis_event_mode_replace_input(Vis*, const char *key, size_t len);
31 #endif
32 void vis_lua_process_response(Vis *, const char *, char *, size_t, ResponseType);
33
34 #endif