]> git.sur5r.net Git - ngadmin/blobdiff - lib/src/list.h
Separated lib in two parts : low level and high level.
[ngadmin] / lib / src / list.h
diff --git a/lib/src/list.h b/lib/src/list.h
deleted file mode 100644 (file)
index 3eaf2ba..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-
-#ifndef DEF_LIST
-#define DEF_LIST
-
-
-#include <stdlib.h>
-#include <stdbool.h>
-#include <string.h>
-
-#ifdef MT_SAFE_LIST
-#include <pthread.h>
-#endif
-
-
-
-typedef struct ListNode ListNode;
-
-struct ListNode {
- void* data;
- ListNode *prev, *next;
-};
-
-
-typedef struct {
- ListNode *first, *last;
- unsigned int count;
- #ifdef MT_SAFE_LIST
- pthread_cond_t cond;
- pthread_mutex_t mutex;
- #endif
-} List;
-
-
-
-
-// Creates an empty list
-List* createEmptyList (void);
-
-// Destroys a list, and eventually frees the elements
-// NOT MT SAFE
-void destroyList (List *l, void (*freefunc)(void*));
-
-// Adds an element at front of the list
-void pushFrontList (List *l, void* data);
-
-// Adds an element at back of the list
-void pushBackList (List *l, void* data);
-
-// Pops an element from the front of the list and returns its value
-void* popFrontList (List *l);
-
-// Pops an element from the back of the list and returns its value
-void* popBackList (List *l);
-
-// Clears all the items of the list, and eventually frees them
-void clearList (List *l, void (*freefunc)(void*));
-
-// Find and destroy a particular element of the list, and eventually frees it
-bool findAndDestroy (List *l, void* data, void (*freefunc)(void*));
-
-// Browse all the items of the list through the callback function
-void browseList (List *l, void (*browsefunc)(void*));
-
-// 
-void* convertToArray (List *l, size_t sz);
-
-
-
-
-#endif
-