block: don't put spaces around :
[ironout.git] / typedefs.c
blob5c16dc8a45cdd8d3788ea5cd5f95edcb10fc22ae
1 #include <stdlib.h>
2 #include <string.h>
3 #include "hash.h"
5 static struct hash *typedefs = NULL;
7 static int str_cmp(void *data, void *key)
9 return strcmp(data, key);
12 static void add_type(char *typename)
14 if (!typedefs)
15 typedefs = hash_init(str_hash, str_hash, str_cmp, 16);
16 hash_put(typedefs, typename);
19 int typedef_name(char *filename, char *name, long offset)
21 if (!typedefs) {
22 add_type("FILE");
23 add_type("size_t");
24 add_type("DIR");
26 return hash_get(typedefs, name) != NULL;