2014-09-29 12:17:35 -07:00
|
|
|
struct pool_val {
|
2015-08-20 14:50:26 -07:00
|
|
|
const char *s;
|
2014-09-29 12:17:35 -07:00
|
|
|
int type;
|
|
|
|
int n;
|
|
|
|
|
|
|
|
struct pool_val *left;
|
|
|
|
struct pool_val *right;
|
|
|
|
|
|
|
|
struct pool_val *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct pool {
|
2015-07-02 17:03:07 -07:00
|
|
|
struct pool_val **vals;
|
2014-09-29 12:17:35 -07:00
|
|
|
|
|
|
|
struct pool_val *head;
|
|
|
|
struct pool_val *tail;
|
|
|
|
int n;
|
|
|
|
};
|
|
|
|
|
2015-08-20 14:50:26 -07:00
|
|
|
struct pool_val *pool(struct pool *p, const char *s, int type);
|
2014-09-29 12:17:35 -07:00
|
|
|
void pool_free(struct pool *p);
|
2014-10-01 10:33:22 -07:00
|
|
|
void pool_free_strings(struct pool *p);
|
2014-09-29 12:17:35 -07:00
|
|
|
void pool_init(struct pool *p, int n);
|
2015-08-20 14:27:39 -07:00
|
|
|
int is_pooled(struct pool *p, const char *s, int type);
|