Lines Matching full:bitmap
1 /* $OpenBSD: bitmap.h,v 1.2 2017/10/20 01:56:39 djm Exp $ */
25 struct bitmap;
27 /* Allocate a new bitmap. Returns NULL on allocation failure. */
28 struct bitmap *bitmap_new(void);
30 /* Free a bitmap */
31 void bitmap_free(struct bitmap *b);
33 /* Zero an existing bitmap */
34 void bitmap_zero(struct bitmap *b);
36 /* Test whether a bit is set in a bitmap. */
37 int bitmap_test_bit(struct bitmap *b, u_int n);
39 /* Set a bit in a bitmap. Returns 0 on success or -1 on error */
40 int bitmap_set_bit(struct bitmap *b, u_int n);
42 /* Clear a bit in a bitmap */
43 void bitmap_clear_bit(struct bitmap *b, u_int n);
45 /* Return the number of bits in a bitmap (i.e. the position of the MSB) */
46 size_t bitmap_nbits(struct bitmap *b);
48 /* Return the number of bytes needed to represent a bitmap */
49 size_t bitmap_nbytes(struct bitmap *b);
51 /* Convert a bitmap to a big endian byte string */
52 int bitmap_to_string(struct bitmap *b, void *p, size_t l);
54 /* Convert a big endian byte string to a bitmap */
55 int bitmap_from_string(struct bitmap *b, const void *p, size_t l);