From 60715c7785e7fbe4759df64258ad58a8e2a0769d Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Fri, 16 May 2025 19:09:02 -0500 Subject: Do some more work on the concurrent queue --- src/shared.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/shared.h') diff --git a/src/shared.h b/src/shared.h index 825814e..66d1af3 100644 --- a/src/shared.h +++ b/src/shared.h @@ -7,6 +7,9 @@ #define FALSE 0 #define TRUE 1 +typedef int (*gcallback)(void*); // Generic callback signature +typedef void (*fcallback)(void*); // free()-like callback signature + #define RETURNWERR(errval, retval) do {\ errno = (errval);\ return (retval);\ @@ -60,12 +63,12 @@ char * xdirname(const char * const path); // Cleanup callback. Should act like `free()`, in that it doesn't crash if the pointer it's given is null -typedef void (*cleanup_callback)(void*); +typedef fcallback cleanup_callback; // Cleanup struct. Stores a STATICALLY defined array of callbacks and void* arguments typedef struct cl { - cleanup_callback *funcs; - void **args; + cleanup_callback *funcs; // Actual type: cleanup_callback funcs[] + void **args; // Actual type: void *args[] int size; int used; -- cgit v1.2.3