home *** CD-ROM | disk | FTP | other *** search
- #ifndef LOOKUPH
- #define LOOKUPH
-
- #define ARG_TYPE const char *
- #define RET_TYPE int
-
- typedef RET_TYPE (*proc)(ARG_TYPE);
-
- struct entry {
- const char *name;
- proc f;
- };
-
- class lookup {
- entry *table;
- proc dflt;
- int max;
- public:
- lookup(entry *t) {
- dflt = t->f;
- max = int(t->name);
- table = t + 1;
- }
- // This really does take a const char *
- proc operator[](const char *);
- };
- #endif
-