xref: /freebsd/contrib/wpa/src/utils/bitfield.h (revision cfd6422a5217410fbd66f7a7a8a64d9d85e61229)
1 /*
2  * Bitfield
3  * Copyright (c) 2013, Jouni Malinen <j@w1.fi>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef BITFIELD_H
10 #define BITFIELD_H
11 
12 struct bitfield;
13 
14 struct bitfield * bitfield_alloc(size_t max_bits);
15 void bitfield_free(struct bitfield *bf);
16 void bitfield_set(struct bitfield *bf, size_t bit);
17 void bitfield_clear(struct bitfield *bf, size_t bit);
18 int bitfield_is_set(struct bitfield *bf, size_t bit);
19 int bitfield_get_first_zero(struct bitfield *bf);
20 
21 #endif /* BITFIELD_H */
22