.TH Q_INIT 3 2023-07-23 "LIBRECAST" "Librecast Programmer's Manual" .SH NAME q_init, q_free \- initialize and free queue .SH LIBRARY Librecast library .RI ( liblibrecast ", " \-llibrecast ) .SH SYNOPSIS .nf .B #include .PP .BI "int q_init(q_t " *q ");" .BI "int q_free(q_t " *q ");" .fi .PP Compile and link with \fI\-llibrecast\fP. .SH DESCRIPTION The .BR q_init () function initializes smolq queue .IR q . .PP You will be surprised to learn that .BR q_free () is the corresponding function to free a queue so initialized. .PP .SH RETURN VALUE These functions return zero on success. On error, -1 is returned and .IR errno is set to indicate the error. .PP .SH ERRORS .BR q_init () may fail when initializing the queue semaphore. .BR q_free () may fail when destroying the queue semaphore. See .BR sem_init (3) and .BR sem_destroy (3) for the relevant error codes. .PP .SH SEE ALSO .BR q_job_seek (3), .BR q_pool_create (3), .BR q_pool_destroy (3), .BR q_push (3), .BR q_wait (3), .BR sem_init (3), .BR sem_destroy (3)