| iMatix home page | << | < | > | >> |
SFL Version 2.11 |
#include "sflstr.h" int strlookup (const LOOKUP *lookup, const char *key)
Searches the specified lookup table, defined as an array of LOOKUP items, for the specified string key, and returns a lookup value. You are REQUIRED to terminate the table with a null key: if the key is not found in the table, returns the value for the last, null key.
{ int index; ASSERT (lookup); ASSERT (key); for (index = 0; lookup [index].key; index++) if (streq (lookup [index].key, key)) break; return (lookup [index].value); }
| << | < | > | >> | Copyright © 1996-2000 iMatix Corporation |