From 40d108599f1e7f6fad03ed29621f6c7bc3d6c61d Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 30 Mar 2026 10:26:07 -0700 Subject: [PATCH] lib: rename GHOSTTY_EXPORT to GHOSTTY_API Rename the shared library visibility macro from GHOSTTY_EXPORT to GHOSTTY_API across all public C headers. This applies to both the libghostty-vt headers under include/ghostty/vt/ and the main include/ghostty.h header. This is a bit more idiomatic compared to other C libs and addresses the fact that we're not always exporting... --- include/ghostty.h | 188 ++++++++++++++--------------- include/ghostty/vt/allocator.h | 4 +- include/ghostty/vt/build_info.h | 2 +- include/ghostty/vt/color.h | 2 +- include/ghostty/vt/focus.h | 2 +- include/ghostty/vt/formatter.h | 8 +- include/ghostty/vt/grid_ref.h | 8 +- include/ghostty/vt/key/encoder.h | 10 +- include/ghostty/vt/key/event.h | 32 ++--- include/ghostty/vt/modes.h | 2 +- include/ghostty/vt/mouse/encoder.h | 12 +- include/ghostty/vt/mouse/event.h | 22 ++-- include/ghostty/vt/osc.h | 14 +-- include/ghostty/vt/paste.h | 4 +- include/ghostty/vt/render.h | 32 ++--- include/ghostty/vt/screen.h | 4 +- include/ghostty/vt/sgr.h | 22 ++-- include/ghostty/vt/size_report.h | 2 +- include/ghostty/vt/style.h | 4 +- include/ghostty/vt/terminal.h | 22 ++-- include/ghostty/vt/types.h | 14 +-- include/ghostty/vt/wasm.h | 20 +-- 22 files changed, 215 insertions(+), 215 deletions(-) diff --git a/include/ghostty.h b/include/ghostty.h index 059c943f4..66dc94a15 100644 --- a/include/ghostty.h +++ b/include/ghostty.h @@ -33,19 +33,19 @@ typedef SSIZE_T ssize_t; // visibility so they remain accessible when the library is built with // -fvisibility=hidden. For static library builds, define GHOSTTY_STATIC // before including this header to make this a no-op. -#ifndef GHOSTTY_EXPORT +#ifndef GHOSTTY_API #if defined(GHOSTTY_STATIC) - #define GHOSTTY_EXPORT + #define GHOSTTY_API #elif defined(_WIN32) || defined(_WIN64) #ifdef GHOSTTY_BUILD_SHARED - #define GHOSTTY_EXPORT __declspec(dllexport) + #define GHOSTTY_API __declspec(dllexport) #else - #define GHOSTTY_EXPORT __declspec(dllimport) + #define GHOSTTY_API __declspec(dllimport) #endif #elif defined(__GNUC__) && __GNUC__ >= 4 - #define GHOSTTY_EXPORT __attribute__((visibility("default"))) + #define GHOSTTY_API __attribute__((visibility("default"))) #else - #define GHOSTTY_EXPORT + #define GHOSTTY_API #endif #endif @@ -1059,144 +1059,144 @@ typedef enum { //------------------------------------------------------------------- // Published API -GHOSTTY_EXPORT int ghostty_init(uintptr_t, char**); -GHOSTTY_EXPORT void ghostty_cli_try_action(void); -GHOSTTY_EXPORT ghostty_info_s ghostty_info(void); -GHOSTTY_EXPORT const char* ghostty_translate(const char*); -GHOSTTY_EXPORT void ghostty_string_free(ghostty_string_s); +GHOSTTY_API int ghostty_init(uintptr_t, char**); +GHOSTTY_API void ghostty_cli_try_action(void); +GHOSTTY_API ghostty_info_s ghostty_info(void); +GHOSTTY_API const char* ghostty_translate(const char*); +GHOSTTY_API void ghostty_string_free(ghostty_string_s); -GHOSTTY_EXPORT ghostty_config_t ghostty_config_new(); -GHOSTTY_EXPORT void ghostty_config_free(ghostty_config_t); -GHOSTTY_EXPORT ghostty_config_t ghostty_config_clone(ghostty_config_t); -GHOSTTY_EXPORT void ghostty_config_load_cli_args(ghostty_config_t); -GHOSTTY_EXPORT void ghostty_config_load_file(ghostty_config_t, const char*); -GHOSTTY_EXPORT void ghostty_config_load_default_files(ghostty_config_t); -GHOSTTY_EXPORT void ghostty_config_load_recursive_files(ghostty_config_t); -GHOSTTY_EXPORT void ghostty_config_finalize(ghostty_config_t); -GHOSTTY_EXPORT bool ghostty_config_get(ghostty_config_t, void*, const char*, uintptr_t); -GHOSTTY_EXPORT ghostty_input_trigger_s ghostty_config_trigger(ghostty_config_t, +GHOSTTY_API ghostty_config_t ghostty_config_new(); +GHOSTTY_API void ghostty_config_free(ghostty_config_t); +GHOSTTY_API ghostty_config_t ghostty_config_clone(ghostty_config_t); +GHOSTTY_API void ghostty_config_load_cli_args(ghostty_config_t); +GHOSTTY_API void ghostty_config_load_file(ghostty_config_t, const char*); +GHOSTTY_API void ghostty_config_load_default_files(ghostty_config_t); +GHOSTTY_API void ghostty_config_load_recursive_files(ghostty_config_t); +GHOSTTY_API void ghostty_config_finalize(ghostty_config_t); +GHOSTTY_API bool ghostty_config_get(ghostty_config_t, void*, const char*, uintptr_t); +GHOSTTY_API ghostty_input_trigger_s ghostty_config_trigger(ghostty_config_t, const char*, uintptr_t); -GHOSTTY_EXPORT uint32_t ghostty_config_diagnostics_count(ghostty_config_t); -GHOSTTY_EXPORT ghostty_diagnostic_s ghostty_config_get_diagnostic(ghostty_config_t, uint32_t); -GHOSTTY_EXPORT ghostty_string_s ghostty_config_open_path(void); +GHOSTTY_API uint32_t ghostty_config_diagnostics_count(ghostty_config_t); +GHOSTTY_API ghostty_diagnostic_s ghostty_config_get_diagnostic(ghostty_config_t, uint32_t); +GHOSTTY_API ghostty_string_s ghostty_config_open_path(void); -GHOSTTY_EXPORT ghostty_app_t ghostty_app_new(const ghostty_runtime_config_s*, +GHOSTTY_API ghostty_app_t ghostty_app_new(const ghostty_runtime_config_s*, ghostty_config_t); -GHOSTTY_EXPORT void ghostty_app_free(ghostty_app_t); -GHOSTTY_EXPORT void ghostty_app_tick(ghostty_app_t); -GHOSTTY_EXPORT void* ghostty_app_userdata(ghostty_app_t); -GHOSTTY_EXPORT void ghostty_app_set_focus(ghostty_app_t, bool); -GHOSTTY_EXPORT bool ghostty_app_key(ghostty_app_t, ghostty_input_key_s); -GHOSTTY_EXPORT bool ghostty_app_key_is_binding(ghostty_app_t, ghostty_input_key_s); -GHOSTTY_EXPORT void ghostty_app_keyboard_changed(ghostty_app_t); -GHOSTTY_EXPORT void ghostty_app_open_config(ghostty_app_t); -GHOSTTY_EXPORT void ghostty_app_update_config(ghostty_app_t, ghostty_config_t); -GHOSTTY_EXPORT bool ghostty_app_needs_confirm_quit(ghostty_app_t); -GHOSTTY_EXPORT bool ghostty_app_has_global_keybinds(ghostty_app_t); -GHOSTTY_EXPORT void ghostty_app_set_color_scheme(ghostty_app_t, ghostty_color_scheme_e); +GHOSTTY_API void ghostty_app_free(ghostty_app_t); +GHOSTTY_API void ghostty_app_tick(ghostty_app_t); +GHOSTTY_API void* ghostty_app_userdata(ghostty_app_t); +GHOSTTY_API void ghostty_app_set_focus(ghostty_app_t, bool); +GHOSTTY_API bool ghostty_app_key(ghostty_app_t, ghostty_input_key_s); +GHOSTTY_API bool ghostty_app_key_is_binding(ghostty_app_t, ghostty_input_key_s); +GHOSTTY_API void ghostty_app_keyboard_changed(ghostty_app_t); +GHOSTTY_API void ghostty_app_open_config(ghostty_app_t); +GHOSTTY_API void ghostty_app_update_config(ghostty_app_t, ghostty_config_t); +GHOSTTY_API bool ghostty_app_needs_confirm_quit(ghostty_app_t); +GHOSTTY_API bool ghostty_app_has_global_keybinds(ghostty_app_t); +GHOSTTY_API void ghostty_app_set_color_scheme(ghostty_app_t, ghostty_color_scheme_e); -GHOSTTY_EXPORT ghostty_surface_config_s ghostty_surface_config_new(); +GHOSTTY_API ghostty_surface_config_s ghostty_surface_config_new(); -GHOSTTY_EXPORT ghostty_surface_t ghostty_surface_new(ghostty_app_t, +GHOSTTY_API ghostty_surface_t ghostty_surface_new(ghostty_app_t, const ghostty_surface_config_s*); -GHOSTTY_EXPORT void ghostty_surface_free(ghostty_surface_t); -GHOSTTY_EXPORT void* ghostty_surface_userdata(ghostty_surface_t); -GHOSTTY_EXPORT ghostty_app_t ghostty_surface_app(ghostty_surface_t); -GHOSTTY_EXPORT ghostty_surface_config_s ghostty_surface_inherited_config(ghostty_surface_t, ghostty_surface_context_e); -GHOSTTY_EXPORT void ghostty_surface_update_config(ghostty_surface_t, ghostty_config_t); -GHOSTTY_EXPORT bool ghostty_surface_needs_confirm_quit(ghostty_surface_t); -GHOSTTY_EXPORT bool ghostty_surface_process_exited(ghostty_surface_t); -GHOSTTY_EXPORT void ghostty_surface_refresh(ghostty_surface_t); -GHOSTTY_EXPORT void ghostty_surface_draw(ghostty_surface_t); -GHOSTTY_EXPORT void ghostty_surface_set_content_scale(ghostty_surface_t, double, double); -GHOSTTY_EXPORT void ghostty_surface_set_focus(ghostty_surface_t, bool); -GHOSTTY_EXPORT void ghostty_surface_set_occlusion(ghostty_surface_t, bool); -GHOSTTY_EXPORT void ghostty_surface_set_size(ghostty_surface_t, uint32_t, uint32_t); -GHOSTTY_EXPORT ghostty_surface_size_s ghostty_surface_size(ghostty_surface_t); -GHOSTTY_EXPORT void ghostty_surface_set_color_scheme(ghostty_surface_t, +GHOSTTY_API void ghostty_surface_free(ghostty_surface_t); +GHOSTTY_API void* ghostty_surface_userdata(ghostty_surface_t); +GHOSTTY_API ghostty_app_t ghostty_surface_app(ghostty_surface_t); +GHOSTTY_API ghostty_surface_config_s ghostty_surface_inherited_config(ghostty_surface_t, ghostty_surface_context_e); +GHOSTTY_API void ghostty_surface_update_config(ghostty_surface_t, ghostty_config_t); +GHOSTTY_API bool ghostty_surface_needs_confirm_quit(ghostty_surface_t); +GHOSTTY_API bool ghostty_surface_process_exited(ghostty_surface_t); +GHOSTTY_API void ghostty_surface_refresh(ghostty_surface_t); +GHOSTTY_API void ghostty_surface_draw(ghostty_surface_t); +GHOSTTY_API void ghostty_surface_set_content_scale(ghostty_surface_t, double, double); +GHOSTTY_API void ghostty_surface_set_focus(ghostty_surface_t, bool); +GHOSTTY_API void ghostty_surface_set_occlusion(ghostty_surface_t, bool); +GHOSTTY_API void ghostty_surface_set_size(ghostty_surface_t, uint32_t, uint32_t); +GHOSTTY_API ghostty_surface_size_s ghostty_surface_size(ghostty_surface_t); +GHOSTTY_API void ghostty_surface_set_color_scheme(ghostty_surface_t, ghostty_color_scheme_e); -GHOSTTY_EXPORT ghostty_input_mods_e ghostty_surface_key_translation_mods(ghostty_surface_t, +GHOSTTY_API ghostty_input_mods_e ghostty_surface_key_translation_mods(ghostty_surface_t, ghostty_input_mods_e); -GHOSTTY_EXPORT bool ghostty_surface_key(ghostty_surface_t, ghostty_input_key_s); -GHOSTTY_EXPORT bool ghostty_surface_key_is_binding(ghostty_surface_t, +GHOSTTY_API bool ghostty_surface_key(ghostty_surface_t, ghostty_input_key_s); +GHOSTTY_API bool ghostty_surface_key_is_binding(ghostty_surface_t, ghostty_input_key_s, ghostty_binding_flags_e*); -GHOSTTY_EXPORT void ghostty_surface_text(ghostty_surface_t, const char*, uintptr_t); -GHOSTTY_EXPORT void ghostty_surface_preedit(ghostty_surface_t, const char*, uintptr_t); -GHOSTTY_EXPORT bool ghostty_surface_mouse_captured(ghostty_surface_t); -GHOSTTY_EXPORT bool ghostty_surface_mouse_button(ghostty_surface_t, +GHOSTTY_API void ghostty_surface_text(ghostty_surface_t, const char*, uintptr_t); +GHOSTTY_API void ghostty_surface_preedit(ghostty_surface_t, const char*, uintptr_t); +GHOSTTY_API bool ghostty_surface_mouse_captured(ghostty_surface_t); +GHOSTTY_API bool ghostty_surface_mouse_button(ghostty_surface_t, ghostty_input_mouse_state_e, ghostty_input_mouse_button_e, ghostty_input_mods_e); -GHOSTTY_EXPORT void ghostty_surface_mouse_pos(ghostty_surface_t, +GHOSTTY_API void ghostty_surface_mouse_pos(ghostty_surface_t, double, double, ghostty_input_mods_e); -GHOSTTY_EXPORT void ghostty_surface_mouse_scroll(ghostty_surface_t, +GHOSTTY_API void ghostty_surface_mouse_scroll(ghostty_surface_t, double, double, ghostty_input_scroll_mods_t); -GHOSTTY_EXPORT void ghostty_surface_mouse_pressure(ghostty_surface_t, uint32_t, double); -GHOSTTY_EXPORT void ghostty_surface_ime_point(ghostty_surface_t, double*, double*, double*, double*); -GHOSTTY_EXPORT void ghostty_surface_request_close(ghostty_surface_t); -GHOSTTY_EXPORT void ghostty_surface_split(ghostty_surface_t, ghostty_action_split_direction_e); -GHOSTTY_EXPORT void ghostty_surface_split_focus(ghostty_surface_t, +GHOSTTY_API void ghostty_surface_mouse_pressure(ghostty_surface_t, uint32_t, double); +GHOSTTY_API void ghostty_surface_ime_point(ghostty_surface_t, double*, double*, double*, double*); +GHOSTTY_API void ghostty_surface_request_close(ghostty_surface_t); +GHOSTTY_API void ghostty_surface_split(ghostty_surface_t, ghostty_action_split_direction_e); +GHOSTTY_API void ghostty_surface_split_focus(ghostty_surface_t, ghostty_action_goto_split_e); -GHOSTTY_EXPORT void ghostty_surface_split_resize(ghostty_surface_t, +GHOSTTY_API void ghostty_surface_split_resize(ghostty_surface_t, ghostty_action_resize_split_direction_e, uint16_t); -GHOSTTY_EXPORT void ghostty_surface_split_equalize(ghostty_surface_t); -GHOSTTY_EXPORT bool ghostty_surface_binding_action(ghostty_surface_t, const char*, uintptr_t); -GHOSTTY_EXPORT void ghostty_surface_complete_clipboard_request(ghostty_surface_t, +GHOSTTY_API void ghostty_surface_split_equalize(ghostty_surface_t); +GHOSTTY_API bool ghostty_surface_binding_action(ghostty_surface_t, const char*, uintptr_t); +GHOSTTY_API void ghostty_surface_complete_clipboard_request(ghostty_surface_t, const char*, void*, bool); -GHOSTTY_EXPORT bool ghostty_surface_has_selection(ghostty_surface_t); -GHOSTTY_EXPORT bool ghostty_surface_read_selection(ghostty_surface_t, ghostty_text_s*); -GHOSTTY_EXPORT bool ghostty_surface_read_text(ghostty_surface_t, +GHOSTTY_API bool ghostty_surface_has_selection(ghostty_surface_t); +GHOSTTY_API bool ghostty_surface_read_selection(ghostty_surface_t, ghostty_text_s*); +GHOSTTY_API bool ghostty_surface_read_text(ghostty_surface_t, ghostty_selection_s, ghostty_text_s*); -GHOSTTY_EXPORT void ghostty_surface_free_text(ghostty_surface_t, ghostty_text_s*); +GHOSTTY_API void ghostty_surface_free_text(ghostty_surface_t, ghostty_text_s*); #ifdef __APPLE__ -GHOSTTY_EXPORT void ghostty_surface_set_display_id(ghostty_surface_t, uint32_t); -GHOSTTY_EXPORT void* ghostty_surface_quicklook_font(ghostty_surface_t); -GHOSTTY_EXPORT bool ghostty_surface_quicklook_word(ghostty_surface_t, ghostty_text_s*); +GHOSTTY_API void ghostty_surface_set_display_id(ghostty_surface_t, uint32_t); +GHOSTTY_API void* ghostty_surface_quicklook_font(ghostty_surface_t); +GHOSTTY_API bool ghostty_surface_quicklook_word(ghostty_surface_t, ghostty_text_s*); #endif -GHOSTTY_EXPORT ghostty_inspector_t ghostty_surface_inspector(ghostty_surface_t); -GHOSTTY_EXPORT void ghostty_inspector_free(ghostty_surface_t); -GHOSTTY_EXPORT void ghostty_inspector_set_focus(ghostty_inspector_t, bool); -GHOSTTY_EXPORT void ghostty_inspector_set_content_scale(ghostty_inspector_t, double, double); -GHOSTTY_EXPORT void ghostty_inspector_set_size(ghostty_inspector_t, uint32_t, uint32_t); -GHOSTTY_EXPORT void ghostty_inspector_mouse_button(ghostty_inspector_t, +GHOSTTY_API ghostty_inspector_t ghostty_surface_inspector(ghostty_surface_t); +GHOSTTY_API void ghostty_inspector_free(ghostty_surface_t); +GHOSTTY_API void ghostty_inspector_set_focus(ghostty_inspector_t, bool); +GHOSTTY_API void ghostty_inspector_set_content_scale(ghostty_inspector_t, double, double); +GHOSTTY_API void ghostty_inspector_set_size(ghostty_inspector_t, uint32_t, uint32_t); +GHOSTTY_API void ghostty_inspector_mouse_button(ghostty_inspector_t, ghostty_input_mouse_state_e, ghostty_input_mouse_button_e, ghostty_input_mods_e); -GHOSTTY_EXPORT void ghostty_inspector_mouse_pos(ghostty_inspector_t, double, double); -GHOSTTY_EXPORT void ghostty_inspector_mouse_scroll(ghostty_inspector_t, +GHOSTTY_API void ghostty_inspector_mouse_pos(ghostty_inspector_t, double, double); +GHOSTTY_API void ghostty_inspector_mouse_scroll(ghostty_inspector_t, double, double, ghostty_input_scroll_mods_t); -GHOSTTY_EXPORT void ghostty_inspector_key(ghostty_inspector_t, +GHOSTTY_API void ghostty_inspector_key(ghostty_inspector_t, ghostty_input_action_e, ghostty_input_key_e, ghostty_input_mods_e); -GHOSTTY_EXPORT void ghostty_inspector_text(ghostty_inspector_t, const char*); +GHOSTTY_API void ghostty_inspector_text(ghostty_inspector_t, const char*); #ifdef __APPLE__ -GHOSTTY_EXPORT bool ghostty_inspector_metal_init(ghostty_inspector_t, void*); -GHOSTTY_EXPORT void ghostty_inspector_metal_render(ghostty_inspector_t, void*, void*); -GHOSTTY_EXPORT bool ghostty_inspector_metal_shutdown(ghostty_inspector_t); +GHOSTTY_API bool ghostty_inspector_metal_init(ghostty_inspector_t, void*); +GHOSTTY_API void ghostty_inspector_metal_render(ghostty_inspector_t, void*, void*); +GHOSTTY_API bool ghostty_inspector_metal_shutdown(ghostty_inspector_t); #endif // APIs I'd like to get rid of eventually but are still needed for now. // Don't use these unless you know what you're doing. -GHOSTTY_EXPORT void ghostty_set_window_background_blur(ghostty_app_t, void*); +GHOSTTY_API void ghostty_set_window_background_blur(ghostty_app_t, void*); // Benchmark API, if available. -GHOSTTY_EXPORT bool ghostty_benchmark_cli(const char*, const char*); +GHOSTTY_API bool ghostty_benchmark_cli(const char*, const char*); #ifdef __cplusplus } diff --git a/include/ghostty/vt/allocator.h b/include/ghostty/vt/allocator.h index 34b47a9c5..2e8685e84 100644 --- a/include/ghostty/vt/allocator.h +++ b/include/ghostty/vt/allocator.h @@ -223,7 +223,7 @@ typedef struct GhosttyAllocator { * * @ingroup allocator */ -GHOSTTY_EXPORT uint8_t* ghostty_alloc(const GhosttyAllocator* allocator, size_t len); +GHOSTTY_API uint8_t* ghostty_alloc(const GhosttyAllocator* allocator, size_t len); /** * Free memory that was allocated by a libghostty-vt function. @@ -248,7 +248,7 @@ GHOSTTY_EXPORT uint8_t* ghostty_alloc(const GhosttyAllocator* allocator, size_t * * @ingroup allocator */ -GHOSTTY_EXPORT void ghostty_free(const GhosttyAllocator* allocator, uint8_t* ptr, size_t len); +GHOSTTY_API void ghostty_free(const GhosttyAllocator* allocator, uint8_t* ptr, size_t len); /** @} */ diff --git a/include/ghostty/vt/build_info.h b/include/ghostty/vt/build_info.h index ad1c35fae..7f77a769b 100644 --- a/include/ghostty/vt/build_info.h +++ b/include/ghostty/vt/build_info.h @@ -129,7 +129,7 @@ typedef enum { * * @ingroup build_info */ -GHOSTTY_EXPORT GhosttyResult ghostty_build_info(GhosttyBuildInfo data, void *out); +GHOSTTY_API GhosttyResult ghostty_build_info(GhosttyBuildInfo data, void *out); #ifdef __cplusplus } diff --git a/include/ghostty/vt/color.h b/include/ghostty/vt/color.h index f5556573b..9dc21864e 100644 --- a/include/ghostty/vt/color.h +++ b/include/ghostty/vt/color.h @@ -85,7 +85,7 @@ typedef uint8_t GhosttyColorPaletteIndex; * * @ingroup sgr */ -GHOSTTY_EXPORT void ghostty_color_rgb_get(GhosttyColorRgb color, +GHOSTTY_API void ghostty_color_rgb_get(GhosttyColorRgb color, uint8_t* r, uint8_t* g, uint8_t* b); diff --git a/include/ghostty/vt/focus.h b/include/ghostty/vt/focus.h index 22b33dfc6..6e4c9502c 100644 --- a/include/ghostty/vt/focus.h +++ b/include/ghostty/vt/focus.h @@ -60,7 +60,7 @@ typedef enum { * @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_SPACE if the buffer * is too small */ -GHOSTTY_EXPORT GhosttyResult ghostty_focus_encode( +GHOSTTY_API GhosttyResult ghostty_focus_encode( GhosttyFocusEvent event, char* buf, size_t buf_len, diff --git a/include/ghostty/vt/formatter.h b/include/ghostty/vt/formatter.h index e361b34a8..81efdb27c 100644 --- a/include/ghostty/vt/formatter.h +++ b/include/ghostty/vt/formatter.h @@ -149,7 +149,7 @@ typedef struct { * * @ingroup formatter */ -GHOSTTY_EXPORT GhosttyResult ghostty_formatter_terminal_new( +GHOSTTY_API GhosttyResult ghostty_formatter_terminal_new( const GhosttyAllocator* allocator, GhosttyFormatter* formatter, GhosttyTerminal terminal, @@ -176,7 +176,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_formatter_terminal_new( * * @ingroup formatter */ -GHOSTTY_EXPORT GhosttyResult ghostty_formatter_format_buf(GhosttyFormatter formatter, +GHOSTTY_API GhosttyResult ghostty_formatter_format_buf(GhosttyFormatter formatter, uint8_t* buf, size_t buf_len, size_t* out_written); @@ -199,7 +199,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_formatter_format_buf(GhosttyFormatter forma * * @ingroup formatter */ -GHOSTTY_EXPORT GhosttyResult ghostty_formatter_format_alloc(GhosttyFormatter formatter, +GHOSTTY_API GhosttyResult ghostty_formatter_format_alloc(GhosttyFormatter formatter, const GhosttyAllocator* allocator, uint8_t** out_ptr, size_t* out_len); @@ -214,7 +214,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_formatter_format_alloc(GhosttyFormatter for * * @ingroup formatter */ -GHOSTTY_EXPORT void ghostty_formatter_free(GhosttyFormatter formatter); +GHOSTTY_API void ghostty_formatter_free(GhosttyFormatter formatter); /** @} */ diff --git a/include/ghostty/vt/grid_ref.h b/include/ghostty/vt/grid_ref.h index 4e9e7de2e..d3489ea73 100644 --- a/include/ghostty/vt/grid_ref.h +++ b/include/ghostty/vt/grid_ref.h @@ -66,7 +66,7 @@ typedef struct { * * @ingroup grid_ref */ -GHOSTTY_EXPORT GhosttyResult ghostty_grid_ref_cell(const GhosttyGridRef *ref, +GHOSTTY_API GhosttyResult ghostty_grid_ref_cell(const GhosttyGridRef *ref, GhosttyCell *out_cell); /** @@ -79,7 +79,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_grid_ref_cell(const GhosttyGridRef *ref, * * @ingroup grid_ref */ -GHOSTTY_EXPORT GhosttyResult ghostty_grid_ref_row(const GhosttyGridRef *ref, +GHOSTTY_API GhosttyResult ghostty_grid_ref_row(const GhosttyGridRef *ref, GhosttyRow *out_row); /** @@ -104,7 +104,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_grid_ref_row(const GhosttyGridRef *ref, * * @ingroup grid_ref */ -GHOSTTY_EXPORT GhosttyResult ghostty_grid_ref_graphemes(const GhosttyGridRef *ref, +GHOSTTY_API GhosttyResult ghostty_grid_ref_graphemes(const GhosttyGridRef *ref, uint32_t *buf, size_t buf_len, size_t *out_len); @@ -119,7 +119,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_grid_ref_graphemes(const GhosttyGridRef *re * * @ingroup grid_ref */ -GHOSTTY_EXPORT GhosttyResult ghostty_grid_ref_style(const GhosttyGridRef *ref, +GHOSTTY_API GhosttyResult ghostty_grid_ref_style(const GhosttyGridRef *ref, GhosttyStyle *out_style); /** @} */ diff --git a/include/ghostty/vt/key/encoder.h b/include/ghostty/vt/key/encoder.h index a53a05bd4..9d8282cec 100644 --- a/include/ghostty/vt/key/encoder.h +++ b/include/ghostty/vt/key/encoder.h @@ -119,7 +119,7 @@ typedef enum { * * @ingroup key */ -GHOSTTY_EXPORT GhosttyResult ghostty_key_encoder_new(const GhosttyAllocator *allocator, GhosttyKeyEncoder *encoder); +GHOSTTY_API GhosttyResult ghostty_key_encoder_new(const GhosttyAllocator *allocator, GhosttyKeyEncoder *encoder); /** * Free a key encoder instance. @@ -131,7 +131,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_key_encoder_new(const GhosttyAllocator *all * * @ingroup key */ -GHOSTTY_EXPORT void ghostty_key_encoder_free(GhosttyKeyEncoder encoder); +GHOSTTY_API void ghostty_key_encoder_free(GhosttyKeyEncoder encoder); /** * Set an option on the key encoder. @@ -154,7 +154,7 @@ GHOSTTY_EXPORT void ghostty_key_encoder_free(GhosttyKeyEncoder encoder); * * @ingroup key */ -GHOSTTY_EXPORT void ghostty_key_encoder_setopt(GhosttyKeyEncoder encoder, GhosttyKeyEncoderOption option, const void *value); +GHOSTTY_API void ghostty_key_encoder_setopt(GhosttyKeyEncoder encoder, GhosttyKeyEncoderOption option, const void *value); /** * Set encoder options from a terminal's current state. @@ -173,7 +173,7 @@ GHOSTTY_EXPORT void ghostty_key_encoder_setopt(GhosttyKeyEncoder encoder, Ghostt * * @ingroup key */ -GHOSTTY_EXPORT void ghostty_key_encoder_setopt_from_terminal(GhosttyKeyEncoder encoder, GhosttyTerminal terminal); +GHOSTTY_API void ghostty_key_encoder_setopt_from_terminal(GhosttyKeyEncoder encoder, GhosttyTerminal terminal); /** * Encode a key event into a terminal escape sequence. @@ -240,6 +240,6 @@ GHOSTTY_EXPORT void ghostty_key_encoder_setopt_from_terminal(GhosttyKeyEncoder e * * @ingroup key */ -GHOSTTY_EXPORT GhosttyResult ghostty_key_encoder_encode(GhosttyKeyEncoder encoder, GhosttyKeyEvent event, char *out_buf, size_t out_buf_size, size_t *out_len); +GHOSTTY_API GhosttyResult ghostty_key_encoder_encode(GhosttyKeyEncoder encoder, GhosttyKeyEvent event, char *out_buf, size_t out_buf_size, size_t *out_len); #endif /* GHOSTTY_VT_KEY_ENCODER_H */ diff --git a/include/ghostty/vt/key/event.h b/include/ghostty/vt/key/event.h index 5293f0e43..bcc9d8dec 100644 --- a/include/ghostty/vt/key/event.h +++ b/include/ghostty/vt/key/event.h @@ -310,7 +310,7 @@ typedef enum { * * @ingroup key */ -GHOSTTY_EXPORT GhosttyResult ghostty_key_event_new(const GhosttyAllocator *allocator, GhosttyKeyEvent *event); +GHOSTTY_API GhosttyResult ghostty_key_event_new(const GhosttyAllocator *allocator, GhosttyKeyEvent *event); /** * Free a key event instance. @@ -322,7 +322,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_key_event_new(const GhosttyAllocator *alloc * * @ingroup key */ -GHOSTTY_EXPORT void ghostty_key_event_free(GhosttyKeyEvent event); +GHOSTTY_API void ghostty_key_event_free(GhosttyKeyEvent event); /** * Set the key action (press, release, repeat). @@ -332,7 +332,7 @@ GHOSTTY_EXPORT void ghostty_key_event_free(GhosttyKeyEvent event); * * @ingroup key */ -GHOSTTY_EXPORT void ghostty_key_event_set_action(GhosttyKeyEvent event, GhosttyKeyAction action); +GHOSTTY_API void ghostty_key_event_set_action(GhosttyKeyEvent event, GhosttyKeyAction action); /** * Get the key action (press, release, repeat). @@ -342,7 +342,7 @@ GHOSTTY_EXPORT void ghostty_key_event_set_action(GhosttyKeyEvent event, GhosttyK * * @ingroup key */ -GHOSTTY_EXPORT GhosttyKeyAction ghostty_key_event_get_action(GhosttyKeyEvent event); +GHOSTTY_API GhosttyKeyAction ghostty_key_event_get_action(GhosttyKeyEvent event); /** * Set the physical key code. @@ -352,7 +352,7 @@ GHOSTTY_EXPORT GhosttyKeyAction ghostty_key_event_get_action(GhosttyKeyEvent eve * * @ingroup key */ -GHOSTTY_EXPORT void ghostty_key_event_set_key(GhosttyKeyEvent event, GhosttyKey key); +GHOSTTY_API void ghostty_key_event_set_key(GhosttyKeyEvent event, GhosttyKey key); /** * Get the physical key code. @@ -362,7 +362,7 @@ GHOSTTY_EXPORT void ghostty_key_event_set_key(GhosttyKeyEvent event, GhosttyKey * * @ingroup key */ -GHOSTTY_EXPORT GhosttyKey ghostty_key_event_get_key(GhosttyKeyEvent event); +GHOSTTY_API GhosttyKey ghostty_key_event_get_key(GhosttyKeyEvent event); /** * Set the modifier keys bitmask. @@ -372,7 +372,7 @@ GHOSTTY_EXPORT GhosttyKey ghostty_key_event_get_key(GhosttyKeyEvent event); * * @ingroup key */ -GHOSTTY_EXPORT void ghostty_key_event_set_mods(GhosttyKeyEvent event, GhosttyMods mods); +GHOSTTY_API void ghostty_key_event_set_mods(GhosttyKeyEvent event, GhosttyMods mods); /** * Get the modifier keys bitmask. @@ -382,7 +382,7 @@ GHOSTTY_EXPORT void ghostty_key_event_set_mods(GhosttyKeyEvent event, GhosttyMod * * @ingroup key */ -GHOSTTY_EXPORT GhosttyMods ghostty_key_event_get_mods(GhosttyKeyEvent event); +GHOSTTY_API GhosttyMods ghostty_key_event_get_mods(GhosttyKeyEvent event); /** * Set the consumed modifiers bitmask. @@ -392,7 +392,7 @@ GHOSTTY_EXPORT GhosttyMods ghostty_key_event_get_mods(GhosttyKeyEvent event); * * @ingroup key */ -GHOSTTY_EXPORT void ghostty_key_event_set_consumed_mods(GhosttyKeyEvent event, GhosttyMods consumed_mods); +GHOSTTY_API void ghostty_key_event_set_consumed_mods(GhosttyKeyEvent event, GhosttyMods consumed_mods); /** * Get the consumed modifiers bitmask. @@ -402,7 +402,7 @@ GHOSTTY_EXPORT void ghostty_key_event_set_consumed_mods(GhosttyKeyEvent event, G * * @ingroup key */ -GHOSTTY_EXPORT GhosttyMods ghostty_key_event_get_consumed_mods(GhosttyKeyEvent event); +GHOSTTY_API GhosttyMods ghostty_key_event_get_consumed_mods(GhosttyKeyEvent event); /** * Set whether the key event is part of a composition sequence. @@ -412,7 +412,7 @@ GHOSTTY_EXPORT GhosttyMods ghostty_key_event_get_consumed_mods(GhosttyKeyEvent e * * @ingroup key */ -GHOSTTY_EXPORT void ghostty_key_event_set_composing(GhosttyKeyEvent event, bool composing); +GHOSTTY_API void ghostty_key_event_set_composing(GhosttyKeyEvent event, bool composing); /** * Get whether the key event is part of a composition sequence. @@ -422,7 +422,7 @@ GHOSTTY_EXPORT void ghostty_key_event_set_composing(GhosttyKeyEvent event, bool * * @ingroup key */ -GHOSTTY_EXPORT bool ghostty_key_event_get_composing(GhosttyKeyEvent event); +GHOSTTY_API bool ghostty_key_event_get_composing(GhosttyKeyEvent event); /** * Set the UTF-8 text generated by the key for the current keyboard layout. @@ -442,7 +442,7 @@ GHOSTTY_EXPORT bool ghostty_key_event_get_composing(GhosttyKeyEvent event); * * @ingroup key */ -GHOSTTY_EXPORT void ghostty_key_event_set_utf8(GhosttyKeyEvent event, const char *utf8, size_t len); +GHOSTTY_API void ghostty_key_event_set_utf8(GhosttyKeyEvent event, const char *utf8, size_t len); /** * Get the UTF-8 text generated by the key event. @@ -455,7 +455,7 @@ GHOSTTY_EXPORT void ghostty_key_event_set_utf8(GhosttyKeyEvent event, const char * * @ingroup key */ -GHOSTTY_EXPORT const char *ghostty_key_event_get_utf8(GhosttyKeyEvent event, size_t *len); +GHOSTTY_API const char *ghostty_key_event_get_utf8(GhosttyKeyEvent event, size_t *len); /** * Set the unshifted Unicode codepoint. @@ -465,7 +465,7 @@ GHOSTTY_EXPORT const char *ghostty_key_event_get_utf8(GhosttyKeyEvent event, siz * * @ingroup key */ -GHOSTTY_EXPORT void ghostty_key_event_set_unshifted_codepoint(GhosttyKeyEvent event, uint32_t codepoint); +GHOSTTY_API void ghostty_key_event_set_unshifted_codepoint(GhosttyKeyEvent event, uint32_t codepoint); /** * Get the unshifted Unicode codepoint. @@ -475,6 +475,6 @@ GHOSTTY_EXPORT void ghostty_key_event_set_unshifted_codepoint(GhosttyKeyEvent ev * * @ingroup key */ -GHOSTTY_EXPORT uint32_t ghostty_key_event_get_unshifted_codepoint(GhosttyKeyEvent event); +GHOSTTY_API uint32_t ghostty_key_event_get_unshifted_codepoint(GhosttyKeyEvent event); #endif /* GHOSTTY_VT_KEY_EVENT_H */ diff --git a/include/ghostty/vt/modes.h b/include/ghostty/vt/modes.h index 2cbad324c..513aaf5a5 100644 --- a/include/ghostty/vt/modes.h +++ b/include/ghostty/vt/modes.h @@ -180,7 +180,7 @@ typedef enum { * @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_SPACE if the buffer * is too small */ -GHOSTTY_EXPORT GhosttyResult ghostty_mode_report_encode( +GHOSTTY_API GhosttyResult ghostty_mode_report_encode( GhosttyMode mode, GhosttyModeReportState state, char* buf, diff --git a/include/ghostty/vt/mouse/encoder.h b/include/ghostty/vt/mouse/encoder.h index 1547777c8..744b99303 100644 --- a/include/ghostty/vt/mouse/encoder.h +++ b/include/ghostty/vt/mouse/encoder.h @@ -131,7 +131,7 @@ typedef enum { * * @ingroup mouse */ -GHOSTTY_EXPORT GhosttyResult ghostty_mouse_encoder_new(const GhosttyAllocator *allocator, +GHOSTTY_API GhosttyResult ghostty_mouse_encoder_new(const GhosttyAllocator *allocator, GhosttyMouseEncoder *encoder); /** @@ -141,7 +141,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_mouse_encoder_new(const GhosttyAllocator *a * * @ingroup mouse */ -GHOSTTY_EXPORT void ghostty_mouse_encoder_free(GhosttyMouseEncoder encoder); +GHOSTTY_API void ghostty_mouse_encoder_free(GhosttyMouseEncoder encoder); /** * Set an option on the mouse encoder. @@ -154,7 +154,7 @@ GHOSTTY_EXPORT void ghostty_mouse_encoder_free(GhosttyMouseEncoder encoder); * * @ingroup mouse */ -GHOSTTY_EXPORT void ghostty_mouse_encoder_setopt(GhosttyMouseEncoder encoder, +GHOSTTY_API void ghostty_mouse_encoder_setopt(GhosttyMouseEncoder encoder, GhosttyMouseEncoderOption option, const void *value); @@ -169,7 +169,7 @@ GHOSTTY_EXPORT void ghostty_mouse_encoder_setopt(GhosttyMouseEncoder encoder, * * @ingroup mouse */ -GHOSTTY_EXPORT void ghostty_mouse_encoder_setopt_from_terminal(GhosttyMouseEncoder encoder, +GHOSTTY_API void ghostty_mouse_encoder_setopt_from_terminal(GhosttyMouseEncoder encoder, GhosttyTerminal terminal); /** @@ -181,7 +181,7 @@ GHOSTTY_EXPORT void ghostty_mouse_encoder_setopt_from_terminal(GhosttyMouseEncod * * @ingroup mouse */ -GHOSTTY_EXPORT void ghostty_mouse_encoder_reset(GhosttyMouseEncoder encoder); +GHOSTTY_API void ghostty_mouse_encoder_reset(GhosttyMouseEncoder encoder); /** * Encode a mouse event into a terminal escape sequence. @@ -202,7 +202,7 @@ GHOSTTY_EXPORT void ghostty_mouse_encoder_reset(GhosttyMouseEncoder encoder); * * @ingroup mouse */ -GHOSTTY_EXPORT GhosttyResult ghostty_mouse_encoder_encode(GhosttyMouseEncoder encoder, +GHOSTTY_API GhosttyResult ghostty_mouse_encoder_encode(GhosttyMouseEncoder encoder, GhosttyMouseEvent event, char *out_buf, size_t out_buf_size, diff --git a/include/ghostty/vt/mouse/event.h b/include/ghostty/vt/mouse/event.h index fb140e0e7..5b72735fc 100644 --- a/include/ghostty/vt/mouse/event.h +++ b/include/ghostty/vt/mouse/event.h @@ -77,7 +77,7 @@ typedef struct { * * @ingroup mouse */ -GHOSTTY_EXPORT GhosttyResult ghostty_mouse_event_new(const GhosttyAllocator *allocator, +GHOSTTY_API GhosttyResult ghostty_mouse_event_new(const GhosttyAllocator *allocator, GhosttyMouseEvent *event); /** @@ -87,7 +87,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_mouse_event_new(const GhosttyAllocator *all * * @ingroup mouse */ -GHOSTTY_EXPORT void ghostty_mouse_event_free(GhosttyMouseEvent event); +GHOSTTY_API void ghostty_mouse_event_free(GhosttyMouseEvent event); /** * Set the event action. @@ -97,7 +97,7 @@ GHOSTTY_EXPORT void ghostty_mouse_event_free(GhosttyMouseEvent event); * * @ingroup mouse */ -GHOSTTY_EXPORT void ghostty_mouse_event_set_action(GhosttyMouseEvent event, +GHOSTTY_API void ghostty_mouse_event_set_action(GhosttyMouseEvent event, GhosttyMouseAction action); /** @@ -108,7 +108,7 @@ GHOSTTY_EXPORT void ghostty_mouse_event_set_action(GhosttyMouseEvent event, * * @ingroup mouse */ -GHOSTTY_EXPORT GhosttyMouseAction ghostty_mouse_event_get_action(GhosttyMouseEvent event); +GHOSTTY_API GhosttyMouseAction ghostty_mouse_event_get_action(GhosttyMouseEvent event); /** * Set the event button. @@ -122,7 +122,7 @@ GHOSTTY_EXPORT GhosttyMouseAction ghostty_mouse_event_get_action(GhosttyMouseEve * * @ingroup mouse */ -GHOSTTY_EXPORT void ghostty_mouse_event_set_button(GhosttyMouseEvent event, +GHOSTTY_API void ghostty_mouse_event_set_button(GhosttyMouseEvent event, GhosttyMouseButton button); /** @@ -134,7 +134,7 @@ GHOSTTY_EXPORT void ghostty_mouse_event_set_button(GhosttyMouseEvent event, * * @ingroup mouse */ -GHOSTTY_EXPORT void ghostty_mouse_event_clear_button(GhosttyMouseEvent event); +GHOSTTY_API void ghostty_mouse_event_clear_button(GhosttyMouseEvent event); /** * Get the event button. @@ -145,7 +145,7 @@ GHOSTTY_EXPORT void ghostty_mouse_event_clear_button(GhosttyMouseEvent event); * * @ingroup mouse */ -GHOSTTY_EXPORT bool ghostty_mouse_event_get_button(GhosttyMouseEvent event, +GHOSTTY_API bool ghostty_mouse_event_get_button(GhosttyMouseEvent event, GhosttyMouseButton *out_button); /** @@ -156,7 +156,7 @@ GHOSTTY_EXPORT bool ghostty_mouse_event_get_button(GhosttyMouseEvent event, * * @ingroup mouse */ -GHOSTTY_EXPORT void ghostty_mouse_event_set_mods(GhosttyMouseEvent event, +GHOSTTY_API void ghostty_mouse_event_set_mods(GhosttyMouseEvent event, GhosttyMods mods); /** @@ -167,7 +167,7 @@ GHOSTTY_EXPORT void ghostty_mouse_event_set_mods(GhosttyMouseEvent event, * * @ingroup mouse */ -GHOSTTY_EXPORT GhosttyMods ghostty_mouse_event_get_mods(GhosttyMouseEvent event); +GHOSTTY_API GhosttyMods ghostty_mouse_event_get_mods(GhosttyMouseEvent event); /** * Set the event position in surface-space pixels. @@ -177,7 +177,7 @@ GHOSTTY_EXPORT GhosttyMods ghostty_mouse_event_get_mods(GhosttyMouseEvent event) * * @ingroup mouse */ -GHOSTTY_EXPORT void ghostty_mouse_event_set_position(GhosttyMouseEvent event, +GHOSTTY_API void ghostty_mouse_event_set_position(GhosttyMouseEvent event, GhosttyMousePosition position); /** @@ -188,6 +188,6 @@ GHOSTTY_EXPORT void ghostty_mouse_event_set_position(GhosttyMouseEvent event, * * @ingroup mouse */ -GHOSTTY_EXPORT GhosttyMousePosition ghostty_mouse_event_get_position(GhosttyMouseEvent event); +GHOSTTY_API GhosttyMousePosition ghostty_mouse_event_get_position(GhosttyMouseEvent event); #endif /* GHOSTTY_VT_MOUSE_EVENT_H */ diff --git a/include/ghostty/vt/osc.h b/include/ghostty/vt/osc.h index f248d59e3..c86498090 100644 --- a/include/ghostty/vt/osc.h +++ b/include/ghostty/vt/osc.h @@ -123,7 +123,7 @@ typedef enum { * * @ingroup osc */ -GHOSTTY_EXPORT GhosttyResult ghostty_osc_new(const GhosttyAllocator *allocator, GhosttyOscParser *parser); +GHOSTTY_API GhosttyResult ghostty_osc_new(const GhosttyAllocator *allocator, GhosttyOscParser *parser); /** * Free an OSC parser instance. @@ -135,7 +135,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_osc_new(const GhosttyAllocator *allocator, * * @ingroup osc */ -GHOSTTY_EXPORT void ghostty_osc_free(GhosttyOscParser parser); +GHOSTTY_API void ghostty_osc_free(GhosttyOscParser parser); /** * Reset an OSC parser instance to its initial state. @@ -148,7 +148,7 @@ GHOSTTY_EXPORT void ghostty_osc_free(GhosttyOscParser parser); * * @ingroup osc */ -GHOSTTY_EXPORT void ghostty_osc_reset(GhosttyOscParser parser); +GHOSTTY_API void ghostty_osc_reset(GhosttyOscParser parser); /** * Parse the next byte in an OSC sequence. @@ -165,7 +165,7 @@ GHOSTTY_EXPORT void ghostty_osc_reset(GhosttyOscParser parser); * * @ingroup osc */ -GHOSTTY_EXPORT void ghostty_osc_next(GhosttyOscParser parser, uint8_t byte); +GHOSTTY_API void ghostty_osc_next(GhosttyOscParser parser, uint8_t byte); /** * Finalize OSC parsing and retrieve the parsed command. @@ -195,7 +195,7 @@ GHOSTTY_EXPORT void ghostty_osc_next(GhosttyOscParser parser, uint8_t byte); * * @ingroup osc */ -GHOSTTY_EXPORT GhosttyOscCommand ghostty_osc_end(GhosttyOscParser parser, uint8_t terminator); +GHOSTTY_API GhosttyOscCommand ghostty_osc_end(GhosttyOscParser parser, uint8_t terminator); /** * Get the type of an OSC command. @@ -209,7 +209,7 @@ GHOSTTY_EXPORT GhosttyOscCommand ghostty_osc_end(GhosttyOscParser parser, uint8_ * * @ingroup osc */ -GHOSTTY_EXPORT GhosttyOscCommandType ghostty_osc_command_type(GhosttyOscCommand command); +GHOSTTY_API GhosttyOscCommandType ghostty_osc_command_type(GhosttyOscCommand command); /** * Extract data from an OSC command. @@ -226,7 +226,7 @@ GHOSTTY_EXPORT GhosttyOscCommandType ghostty_osc_command_type(GhosttyOscCommand * * @ingroup osc */ -GHOSTTY_EXPORT bool ghostty_osc_command_data(GhosttyOscCommand command, GhosttyOscCommandData data, void *out); +GHOSTTY_API bool ghostty_osc_command_data(GhosttyOscCommand command, GhosttyOscCommandData data, void *out); /** @} */ diff --git a/include/ghostty/vt/paste.h b/include/ghostty/vt/paste.h index 488be4c2a..b3df5be4e 100644 --- a/include/ghostty/vt/paste.h +++ b/include/ghostty/vt/paste.h @@ -55,7 +55,7 @@ extern "C" { * @param len The length of the data in bytes * @return true if the data is safe to paste, false otherwise */ -GHOSTTY_EXPORT bool ghostty_paste_is_safe(const char* data, size_t len); +GHOSTTY_API bool ghostty_paste_is_safe(const char* data, size_t len); /** * Encode paste data for writing to the terminal pty. @@ -84,7 +84,7 @@ GHOSTTY_EXPORT bool ghostty_paste_is_safe(const char* data, size_t len); * @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_SPACE if the buffer * is too small */ -GHOSTTY_EXPORT GhosttyResult ghostty_paste_encode( +GHOSTTY_API GhosttyResult ghostty_paste_encode( char* data, size_t data_len, bool bracketed, diff --git a/include/ghostty/vt/render.h b/include/ghostty/vt/render.h index 83bab1439..163a4e1d4 100644 --- a/include/ghostty/vt/render.h +++ b/include/ghostty/vt/render.h @@ -299,7 +299,7 @@ typedef struct { * * @ingroup render */ -GHOSTTY_EXPORT GhosttyResult ghostty_render_state_new(const GhosttyAllocator* allocator, +GHOSTTY_API GhosttyResult ghostty_render_state_new(const GhosttyAllocator* allocator, GhosttyRenderState* state); /** @@ -312,7 +312,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_render_state_new(const GhosttyAllocator* al * * @ingroup render */ -GHOSTTY_EXPORT void ghostty_render_state_free(GhosttyRenderState state); +GHOSTTY_API void ghostty_render_state_free(GhosttyRenderState state); /** * Update a render state instance from a terminal. @@ -328,7 +328,7 @@ GHOSTTY_EXPORT void ghostty_render_state_free(GhosttyRenderState state); * * @ingroup render */ -GHOSTTY_EXPORT GhosttyResult ghostty_render_state_update(GhosttyRenderState state, +GHOSTTY_API GhosttyResult ghostty_render_state_update(GhosttyRenderState state, GhosttyTerminal terminal); /** @@ -345,7 +345,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_render_state_update(GhosttyRenderState stat * * @ingroup render */ -GHOSTTY_EXPORT GhosttyResult ghostty_render_state_get(GhosttyRenderState state, +GHOSTTY_API GhosttyResult ghostty_render_state_get(GhosttyRenderState state, GhosttyRenderStateData data, void* out); @@ -364,7 +364,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_render_state_get(GhosttyRenderState state, * * @ingroup render */ -GHOSTTY_EXPORT GhosttyResult ghostty_render_state_set(GhosttyRenderState state, +GHOSTTY_API GhosttyResult ghostty_render_state_set(GhosttyRenderState state, GhosttyRenderStateOption option, const void* value); @@ -383,7 +383,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_render_state_set(GhosttyRenderState state, * * @ingroup render */ -GHOSTTY_EXPORT GhosttyResult ghostty_render_state_colors_get(GhosttyRenderState state, +GHOSTTY_API GhosttyResult ghostty_render_state_colors_get(GhosttyRenderState state, GhosttyRenderStateColors* out_colors); /** @@ -400,7 +400,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_render_state_colors_get(GhosttyRenderState * * @ingroup render */ -GHOSTTY_EXPORT GhosttyResult ghostty_render_state_row_iterator_new( +GHOSTTY_API GhosttyResult ghostty_render_state_row_iterator_new( const GhosttyAllocator* allocator, GhosttyRenderStateRowIterator* out_iterator); @@ -411,7 +411,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_render_state_row_iterator_new( * * @ingroup render */ -GHOSTTY_EXPORT void ghostty_render_state_row_iterator_free(GhosttyRenderStateRowIterator iterator); +GHOSTTY_API void ghostty_render_state_row_iterator_free(GhosttyRenderStateRowIterator iterator); /** * Move a render-state row iterator to the next row. @@ -425,7 +425,7 @@ GHOSTTY_EXPORT void ghostty_render_state_row_iterator_free(GhosttyRenderStateRow * * @ingroup render */ -GHOSTTY_EXPORT bool ghostty_render_state_row_iterator_next(GhosttyRenderStateRowIterator iterator); +GHOSTTY_API bool ghostty_render_state_row_iterator_next(GhosttyRenderStateRowIterator iterator); /** * Get a value from the current row in a render-state row iterator. @@ -443,7 +443,7 @@ GHOSTTY_EXPORT bool ghostty_render_state_row_iterator_next(GhosttyRenderStateRow * * @ingroup render */ -GHOSTTY_EXPORT GhosttyResult ghostty_render_state_row_get( +GHOSTTY_API GhosttyResult ghostty_render_state_row_get( GhosttyRenderStateRowIterator iterator, GhosttyRenderStateRowData data, void* out); @@ -465,7 +465,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_render_state_row_get( * * @ingroup render */ -GHOSTTY_EXPORT GhosttyResult ghostty_render_state_row_set( +GHOSTTY_API GhosttyResult ghostty_render_state_row_set( GhosttyRenderStateRowIterator iterator, GhosttyRenderStateRowOption option, const void* value); @@ -487,7 +487,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_render_state_row_set( * * @ingroup render */ -GHOSTTY_EXPORT GhosttyResult ghostty_render_state_row_cells_new( +GHOSTTY_API GhosttyResult ghostty_render_state_row_cells_new( const GhosttyAllocator* allocator, GhosttyRenderStateRowCells* out_cells); @@ -544,7 +544,7 @@ typedef enum { * * @ingroup render */ -GHOSTTY_EXPORT bool ghostty_render_state_row_cells_next(GhosttyRenderStateRowCells cells); +GHOSTTY_API bool ghostty_render_state_row_cells_next(GhosttyRenderStateRowCells cells); /** * Move a render-state row cells iterator to a specific column. @@ -560,7 +560,7 @@ GHOSTTY_EXPORT bool ghostty_render_state_row_cells_next(GhosttyRenderStateRowCel * * @ingroup render */ -GHOSTTY_EXPORT GhosttyResult ghostty_render_state_row_cells_select( +GHOSTTY_API GhosttyResult ghostty_render_state_row_cells_select( GhosttyRenderStateRowCells cells, uint16_t x); /** @@ -580,7 +580,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_render_state_row_cells_select( * * @ingroup render */ -GHOSTTY_EXPORT GhosttyResult ghostty_render_state_row_cells_get( +GHOSTTY_API GhosttyResult ghostty_render_state_row_cells_get( GhosttyRenderStateRowCells cells, GhosttyRenderStateRowCellsData data, void* out); @@ -592,7 +592,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_render_state_row_cells_get( * * @ingroup render */ -GHOSTTY_EXPORT void ghostty_render_state_row_cells_free(GhosttyRenderStateRowCells cells); +GHOSTTY_API void ghostty_render_state_row_cells_free(GhosttyRenderStateRowCells cells); /** @} */ diff --git a/include/ghostty/vt/screen.h b/include/ghostty/vt/screen.h index eed0de222..89b4825fe 100644 --- a/include/ghostty/vt/screen.h +++ b/include/ghostty/vt/screen.h @@ -307,7 +307,7 @@ typedef enum { * * @ingroup screen */ -GHOSTTY_EXPORT GhosttyResult ghostty_cell_get(GhosttyCell cell, +GHOSTTY_API GhosttyResult ghostty_cell_get(GhosttyCell cell, GhosttyCellData data, void *out); @@ -327,7 +327,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_cell_get(GhosttyCell cell, * * @ingroup screen */ -GHOSTTY_EXPORT GhosttyResult ghostty_row_get(GhosttyRow row, +GHOSTTY_API GhosttyResult ghostty_row_get(GhosttyRow row, GhosttyRowData data, void *out); diff --git a/include/ghostty/vt/sgr.h b/include/ghostty/vt/sgr.h index 40c7efd6d..01ea3a359 100644 --- a/include/ghostty/vt/sgr.h +++ b/include/ghostty/vt/sgr.h @@ -184,7 +184,7 @@ typedef struct { * * @ingroup sgr */ -GHOSTTY_EXPORT GhosttyResult ghostty_sgr_new(const GhosttyAllocator* allocator, +GHOSTTY_API GhosttyResult ghostty_sgr_new(const GhosttyAllocator* allocator, GhosttySgrParser* parser); /** @@ -198,7 +198,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_sgr_new(const GhosttyAllocator* allocator, * * @ingroup sgr */ -GHOSTTY_EXPORT void ghostty_sgr_free(GhosttySgrParser parser); +GHOSTTY_API void ghostty_sgr_free(GhosttySgrParser parser); /** * Reset an SGR parser instance to the beginning of the parameter list. @@ -211,7 +211,7 @@ GHOSTTY_EXPORT void ghostty_sgr_free(GhosttySgrParser parser); * * @ingroup sgr */ -GHOSTTY_EXPORT void ghostty_sgr_reset(GhosttySgrParser parser); +GHOSTTY_API void ghostty_sgr_reset(GhosttySgrParser parser); /** * Set SGR parameters for parsing. @@ -243,7 +243,7 @@ GHOSTTY_EXPORT void ghostty_sgr_reset(GhosttySgrParser parser); * * @ingroup sgr */ -GHOSTTY_EXPORT GhosttyResult ghostty_sgr_set_params(GhosttySgrParser parser, +GHOSTTY_API GhosttyResult ghostty_sgr_set_params(GhosttySgrParser parser, const uint16_t* params, const char* separators, size_t len); @@ -261,7 +261,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_sgr_set_params(GhosttySgrParser parser, * * @ingroup sgr */ -GHOSTTY_EXPORT bool ghostty_sgr_next(GhosttySgrParser parser, GhosttySgrAttribute* attr); +GHOSTTY_API bool ghostty_sgr_next(GhosttySgrParser parser, GhosttySgrAttribute* attr); /** * Get the full parameter list from an unknown SGR attribute. @@ -276,7 +276,7 @@ GHOSTTY_EXPORT bool ghostty_sgr_next(GhosttySgrParser parser, GhosttySgrAttribut * * @ingroup sgr */ -GHOSTTY_EXPORT size_t ghostty_sgr_unknown_full(GhosttySgrUnknown unknown, +GHOSTTY_API size_t ghostty_sgr_unknown_full(GhosttySgrUnknown unknown, const uint16_t** ptr); /** @@ -292,7 +292,7 @@ GHOSTTY_EXPORT size_t ghostty_sgr_unknown_full(GhosttySgrUnknown unknown, * * @ingroup sgr */ -GHOSTTY_EXPORT size_t ghostty_sgr_unknown_partial(GhosttySgrUnknown unknown, +GHOSTTY_API size_t ghostty_sgr_unknown_partial(GhosttySgrUnknown unknown, const uint16_t** ptr); /** @@ -307,7 +307,7 @@ GHOSTTY_EXPORT size_t ghostty_sgr_unknown_partial(GhosttySgrUnknown unknown, * * @ingroup sgr */ -GHOSTTY_EXPORT GhosttySgrAttributeTag ghostty_sgr_attribute_tag(GhosttySgrAttribute attr); +GHOSTTY_API GhosttySgrAttributeTag ghostty_sgr_attribute_tag(GhosttySgrAttribute attr); /** * Get the value from an SGR attribute. @@ -321,7 +321,7 @@ GHOSTTY_EXPORT GhosttySgrAttributeTag ghostty_sgr_attribute_tag(GhosttySgrAttrib * * @ingroup sgr */ -GHOSTTY_EXPORT GhosttySgrAttributeValue* ghostty_sgr_attribute_value( +GHOSTTY_API GhosttySgrAttributeValue* ghostty_sgr_attribute_value( GhosttySgrAttribute* attr); #ifdef __wasm__ @@ -335,7 +335,7 @@ GHOSTTY_EXPORT GhosttySgrAttributeValue* ghostty_sgr_attribute_value( * * @ingroup wasm */ -GHOSTTY_EXPORT GhosttySgrAttribute* ghostty_wasm_alloc_sgr_attribute(void); +GHOSTTY_API GhosttySgrAttribute* ghostty_wasm_alloc_sgr_attribute(void); /** * Free memory for an SGR attribute (WebAssembly only). @@ -346,7 +346,7 @@ GHOSTTY_EXPORT GhosttySgrAttribute* ghostty_wasm_alloc_sgr_attribute(void); * * @ingroup wasm */ -GHOSTTY_EXPORT void ghostty_wasm_free_sgr_attribute(GhosttySgrAttribute* attr); +GHOSTTY_API void ghostty_wasm_free_sgr_attribute(GhosttySgrAttribute* attr); #endif #ifdef __cplusplus diff --git a/include/ghostty/vt/size_report.h b/include/ghostty/vt/size_report.h index cf18b2418..98c67c5ed 100644 --- a/include/ghostty/vt/size_report.h +++ b/include/ghostty/vt/size_report.h @@ -84,7 +84,7 @@ typedef struct { * @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_SPACE if the buffer * is too small */ -GHOSTTY_EXPORT GhosttyResult ghostty_size_report_encode( +GHOSTTY_API GhosttyResult ghostty_size_report_encode( GhosttySizeReportStyle style, GhosttySizeReportSize size, char* buf, diff --git a/include/ghostty/vt/style.h b/include/ghostty/vt/style.h index 86a177178..ac0495600 100644 --- a/include/ghostty/vt/style.h +++ b/include/ghostty/vt/style.h @@ -115,7 +115,7 @@ typedef struct { * * @ingroup style */ -GHOSTTY_EXPORT void ghostty_style_default(GhosttyStyle* style); +GHOSTTY_API void ghostty_style_default(GhosttyStyle* style); /** * Check if a style is the default style. @@ -127,7 +127,7 @@ GHOSTTY_EXPORT void ghostty_style_default(GhosttyStyle* style); * * @ingroup style */ -GHOSTTY_EXPORT bool ghostty_style_is_default(const GhosttyStyle* style); +GHOSTTY_API bool ghostty_style_is_default(const GhosttyStyle* style); #ifdef __cplusplus } diff --git a/include/ghostty/vt/terminal.h b/include/ghostty/vt/terminal.h index f7670741a..b43e37cf4 100644 --- a/include/ghostty/vt/terminal.h +++ b/include/ghostty/vt/terminal.h @@ -768,7 +768,7 @@ typedef enum { * * @ingroup terminal */ -GHOSTTY_EXPORT GhosttyResult ghostty_terminal_new(const GhosttyAllocator* allocator, +GHOSTTY_API GhosttyResult ghostty_terminal_new(const GhosttyAllocator* allocator, GhosttyTerminal* terminal, GhosttyTerminalOptions options); @@ -782,7 +782,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_terminal_new(const GhosttyAllocator* alloca * * @ingroup terminal */ -GHOSTTY_EXPORT void ghostty_terminal_free(GhosttyTerminal terminal); +GHOSTTY_API void ghostty_terminal_free(GhosttyTerminal terminal); /** * Perform a full reset of the terminal (RIS). @@ -795,7 +795,7 @@ GHOSTTY_EXPORT void ghostty_terminal_free(GhosttyTerminal terminal); * * @ingroup terminal */ -GHOSTTY_EXPORT void ghostty_terminal_reset(GhosttyTerminal terminal); +GHOSTTY_API void ghostty_terminal_reset(GhosttyTerminal terminal); /** * Resize the terminal to the given dimensions. @@ -818,7 +818,7 @@ GHOSTTY_EXPORT void ghostty_terminal_reset(GhosttyTerminal terminal); * * @ingroup terminal */ -GHOSTTY_EXPORT GhosttyResult ghostty_terminal_resize(GhosttyTerminal terminal, +GHOSTTY_API GhosttyResult ghostty_terminal_resize(GhosttyTerminal terminal, uint16_t cols, uint16_t rows, uint32_t cell_width_px, @@ -844,7 +844,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_terminal_resize(GhosttyTerminal terminal, * * @ingroup terminal */ -GHOSTTY_EXPORT GhosttyResult ghostty_terminal_set(GhosttyTerminal terminal, +GHOSTTY_API GhosttyResult ghostty_terminal_set(GhosttyTerminal terminal, GhosttyTerminalOption option, const void* value); @@ -869,7 +869,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_terminal_set(GhosttyTerminal terminal, * * @ingroup terminal */ -GHOSTTY_EXPORT void ghostty_terminal_vt_write(GhosttyTerminal terminal, +GHOSTTY_API void ghostty_terminal_vt_write(GhosttyTerminal terminal, const uint8_t* data, size_t len); @@ -886,7 +886,7 @@ GHOSTTY_EXPORT void ghostty_terminal_vt_write(GhosttyTerminal terminal, * * @ingroup terminal */ -GHOSTTY_EXPORT void ghostty_terminal_scroll_viewport(GhosttyTerminal terminal, +GHOSTTY_API void ghostty_terminal_scroll_viewport(GhosttyTerminal terminal, GhosttyTerminalScrollViewport behavior); /** @@ -903,7 +903,7 @@ GHOSTTY_EXPORT void ghostty_terminal_scroll_viewport(GhosttyTerminal terminal, * * @ingroup terminal */ -GHOSTTY_EXPORT GhosttyResult ghostty_terminal_mode_get(GhosttyTerminal terminal, +GHOSTTY_API GhosttyResult ghostty_terminal_mode_get(GhosttyTerminal terminal, GhosttyMode mode, bool* out_value); @@ -920,7 +920,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_terminal_mode_get(GhosttyTerminal terminal, * * @ingroup terminal */ -GHOSTTY_EXPORT GhosttyResult ghostty_terminal_mode_set(GhosttyTerminal terminal, +GHOSTTY_API GhosttyResult ghostty_terminal_mode_set(GhosttyTerminal terminal, GhosttyMode mode, bool value); @@ -940,7 +940,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_terminal_mode_set(GhosttyTerminal terminal, * * @ingroup terminal */ -GHOSTTY_EXPORT GhosttyResult ghostty_terminal_get(GhosttyTerminal terminal, +GHOSTTY_API GhosttyResult ghostty_terminal_get(GhosttyTerminal terminal, GhosttyTerminalData data, void *out); @@ -970,7 +970,7 @@ GHOSTTY_EXPORT GhosttyResult ghostty_terminal_get(GhosttyTerminal terminal, * * @ingroup terminal */ -GHOSTTY_EXPORT GhosttyResult ghostty_terminal_grid_ref(GhosttyTerminal terminal, +GHOSTTY_API GhosttyResult ghostty_terminal_grid_ref(GhosttyTerminal terminal, GhosttyPoint point, GhosttyGridRef *out_ref); diff --git a/include/ghostty/vt/types.h b/include/ghostty/vt/types.h index 4b4d87e7a..8f0be7760 100644 --- a/include/ghostty/vt/types.h +++ b/include/ghostty/vt/types.h @@ -16,19 +16,19 @@ // visibility so they remain accessible when the library is built with // -fvisibility=hidden. For static library builds, define GHOSTTY_STATIC // before including this header to make this a no-op. -#ifndef GHOSTTY_EXPORT +#ifndef GHOSTTY_API #if defined(GHOSTTY_STATIC) - #define GHOSTTY_EXPORT + #define GHOSTTY_API #elif defined(_WIN32) || defined(_WIN64) #ifdef GHOSTTY_BUILD_SHARED - #define GHOSTTY_EXPORT __declspec(dllexport) + #define GHOSTTY_API __declspec(dllexport) #else - #define GHOSTTY_EXPORT __declspec(dllimport) + #define GHOSTTY_API __declspec(dllimport) #endif #elif defined(__GNUC__) && __GNUC__ >= 4 - #define GHOSTTY_EXPORT __attribute__((visibility("default"))) + #define GHOSTTY_API __attribute__((visibility("default"))) #else - #define GHOSTTY_EXPORT + #define GHOSTTY_API #endif #endif @@ -116,6 +116,6 @@ typedef struct { * * @return Pointer to the null-terminated JSON string. */ -GHOSTTY_EXPORT const char *ghostty_type_json(void); +GHOSTTY_API const char *ghostty_type_json(void); #endif /* GHOSTTY_VT_TYPES_H */ diff --git a/include/ghostty/vt/wasm.h b/include/ghostty/vt/wasm.h index b7e1f3f62..e2b63e2c6 100644 --- a/include/ghostty/vt/wasm.h +++ b/include/ghostty/vt/wasm.h @@ -75,7 +75,7 @@ * @return Pointer to allocated opaque pointer, or NULL if allocation failed * @ingroup wasm */ -GHOSTTY_EXPORT void** ghostty_wasm_alloc_opaque(void); +GHOSTTY_API void** ghostty_wasm_alloc_opaque(void); /** * Free an opaque pointer allocated by ghostty_wasm_alloc_opaque(). @@ -83,7 +83,7 @@ GHOSTTY_EXPORT void** ghostty_wasm_alloc_opaque(void); * @param ptr Pointer to free, or NULL (NULL is safely ignored) * @ingroup wasm */ -GHOSTTY_EXPORT void ghostty_wasm_free_opaque(void **ptr); +GHOSTTY_API void ghostty_wasm_free_opaque(void **ptr); /** * Allocate an array of uint8_t values. @@ -92,7 +92,7 @@ GHOSTTY_EXPORT void ghostty_wasm_free_opaque(void **ptr); * @return Pointer to allocated array, or NULL if allocation failed * @ingroup wasm */ -GHOSTTY_EXPORT uint8_t* ghostty_wasm_alloc_u8_array(size_t len); +GHOSTTY_API uint8_t* ghostty_wasm_alloc_u8_array(size_t len); /** * Free an array allocated by ghostty_wasm_alloc_u8_array(). @@ -101,7 +101,7 @@ GHOSTTY_EXPORT uint8_t* ghostty_wasm_alloc_u8_array(size_t len); * @param len Length of the array (must match the length passed to alloc) * @ingroup wasm */ -GHOSTTY_EXPORT void ghostty_wasm_free_u8_array(uint8_t *ptr, size_t len); +GHOSTTY_API void ghostty_wasm_free_u8_array(uint8_t *ptr, size_t len); /** * Allocate an array of uint16_t values. @@ -110,7 +110,7 @@ GHOSTTY_EXPORT void ghostty_wasm_free_u8_array(uint8_t *ptr, size_t len); * @return Pointer to allocated array, or NULL if allocation failed * @ingroup wasm */ -GHOSTTY_EXPORT uint16_t* ghostty_wasm_alloc_u16_array(size_t len); +GHOSTTY_API uint16_t* ghostty_wasm_alloc_u16_array(size_t len); /** * Free an array allocated by ghostty_wasm_alloc_u16_array(). @@ -119,7 +119,7 @@ GHOSTTY_EXPORT uint16_t* ghostty_wasm_alloc_u16_array(size_t len); * @param len Length of the array (must match the length passed to alloc) * @ingroup wasm */ -GHOSTTY_EXPORT void ghostty_wasm_free_u16_array(uint16_t *ptr, size_t len); +GHOSTTY_API void ghostty_wasm_free_u16_array(uint16_t *ptr, size_t len); /** * Allocate a single uint8_t value. @@ -127,7 +127,7 @@ GHOSTTY_EXPORT void ghostty_wasm_free_u16_array(uint16_t *ptr, size_t len); * @return Pointer to allocated uint8_t, or NULL if allocation failed * @ingroup wasm */ -GHOSTTY_EXPORT uint8_t* ghostty_wasm_alloc_u8(void); +GHOSTTY_API uint8_t* ghostty_wasm_alloc_u8(void); /** * Free a uint8_t allocated by ghostty_wasm_alloc_u8(). @@ -135,7 +135,7 @@ GHOSTTY_EXPORT uint8_t* ghostty_wasm_alloc_u8(void); * @param ptr Pointer to free, or NULL (NULL is safely ignored) * @ingroup wasm */ -GHOSTTY_EXPORT void ghostty_wasm_free_u8(uint8_t *ptr); +GHOSTTY_API void ghostty_wasm_free_u8(uint8_t *ptr); /** * Allocate a single size_t value. @@ -143,7 +143,7 @@ GHOSTTY_EXPORT void ghostty_wasm_free_u8(uint8_t *ptr); * @return Pointer to allocated size_t, or NULL if allocation failed * @ingroup wasm */ -GHOSTTY_EXPORT size_t* ghostty_wasm_alloc_usize(void); +GHOSTTY_API size_t* ghostty_wasm_alloc_usize(void); /** * Free a size_t allocated by ghostty_wasm_alloc_usize(). @@ -151,7 +151,7 @@ GHOSTTY_EXPORT size_t* ghostty_wasm_alloc_usize(void); * @param ptr Pointer to free, or NULL (NULL is safely ignored) * @ingroup wasm */ -GHOSTTY_EXPORT void ghostty_wasm_free_usize(size_t *ptr); +GHOSTTY_API void ghostty_wasm_free_usize(size_t *ptr); /** @} */