blob: 468f4a6fdb983788f194813e62fa7b4f0910f5e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#pragma once
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include "util_ct.h"
// This macro accepts zero
#define prne_bf_get_size(nb_bits)\
((nb_bits) % 8 == 0 ? (nb_bits) / 8 : (nb_bits) / 8 + 1)
typedef void(*prne_bf_foreach_ft)(
void *ctx,
const unsigned int bit,
const bool v);
void prne_bf_set (uint8_t *bf, const unsigned int bit, const bool v);
bool prne_bf_test (
const uint8_t *bf,
const size_t size,
const unsigned int bit);
void prne_bf_foreach (
void *ctx,
const uint8_t *bf,
const size_t size,
prne_bf_foreach_ft f);
|