Mercurial > repos > blastem
comparison tern.c @ 431:440efd7d27a9
Read key bindings from config file
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 10 Jul 2013 22:48:17 -0700 |
parents | f6fdde540791 |
children | 140af5509ce7 |
comparison
equal
deleted
inserted
replaced
430:7f84090ab1cd | 431:440efd7d27a9 |
---|---|
61 } | 61 } |
62 } | 62 } |
63 return 0; | 63 return 0; |
64 } | 64 } |
65 | 65 |
66 tern_node * tern_find_prefix(tern_node * head, char * key) | |
67 { | |
68 tern_node * cur = head; | |
69 while (cur && *key) | |
70 { | |
71 if (cur->el == *key) { | |
72 cur = cur->straight.next; | |
73 key++; | |
74 } else if (*key < cur->el) { | |
75 cur = cur->left; | |
76 } else { | |
77 cur = cur->right; | |
78 } | |
79 } | |
80 return cur; | |
81 } | |
82 | |
66 intptr_t tern_find_int(tern_node * head, char * key, intptr_t def) | 83 intptr_t tern_find_int(tern_node * head, char * key, intptr_t def) |
67 { | 84 { |
68 tern_val ret; | 85 tern_val ret; |
69 if (tern_find(head, key, &ret)) { | 86 if (tern_find(head, key, &ret)) { |
70 return ret.intval; | 87 return ret.intval; |