mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
hooking everything up
This commit is contained in:
parent
84d5cbc4f1
commit
ee21f86f8f
9 changed files with 334 additions and 19 deletions
|
@ -129,6 +129,17 @@ pub fn dictLen(dict: RocDict) callconv(.C) usize {
|
|||
return dict.dict_entries_len;
|
||||
}
|
||||
|
||||
// Dict.insert : Dict k v, k, v -> Dict k v
|
||||
const Opaque = ?[*]u8;
|
||||
const HashFn = fn (u64, ?[*]u8) callconv(.C) u64;
|
||||
const EqFn = fn (?[*]u8, ?[*]u8) callconv(.C) bool;
|
||||
const Dec = fn (?[*]u8) callconv(.C) void;
|
||||
pub fn dictInsert(dict: RocDict, alignment: usize, key: Opaque, key_width: usize, value: Opaque, value_width: usize, hash: HashFn, is_eq: EqFn, dec_value: Dec, result: *RocDict) callconv(.C) void {
|
||||
result.* = RocDict.empty();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
test "RocDict.init() contains nothing" {
|
||||
const key_size = @sizeOf(usize);
|
||||
const value_size = @sizeOf(usize);
|
||||
|
|
|
@ -9,6 +9,7 @@ const hash = @import("hash.zig");
|
|||
comptime {
|
||||
exportDictFn(dict.dictLen, "len");
|
||||
exportDictFn(dict.dictEmpty, "empty");
|
||||
exportDictFn(dict.dictInsert, "insert");
|
||||
exportDictFn(hash.wyhash, "hash");
|
||||
exportDictFn(hash.wyhash_rocstr, "hash_str");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue