4 void *lsearch(const void *key, void *base, size_t *nelp, size_t width,
5 int (*compar)(const void *, const void *))
7 char (*p)[width] = base;
11 for (i = 0; i < n; i++)
12 if (compar(key, p[i]) == 0)
15 return memcpy(p[n], key, width);
18 void *lfind(const void *key, const void *base, size_t *nelp,
19 size_t width, int (*compar)(const void *, const void *))
21 char (*p)[width] = (void *)base;
25 for (i = 0; i < n; i++)
26 if (compar(key, p[i]) == 0)