From 130a0edc0405e53b45f8b2f8da0b94356480a644 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Mon, 1 Jan 2024 11:23:22 -0500 Subject: wip Signed-off-by: Andrew Opalach --- src/util/color_palette.c | 2 +- src/util/queue.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src/util') 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); \ -- cgit v1.2.3-101-g0448