summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/color_palette.c2
-rw-r--r--src/util/queue.h10
2 files changed, 11 insertions, 1 deletions
diff --git a/src/util/color_palette.c b/src/util/color_palette.c
index e55c9e1..53c2c68 100644
--- a/src/util/color_palette.c
+++ b/src/util/color_palette.c
@@ -32,7 +32,7 @@ static char *normal_colors[16] = {
bool camu_color_palette_init(str *path)
{
struct aki_file file;
- if (!aki_file_open(&file, path, false)) {
+ if (!aki_file_open(&file, path, 0)) {
return false;
}
str s;
diff --git a/src/util/queue.h b/src/util/queue.h
index 032bb55..4f184ba 100644
--- a/src/util/queue.h
+++ b/src/util/queue.h
@@ -36,6 +36,16 @@
aki_mutex_unlock(&(q).mutex); \
} while (0)
+#define camu_queue_try_pop(q, s, r) \
+ do { \
+ aki_mutex_lock(&(q).mutex); \
+ s = (q).a.size; \
+ if (s > 0) { \
+ al_array_pop_at((q).a, 0, r); \
+ } \
+ aki_mutex_unlock(&(q).mutex); \
+ } while (0)
+
#define camu_queue_free(q) \
do { \
aki_mutex_destroy(&(q).mutex); \