aboutsummaryrefslogtreecommitdiff
path: root/Src/replicant/nu/nodelist.h
diff options
context:
space:
mode:
authorJean-Francois Mauguit <jfmauguit@mac.com>2024-09-24 09:03:25 -0400
committerGitHub <noreply@github.com>2024-09-24 09:03:25 -0400
commitbab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/replicant/nu/nodelist.h
parent4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff)
parent20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff)
downloadwinamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/replicant/nu/nodelist.h')
-rw-r--r--Src/replicant/nu/nodelist.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/Src/replicant/nu/nodelist.h b/Src/replicant/nu/nodelist.h
new file mode 100644
index 00000000..5a7f1ec1
--- /dev/null
+++ b/Src/replicant/nu/nodelist.h
@@ -0,0 +1,24 @@
+#pragma once
+#include "queue_node.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ // non-thread-safe list of queue_node_t objects with _head and _tail
+ typedef struct nodelist_s
+ {
+ queue_node_t *head;
+ queue_node_t *tail;
+ } nodelist_s, *nodelist_t;
+
+ void nodelist_init(nodelist_t nodelist);
+ void nodelist_push_back(nodelist_t nodelist, queue_node_t *item);
+ void nodelist_push_front(nodelist_t nodelist, queue_node_t *item);
+ queue_node_t *nodelist_pop_front(nodelist_t nodelist);
+ // pushes an item onto the list, but treat it as a whole list rather than a single item
+ void nodelist_push_back_list(nodelist_t nodelist, queue_node_t *item);
+
+
+ #ifdef __cplusplus
+}
+#endif