#include <stdint.h>
#include <string.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/io/queue.h>
Go to the source code of this file.
◆ fr_queue_s
Definition at line 33 of file queue.c.
Data Fields |
void * |
entry[1] |
Array of queue data. |
int |
head |
head of the queue |
int |
num |
number of elements pushed into the queue |
int |
size |
size of the queue |
int |
tail |
tail of the queue |
◆ fr_queue_create()
fr_queue_t* fr_queue_create |
( |
TALLOC_CTX * |
ctx, |
|
|
int |
size |
|
) |
| |
Create a non-thread-safe queue.
- Parameters
-
[in] | ctx | the talloc ctx |
[in] | size | the number of entries in the queue |
- Returns
- NULL on error
- fr_queue_t *, a pointer to the allocated and initialized queue
Definition at line 51 of file queue.c.
◆ fr_queue_debug()
void fr_queue_debug |
( |
fr_queue_t * |
fq, |
|
|
FILE * |
fp |
|
) |
| |
Dump a queue.
- Parameters
-
[in] | fq | the queue |
[in] | fp | where the debugging information will be printed. |
Definition at line 258 of file queue.c.
◆ fr_queue_localize_atomic()
Pull all entries from an atomic queue into our local queue.
- Parameters
-
[in] | fq | the local queue |
[in] | aq | the atomic queue |
- Returns
- number of entries successfully moved over
Definition at line 222 of file queue.c.
◆ fr_queue_num_elements()
get the number of elements in a queue.
- Parameters
-
- Returns
- The number of elements in the queue.
Definition at line 141 of file queue.c.
◆ fr_queue_pop()
Pop a pointer from the queue.
- Parameters
-
[in] | fq | the queue |
[in] | p_data | where to write the data |
- Returns
- true on successful pop
- false on queue empty
Definition at line 107 of file queue.c.
◆ fr_queue_push()
Push a pointer into the queue.
- Parameters
-
[in] | fq | the queue |
[in] | data | the data to push |
- Returns
- true on successful push
- false on queue full
Definition at line 85 of file queue.c.
◆ fr_queue_resize()
Resize a queue, and copy the entries over.
- Parameters
-
[in] | fq | the queue |
[in] | size | the new size of the queue |
- Returns
- NULL on error
- fr_queue_t * the new queue, which MAY BE fq.
Definition at line 158 of file queue.c.
◆ fr_queue_size()
get the size of a queue
- Parameters
-
- Returns
-
Definition at line 127 of file queue.c.