HP-UX Reference (11i v1 00/12) - 3 Library Functions A-M (vol 6)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/!!!intro.3c
________________________________________________________________
___ ___
l
lsearch(3C) lsearch(3C)
while (fgets(line, ELSIZE, stdin) != NULL &&
nel < TABSIZE)
(void) lsearch(line, (char *)tab, &nel,
ELSIZE, strcmp);
...
RETURN VALUE
If the searched-for datum is found, both lsearch() and lfind() return a pointer to it. Otherwise,
lfind() returns NULL and lsearch() returns a pointer to the newly added element.
WARNINGS
Undefined results can occur if there is not enough room in the table to add a new item.
SEE ALSO
bsearch(3C), hsearch(3C), tsearch(3C).
STANDARDS CONFORMANCE
lsearch(): AES, SVID2, SVID3, XPG2, XPG3, XPG4
lfind(): AES, SVID2, SVID3, XPG2, XPG3, XPG4
HP-UX Release 11i: December 2000 2 Section 3505
___
___