swh:1:snp:ff2a11cd2e44dd19ec3814028ef2ce6605664e63
Raw File
Tip revision: 666565e8204f5150e5023374c3e82a2452cf3bde authored by Eric Fischer on 27 April 2016, 22:52:05 UTC
Merge pull request #232 from mapbox/cplusplus
Tip revision: 666565e
pool.hpp
struct pool_val {
	const char *s;
	int type;
	int n;

	struct pool_val *left;
	struct pool_val *right;

	struct pool_val *next;
};

struct pool {
	struct pool_val **vals;

	struct pool_val *head;
	struct pool_val *tail;
	int n;
};

struct pool_val *pool(struct pool *p, const char *s, int type);
void pool_free(struct pool *p);
void pool_free_strings(struct pool *p);
void pool_init(struct pool *p, int n);
int is_pooled(struct pool *p, const char *s, int type);

struct stringpool {
	long long left;
	long long right;
	long long off;
};

long long addpool(struct memfile *poolfile, struct memfile *treefile, const char *s, char type);
back to top