blob: b28258ff08e1e44ee0bac7946fb7706ee0be7a83 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
const c = @import("c.zig").c;
const errors = @import("errors.zig");
const Error = errors.Error;
pub const MatchParam = struct {
value: *c.OnigMatchParam,
pub fn init() !MatchParam {
const value = c.onig_new_match_param() orelse return Error.Memory;
return .{ .value = value };
}
pub fn deinit(self: *MatchParam) void {
c.onig_free_match_param(self.value);
}
pub fn setRetryLimitInSearch(self: *MatchParam, limit: usize) !void {
_ = try errors.convertError(c.onig_set_retry_limit_in_search_of_match_param(
self.value,
@intCast(limit),
));
}
};
|