Lines Matching refs: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)
26 struct bitmask *bmp;
40 /* Free `struct bitmask` */
41 void bitmask_free(struct bitmask *bmp)
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)
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)
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)
121 /* Set all bits in bitmask: bmp = ~0 */
122 struct bitmask *bitmask_setall(struct bitmask *bmp)
130 /* Clear all bits in bitmask: bmp = 0 */
131 struct bitmask *bitmask_clearall(struct bitmask *bmp)
140 int bitmask_isallclear(const struct bitmask *bmp)
150 int bitmask_isbitset(const struct bitmask *bmp, unsigned int i)
156 unsigned int bitmask_first(const struct bitmask *bmp)
162 unsigned int bitmask_last(const struct bitmask *bmp)
173 unsigned int bitmask_next(const struct bitmask *bmp, unsigned int i)
184 * with optional ':%u' strides modifying ranges, into provided bitmask.
192 int bitmask_parselist(const char *buf, struct bitmask *bmp)
275 int bitmask_displaylist(char *buf, int buflen, const struct bitmask *bmp)