Blame


1 54be8251 2018-06-04 stsp /*
2 54be8251 2018-06-04 stsp * Copyright (c) 2018 Stefan Sperling <stsp@openbsd.org>
3 54be8251 2018-06-04 stsp *
4 54be8251 2018-06-04 stsp * Permission to use, copy, modify, and distribute this software for any
5 54be8251 2018-06-04 stsp * purpose with or without fee is hereby granted, provided that the above
6 54be8251 2018-06-04 stsp * copyright notice and this permission notice appear in all copies.
7 54be8251 2018-06-04 stsp *
8 54be8251 2018-06-04 stsp * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 54be8251 2018-06-04 stsp * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 54be8251 2018-06-04 stsp * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 54be8251 2018-06-04 stsp * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 54be8251 2018-06-04 stsp * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 54be8251 2018-06-04 stsp * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 54be8251 2018-06-04 stsp * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 54be8251 2018-06-04 stsp */
16 54be8251 2018-06-04 stsp
17 54be8251 2018-06-04 stsp struct got_object_idset;
18 54be8251 2018-06-04 stsp
19 d54f52f4 2018-07-07 stsp enum got_object_idset_iteration_order {
20 d54f52f4 2018-07-07 stsp GOT_OBJECT_IDSET_ITERATE_BY_OBJECT_ID,
21 d54f52f4 2018-07-07 stsp GOT_OBJECT_IDSET_ITERATE_RECENTLY_USED,
22 d54f52f4 2018-07-07 stsp };
23 d54f52f4 2018-07-07 stsp
24 d54f52f4 2018-07-07 stsp struct got_object_idset *got_object_idset_alloc(
25 d54f52f4 2018-07-07 stsp enum got_object_idset_iteration_order);
26 54be8251 2018-06-04 stsp void got_object_idset_free(struct got_object_idset *);
27 54be8251 2018-06-04 stsp
28 d5a90aac 2018-06-04 stsp const struct got_error *got_object_idset_add(void **,
29 d5a90aac 2018-06-04 stsp struct got_object_idset *, struct got_object_id *, void *);
30 45b73774 2018-06-04 stsp void *got_object_idset_get(struct got_object_idset *, struct got_object_id *);
31 e7c810ea 2018-06-22 stsp const struct got_error *got_object_idset_remove(void **,
32 e7c810ea 2018-06-22 stsp struct got_object_idset *, struct got_object_id *);
33 27c21a11 2018-06-22 stsp const struct got_error *got_object_idset_remove_random(void **,
34 27c21a11 2018-06-22 stsp struct got_object_idset *);
35 54be8251 2018-06-04 stsp int got_object_idset_contains(struct got_object_idset *,
36 54be8251 2018-06-04 stsp struct got_object_id *);
37 54be8251 2018-06-04 stsp void got_object_idset_for_each(struct got_object_idset *,
38 917bfd05 2018-06-10 stsp void (*cb)(struct got_object_id *, void *, void *), void *);
39 069f84d5 2018-06-11 stsp int got_object_idset_num_elements(struct got_object_idset *);