comparison tern.h @ 487:c08a4efeee7f opengl

Update opengl branch from default. Fix build breakage unrelated to merge
author Mike Pavone <pavone@retrodev.com>
date Sat, 26 Oct 2013 22:38:47 -0700
parents 140af5509ce7
children 51bf87f76d15
comparison
equal deleted inserted replaced
449:7696d824489d 487:c08a4efeee7f
1 /*
2 Copyright 2013 Michael Pavone
3 This file is part of BlastEm.
4 BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text.
5 */
6 #ifndef TERN_H_
7 #define TERN_H_
8
9 #include <stdint.h>
10
11 typedef union {
12 void *ptrval;
13 intptr_t intval;
14 } tern_val;
15
16 typedef struct tern_node {
17 struct tern_node *left;
18 union {
19 struct tern_node *next;
20 tern_val value;
21 } straight;
22 struct tern_node *right;
23 char el;
24 } tern_node;
25
26 tern_node * tern_insert(tern_node * head, char * key, tern_val value);
27 int tern_find(tern_node * head, char * key, tern_val *ret);
28 tern_node * tern_find_prefix(tern_node * head, char * key);
29 intptr_t tern_find_int(tern_node * head, char * key, intptr_t def);
30 tern_node * tern_insert_int(tern_node * head, char * key, intptr_t value);
31 void * tern_find_ptr(tern_node * head, char * key);
32 tern_node * tern_insert_ptr(tern_node * head, char * key, void * value);
33
34 #endif //TERN_H_