Root/qpkg/id.h

Source at commit a9f12d56661a8e6def5a2b32519c3efd55e38d31 created 8 years 11 months ago.
By Werner Almesberger, qpkg: converted ID comparison from "struct id *" to "void *"
1#ifndef ID_H
2#define ID_H
3
4#include <sys/types.h>
5
6#include "jrb.h"
7
8
9struct id;
10
11struct tree {
12    int (*comp)(const void *a, const void *b);
13    struct jrb *root;
14};
15
16struct id {
17    struct jrb *jrb;
18    const char *s;
19    size_t len;
20    void *value;
21};
22
23
24int comp_id(const void *a, const void *b);
25
26struct tree *make_tree(int (*comp)(const void *a, const void *b));
27struct id *make_id(struct tree *tree, const char *s, size_t len);
28const struct id *find_id(const struct tree *tree, const char *s, size_t len);
29const struct id *first_id(const struct tree *tree);
30const struct id *next_id(const struct id *id);
31
32#endif /* !ID_H */
33

Archive Download this file

Branches:
master



interactive