-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbitvec.h
More file actions
27 lines (22 loc) · 704 Bytes
/
bitvec.h
File metadata and controls
27 lines (22 loc) · 704 Bytes
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
#ifndef _H_BITVEC
#define _H_BITVEC
#include <stdint.h>
#include <pthread.h>
typedef struct {
pthread_mutex_t lock;
uint64_t max_offset;
uint64_t *storage;
size_t size;
} bitvec_t;
int bitvec_check(bitvec_t*, uint64_t);
void bitvec_set(bitvec_t *, uint64_t);
void bitvec_clear(bitvec_t *, uint64_t);
int bitvec_alloc(bitvec_t **, uint64_t);
void bitvec_batch_set_u32(bitvec_t *, uint32_t *, uint32_t);
void bitvec_clear_all(bitvec_t *);
void bitvec_union(bitvec_t*, bitvec_t*);
void bitvec_free(bitvec_t*);
double bitvec_distance(bitvec_t*, bitvec_t*);
uint64_t bitvec_popcount(bitvec_t *b);
uint64_t bitvec_get_next_offset(bitvec_t *b, uint64_t from);
#endif