]> git.rkrishnan.org Git - dttsp.git/blob - jDttSP/thunk.c
e52d80adb33d35b920d38973678fe8d9ddc4957a
[dttsp.git] / jDttSP / thunk.c
1 /* thunk.c */
2
3 #include <common.h>
4 #include <thunk.h>
5
6 PRIVATE BOOLEAN
7 streq(char *p, char *q) { return !strcmp(p, q); }
8
9 /* somewhere along the line
10    we'll kick this up a notch
11    with gperf */
12
13 Thunk
14 Thunk_lookup(CTB ctb, char *key) {
15   if (key && *key) {
16     for (;;) {
17       if (!ctb || !ctb->key || !ctb->thk) break;
18       if (streq(key, ctb->key)) return ctb->thk;
19       ctb++;
20     }
21   }
22   return (Thunk) 0;
23 }