diff --git a/src/example/main.zig b/src/example/main.zig index ac54047..37390e2 100644 --- a/src/example/main.zig +++ b/src/example/main.zig @@ -15,7 +15,7 @@ const Kinds = struct { }; const all_nifs = .{ - kinda.NIFFunc(Kinds.All, capi, "kinda_example_add", .{ .overwrite = "Elixir.KindaExample.NIF.kinda_example_add"}), + kinda.NIFFunc(Kinds.All, capi, "kinda_example_add", .{ .wrapper = "Elixir.KindaExample.NIF.kinda_example_add"}), } ++ Kinds.CInt.nifs; pub export var nifs: [all_nifs.len]e.ErlNifFunc = all_nifs; diff --git a/src/kinda.zig b/src/kinda.zig index f118983..018d1b8 100644 --- a/src/kinda.zig +++ b/src/kinda.zig @@ -201,7 +201,7 @@ pub fn open_internal_resource_types(env: beam.env) void { Internal.OpaqueArray.open_all(env); } -const NIFFuncAttrs = struct { flags: u32 = 0, overwrite: ?[*c]const u8 = null }; +const NIFFuncAttrs = struct { flags: u32 = 0, wrapper: ?[*c]const u8 = null }; pub fn NIFFunc(comptime Kinds: anytype, c: anytype, comptime name: anytype, attrs: NIFFuncAttrs) e.ErlNifFunc { @setEvalBranchQuota(2000); const cfunction = @field(c, name); @@ -295,6 +295,6 @@ pub fn NIFFunc(comptime Kinds: anytype, c: anytype, comptime name: anytype, attr return beam.make_tuple(env, tuple_slice); } } - const entry = e.ErlNifFunc{ .name = attrs.overwrite orelse name, .arity = FTI.params.len, .fptr = nif, .flags = flags }; + const entry = e.ErlNifFunc{ .name = attrs.wrapper orelse name, .arity = FTI.params.len, .fptr = nif, .flags = flags }; }).entry; }