aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/run_queue.h
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-05-13 14:24:36 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-05-13 14:24:40 +0200
commit046e353e128372f846c432a90ca9401506d37d5b (patch)
treeec4f318fac89c2144211e58181b51f53d4cc3e55 /src/run_queue.h
parentcmake: document _GNU_SOURCE usage (diff)
downloadcimple-046e353e128372f846c432a90ca9401506d37d5b.tar.gz
cimple-046e353e128372f846c432a90ca9401506d37d5b.zip
ci_queue -> run_queue
Also, some minor refactoring.
Diffstat (limited to 'src/run_queue.h')
-rw-r--r--src/run_queue.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/run_queue.h b/src/run_queue.h
new file mode 100644
index 0000000..629a8e0
--- /dev/null
+++ b/src/run_queue.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2022 Egor Tensin <Egor.Tensin@gmail.com>
+ * This file is part of the "cimple" project.
+ * For details, see https://github.com/egor-tensin/cimple.
+ * Distributed under the MIT License.
+ */
+
+#ifndef __RUN_QUEUE_H__
+#define __RUN_QUEUE_H__
+
+#include <sys/queue.h>
+
+struct run_queue_entry;
+
+int run_queue_entry_create(struct run_queue_entry **, const char *url, const char *rev);
+void run_queue_entry_destroy(struct run_queue_entry *);
+
+const char *run_queue_entry_get_url(const struct run_queue_entry *);
+const char *run_queue_entry_get_rev(const struct run_queue_entry *);
+
+STAILQ_HEAD(run_queue, run_queue_entry);
+
+void run_queue_create(struct run_queue *);
+void run_queue_destroy(struct run_queue *);
+
+int run_queue_is_empty(const struct run_queue *);
+
+void run_queue_add_first(struct run_queue *, struct run_queue_entry *);
+void run_queue_add_last(struct run_queue *, struct run_queue_entry *);
+
+struct run_queue_entry *run_queue_remove_first(struct run_queue *);
+
+#endif