The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Typedefs | Functions
queue.h File Reference
#include <stdbool.h>
#include <freeradius-devel/io/atomic_queue.h>
#include <freeradius-devel/util/talloc.h>
+ Include dependency graph for queue.h:

Go to the source code of this file.

Typedefs

typedef struct fr_queue_s fr_queue_t
 

Functions

fr_queue_tfr_queue_create (TALLOC_CTX *ctx, int size)
 Create a non-thread-safe queue. More...
 
void fr_queue_debug (fr_queue_t *fq, FILE *fp)
 Dump a queue. More...
 
int fr_queue_localize_atomic (fr_queue_t *fq, fr_atomic_queue_t *aq)
 Pull all entries from an atomic queue into our local queue. More...
 
int fr_queue_num_elements (fr_queue_t *fq)
 get the number of elements in a queue. More...
 
bool fr_queue_pop (fr_queue_t *fq, void **p_data)
 Pop a pointer from the queue. More...
 
bool fr_queue_push (fr_queue_t *fq, void *data)
 Push a pointer into the queue. More...
 
fr_queue_tfr_queue_resize (fr_queue_t *fq, int size)
 Resize a queue, and copy the entries over. More...
 
int fr_queue_size (fr_queue_t *fq)
 get the size of a queue More...
 

Typedef Documentation

◆ fr_queue_t

typedef struct fr_queue_s fr_queue_t

Definition at line 1 of file queue.h.

Function Documentation

◆ fr_queue_create()

fr_queue_t* fr_queue_create ( TALLOC_CTX *  ctx,
int  size 
)

Create a non-thread-safe queue.

Parameters
[in]ctxthe talloc ctx
[in]sizethe 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.

+ Here is the caller graph for this function:

◆ fr_queue_debug()

void fr_queue_debug ( fr_queue_t fq,
FILE *  fp 
)

Dump a queue.

Parameters
[in]fqthe queue
[in]fpwhere the debugging information will be printed.

Definition at line 258 of file queue.c.

◆ fr_queue_localize_atomic()

int fr_queue_localize_atomic ( fr_queue_t fq,
fr_atomic_queue_t aq 
)

Pull all entries from an atomic queue into our local queue.

Parameters
[in]fqthe local queue
[in]aqthe atomic queue
Returns
  • number of entries successfully moved over

Definition at line 222 of file queue.c.

+ Here is the call graph for this function:

◆ fr_queue_num_elements()

int fr_queue_num_elements ( fr_queue_t fq)

get the number of elements in a queue.

Parameters
[in]fqthe queue
Returns
  • The number of elements in the queue.

Definition at line 141 of file queue.c.

◆ fr_queue_pop()

bool fr_queue_pop ( fr_queue_t fq,
void **  p_data 
)

Pop a pointer from the queue.

Parameters
[in]fqthe queue
[in]p_datawhere to write the data
Returns
  • true on successful pop
  • false on queue empty

Definition at line 107 of file queue.c.

◆ fr_queue_push()

bool fr_queue_push ( fr_queue_t fq,
void *  data 
)

Push a pointer into the queue.

Parameters
[in]fqthe queue
[in]datathe data to push
Returns
  • true on successful push
  • false on queue full

Definition at line 85 of file queue.c.

◆ fr_queue_resize()

fr_queue_t* fr_queue_resize ( fr_queue_t fq,
int  size 
)

Resize a queue, and copy the entries over.

Parameters
[in]fqthe queue
[in]sizethe 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.

+ Here is the call graph for this function:

◆ fr_queue_size()

int fr_queue_size ( fr_queue_t fq)

get the size of a queue

Parameters
[in]fqthe queue
Returns
  • The size of the queue.

Definition at line 127 of file queue.c.