Blame


1 eb77ee11 2018-07-08 stsp /*
2 eb77ee11 2018-07-08 stsp * Copyright (c) 2018 Stefan Sperling <stsp@openbsd.org>
3 eb77ee11 2018-07-08 stsp *
4 eb77ee11 2018-07-08 stsp * Permission to use, copy, modify, and distribute this software for any
5 eb77ee11 2018-07-08 stsp * purpose with or without fee is hereby granted, provided that the above
6 eb77ee11 2018-07-08 stsp * copyright notice and this permission notice appear in all copies.
7 eb77ee11 2018-07-08 stsp *
8 eb77ee11 2018-07-08 stsp * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 eb77ee11 2018-07-08 stsp * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 eb77ee11 2018-07-08 stsp * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 eb77ee11 2018-07-08 stsp * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 eb77ee11 2018-07-08 stsp * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 eb77ee11 2018-07-08 stsp * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 eb77ee11 2018-07-08 stsp * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 eb77ee11 2018-07-08 stsp */
16 eb77ee11 2018-07-08 stsp
17 eb77ee11 2018-07-08 stsp struct got_object_idcache;
18 eb77ee11 2018-07-08 stsp
19 eb77ee11 2018-07-08 stsp struct got_object_idcache *got_object_idcache_alloc(int);
20 eb77ee11 2018-07-08 stsp void got_object_idcache_free(struct got_object_idcache *);
21 eb77ee11 2018-07-08 stsp
22 eb77ee11 2018-07-08 stsp const struct got_error *got_object_idcache_add(struct got_object_idcache *,
23 eb77ee11 2018-07-08 stsp struct got_object_id *, void *);
24 c0df5966 2021-12-31 stsp void *got_object_idcache_get(struct got_object_idcache *,
25 c0df5966 2021-12-31 stsp struct got_object_id *);
26 d83eb5cd 2018-11-05 stsp const struct got_error *got_object_idcache_remove_one(void **,
27 d83eb5cd 2018-11-05 stsp struct got_object_idcache *, struct got_object_id *);
28 eb77ee11 2018-07-08 stsp int got_object_idcache_contains(struct got_object_idcache *,
29 eb77ee11 2018-07-08 stsp struct got_object_id *);
30 eb77ee11 2018-07-08 stsp void got_object_idcache_for_each(struct got_object_idcache *,
31 eb77ee11 2018-07-08 stsp void (*cb)(struct got_object_id *, void *, void *), void *);
32 eb77ee11 2018-07-08 stsp int got_object_idcache_num_elements(struct got_object_idcache *);