medialibrary: Ignore empty playlists for now
[vlc.git] / compat / lfind.c
blobd62b2cfd9beaf6c8f01f9d611fd93047d813459c
1 /*****************************************************************************
2 * lfind.c : implement lfind
3 *****************************************************************************/
5 #ifdef HAVE_CONFIG_H
6 # include <config.h>
7 #endif
9 void *lfind(const void *key, const void *base, size_t *nmemb,
10 size_t size, int(*cmp)(const void *, const void *))
12 for (int i = 0; i < *nmemb; ++i)
14 const void *elem = base + i * size;
15 if (!cmp(key, elem))
16 return elem;
18 return NULL;