summaryrefslogtreecommitdiff
path: root/ccan/invbloom/_info
blob: 4055a2c7812ff30078a37832c79d7ce2ca984728 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "config.h"
#include <stdio.h>
#include <string.h>

/**
 * invbloom - implementation of invertible bloom lookup tables.
 *
 * This code implements a subset of invertible bloom lookup tables
 * as described in[1].
 *
 * [1] Goodrich, Michael T., and Michael Mitzenmacher. "Invertible bloom
 *     lookup tables." Communication, Control, and Computing (Allerton), 2011
 *     49th Annual Allerton Conference on. IEEE, 2011.
 *      http://arxiv.org/pdf/1101.2245
 *
 * License: BSD-MIT
 *
 * Example:
 *	#include <ccan/invbloom/invbloom.h>
 *	#include <stdio.h>
 *
 *	int main(int argc, char *argv[])
 *	{
 *		unsigned int i, n;
 *		struct invbloom *ib = invbloom_new(NULL, char *, 16, 0);
 *
 *		for (i = 1; i < argc; i++)
 *			invbloom_insert(ib, &argv[i]);
 *
 *		n = 0;
 *		for (i = 1; i < argc; i++)
 *			n += invbloom_get(ib, &argv[i]);
 *
 *		printf("%u out of %u are found\n", n, argc);
 *
 *		n = 0;
 *		for (i = 1; i < argc; i++) {
 *			unsigned int j;
 *			char **p = invbloom_extract(NULL, ib);
 *
 *			for (j = 1; j < argc; j++) {
 *				if (p == &argv[j])
 *					n++;
 *			}
 *			tal_free(p);
 *		}
 *		printf("%u out of %u were extracted\n", n, argc);
 *		return 0;
 *	}
 */
int main(int argc, char *argv[])
{
	/* Expect exactly one argument */
	if (argc != 2)
		return 1;

	if (strcmp(argv[1], "depends") == 0) {
		printf("ccan/endian\n");
		printf("ccan/hash\n");
		printf("ccan/short_types\n");
		printf("ccan/tal\n");
		printf("ccan/typesafe_cb\n");
		return 0;
	}

	return 1;
}