void *oidmap_put(struct oidmap *map, void *entry) { struct oidmap_entry *to_put = entry; if (!map->map.cmpfn) oidmap_init(map, 0); hashmap_entry_init(&to_put->internal_entry, hash(&to_put->oid)); return hashmap_put(&map->map, to_put); }
void *oidmap_remove(struct oidmap *map, const struct object_id *key) { struct hashmap_entry entry; if (!map->map.cmpfn) oidmap_init(map, 0); hashmap_entry_init(&entry, hash(key)); return hashmap_remove(&map->map, &entry, key); }
static void *filter_trees_depth__init( struct oidset *omitted, struct list_objects_filter_options *filter_options, filter_object_fn *filter_fn, filter_free_fn *filter_free_fn) { struct filter_trees_depth_data *d = xcalloc(1, sizeof(*d)); d->omits = omitted; oidmap_init(&d->seen_at_depth, 0); d->exclude_depth = filter_options->tree_exclude_depth; d->current_depth = 0; *filter_fn = filter_trees_depth; *filter_free_fn = filter_trees_free; return d; }