vis: make paragraph textobjects linewise
[vis/gkirilov.git] / vis-lua.h
blobb4f3f51bba5a0c8dfe277e06ed4c501a87f53ba4
1 #ifndef VIS_LUA_H
2 #define VIS_LUA_H
4 #if CONFIG_LUA
5 #include <lua.h>
6 #include <lualib.h>
7 #include <lauxlib.h>
9 #else
10 typedef struct lua_State lua_State;
11 typedef void* lua_CFunction;
12 #endif
14 #include "vis.h"
15 #include "vis-subprocess.h"
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);
24 /* various event handlers, triggered by the vis core */
25 void vis_lua_init(Vis*);
26 void vis_lua_start(Vis*);
27 void vis_lua_quit(Vis*);
28 #if !CONFIG_LUA
29 #define vis_lua_mode_insert_input vis_insert_key
30 #define vis_lua_mode_replace_input vis_replace_key
31 #else
32 void vis_lua_mode_insert_input(Vis*, const char *key, size_t len);
33 void vis_lua_mode_replace_input(Vis*, const char *key, size_t len);
34 #endif
35 void vis_lua_file_open(Vis*, File*);
36 bool vis_lua_file_save_pre(Vis*, File*, const char *path);
37 void vis_lua_file_save_post(Vis*, File*, const char *path);
38 void vis_lua_file_close(Vis*, File*);
39 void vis_lua_win_open(Vis*, Win*);
40 void vis_lua_win_close(Vis*, Win*);
41 void vis_lua_win_highlight(Vis*, Win*);
42 void vis_lua_win_status(Vis*, Win*);
43 void vis_lua_term_csi(Vis*, const long *);
44 void vis_lua_process_response(Vis *, const char *, char *, size_t, ResponseType);
45 void vis_lua_ui_draw(Vis*);
47 #endif