mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-07-28 11:36:34 +00:00
config: add C API ghostty_config_get to read configuration values
This commit is contained in:
@@ -4,6 +4,8 @@ const inputpkg = @import("../input.zig");
|
||||
const global = &@import("../main.zig").state;
|
||||
|
||||
const Config = @import("Config.zig");
|
||||
const c_get = @import("c_get.zig");
|
||||
const Key = @import("key.zig").Key;
|
||||
|
||||
const log = std.log.scoped(.config);
|
||||
|
||||
@@ -78,6 +80,16 @@ export fn ghostty_config_finalize(self: *Config) void {
|
||||
};
|
||||
}
|
||||
|
||||
export fn ghostty_config_get(
|
||||
self: *Config,
|
||||
ptr: *anyopaque,
|
||||
key_str: [*]const u8,
|
||||
len: usize,
|
||||
) bool {
|
||||
const key = std.meta.stringToEnum(Key, key_str[0..len]) orelse return false;
|
||||
return c_get.get(self, key, ptr);
|
||||
}
|
||||
|
||||
export fn ghostty_config_trigger(
|
||||
self: *Config,
|
||||
str: [*]const u8,
|
||||
|
||||
Reference in New Issue
Block a user