| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

strlookup

#include "sflstr.h"
int
strlookup (const LOOKUP *lookup, const char *key)

Synopsis

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.

Source Code - (sflstr.c)

{
    int
        index;

    ASSERT (lookup);
    ASSERT (key);

    for (index = 0; lookup [index].key; index++)
        if (streq (lookup [index].key, key))
            break;

    return (lookup [index].value);
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation