xref: /aosp_15_r20/external/libbpf/src/strset.h (revision f7c14bbac8cf49633f2740db462ea43457973ec4)
1*f7c14bbaSAndroid Build Coastguard Worker /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
2*f7c14bbaSAndroid Build Coastguard Worker 
3*f7c14bbaSAndroid Build Coastguard Worker /* Copyright (c) 2021 Facebook */
4*f7c14bbaSAndroid Build Coastguard Worker #ifndef __LIBBPF_STRSET_H
5*f7c14bbaSAndroid Build Coastguard Worker #define __LIBBPF_STRSET_H
6*f7c14bbaSAndroid Build Coastguard Worker 
7*f7c14bbaSAndroid Build Coastguard Worker #include <stdbool.h>
8*f7c14bbaSAndroid Build Coastguard Worker #include <stddef.h>
9*f7c14bbaSAndroid Build Coastguard Worker 
10*f7c14bbaSAndroid Build Coastguard Worker struct strset;
11*f7c14bbaSAndroid Build Coastguard Worker 
12*f7c14bbaSAndroid Build Coastguard Worker struct strset *strset__new(size_t max_data_sz, const char *init_data, size_t init_data_sz);
13*f7c14bbaSAndroid Build Coastguard Worker void strset__free(struct strset *set);
14*f7c14bbaSAndroid Build Coastguard Worker 
15*f7c14bbaSAndroid Build Coastguard Worker const char *strset__data(const struct strset *set);
16*f7c14bbaSAndroid Build Coastguard Worker size_t strset__data_size(const struct strset *set);
17*f7c14bbaSAndroid Build Coastguard Worker 
18*f7c14bbaSAndroid Build Coastguard Worker int strset__find_str(struct strset *set, const char *s);
19*f7c14bbaSAndroid Build Coastguard Worker int strset__add_str(struct strset *set, const char *s);
20*f7c14bbaSAndroid Build Coastguard Worker 
21*f7c14bbaSAndroid Build Coastguard Worker #endif /* __LIBBPF_STRSET_H */
22