X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib%2Flist.h;fp=lib%2Flist.h;h=0000000000000000000000000000000000000000;hb=284454918cc95058b026d057195eaa5279135c36;hp=3f701be650e681ecc8937147e08a20cd0c2a4615;hpb=bd0ed9bc7c534be30b0140b341b4d8a390483dbd;p=apps%2Fmadmutt.git diff --git a/lib/list.h b/lib/list.h deleted file mode 100644 index 3f701be..0000000 --- a/lib/list.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * written for mutt-ng by: - * Rocco Rutte - * - * This file is part of mutt-ng, see http://www.muttng.org/. - * It's licensed under the GNU General Public License, - * please see the file GPL in the top level source directory. - */ - -/* - * this aims to provide a generic list - * implementation using arrays only - * mostly untested - */ - -#ifndef _LIB_LIST_H -#define _LIB_LIST_H - -typedef struct list2_t { - void** data; - ssize_t length; -} list2_t; - -/* - * basics - */ - -list2_t* list_new (void); - -typedef void list_del_t (void**); - -/* free() all memory used by list and optionally - * use del function to free() items as well */ -void list_del (list2_t**, list_del_t* del); - -#define list_empty(l) (!l || l->length == 0 || !l->data) - -/* - * insertion, removal - * the list_push_* functions create a list if empty so far - * for convenience - */ -void list_push_back (list2_t**, void*); -void list_push_front (list2_t**, void*); -void* list_pop_back (list2_t*); -void* list_pop_front (list2_t*); -void* list_pop_idx (list2_t*, int); - -/* - * copying - */ - -/* plain copy */ -list2_t* list_cpy (list2_t*); -/* "hard copy" using callback to copy items */ -list2_t* list_dup (list2_t*, void* (*dup) (void*)); - -/* - * misc - */ - -/* looks up item in list using callback function and comparison item - * return: - * -1 if not found - * index in data array otherwise - * the callback must return 0 on equality - */ -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 */