X-Git-Url: https://pd.if.org/git/?p=nbds;a=blobdiff_plain;f=map%2Fmap.c;h=0db50bdbcd3185ee275089f2ea6aef97b301fa4d;hp=c4749b3cfc21f80eecfc43147f0000ee26ca52fd;hb=9d72edf41ce3a2ddbbe2d44afc23ef5ec53339c3;hpb=f1098084dd54496a61f9a254541190df77edd166 diff --git a/map/map.c b/map/map.c index c4749b3..0db50bd 100644 --- a/map/map.c +++ b/map/map.c @@ -6,20 +6,18 @@ */ #include "common.h" -#include "mlocal.h" -#include "mem.h" #include "map.h" +#include "mem.h" struct map { const map_impl_t *impl; void *data; }; -map_t *map_alloc (map_type_t map_type, cmp_fun_t cmp_fun, hash_fun_t hash_fun, clone_fun_t clone_fun) { - const map_impl_t *map_impl = map_type; +map_t *map_alloc (const map_impl_t *map_impl, const datatype_t *key_type) { map_t *map = nbd_malloc(sizeof(map_t)); map->impl = map_impl; - map->data = map->impl->alloc(cmp_fun, hash_fun, clone_fun); + map->data = map->impl->alloc(key_type); return map; }