2016-06-13 16:56:33 +00:00
# define EXEC_COMMAND_SIG(n) void n(Application_Links *app, int command_id)
# define EXEC_SYSTEM_COMMAND_SIG(n) int n(Application_Links *app, View_Summary *view, Buffer_Identifier buffer, char *path, int path_len, char *command, int command_len, unsigned int flags)
2016-06-23 23:11:09 +00:00
# define CLIPBOARD_POST_SIG(n) void n(Application_Links *app, char *str, int len)
2016-06-14 14:20:15 +00:00
# define CLIPBOARD_COUNT_SIG(n) int n(Application_Links *app)
2016-06-14 19:00:03 +00:00
# define CLIPBOARD_INDEX_SIG(n) int n(Application_Links *app, int index, char *out, int len)
2016-06-20 20:34:48 +00:00
# define GET_BUFFER_FIRST_SIG(n) Buffer_Summary n(Application_Links *app, unsigned int access)
# define GET_BUFFER_NEXT_SIG(n) void n(Application_Links *app, Buffer_Summary *buffer, unsigned int access)
2016-06-23 23:11:09 +00:00
# define GET_BUFFER_SIG(n) Buffer_Summary n(Application_Links *app, int buffer_id, unsigned int access)
# define GET_BUFFER_BY_NAME_SIG(n) Buffer_Summary n(Application_Links *app, char *name, int len, unsigned int access)
2016-06-27 15:52:58 +00:00
# define BUFFER_BOUNDARY_SEEK_SIG(n) int n(Application_Links *app, Buffer_Summary *buffer, int start_pos, int seek_forward, unsigned int flags)
2016-06-23 23:11:09 +00:00
# define BUFFER_READ_RANGE_SIG(n) int n(Application_Links *app, Buffer_Summary *buffer, int start, int end, char *out)
2016-06-20 20:34:48 +00:00
# define BUFFER_REPLACE_RANGE_SIG(n) int n(Application_Links *app, Buffer_Summary *buffer, int start, int end, char *str, int len)
2016-06-13 16:56:33 +00:00
# define BUFFER_SET_SETTING_SIG(n) int n(Application_Links *app, Buffer_Summary *buffer, int setting, int value)
2016-06-24 02:53:33 +00:00
# define BUFFER_AUTO_INDENT_SIG(n) int n(Application_Links *app, Buffer_Summary *buffer, int start, int end, int tab_width, unsigned int flags)
2016-06-24 02:21:11 +00:00
# define CREATE_BUFFER_SIG(n) Buffer_Summary n(Application_Links *app, char *filename, int filename_len, unsigned int flags)
# define SAVE_BUFFER_SIG(n) int n(Application_Links *app, Buffer_Summary *buffer, char *filename, int filename_len, unsigned int flags)
# define KILL_BUFFER_SIG(n) int n(Application_Links *app, Buffer_Identifier buffer, int view_id, unsigned int flags)
2016-06-20 20:34:48 +00:00
# define GET_VIEW_FIRST_SIG(n) View_Summary n(Application_Links *app, unsigned int access)
# define GET_VIEW_NEXT_SIG(n) void n(Application_Links *app, View_Summary *view, unsigned int access)
2016-06-24 02:21:11 +00:00
# define GET_VIEW_SIG(n) View_Summary n(Application_Links *app, int view_id, unsigned int access)
2016-06-20 20:34:48 +00:00
# define GET_ACTIVE_VIEW_SIG(n) View_Summary n(Application_Links *app, unsigned int access)
2016-06-24 04:02:09 +00:00
# define VIEW_COMPUTE_CURSOR_SIG(n) int n(Application_Links *app, View_Summary *view, Buffer_Seek seek, Full_Cursor *cursor_out)
2016-05-25 22:43:58 +00:00
# define VIEW_SET_CURSOR_SIG(n) int n(Application_Links *app, View_Summary *view, Buffer_Seek seek, int set_preferred_x)
# define VIEW_SET_MARK_SIG(n) int n(Application_Links *app, View_Summary *view, Buffer_Seek seek)
# define VIEW_SET_HIGHLIGHT_SIG(n) int n(Application_Links *app, View_Summary *view, int start, int end, int turn_on)
2016-06-24 04:02:09 +00:00
# define VIEW_SET_BUFFER_SIG(n) int n(Application_Links *app, View_Summary *view, int buffer_id, unsigned int flags)
# define VIEW_POST_FADE_SIG(n) int n(Application_Links *app, View_Summary *view, float seconds, int start, int end, unsigned int color)
2016-06-14 19:00:03 +00:00
# define VIEW_SET_PASTE_REWRITE__SIG(n) void n(Application_Links *app, View_Summary *view)
# define VIEW_GET_PASTE_REWRITE__SIG(n) int n(Application_Links *app, View_Summary *view)
2016-05-25 22:43:58 +00:00
# define GET_USER_INPUT_SIG(n) User_Input n(Application_Links *app, unsigned int get_type, unsigned int abort_type)
# define GET_COMMAND_INPUT_SIG(n) User_Input n(Application_Links *app)
2016-06-10 23:46:30 +00:00
# define GET_MOUSE_STATE_SIG(n) Mouse_State n(Application_Links *app)
2016-05-25 22:43:58 +00:00
# define START_QUERY_BAR_SIG(n) int n(Application_Links *app, Query_Bar *bar, unsigned int flags)
# define END_QUERY_BAR_SIG(n) void n(Application_Links *app, Query_Bar *bar, unsigned int flags)
2016-06-24 19:33:37 +00:00
# define PRINT_MESSAGE_SIG(n) void n(Application_Links *app, char *str, int len)
2016-05-25 22:43:58 +00:00
# define CHANGE_THEME_SIG(n) void n(Application_Links *app, char *name, int len)
# define CHANGE_FONT_SIG(n) void n(Application_Links *app, char *name, int len)
# define SET_THEME_COLORS_SIG(n) void n(Application_Links *app, Theme_Color *colors, int count)
2016-06-14 19:00:03 +00:00
# define GET_THEME_COLORS_SIG(n) void n(Application_Links *app, Theme_Color *colors, int count)
2016-06-27 15:52:58 +00:00
# define DIRECTORY_GET_HOT_SIG(n) int n(Application_Links *app, char *out, int capacity)
# define GET_FILE_LIST_SIG(n) File_List n(Application_Links *app, char *dir, int len)
# define FREE_FILE_LIST_SIG(n) void n(Application_Links *app, File_List list)
# define FILE_EXISTS_SIG(n) int n(Application_Links *app, char *filename, int len)
# define DIRECTORY_CD_SIG(n) int n(Application_Links *app, char *dir, int *len, int capacity, char *rel_path, int rel_len)
# define GET_4ED_PATH_SIG(n) int n(Application_Links *app, char *out, int capacity)
2016-05-25 22:43:58 +00:00
extern " C " {
2016-06-13 16:56:33 +00:00
typedef EXEC_COMMAND_SIG ( Exec_Command_Function ) ;
typedef EXEC_SYSTEM_COMMAND_SIG ( Exec_System_Command_Function ) ;
2016-06-14 14:20:15 +00:00
typedef CLIPBOARD_POST_SIG ( Clipboard_Post_Function ) ;
typedef CLIPBOARD_COUNT_SIG ( Clipboard_Count_Function ) ;
typedef CLIPBOARD_INDEX_SIG ( Clipboard_Index_Function ) ;
2016-05-25 22:43:58 +00:00
typedef GET_BUFFER_FIRST_SIG ( Get_Buffer_First_Function ) ;
typedef GET_BUFFER_NEXT_SIG ( Get_Buffer_Next_Function ) ;
typedef GET_BUFFER_SIG ( Get_Buffer_Function ) ;
typedef GET_BUFFER_BY_NAME_SIG ( Get_Buffer_By_Name_Function ) ;
2016-06-27 15:52:58 +00:00
typedef BUFFER_BOUNDARY_SEEK_SIG ( Buffer_Boundary_Seek_Function ) ;
2016-06-23 23:11:09 +00:00
typedef BUFFER_READ_RANGE_SIG ( Buffer_Read_Range_Function ) ;
2016-06-20 20:34:48 +00:00
typedef BUFFER_REPLACE_RANGE_SIG ( Buffer_Replace_Range_Function ) ;
2016-06-13 16:56:33 +00:00
typedef BUFFER_SET_SETTING_SIG ( Buffer_Set_Setting_Function ) ;
2016-06-24 02:53:33 +00:00
typedef BUFFER_AUTO_INDENT_SIG ( Buffer_Auto_Indent_Function ) ;
2016-06-17 03:31:15 +00:00
typedef CREATE_BUFFER_SIG ( Create_Buffer_Function ) ;
typedef SAVE_BUFFER_SIG ( Save_Buffer_Function ) ;
typedef KILL_BUFFER_SIG ( Kill_Buffer_Function ) ;
2016-05-25 22:43:58 +00:00
typedef GET_VIEW_FIRST_SIG ( Get_View_First_Function ) ;
typedef GET_VIEW_NEXT_SIG ( Get_View_Next_Function ) ;
typedef GET_VIEW_SIG ( Get_View_Function ) ;
typedef GET_ACTIVE_VIEW_SIG ( Get_Active_View_Function ) ;
typedef VIEW_COMPUTE_CURSOR_SIG ( View_Compute_Cursor_Function ) ;
typedef VIEW_SET_CURSOR_SIG ( View_Set_Cursor_Function ) ;
typedef VIEW_SET_MARK_SIG ( View_Set_Mark_Function ) ;
typedef VIEW_SET_HIGHLIGHT_SIG ( View_Set_Highlight_Function ) ;
typedef VIEW_SET_BUFFER_SIG ( View_Set_Buffer_Function ) ;
2016-06-14 19:00:03 +00:00
typedef VIEW_POST_FADE_SIG ( View_Post_Fade_Function ) ;
typedef VIEW_SET_PASTE_REWRITE__SIG ( View_Set_Paste_Rewrite__Function ) ;
typedef VIEW_GET_PASTE_REWRITE__SIG ( View_Get_Paste_Rewrite__Function ) ;
2016-05-25 22:43:58 +00:00
typedef GET_USER_INPUT_SIG ( Get_User_Input_Function ) ;
typedef GET_COMMAND_INPUT_SIG ( Get_Command_Input_Function ) ;
2016-06-10 23:46:30 +00:00
typedef GET_MOUSE_STATE_SIG ( Get_Mouse_State_Function ) ;
2016-05-25 22:43:58 +00:00
typedef START_QUERY_BAR_SIG ( Start_Query_Bar_Function ) ;
typedef END_QUERY_BAR_SIG ( End_Query_Bar_Function ) ;
typedef PRINT_MESSAGE_SIG ( Print_Message_Function ) ;
typedef CHANGE_THEME_SIG ( Change_Theme_Function ) ;
typedef CHANGE_FONT_SIG ( Change_Font_Function ) ;
typedef SET_THEME_COLORS_SIG ( Set_Theme_Colors_Function ) ;
2016-06-14 19:00:03 +00:00
typedef GET_THEME_COLORS_SIG ( Get_Theme_Colors_Function ) ;
2016-06-27 15:52:58 +00:00
typedef DIRECTORY_GET_HOT_SIG ( Directory_Get_Hot_Function ) ;
typedef GET_FILE_LIST_SIG ( Get_File_List_Function ) ;
typedef FREE_FILE_LIST_SIG ( Free_File_List_Function ) ;
typedef FILE_EXISTS_SIG ( File_Exists_Function ) ;
typedef DIRECTORY_CD_SIG ( Directory_CD_Function ) ;
typedef GET_4ED_PATH_SIG ( Get_4ed_Path_Function ) ;
2016-05-25 22:43:58 +00:00
}
struct Application_Links {
void * memory ;
int memory_size ;
2016-06-13 16:56:33 +00:00
Exec_Command_Function * exec_command ;
Exec_System_Command_Function * exec_system_command ;
2016-06-14 14:20:15 +00:00
Clipboard_Post_Function * clipboard_post ;
Clipboard_Count_Function * clipboard_count ;
Clipboard_Index_Function * clipboard_index ;
2016-05-25 22:43:58 +00:00
Get_Buffer_First_Function * get_buffer_first ;
Get_Buffer_Next_Function * get_buffer_next ;
Get_Buffer_Function * get_buffer ;
Get_Buffer_By_Name_Function * get_buffer_by_name ;
2016-06-27 15:52:58 +00:00
Buffer_Boundary_Seek_Function * buffer_boundary_seek ;
2016-06-23 23:11:09 +00:00
Buffer_Read_Range_Function * buffer_read_range ;
2016-06-20 20:34:48 +00:00
Buffer_Replace_Range_Function * buffer_replace_range ;
2016-06-13 16:56:33 +00:00
Buffer_Set_Setting_Function * buffer_set_setting ;
2016-06-24 02:53:33 +00:00
Buffer_Auto_Indent_Function * buffer_auto_indent ;
2016-06-17 03:31:15 +00:00
Create_Buffer_Function * create_buffer ;
Save_Buffer_Function * save_buffer ;
Kill_Buffer_Function * kill_buffer ;
2016-05-25 22:43:58 +00:00
Get_View_First_Function * get_view_first ;
Get_View_Next_Function * get_view_next ;
Get_View_Function * get_view ;
Get_Active_View_Function * get_active_view ;
View_Compute_Cursor_Function * view_compute_cursor ;
View_Set_Cursor_Function * view_set_cursor ;
View_Set_Mark_Function * view_set_mark ;
View_Set_Highlight_Function * view_set_highlight ;
View_Set_Buffer_Function * view_set_buffer ;
2016-06-14 19:00:03 +00:00
View_Post_Fade_Function * view_post_fade ;
View_Set_Paste_Rewrite__Function * view_set_paste_rewrite_ ;
View_Get_Paste_Rewrite__Function * view_get_paste_rewrite_ ;
2016-05-25 22:43:58 +00:00
Get_User_Input_Function * get_user_input ;
Get_Command_Input_Function * get_command_input ;
2016-06-10 23:46:30 +00:00
Get_Mouse_State_Function * get_mouse_state ;
2016-05-25 22:43:58 +00:00
Start_Query_Bar_Function * start_query_bar ;
End_Query_Bar_Function * end_query_bar ;
Print_Message_Function * print_message ;
Change_Theme_Function * change_theme ;
Change_Font_Function * change_font ;
Set_Theme_Colors_Function * set_theme_colors ;
2016-06-14 19:00:03 +00:00
Get_Theme_Colors_Function * get_theme_colors ;
2016-06-27 15:52:58 +00:00
Directory_Get_Hot_Function * directory_get_hot ;
Get_File_List_Function * get_file_list ;
Free_File_List_Function * free_file_list ;
File_Exists_Function * file_exists ;
Directory_CD_Function * directory_cd ;
Get_4ed_Path_Function * get_4ed_path ;
2016-05-25 22:43:58 +00:00
void * cmd_context ;
void * system_links ;
void * current_coroutine ;
int type_coroutine ;
} ;
2016-06-13 16:56:33 +00:00
# define FillAppLinksAPI(app_links) do{\
2016-06-27 15:52:58 +00:00
app_links - > exec_command = Exec_Command ; \
app_links - > exec_system_command = Exec_System_Command ; \
app_links - > clipboard_post = Clipboard_Post ; \
app_links - > clipboard_count = Clipboard_Count ; \
app_links - > clipboard_index = Clipboard_Index ; \
app_links - > get_buffer_first = Get_Buffer_First ; \
app_links - > get_buffer_next = Get_Buffer_Next ; \
app_links - > get_buffer = Get_Buffer ; \
app_links - > get_buffer_by_name = Get_Buffer_By_Name ; \
app_links - > buffer_boundary_seek = Buffer_Boundary_Seek ; \
app_links - > buffer_read_range = Buffer_Read_Range ; \
app_links - > buffer_replace_range = Buffer_Replace_Range ; \
app_links - > buffer_set_setting = Buffer_Set_Setting ; \
app_links - > buffer_auto_indent = Buffer_Auto_Indent ; \
app_links - > create_buffer = Create_Buffer ; \
app_links - > save_buffer = Save_Buffer ; \
app_links - > kill_buffer = Kill_Buffer ; \
app_links - > get_view_first = Get_View_First ; \
app_links - > get_view_next = Get_View_Next ; \
app_links - > get_view = Get_View ; \
app_links - > get_active_view = Get_Active_View ; \
app_links - > view_compute_cursor = View_Compute_Cursor ; \
app_links - > view_set_cursor = View_Set_Cursor ; \
app_links - > view_set_mark = View_Set_Mark ; \
app_links - > view_set_highlight = View_Set_Highlight ; \
app_links - > view_set_buffer = View_Set_Buffer ; \
app_links - > view_post_fade = View_Post_Fade ; \
app_links - > view_set_paste_rewrite_ = View_Set_Paste_Rewrite_ ; \
app_links - > view_get_paste_rewrite_ = View_Get_Paste_Rewrite_ ; \
app_links - > get_user_input = Get_User_Input ; \
app_links - > get_command_input = Get_Command_Input ; \
app_links - > get_mouse_state = Get_Mouse_State ; \
app_links - > start_query_bar = Start_Query_Bar ; \
app_links - > end_query_bar = End_Query_Bar ; \
app_links - > print_message = Print_Message ; \
app_links - > change_theme = Change_Theme ; \
app_links - > change_font = Change_Font ; \
app_links - > set_theme_colors = Set_Theme_Colors ; \
app_links - > get_theme_colors = Get_Theme_Colors ; \
app_links - > directory_get_hot = Directory_Get_Hot ; \
app_links - > get_file_list = Get_File_List ; \
app_links - > free_file_list = Free_File_List ; \
app_links - > file_exists = File_Exists ; \
app_links - > directory_cd = Directory_CD ; \
app_links - > get_4ed_path = Get_4ed_Path ; } while ( false )