summaryrefslogtreecommitdiffstats
path: root/bitsplit.h
blob: 8a53f3e31f13b1f26d907b6e4a32b79aa559c7a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef foobitsplithfoo
#define foobitsplithfoo

#include <inttypes.h>
#include <sys/types.h>

struct bitsplit_state {
    uint8_t in;
    int n_in;
    int maxbits_in;

    uint8_t out;
    int n_out;
    int maxbits_out;
};


void bitsplit_init(struct bitsplit_state *s, int maxbits_in, int maxbits_out);
void bitsplit(struct bitsplit_state *s, uint8_t *src, size_t *src_l, uint8_t *dst, size_t *dst_l);

#endif