INtime SDK Help
lfind

Performs a linear search for a specified key in an unsorted array.

#include <search.h>

char *lfind (const void *key, 
    const void *base, 
    unsigned int *num, 
    unsigned int width, 
    int (*compare) (const void *elem1, const void *elem2)
);

Parameters

key
Value being sought.
base
Pointer to base of the array to be searched.
num
Number of elements in the array.
width
Width of elements in bytes.
compare
Pointer to a user-supplied routine that compares two array elements, elem1 and elem2, and returns a value specifying their relationship.
elem1
Pointer to the key for the search.
elem2
Pointer to the array element to be compared with the key.

Remarks

lfind calls the compare routine one or more times during the search, passing pointers to two array elements on each call. This routine must compare the elements, then return a non-0 value if the elements are different, or 0 if the elements are identical.

Return Values

A pointer to the array element that matches key.
Success.
A null pointer if a match is not found.
Failure.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/rt/include/search.h search.h clib.lib

See Also

bsearch, lsearch, qsort