src/server/ucx/dlist.h

changeset 14
b8bf95b39952
parent 13
1fdbf4170ef4
child 15
cff9c4101dd7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/server/ucx/dlist.h	Sat Jan 14 13:53:44 2012 +0100
@@ -0,0 +1,39 @@
+/*
+ *
+ */
+
+#ifndef DLIST_H
+#define	DLIST_H
+
+#include "ucx.h"
+#include <stddef.h>
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+typedef struct UcxDlist UcxDlist;
+struct UcxDlist {
+    void     *data;
+    UcxDlist *next;
+    UcxDlist *prev;
+};
+
+void ucx_dlist_free(UcxDlist *l);
+UcxDlist *ucx_dlist_append(UcxDlist *l, void *data);
+UcxDlist *ucx_dlist_prepend(UcxDlist *l, void *data);
+UcxDlist *ucx_dlist_concat(UcxDlist *l1, UcxDlist *l2);
+UcxDlist *ucx_dlist_last(UcxDlist *l);
+UcxDlist *ucx_dlist_get(UcxDlist *l, int index);
+size_t ucx_dlist_size(UcxDlist *l);
+void ucx_dlist_foreach(UcxDlist *l, ucx_callback fnc, void* data);
+
+/* dlist specific functions */
+UcxDlist *ucx_dlist_first(UcxDlist *l);
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif	/* DLIST_H */
+

mercurial