streamers / nodeid_set.h @ 16ae4927
History | View | Annotate | Download (1.02 KB)
1 |
/*
|
---|---|
2 |
* Copyright (c) 2010 Csaba Kiraly
|
3 |
* Copyright (c) 2010 Luca Abeni
|
4 |
*
|
5 |
* This is free software; see gpl-3.0.txt
|
6 |
*/
|
7 |
|
8 |
#ifndef NODEID_SET_H
|
9 |
#define NODEID_SET_H
|
10 |
|
11 |
#include <stdbool.h> |
12 |
|
13 |
struct nodeID;
|
14 |
|
15 |
// The usual shuffle
|
16 |
void shuffle(void *base, size_t nmemb, size_t size); |
17 |
|
18 |
void nidset_shuffle(const struct nodeID **base, size_t nmemb); |
19 |
|
20 |
int nidset_filter(const struct nodeID **dst, size_t *dst_size, const struct nodeID **src, size_t src_size, bool(*f)(const struct nodeID *)); |
21 |
|
22 |
// B \ A
|
23 |
int nidset_complement(const struct nodeID **dst, size_t *dst_size, const struct nodeID **bs, size_t bs_size, const struct nodeID **as, size_t as_size); |
24 |
|
25 |
bool nidset_find(size_t *i, const struct nodeID **ids, size_t ids_size, const struct nodeID *id); |
26 |
|
27 |
int nidset_add(const struct nodeID **dst, size_t *dst_size, const struct nodeID **as, size_t as_size, const struct nodeID **bs, size_t bs_size); |
28 |
|
29 |
int nidset_add_i(const struct nodeID **dst, size_t *dst_size, size_t max_size, const struct nodeID **as, size_t as_size); |
30 |
|
31 |
#endif /* NODEID_SET_H */ |
32 |
|