• Home
  • Raw
  • Download

Lines Matching refs:sym

95 	h->sym = NULL;  in newsym()
100 static struct sym *mknode(struct sym *next, char *key, void *data) in mknode()
102 struct sym *n; in mknode()
104 if ((n = malloc(sizeof(struct sym))) == NULL) { in mknode()
124 static struct sym *find_key1(struct sym *sym, char *key) in find_key1() argument
126 while (sym != NULL) in find_key1()
127 if (strcmp(sym->key, key) == 0) in find_key1()
128 return (sym); in find_key1()
130 sym = sym->next; in find_key1()
137 static int add_key(SYM sym, char *key, void *data) in add_key() argument
139 register struct sym *sn; in add_key()
141 if (sym->sym == NULL) { in add_key()
142 sym->sym = mknode(NULL, key, data); in add_key()
143 if (sym->sym == NULL) { in add_key()
147 for (sn = sym->sym; sn != NULL && sn->next != NULL; in add_key()
194 int sym_put(SYM sym, char *key, void *data, int flags) in sym_put() argument
200 struct sym *nsym = NULL; /* search: found symbol entry */ in sym_put()
202 if (sym == NULL) in sym_put()
213 for (kk = (char **)keys, csym = sym; in sym_put()
214 *kk != NULL && (nsym = find_key1(csym->sym, *kk)) != NULL; in sym_put()
265 void *sym_get(SYM sym, char *key) in sym_get() argument
271 struct sym *nsym = NULL; /* search: found symbol entry */ in sym_get()
273 if (sym == NULL) in sym_get()
281 for (kk = (char **)keys, csym = sym; in sym_get()
282 *kk != NULL && (nsym = find_key1(csym->sym, *kk)) != NULL; in sym_get()
317 int sym_seq(SYM sym, DBT * key, DBT * data, int flags) in sym_seq() argument
334 csym = (SYM) sym_get(sym, (char *)key->data); in sym_seq()
338 sym->cursor = csym->sym; in sym_seq()
339 if (sym->cursor == NULL) in sym_seq()
341 key->data = sym->cursor->key; in sym_seq()
342 data->data = sym->cursor->data; in sym_seq()
347 sym->cursor = sym->sym; in sym_seq()
348 if (sym->cursor == NULL) in sym_seq()
350 key->data = sym->cursor->key; in sym_seq()
351 data->data = sym->cursor->data; in sym_seq()
356 if (sym->cursor == NULL) in sym_seq()
358 sym->cursor = sym->cursor->next; in sym_seq()
360 if (sym->cursor == NULL) in sym_seq()
363 key->data = sym->cursor->key; in sym_seq()
364 data->data = sym->cursor->data; in sym_seq()
380 int sym_dump(SYM sym, int depth) in sym_dump() argument
383 register struct sym *se; /* symbol entry */ in sym_dump()
386 if (sym == NULL || sym->magic != SYM_MAGIC) in sym_dump()
389 for (se = sym->sym; se != NULL; se = se->next) { in sym_dump()
403 int sym_dump_s(SYM sym, int depth) in sym_dump_s() argument
406 register struct sym *se; /* symbol entry */ in sym_dump_s()
409 if (sym == NULL) in sym_dump_s()
412 if (sym->magic != SYM_MAGIC) { in sym_dump_s()
417 printf(" = %s\n", (char *)sym); in sym_dump_s()
421 for (se = sym->sym; se != NULL; se = se->next) { in sym_dump_s()
441 int sym_rm(SYM sym, int flags) in sym_rm() argument
443 register struct sym *se, *nse; /* symbol entry */ in sym_rm()
445 if (sym == NULL) in sym_rm()
448 if (sym->magic != SYM_MAGIC) { in sym_rm()
450 free(sym); in sym_rm()
454 for (se = sym->sym; se != NULL;) { in sym_rm()
465 free(sym); in sym_rm()