Mercurial > repos > blastem
comparison testtern.c @ 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 |
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 #include "tern.h" | |
7 #include <stdio.h> | |
8 #include <stddef.h> | |
9 | |
10 int main(int argc, char ** argv) | |
11 { | |
12 tern_node * tree = tern_insert_ptr(NULL, "foo", "bar"); | |
13 tree = tern_insert_ptr(tree, "foobar", "baz"); | |
14 tree = tern_insert_ptr(tree, "goobar", "qux"); | |
15 tree = tern_insert_int(tree, "foobarbaz", 42); | |
16 tree = tern_insert_int(tree, "goobarbaz", 21); | |
17 printf("foo: %s\n", (char *)tern_find_ptr(tree, "foo")); | |
18 printf("foobar: %s\n", (char *)tern_find_ptr(tree, "foobar")); | |
19 printf("goobar: %s\n", (char *)tern_find_ptr(tree, "goobar")); | |
20 printf("foob: %s\n", (char *)tern_find_ptr(tree, "foob")); | |
21 printf("foobarbaz: %d\n", (int)tern_find_int(tree, "foobarbaz", 0)); | |
22 printf("goobarbaz: %d\n", (int)tern_find_int(tree, "goobarbaz", 0)); | |
23 printf("foobarb: %d\n", (int)tern_find_int(tree, "foobarb", 0)); | |
24 return 0; | |
25 } | |
26 |