Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
jackalcooper committed Feb 18, 2024
1 parent e351b0a commit 2a83273
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/example/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/kinda.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}

0 comments on commit 2a83273

Please sign in to comment.