aboutsummaryrefslogtreecommitdiff
path: root/src/bitarray.h
blob: 934b84ebcce4429fa8a2237807c490f890a5b950 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef INCLUDED_BITARRAY_H
#define INCLUDED_BITARRAY_H

#include <stdlib.h>
#include <stdbool.h>
#include <inttypes.h>

struct bitarray {
  uint8_t *bytes;
  size_t   size;
};

void bitarray_init (struct bitarray *, size_t bit_count);
void bitarray_free (struct bitarray *);
void bitarray_set  (struct bitarray *, size_t index, bool);
bool bitarray_get  (struct bitarray *, size_t index);

#endif