Mercurial > repos > blastem
comparison tern.c @ 498:51bf87f76d15
Pull shader file names from config file.
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 28 Oct 2013 23:59:59 -0700 |
parents | 140af5509ce7 |
children | de6f00204fa2 |
comparison
equal
deleted
inserted
replaced
497:0820a71b80f3 | 498:51bf87f76d15 |
---|---|
1 /* | 1 /* |
2 Copyright 2013 Michael Pavone | 2 Copyright 2013 Michael Pavone |
3 This file is part of BlastEm. | 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. | 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 */ | 5 */ |
6 #include "tern.h" | 6 #include "tern.h" |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
99 tern_val val; | 99 tern_val val; |
100 val.intval = value; | 100 val.intval = value; |
101 return tern_insert(head, key, val); | 101 return tern_insert(head, key, val); |
102 } | 102 } |
103 | 103 |
104 void * tern_find_ptr(tern_node * head, char * key) | 104 void * tern_find_ptr_default(tern_node * head, char * key, void * def) |
105 { | 105 { |
106 tern_val ret; | 106 tern_val ret; |
107 if (tern_find(head, key, &ret)) { | 107 if (tern_find(head, key, &ret)) { |
108 return ret.ptrval; | 108 return ret.ptrval; |
109 } | 109 } |
110 return NULL; | 110 return def; |
111 } | |
112 | |
113 void * tern_find_ptr(tern_node * head, char * key) | |
114 { | |
115 return tern_find_ptr_default(head, key, NULL); | |
111 } | 116 } |
112 | 117 |
113 tern_node * tern_insert_ptr(tern_node * head, char * key, void * value) | 118 tern_node * tern_insert_ptr(tern_node * head, char * key, void * value) |
114 { | 119 { |
115 tern_val val; | 120 tern_val val; |