From 1536f1e0287b8281014200ef6911b294272c4773 Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Wed, 11 Jun 2025 19:39:52 -0500 Subject: Start fixing the encryption scheme --- src/threadpool.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/threadpool.h') diff --git a/src/threadpool.h b/src/threadpool.h index 91c903c..61dbacd 100644 --- a/src/threadpool.h +++ b/src/threadpool.h @@ -25,7 +25,7 @@ typedef struct ctqueue ctqueue; * @param callback Callback function the given data should be ran with. Must be non-null * @param freecb Callback function for freeing the given data. May be null * @param data Data to be passed to the callback. May be null - * @return task* Returns a task object with set parameters. Returns `null` and sets errno on error + * @retval (task*)[NULL, task*] Returns a task object with set parameters. Returns `null` and sets errno on error */ task * task_init(gcallback callback, fcallback freecb, void *data); @@ -40,7 +40,7 @@ void task_free(void *tsk); * @brief Fire a task. Passes the `data` member to the specified `callback` * * @param tsk A task to be fired. Must be non-null - * @return int Returns value of the fired callback. Returns -1 and sets errno on error + * @retval (int) Returns value of the fired callback. Returns -1 and sets errno on error */ int task_fire(task *tsk); @@ -48,7 +48,7 @@ int task_fire(task *tsk); * @brief Fire and destroy a task simultaneously. Calls specified callback and free-callback on associated data * * @param tsk Task to be fired and destroyed. Must be non-null - * @return int Returns value of the callback. Returns -1 and sets errno on error + * @retval (int) Returns value of the callback. Returns -1 and sets errno on error */ int task_fired(task *tsk); @@ -57,7 +57,7 @@ int task_fired(task *tsk); /** * @brief Create a FIFO queue of tasks * - * @return taskqueue* Returns a new taskqueue object. Returns `null` and sets errno on error + * @retval (taskqueue*)[NULL, taskqueue*] Returns a new taskqueue object. Returns `null` and sets errno on error */ taskqueue * taskqueue_init(void); @@ -73,7 +73,7 @@ void taskqueue_free(void *tq); * * @param tq The taskqueue to be modified. Must be non-null * @param tsk The task to push. Must be non-null - * @return int Returns 0 on success, sets errno and returns -1 on error + * @retval (int)[-1, 0] Returns 0 on success, sets errno and returns -1 on error */ int taskqueue_push(taskqueue *tq, task *tsk); @@ -81,7 +81,7 @@ int taskqueue_push(taskqueue *tq, task *tsk); * @brief Pop a task from a taskqueue * * @param tq A taskqueue to grab a task from. Must be non-null - * @return task* Returns a task on success, sets errno and returns `null` on error + * @retval (task*)[NULL, task*] Returns a task on success, sets errno and returns `null` on error */ task * taskqueue_pop(taskqueue *tq); @@ -90,7 +90,7 @@ task * taskqueue_pop(taskqueue *tq); * * @param tq The taskqueue to be modified. Must be non-null * @param tsk The task to be appended. Must be non-null - * @return int Returns 0 on success, sets errno and returns `null` on error + * @retval (int)[-1, 0] Returns 0 on success, sets errno and returns -1 on error */ int taskqueue_pushfront(taskqueue *tq, task *tsk); @@ -98,7 +98,7 @@ int taskqueue_pushfront(taskqueue *tq, task *tsk); * @brief Pop a task from the back (most recently pushed task) of a taskqueue * * @param tq A taskqueue to pop from. Must be non-null - * @return task* Returns a task on success, sets errno and returns `null` on error + * @retval (task*)[NULL, task*] Returns a task on success, sets errno and returns `null` on error */ task * taskqueue_popback(taskqueue *tq); @@ -108,7 +108,7 @@ task * taskqueue_popback(taskqueue *tq); * @brief Create a concurrent taskqueue with `size` allocated threads * * @param size Number of threads in the threadpool. Must be greater than zero - * @return ctqueue* Returns a new ctqueue, sets errno and returns `null` on error + * @retval (ctqueue*)[NULL, ctqueue*] Returns a new ctqueue, sets errno and returns `null` on error */ ctqueue * ctqueue_init(int size); @@ -116,7 +116,7 @@ ctqueue * ctqueue_init(int size); * @brief Cancel all tasks being processed in a currently running concurrent taskqueue * * @param ctq The concurrent taskqueue to be canceled. Must be non-null - * @return int Returns 0 on success, sets errno and returns -1 on error + * @retval (int)[-1, 0] Returns 0 on success, sets errno and returns -1 on error */ int ctqueue_cancel(ctqueue *ctq); @@ -134,7 +134,7 @@ void ctqueue_free(void *ctq); * * @param ctq The concurrent taskqueue to modify. Must be non-null * @param tsk The task to push. Must be non-null - * @return Returns `thrd_success` on success, returns `thrd_error` or `thrd_nomem` on error + * @retval (int) Returns `thrd_success` on success, returns `thrd_error` or `thrd_nomem` on error */ int ctqueue_waitpush(ctqueue *ctq, task *tsk); @@ -144,7 +144,7 @@ int ctqueue_waitpush(ctqueue *ctq, task *tsk); * @attention May block for an indefinite amount of time to pop the task * * @param ctq The concurrent taskqueue to pop from. Must be non-null - * @return Returns a task on success, sets errno and returns `null` on error + * @retval (task*)[NULL, task*] Returns a task on success, sets errno and returns `null` on error */ task * ctqueue_waitpop(ctqueue *ctq); @@ -153,7 +153,7 @@ task * ctqueue_waitpop(ctqueue *ctq); * @attention Threads will not consume pushed tasks until this function is ran * * @param ctq A concurrent taskqueue to start. Must be non-null - * @return int Returns 0 on success, sets errno and returns -1 on error + * @retval (int)[-1, 0] Returns 0 on success, sets errno and returns -1 on error */ int ctqueue_start(ctqueue *ctq); -- cgit v1.2.3