ghostty/pkg/oniguruma/region.zig
Mitchell Hashimoto 364020973c pkg/oniguruma: search
2023-11-29 15:29:43 -08:00

17 lines
492 B
Zig

const std = @import("std");
const c = @import("c.zig");
pub const Region = extern struct {
allocated: c_int = 0,
num_regs: c_int = 0,
beg: ?[*]c_int = null,
end: ?[*]c_int = null,
history_root: ?*c.OnigCaptureTreeNode = null, // TODO: convert to Zig
pub fn deinit(self: *Region) void {
// We never free ourself because allocation of Region in the Zig
// bindings is handled by the Zig program.
c.onig_region_free(@ptrCast(self), 0);
}
};