Lines Matching full:bitmask

6 #include <helpers/bitmask.h>
20 * Allocate and free `struct bitmask *`
23 /* Allocate a new `struct bitmask` with a size of n bits */
24 struct bitmask *bitmask_alloc(unsigned int n) in bitmask_alloc()
26 struct bitmask *bmp; in bitmask_alloc()
40 /* Free `struct bitmask` */
41 void bitmask_free(struct bitmask *bmp) in bitmask_free()
61 /* Return the value (0 or 1) of bit n in bitmask bmp */
62 static unsigned int _getbit(const struct bitmask *bmp, unsigned int n) in _getbit()
70 /* Set bit n in bitmask bmp to value v (0 or 1) */
71 static void _setbit(struct bitmask *bmp, unsigned int n, unsigned int v) in _setbit()
83 * When parsing bitmask lists, only allow numbers, separated by one
114 /* Set a single bit i in bitmask */
115 struct bitmask *bitmask_setbit(struct bitmask *bmp, unsigned int i) in bitmask_setbit()
121 /* Set all bits in bitmask: bmp = ~0 */
122 struct bitmask *bitmask_setall(struct bitmask *bmp) in bitmask_setall()
130 /* Clear all bits in bitmask: bmp = 0 */
131 struct bitmask *bitmask_clearall(struct bitmask *bmp) in bitmask_clearall()
140 int bitmask_isallclear(const struct bitmask *bmp) in bitmask_isallclear()
150 int bitmask_isbitset(const struct bitmask *bmp, unsigned int i) in bitmask_isbitset()
156 unsigned int bitmask_first(const struct bitmask *bmp) in bitmask_first()
162 unsigned int bitmask_last(const struct bitmask *bmp) in bitmask_last()
173 unsigned int bitmask_next(const struct bitmask *bmp, unsigned int i) in bitmask_next()
184 * with optional ':%u' strides modifying ranges, into provided bitmask.
192 int bitmask_parselist(const char *buf, struct bitmask *bmp) in bitmask_parselist()
275 int bitmask_displaylist(char *buf, int buflen, const struct bitmask *bmp) in bitmask_displaylist()