Q_INIT(3)

NAME
q_init, q_free - initialize and free queue

LIBRARY
Librecast library (liblibrecast, -llibrecast)

SYNOPSIS
#include <librecast/q.h>

int q_init(q_t *q);
int q_free(q_t *q);

Compile and link with -llibrecast.

DESCRIPTION
The q_init() function initializes smolq queue q.

You will be surprised to learn that q_free() is the corresponding function to free a queue so initialized.

RETURN VALUE
These functions return zero on success. On error, -1 is returned and errno is set to indicate the error.

ERRORS
q_init() may fail when initializing the queue semaphore. q_free() may fail when destroying the queue semaphore. See sem_init(3) and sem_destroy(3) for the relevant error codes.

SEE ALSO
q_job_seek(3), q_pool_create(3), q_pool_destroy(3), q_push(3), q_wait(3), sem_init(3), sem_destroy(3)