ordered-set: introduce ordered_set_put_strdup_full() and friends which take hash ops

This commit is contained in:
Yu Watanabe
2025-06-14 00:06:43 +09:00
parent 6ffc16dfd9
commit 38de38a70d
2 changed files with 18 additions and 9 deletions
+8 -3
View File
@@ -67,9 +67,14 @@ static inline int ordered_set_reserve(OrderedSet *s, unsigned entries_add) {
}
int ordered_set_consume(OrderedSet *s, void *p);
int ordered_set_put_strdup(OrderedSet **s, const char *p);
int ordered_set_put_strdupv(OrderedSet **s, char **l);
int ordered_set_put_string_set(OrderedSet **s, OrderedSet *l);
int ordered_set_put_strdup_full(OrderedSet **s, const struct hash_ops *hash_ops, const char *p);
#define ordered_set_put_strdup(s, p) ordered_set_put_strdup_full(s, &string_hash_ops_free, p)
int ordered_set_put_strdupv_full(OrderedSet **s, const struct hash_ops *hash_ops, char **l);
#define ordered_set_put_strdupv(s, l) ordered_set_put_strdupv_full(s, &string_hash_ops_free, l)
int ordered_set_put_string_set_full(OrderedSet **s, const struct hash_ops *hash_ops, OrderedSet *l);
#define ordered_set_put_string_set(s, l) ordered_set_put_string_set_full(s, &string_hash_ops_free, l)
void ordered_set_print(FILE *f, const char *field, OrderedSet *s);
#define _ORDERED_SET_FOREACH(e, s, i) \