types.h
changeset 115 26edeea5c95a
child 116 4ec6e2a55c34
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/types.h	Thu Feb 07 09:58:48 2008 -0500
     1.3 @@ -0,0 +1,27 @@
     1.4 +#ifndef _RAZOR_TYPES_H_
     1.5 +#define _RAZOR_TYPES_H_
     1.6 +
     1.7 +#include <stdint.h>
     1.8 +
     1.9 +struct array {
    1.10 +	void *data;
    1.11 +	int size, alloc;
    1.12 +};
    1.13 +
    1.14 +void array_init(struct array *array);
    1.15 +void array_release(struct array *array);
    1.16 +void *array_add(struct array *array, int size);
    1.17 +
    1.18 +
    1.19 +struct hashtable {
    1.20 +	struct array buckets;
    1.21 +	struct array *pool;
    1.22 +};
    1.23 +
    1.24 +void hashtable_init(struct hashtable *table, struct array *pool);
    1.25 +void hashtable_release(struct hashtable *table);
    1.26 +uint32_t hashtable_insert(struct hashtable *table, const char *key);
    1.27 +uint32_t hashtable_lookup(struct hashtable *table, const char *key);
    1.28 +uint32_t hashtable_tokenize(struct hashtable *table, const char *string);
    1.29 +
    1.30 +#endif /* _RAZOR_TYPES_H_ */