X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib%2Flist.h;h=3f701be650e681ecc8937147e08a20cd0c2a4615;hb=16536d59024177409f49134c3f03f69855c144b9;hp=20f4c60d5e6ca83bd5f9463a4b0e45a4b0c68bdf;hpb=98ccd0a3050f3dda6c8995e1894b46b8cb7f6ba5;p=apps%2Fmadmutt.git diff --git a/lib/list.h b/lib/list.h index 20f4c60..3f701be 100644 --- a/lib/list.h +++ b/lib/list.h @@ -16,11 +16,9 @@ #ifndef _LIB_LIST_H #define _LIB_LIST_H -#include - typedef struct list2_t { void** data; - size_t length; + ssize_t length; } list2_t; /* @@ -67,6 +65,12 @@ list2_t* list_dup (list2_t*, void* (*dup) (void*)); * index in data array otherwise * the callback must return 0 on equality */ -int list_lookup (list2_t*, int (*cmp) (const void*, const void*), const void*); +typedef int list_lookup_t (const void*, const void*); +int list_lookup (list2_t*, list_lookup_t* cmp, const void*); + +/* + * dumb-splits string at boundary characters into list + */ +list2_t* list_from_str (const char* str, const char* delim); #endif /* !_LIB_LIST_H */