diff 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
line wrap: on
line diff
--- a/tern.c	Mon Oct 28 23:50:28 2013 -0700
+++ b/tern.c	Mon Oct 28 23:59:59 2013 -0700
@@ -1,6 +1,6 @@
 /*
  Copyright 2013 Michael Pavone
- This file is part of BlastEm. 
+ This file is part of BlastEm.
  BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text.
 */
 #include "tern.h"
@@ -101,13 +101,18 @@
 	return tern_insert(head, key, val);
 }
 
-void * tern_find_ptr(tern_node * head, char * key)
+void * tern_find_ptr_default(tern_node * head, char * key, void * def)
 {
 	tern_val ret;
 	if (tern_find(head, key, &ret)) {
 		return ret.ptrval;
 	}
-	return NULL;
+	return def;
+}
+
+void * tern_find_ptr(tern_node * head, char * key)
+{
+	return tern_find_ptr_default(head, key, NULL);
 }
 
 tern_node * tern_insert_ptr(tern_node * head, char * key, void * value)