3 #define NONAMEGEN "NONAMEGEN"
5 struct symlist *symlist_read(FILE * f) {
7 ret = malloc(sizeof(struct symlist));
10 ret->array = malloc(ret->size * sizeof(struct symlist_el));
14 size_t w_pos = 0, w_size = 2;
15 w = malloc((w_size + 1) * sizeof(char));
22 if ((size_t) id > ret->size) {
26 ret->size * sizeof(struct symlist_el));
30 ret->array[(size_t) id - 1].id = id;
31 if (!strncmp(w, NONAMEGEN, strlen(NONAMEGEN)))
32 ret->array[(size_t) id - 1].sym = NULL;
34 ret->array[(size_t) id - 1].sym = sym_lookup(w, 0);
36 } else if (c == ':') {
41 if (w_pos >= w_size) {
43 w = realloc(w, (w_size + 1) * sizeof(char));
45 w[w_pos++] = (char) c;
52 struct symbol *symlist_get(struct symlist *sl, unsigned int id) {
53 return sl->array[id].sym;