diff options
Diffstat (limited to 'vis.h')
| -rw-r--r-- | vis.h | 200 |
1 files changed, 102 insertions, 98 deletions
@@ -1,6 +1,10 @@ #ifndef VIS_H #define VIS_H +#ifndef VIS_EXPORT + #define VIS_EXPORT +#endif + #include <signal.h> #include <stddef.h> #include <stdbool.h> @@ -103,21 +107,21 @@ typedef struct { * Initializes a new editor instance. * @param vis The editor instance. */ -bool vis_init(Vis*); +VIS_EXPORT bool vis_init(Vis*); /** Release all resources associated with this editor instance, terminates UI. */ -void vis_cleanup(Vis*); +VIS_EXPORT void vis_cleanup(Vis*); /** * Enter main loop, start processing user input. * @param vis The editor instance. * @return The editor exit status code. */ -int vis_run(Vis*); +VIS_EXPORT int vis_run(Vis*); /** * Terminate editing session, the given ``status`` will be the return value of `vis_run`. * @param vis The editor instance. * @param status The exit status. */ -void vis_exit(Vis *vis, int status); +VIS_EXPORT void vis_exit(Vis *vis, int status); /** * Emergency exit, print given message, perform minimal UI cleanup and exit process. * @param vis The editor instance. @@ -126,7 +130,7 @@ void vis_exit(Vis *vis, int status); * .. note:: This function does not return. * @endrst */ -void vis_die(Vis *vis, const char *msg, ...) __attribute__((noreturn,format(printf, 2, 3))); +VIS_EXPORT void vis_die(Vis *vis, const char *msg, ...) __attribute__((noreturn,format(printf, 2, 3))); /** * Inform the editor core that a signal occurred. @@ -142,7 +146,7 @@ void vis_die(Vis *vis, const char *msg, ...) __attribute__((noreturn,format(prin * specified in `sigaction(2)`. * @endrst */ -bool vis_signal_handler(Vis *vis, int signum, const siginfo_t *siginfo, const void *context); +VIS_EXPORT bool vis_signal_handler(Vis *vis, int signum, const siginfo_t *siginfo, const void *context); /** * Interrupt long running operation. * @param vis The editor instance. @@ -153,12 +157,12 @@ bool vis_signal_handler(Vis *vis, int signum, const siginfo_t *siginfo, const vo * .. note:: It is invoked from `vis_signal_handler` when receiving ``SIGINT``. * @endrst */ -void vis_interrupt(Vis*); +VIS_EXPORT void vis_interrupt(Vis*); /** * Check whether interruption was requested. * @param vis The editor instance. */ -bool vis_interrupt_requested(Vis*); +VIS_EXPORT bool vis_interrupt_requested(Vis*); /** @} */ /* @@ -174,12 +178,12 @@ bool vis_interrupt_requested(Vis*); * Draw user interface. * @param vis The editor instance. */ -void vis_draw(Vis*); +VIS_EXPORT void vis_draw(Vis*); /** * Completely redraw user interface. * @param vis The editor instance. */ -void vis_redraw(Vis*); +VIS_EXPORT void vis_redraw(Vis*); /** @} */ /* @@ -200,7 +204,7 @@ void vis_redraw(Vis*); * the underlying File object is shared. * @endrst */ -bool vis_window_new(Vis *vis, const char *filename); +VIS_EXPORT bool vis_window_new(Vis *vis, const char *filename); /** * Create a new window associated with a file descriptor. * @param vis The editor instance. @@ -210,64 +214,64 @@ bool vis_window_new(Vis *vis, const char *filename); * explicit filename will instead write to the file descriptor. * @endrst */ -bool vis_window_new_fd(Vis *vis, int fd); +VIS_EXPORT bool vis_window_new_fd(Vis *vis, int fd); /** * Reload the file currently displayed in the window from disk. * @param win The window to reload. */ -bool vis_window_reload(Win*); +VIS_EXPORT bool vis_window_reload(Win*); /** * Change the file currently displayed in the window. * @param win The window to change. * @param filename The new file to display. */ -bool vis_window_change_file(Win *win, const char *filename); +VIS_EXPORT bool vis_window_change_file(Win *win, const char *filename); /** * Check whether closing the window would loose unsaved changes. * @param win The window to check. */ -bool vis_window_closable(Win*); +VIS_EXPORT bool vis_window_closable(Win*); /** * Close window, redraw user interface. * @param win The window to close. */ -void vis_window_close(Win*); +VIS_EXPORT void vis_window_close(Win*); /** * Split the window, shares the underlying file object. * @param original The window to split. */ -bool vis_window_split(Win*); +VIS_EXPORT bool vis_window_split(Win*); /** * Draw a specific window. * @param win The window to draw. */ -void vis_window_draw(Win*); +VIS_EXPORT void vis_window_draw(Win*); /** * Invalidate a window, forcing a redraw. * @param win The window to invalidate. */ -void vis_window_invalidate(Win*); +VIS_EXPORT void vis_window_invalidate(Win*); /** * Focus next window. * @param vis The editor instance. */ -void vis_window_next(Vis*); +VIS_EXPORT void vis_window_next(Vis*); /** * Focus previous window. * @param vis The editor instance. */ -void vis_window_prev(Vis*); +VIS_EXPORT void vis_window_prev(Vis*); /** * Change currently focused window, receiving user input. * @param win The window to focus. */ -void vis_window_focus(Win*); +VIS_EXPORT void vis_window_focus(Win*); /** * Swap location of two windows. * @param win1 The first window. * @param win2 The second window. */ -void vis_window_swap(Win *win1, Win *win2); +VIS_EXPORT void vis_window_swap(Win *win1, Win *win2); /** @} */ /* @@ -287,7 +291,7 @@ void vis_window_swap(Win *win1, Win *win2); * .. note:: The prompt is currently implemented as a single line height window. * @endrst */ -void vis_prompt_show(Vis *vis, const char *title); +VIS_EXPORT void vis_prompt_show(Vis *vis, const char *title); /** * Display a single line message. @@ -297,14 +301,14 @@ void vis_prompt_show(Vis *vis, const char *title); * .. note:: The message will automatically be hidden upon next input. * @endrst */ -void vis_info_show(Vis *vis, const char *msg, ...) __attribute__((format(printf, 2, 3))); +VIS_EXPORT void vis_info_show(Vis *vis, const char *msg, ...) __attribute__((format(printf, 2, 3))); /** * Display arbitrary long message in a dedicated window. * @param vis The editor instance. * @param msg The message to display. */ -void vis_message_show(Vis *vis, const char *msg); +VIS_EXPORT void vis_message_show(Vis *vis, const char *msg); /** @} */ /* @@ -323,14 +327,14 @@ void vis_message_show(Vis *vis, const char *msg); * @param data The data to insert. * @param len The length of the data to insert. */ -void vis_insert(Vis *vis, size_t pos, const char *data, size_t len); +VIS_EXPORT void vis_insert(Vis *vis, size_t pos, const char *data, size_t len); /** * Delete data from the file. * @param vis The editor instance. * @param pos The starting position of the deletion. * @param len The length of the data to delete. */ -void vis_delete(Vis *vis, size_t pos, size_t len); +VIS_EXPORT void vis_delete(Vis *vis, size_t pos, size_t len); /** * Replace data in the file. * @param vis The editor instance. @@ -338,14 +342,14 @@ void vis_delete(Vis *vis, size_t pos, size_t len); * @param data The new data. * @param len The length of the new data. */ -void vis_replace(Vis *vis, size_t pos, const char *data, size_t len); +VIS_EXPORT void vis_replace(Vis *vis, size_t pos, const char *data, size_t len); /** * Perform insertion at all cursor positions. * @param vis The editor instance. * @param data The data to insert. * @param len The length of the data. */ -void vis_insert_key(Vis *vis, const char *data, size_t len); +VIS_EXPORT void vis_insert_key(Vis *vis, const char *data, size_t len); /** * Perform character substitution at all cursor positions. * @param vis The editor instance. @@ -355,7 +359,7 @@ void vis_insert_key(Vis *vis, const char *data, size_t len); * .. note:: Does not replace new line characters. * @endrst */ -void vis_replace_key(Vis *vis, const char *data, size_t len); +VIS_EXPORT void vis_replace_key(Vis *vis, const char *data, size_t len); /** * Insert a tab at all cursor positions. * @param vis The editor instance. @@ -363,7 +367,7 @@ void vis_replace_key(Vis *vis, const char *data, size_t len); * .. note:: Performs tab expansion according to current settings. * @endrst */ -void vis_insert_tab(Vis*); +VIS_EXPORT void vis_insert_tab(Vis*); /** * Inserts a new line character at every cursor position. * @param vis The editor instance. @@ -371,7 +375,7 @@ void vis_insert_tab(Vis*); * .. note:: Performs auto indentation according to current settings. * @endrst */ -void vis_insert_nl(Vis*); +VIS_EXPORT void vis_insert_nl(Vis*); /** @} */ @@ -406,13 +410,13 @@ enum VisMode { * No events are emitted, if the specified mode is already active. * @endrst */ -void vis_mode_switch(Vis *vis, enum VisMode mode); +VIS_EXPORT void vis_mode_switch(Vis *vis, enum VisMode mode); /** * Translate human readable mode name to constant. * @param vis The editor instance. * @param name The name of the mode. */ -enum VisMode vis_mode_from(Vis *vis, const char *name); +VIS_EXPORT enum VisMode vis_mode_from(Vis *vis, const char *name); /** @} */ @@ -429,13 +433,13 @@ enum VisMode vis_mode_from(Vis *vis, const char *name); * Create a new key binding. * @param vis The editor instance. */ -KeyBinding *vis_binding_new(Vis*); +VIS_EXPORT KeyBinding *vis_binding_new(Vis*); /** * Free a key binding. * @param vis The editor instance. * @param binding The key binding to free. */ -void vis_binding_free(Vis *vis, KeyBinding *binding); +VIS_EXPORT void vis_binding_free(Vis *vis, KeyBinding *binding); /** * Set up a key binding. @@ -448,7 +452,7 @@ void vis_binding_free(Vis *vis, KeyBinding *binding); * .. note:: ``binding->key`` is always ignored in favor of ``key``. * @endrst */ -bool vis_mode_map(Vis *vis, enum VisMode mode, bool force, const char *key, const KeyBinding *binding); +VIS_EXPORT bool vis_mode_map(Vis *vis, enum VisMode mode, bool force, const char *key, const KeyBinding *binding); /** * Analogous to `vis_mode_map`, but window specific. * @param win The window for the mapping. @@ -457,21 +461,21 @@ bool vis_mode_map(Vis *vis, enum VisMode mode, bool force, const char *key, cons * @param key The symbolic key to map. * @param binding The binding to map. */ -bool vis_window_mode_map(Win *win, enum VisMode mode, bool force, const char *key, const KeyBinding *binding); +VIS_EXPORT bool vis_window_mode_map(Win *win, enum VisMode mode, bool force, const char *key, const KeyBinding *binding); /** * Unmap a symbolic key in a given mode. * @param vis The editor instance. * @param mode The mode from which to unmap. * @param key The symbolic key to unmap. */ -bool vis_mode_unmap(Vis *vis, enum VisMode mode, const char *key); +VIS_EXPORT bool vis_mode_unmap(Vis *vis, enum VisMode mode, const char *key); /** * Analogous to `vis_mode_unmap`, but window specific. * @param win The window from which to unmap. * @param mode The mode from which to unmap. * @param key The symbolic key to unmap. */ -bool vis_window_mode_unmap(Win *win, enum VisMode mode, const char *key); +VIS_EXPORT bool vis_window_mode_unmap(Win *win, enum VisMode mode, const char *key); /** @} */ /* @@ -491,13 +495,13 @@ bool vis_window_mode_unmap(Win *win, enum VisMode mode, const char *key); * @param func The function implementing the key action logic. * @param arg Argument passed to function. */ -KeyAction *vis_action_new(Vis *vis, const char *name, const char *help, KeyActionFunction *func, Arg arg); +VIS_EXPORT KeyAction *vis_action_new(Vis *vis, const char *name, const char *help, KeyActionFunction *func, Arg arg); /** * Free a key action. * @param vis The editor instance. * @param action The key action to free. */ -void vis_action_free(Vis *vis, KeyAction *action); +VIS_EXPORT void vis_action_free(Vis *vis, KeyAction *action); /** * Register key action. * @param vis The editor instance. @@ -507,7 +511,7 @@ void vis_action_free(Vis *vis, KeyAction *action); * in ``keyaction->name``. * @endrst */ -bool vis_action_register(Vis *vis, const KeyAction *keyaction); +VIS_EXPORT bool vis_action_register(Vis *vis, const KeyAction *keyaction); /** @} */ @@ -527,12 +531,12 @@ bool vis_action_register(Vis *vis, const KeyAction *keyaction); * @param key The key to translate. * @param mapping The string to map the key to. */ -bool vis_keymap_add(Vis *vis, const char *key, const char *mapping); +VIS_EXPORT bool vis_keymap_add(Vis *vis, const char *key, const char *mapping); /** * Temporarily disable the keymap for the next key press. * @param vis The editor instance. */ -void vis_keymap_disable(Vis*); +VIS_EXPORT void vis_keymap_disable(Vis*); /** @} */ @@ -590,7 +594,7 @@ typedef size_t (VisOperatorFunction)(Vis *vis, Text *text, OperatorContext *cont * @return Operator ID. Negative values indicate an error, positive ones can be * used with `vis_operator`. */ -int vis_operator_register(Vis *vis, VisOperatorFunction *func, void *context); +VIS_EXPORT int vis_operator_register(Vis *vis, VisOperatorFunction *func, void *context); /** * Set operator to execute. @@ -612,19 +616,19 @@ int vis_operator_register(Vis *vis, VisOperatorFunction *func, void *context); * - `VIS_OP_MODESWITCH` an ``enum VisMode`` indicating the mode to switch to. * - `VIS_OP_REPLACE` a char pointer referring to the replacement character. */ -bool vis_operator(Vis *vis, enum VisOperator op, ...); +VIS_EXPORT bool vis_operator(Vis *vis, enum VisOperator op, ...); /** * Repeat last operator, possibly with a new count if one was provided in the meantime. * @param vis The editor instance. */ -void vis_repeat(Vis*); +VIS_EXPORT void vis_repeat(Vis*); /** * Cancel pending operator, reset count, motion, text object, register etc. * @param vis The editor instance. */ -void vis_cancel(Vis*); +VIS_EXPORT void vis_cancel(Vis*); /** @} */ @@ -736,7 +740,7 @@ enum VisMotion { * * The character to search for as ``const char *``. */ -bool vis_motion(Vis *vis, enum VisMotion motion, ...); +VIS_EXPORT bool vis_motion(Vis *vis, enum VisMotion motion, ...); enum VisMotionType { VIS_MOTIONTYPE_LINEWISE = 1 << 0, @@ -748,7 +752,7 @@ enum VisMotionType { * @param vis The editor instance. * @param type The motion type (line-wise or character-wise). */ -void vis_motion_type(Vis *vis, enum VisMotionType type); +VIS_EXPORT void vis_motion_type(Vis *vis, enum VisMotionType type); /** * Motions take a starting position and transform it to an end position. @@ -771,7 +775,7 @@ typedef size_t (VisMotionFunction)(Vis *vis, Win *win, void *context, size_t pos * @return Motion ID. Negative values indicate an error, positive ones can be * used with `vis_motion`. */ -int vis_motion_register(Vis *vis, void *context, VisMotionFunction *func); +VIS_EXPORT int vis_motion_register(Vis *vis, void *context, VisMotionFunction *func); /** @} */ @@ -793,7 +797,7 @@ int vis_motion_register(Vis *vis, void *context, VisMotionFunction *func); * @param vis The editor instance. * @param new_shell The new shell to set. */ -void vis_shell_set(Vis *vis, const char *new_shell); +VIS_EXPORT void vis_shell_set(Vis *vis, const char *new_shell); typedef struct { Vis *vis; @@ -806,13 +810,13 @@ typedef struct { * @param vis The editor instance. * @param def The default count if none is specified. */ -VisCountIterator vis_count_iterator_get(Vis *vis, int def); +VIS_EXPORT VisCountIterator vis_count_iterator_get(Vis *vis, int def); /** * Get iterator initialized with a count value. * @param vis The editor instance. * @param count The count value to initialize with. */ -VisCountIterator vis_count_iterator_init(Vis *vis, int count); +VIS_EXPORT VisCountIterator vis_count_iterator_init(Vis *vis, int count); /** * Increment iterator counter. * @param iter Pointer to the iterator. @@ -822,7 +826,7 @@ VisCountIterator vis_count_iterator_init(Vis *vis, int count); * `interrupted <vis_interrupt>`_ in the meantime. * @endrst */ -bool vis_count_iterator_next(VisCountIterator *iter); +VIS_EXPORT bool vis_count_iterator_next(VisCountIterator *iter); /** @} */ @@ -889,14 +893,14 @@ typedef Filerange (VisTextObjectFunction)(Vis *vis, Win *win, void *context, siz * @return Text object ID. Negative values indicate an error, positive ones can be * used with `vis_textobject`. */ -int vis_textobject_register(Vis *vis, int type, void *data, VisTextObjectFunction *func); +VIS_EXPORT int vis_textobject_register(Vis *vis, int type, void *data, VisTextObjectFunction *func); /** * Set text object to use. * @param vis The editor instance. * @param textobj The text object to set. */ -bool vis_textobject(Vis *vis, enum VisTextObject textobj); +VIS_EXPORT bool vis_textobject(Vis *vis, enum VisTextObject textobj); /** @} */ @@ -928,13 +932,13 @@ enum VisMark { * @param vis The editor instance. * @param mark The character representing the mark. */ -enum VisMark vis_mark_from(Vis *vis, char mark); +VIS_EXPORT enum VisMark vis_mark_from(Vis *vis, char mark); /** * Translate between mark constant and single character mark name. * @param vis The editor instance. * @param mark The mark constant. */ -char vis_mark_to(Vis *vis, enum VisMark mark); +VIS_EXPORT char vis_mark_to(Vis *vis, enum VisMark mark); /** * Specify mark to use. * @param vis The editor instance. @@ -943,12 +947,12 @@ char vis_mark_to(Vis *vis, enum VisMark mark); * .. note:: If none is specified `VIS_MARK_DEFAULT` will be used. * @endrst */ -void vis_mark(Vis *vis, enum VisMark mark); +VIS_EXPORT void vis_mark(Vis *vis, enum VisMark mark); /** * Get the currently used mark. * @param vis The editor instance. */ -enum VisMark vis_mark_used(Vis*); +VIS_EXPORT enum VisMark vis_mark_used(Vis*); /** * Store a set of ``Filerange``s in a mark. * @@ -956,7 +960,7 @@ enum VisMark vis_mark_used(Vis*); * @param id The mark ID to use. * @param sel The array containing the file ranges. */ -void vis_mark_set(Win *win, enum VisMark id, Array *sel); +VIS_EXPORT void vis_mark_set(Win *win, enum VisMark id, Array *sel); /** * Get an array of file ranges stored in the mark. * @param win The window whose mark to retrieve. @@ -967,7 +971,7 @@ void vis_mark_set(Win *win, enum VisMark id, Array *sel); * ``array_release``. * @endrst */ -Array vis_mark_get(Win *win, enum VisMark id); +VIS_EXPORT Array vis_mark_get(Win *win, enum VisMark id); /** * Normalize an Array of Fileranges. * @param array The array of file ranges to normalize. @@ -975,22 +979,22 @@ Array vis_mark_get(Win *win, enum VisMark id); * Removes invalid ranges, merges overlapping ones and sorts * according to the start position. */ -void vis_mark_normalize(Array *array); +VIS_EXPORT void vis_mark_normalize(Array *array); /** * Add selections of focused window to jump list. * @param vis The editor instance. */ -bool vis_jumplist_save(Vis*); +VIS_EXPORT bool vis_jumplist_save(Vis*); /** * Navigate jump list backwards. * @param vis The editor instance. */ -bool vis_jumplist_prev(Vis*); +VIS_EXPORT bool vis_jumplist_prev(Vis*); /** * Navigate jump list forwards. * @param vis The editor instance. */ -bool vis_jumplist_next(Vis*); +VIS_EXPORT bool vis_jumplist_next(Vis*); /** @} */ /* @@ -1048,13 +1052,13 @@ enum VisRegister { * @param vis The editor instance. * @param reg The character representing the register. */ -enum VisRegister vis_register_from(Vis *vis, char reg); +VIS_EXPORT enum VisRegister vis_register_from(Vis *vis, char reg); /** * Translate between register constant and single character register name. * @param vis The editor instance. * @param reg The register constant. */ -char vis_register_to(Vis *vis, enum VisRegister reg); +VIS_EXPORT char vis_register_to(Vis *vis, enum VisRegister reg); /** * Specify register to use. * @param vis The editor instance. @@ -1063,12 +1067,12 @@ char vis_register_to(Vis *vis, enum VisRegister reg); * .. note:: If none is specified `VIS_REG_DEFAULT` will be used. * @endrst */ -void vis_register(Vis *vis, enum VisRegister reg); +VIS_EXPORT void vis_register(Vis *vis, enum VisRegister reg); /** * Get the currently used register. * @param vis The editor instance. */ -enum VisRegister vis_register_used(Vis*); +VIS_EXPORT enum VisRegister vis_register_used(Vis*); /** * Get register content. * @param vis The editor instance. @@ -1079,14 +1083,14 @@ enum VisRegister vis_register_used(Vis*); * ``array_release``. * @endrst */ -Array vis_register_get(Vis *vis, enum VisRegister id); +VIS_EXPORT Array vis_register_get(Vis *vis, enum VisRegister id); /** * Set register content. * @param vis The editor instance. * @param id The register ID to set. * @param data The array comprised of ``TextString`` structs. */ -bool vis_register_set(Vis *vis, enum VisRegister id, Array *data); +VIS_EXPORT bool vis_register_set(Vis *vis, enum VisRegister id, Array *data); /** @} */ /* @@ -1106,17 +1110,17 @@ bool vis_register_set(Vis *vis, enum VisRegister id, Array *data); * .. note:: Fails if a recording is already ongoing. * @endrst */ -bool vis_macro_record(Vis *vis, enum VisRegister reg); +VIS_EXPORT bool vis_macro_record(Vis *vis, enum VisRegister reg); /** * Stop recording, fails if there is nothing to stop. * @param vis The editor instance. */ -bool vis_macro_record_stop(Vis*); +VIS_EXPORT bool vis_macro_record_stop(Vis*); /** * Check whether a recording is currently ongoing. * @param vis The editor instance. */ -bool vis_macro_recording(Vis*); +VIS_EXPORT bool vis_macro_recording(Vis*); /** * Replay a macro. * @param vis The editor instance. @@ -1125,7 +1129,7 @@ bool vis_macro_recording(Vis*); * .. note:: A macro currently being recorded can not be replayed. * @endrst */ -bool vis_macro_replay(Vis *vis, enum VisRegister reg); +VIS_EXPORT bool vis_macro_replay(Vis *vis, enum VisRegister reg); /** @} */ @@ -1144,7 +1148,7 @@ bool vis_macro_replay(Vis *vis, enum VisRegister reg); * @param vis The editor instance. * @param cmd The command string to execute. */ -bool vis_cmd(Vis *vis, const char *cmd); +VIS_EXPORT bool vis_cmd(Vis *vis, const char *cmd); /** Command handler function. */ typedef bool (VisCommandFunction)(Vis*, Win*, void *data, bool force, @@ -1160,14 +1164,14 @@ typedef bool (VisCommandFunction)(Vis*, Win*, void *data, bool force, * .. note:: Any unique prefix of the command name will invoke the command. * @endrst */ -bool vis_cmd_register(Vis *vis, const char *name, const char *help, void *context, VisCommandFunction *func); +VIS_EXPORT bool vis_cmd_register(Vis *vis, const char *name, const char *help, void *context, VisCommandFunction *func); /** * Unregister ``:``-command. * @param vis The editor instance. * @param name The name of the command to unregister. */ -bool vis_cmd_unregister(Vis *vis, const char *name); +VIS_EXPORT bool vis_cmd_unregister(Vis *vis, const char *name); /** @} */ @@ -1215,8 +1219,8 @@ typedef bool (VisOptionFunction)(Vis *vis, Win *win, void *context, bool force, * .. note:: Fails if any of the given option names is already registered. * @endrst */ -bool vis_option_register(Vis *vis, const char *names[], enum VisOption option_flags, - VisOptionFunction *func, void *context, const char *help); +VIS_EXPORT bool vis_option_register(Vis *vis, const char *names[], enum VisOption option_flags, + VisOptionFunction *func, void *context, const char *help); /** * Unregister an existing ``:set`` option. * @param vis The editor instance. @@ -1225,14 +1229,14 @@ bool vis_option_register(Vis *vis, const char *names[], enum VisOption option_fl * .. note:: Also unregisters all aliases as given to `vis_option_register`. * @endrst */ -bool vis_option_unregister(Vis *vis, const char *name); +VIS_EXPORT bool vis_option_unregister(Vis *vis, const char *name); /** * Execute any kind (``:``, ``?``, ``/``) of prompt command * @param vis The editor instance. * @param cmd The command string. */ -bool vis_prompt_cmd(Vis *vis, const char *cmd); +VIS_EXPORT bool vis_prompt_cmd(Vis *vis, const char *cmd); /** * Write newline separated list of available commands to ``buf`` @@ -1240,7 +1244,7 @@ bool vis_prompt_cmd(Vis *vis, const char *cmd); * @param buf The buffer to write to. * @param prefix Prefix to filter command list by. */ -void vis_print_cmds(Vis*, Buffer *buf, const char *prefix); +VIS_EXPORT void vis_print_cmds(Vis*, Buffer *buf, const char *prefix); /** * Pipe a given file range to an external process. @@ -1276,7 +1280,7 @@ void vis_print_cmds(Vis*, Buffer *buf, const char *prefix); * * @return The exit status of the forked process. */ -int vis_pipe(Vis *vis, File *file, Filerange *range, const char *argv[], +VIS_EXPORT int vis_pipe(Vis *vis, File *file, Filerange *range, const char *argv[], void *stdout_context, ssize_t (*read_stdout)(void *stdout_context, char *data, size_t len), void *stderr_context, ssize_t (*read_stderr)(void *stderr_context, char *data, size_t len), bool fullscreen); @@ -1296,7 +1300,7 @@ int vis_pipe(Vis *vis, File *file, Filerange *range, const char *argv[], * by the caller. * @endrst */ -int vis_pipe_collect(Vis *vis, File *file, Filerange *range, const char *argv[], char **out, char **err, bool fullscreen); +VIS_EXPORT int vis_pipe_collect(Vis *vis, File *file, Filerange *range, const char *argv[], char **out, char **err, bool fullscreen); /** * Pipe a buffer to an external process, return its exit status and capture @@ -1312,7 +1316,7 @@ int vis_pipe_collect(Vis *vis, File *file, Filerange *range, const char *argv[], * by the caller. * @endrst */ -int vis_pipe_buf_collect(Vis *vis, const char *buf, const char *argv[], char **out, char **err, bool fullscreen); +VIS_EXPORT int vis_pipe_buf_collect(Vis *vis, const char *buf, const char *argv[], char **out, char **err, bool fullscreen); /** @} */ @@ -1333,13 +1337,13 @@ int vis_pipe_buf_collect(Vis *vis, const char *buf, const char *argv[], char **o * Given the start of a symbolic key, returns a pointer to the start of the one * immediately following it. */ -const char *vis_keys_next(Vis *vis, const char *keys); +VIS_EXPORT const char *vis_keys_next(Vis *vis, const char *keys); /** * Convert next symbolic key to an Unicode code point, returns ``-1`` for unknown keys. * @param vis The editor instance. * @param keys The symbolic key string. */ -long vis_keys_codepoint(Vis *vis, const char *keys); +VIS_EXPORT long vis_keys_codepoint(Vis *vis, const char *keys); /** * Convert next symbolic key to a UTF-8 sequence. * @param vis The editor instance. @@ -1350,13 +1354,13 @@ long vis_keys_codepoint(Vis *vis, const char *keys); * .. note:: Guarantees that ``utf8`` is NUL terminated on success. * @endrst */ -bool vis_keys_utf8(Vis *vis, const char *keys, char utf8[static UTFmax+1]); +VIS_EXPORT bool vis_keys_utf8(Vis *vis, const char *keys, char utf8[static UTFmax+1]); /** * Process symbolic keys as if they were user originated input. * @param vis The editor instance. * @param keys The symbolic key string to feed. */ -void vis_keys_feed(Vis *vis, const char *keys); +VIS_EXPORT void vis_keys_feed(Vis *vis, const char *keys); /** @} */ /* @@ -1379,7 +1383,7 @@ void vis_keys_feed(Vis *vis, const char *keys); * .. warning:: The caller must free the regex object using `text_regex_free`. * @endrst */ -Regex *vis_regex(Vis *vis, const char *pattern); +VIS_EXPORT Regex *vis_regex(Vis *vis, const char *pattern); /** * Take an undo snapshot to which we can later revert. @@ -1389,11 +1393,11 @@ Regex *vis_regex(Vis *vis, const char *pattern); * .. note:: Does nothing when invoked while replaying a macro. * @endrst */ -void vis_file_snapshot(Vis *vis, File *file); +VIS_EXPORT void vis_file_snapshot(Vis *vis, File *file); /** @} */ /* TODO: expose proper API to iterate through files etc */ -Text *vis_text(Vis*); -View *vis_view(Vis*); +VIS_EXPORT Text *vis_text(Vis*); +VIS_EXPORT View *vis_view(Vis*); #endif |
