summaryrefslogtreecommitdiff
path: root/prism/list.c
diff options
context:
space:
mode:
Diffstat (limited to 'prism/list.c')
-rw-r--r--prism/list.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/prism/list.c b/prism/list.c
new file mode 100644
index 0000000000..8d4cd1be94
--- /dev/null
+++ b/prism/list.c
@@ -0,0 +1,24 @@
+#include "prism/internal/list.h"
+
+/**
+ * Returns the size of the list.
+ */
+size_t
+pm_list_size(pm_list_t *list) {
+ return list->size;
+}
+
+/**
+ * Append a node to the given list.
+ */
+void
+pm_list_append(pm_list_t *list, pm_list_node_t *node) {
+ if (list->head == NULL) {
+ list->head = node;
+ } else {
+ list->tail->next = node;
+ }
+
+ list->tail = node;
+ list->size++;
+}