c api: add ghostty_info to get metadata about the build

This commit is contained in:
Mitchell Hashimoto
2023-09-15 12:32:41 -07:00
parent 0ac1010d5a
commit de0f71c6a1
2 changed files with 42 additions and 0 deletions

View File

@@ -284,9 +284,22 @@ typedef struct {
bool physical;
} ghostty_input_trigger_s;
typedef enum {
GHOSTTY_BUILD_MODE_DEBUG,
GHOSTTY_BUILD_MODE_RELEASE_SAFE,
GHOSTTY_BUILD_MODE_RELEASE_FAST,
GHOSTTY_BUILD_MODE_RELEASE_SMALL,
} ghostty_build_mode_e;
// Fully defined types. This MUST be kept in sync with equivalent Zig
// structs. To find the Zig struct, grep for this type name. The documentation
// for all of these types is available in the Zig source.
typedef struct {
ghostty_build_mode_e build_mode;
const char *version;
uintptr_t version_len;
} ghostty_info_s;
typedef struct {
const char *message;
} ghostty_error_s;
@@ -338,6 +351,7 @@ typedef struct {
// Published API
int ghostty_init(void);
ghostty_info_s ghostty_info(void);
ghostty_config_t ghostty_config_new();
void ghostty_config_free(ghostty_config_t);