comparison tern.h @ 766:1b2f8280ba81

WIP changes to support reading cart memory map from ROM DB
author Michael Pavone <pavone@retrodev.com>
date Sun, 05 Jul 2015 14:21:34 -0700
parents de6f00204fa2
children 2f48a3c187c6
comparison
equal deleted inserted replaced
765:dc54387ee1cd 766:1b2f8280ba81
23 } straight; 23 } straight;
24 struct tern_node *right; 24 struct tern_node *right;
25 char el; 25 char el;
26 } tern_node; 26 } tern_node;
27 27
28 typedef void (*iter_fun)(char *key, tern_val val, void *data);
29
28 tern_node * tern_insert(tern_node * head, char * key, tern_val value); 30 tern_node * tern_insert(tern_node * head, char * key, tern_val value);
29 int tern_find(tern_node * head, char * key, tern_val *ret); 31 int tern_find(tern_node * head, char * key, tern_val *ret);
30 tern_node * tern_find_prefix(tern_node * head, char * key); 32 tern_node * tern_find_prefix(tern_node * head, char * key);
31 intptr_t tern_find_int(tern_node * head, char * key, intptr_t def); 33 intptr_t tern_find_int(tern_node * head, char * key, intptr_t def);
32 tern_node * tern_insert_int(tern_node * head, char * key, intptr_t value); 34 tern_node * tern_insert_int(tern_node * head, char * key, intptr_t value);
33 void * tern_find_ptr_default(tern_node * head, char * key, void * def); 35 void * tern_find_ptr_default(tern_node * head, char * key, void * def);
34 void * tern_find_ptr(tern_node * head, char * key); 36 void * tern_find_ptr(tern_node * head, char * key);
37 tern_val tern_find_path_default(tern_node *head, char *key, tern_val def);
38 tern_val tern_find_path(tern_node *head, char *key);
35 tern_node * tern_insert_ptr(tern_node * head, char * key, void * value); 39 tern_node * tern_insert_ptr(tern_node * head, char * key, void * value);
40 tern_node * tern_insert_node(tern_node *head, char *key, tern_node *value);
41 uint32_t tern_count(tern_node *head);
36 char * tern_int_key(uint32_t key, char * buf); 42 char * tern_int_key(uint32_t key, char * buf);
43 tern_node * tern_get_node(tern_val value);
37 44
38 #endif //TERN_H_ 45 #endif //TERN_H_