summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2024-01-01 11:23:22 -0500
committerAndrew Opalach <andrew@akon.city> 2024-01-01 11:23:22 -0500
commit130a0edc0405e53b45f8b2f8da0b94356480a644 (patch)
tree76cda2f7e0098bdcb6c54dc152bf3e95467fd44e /src/util
parent099126fdca625c5f6c219c5a1a7ecbc0e145988f (diff)
downloadcamu-130a0edc0405e53b45f8b2f8da0b94356480a644.tar.gz
camu-130a0edc0405e53b45f8b2f8da0b94356480a644.tar.bz2
camu-130a0edc0405e53b45f8b2f8da0b94356480a644.zip
wip
Signed-off-by: Andrew Opalach <andrew@akon.city>
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); \