summaryrefslogtreecommitdiffstats
path: root/bootstr.h
blob: 8f26a6d50d8ec00c66377bd7a2c0e710056dba4b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#pragma once

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

struct bootstr_cfg {
	const uint32_t *base;
	ssize_t baselen;
	const uint32_t *delim;
	bool (*is_basic)(uint32_t c);
	ssize_t tmin, tmax;
	ssize_t skew, damp;
	ssize_t initial_bias;
	ssize_t initial_n;
};

int bootstr_encode(const struct bootstr_cfg *cfg, uint32_t *in, uint32_t **out);
int bootstr_decode(const struct bootstr_cfg *cfg, uint32_t *in, uint32_t **out);