src/request_queue.c file

Classes

struct request_queue

Functions

auto request_queue_new(TALLOC_CTX* ctx, unsigned int capacity) -> request_queue*
request_queue_new Creates new request_queue.
auto request_queue_push(request_queue* queue, struct Queue_Node_s* node) -> enum RequestQueueErrorCode
auto request_queue_pop(request_queue* queue) -> struct Queue_Node_s*
request_queue_pop Get node from the top of queue and remove it.
auto request_queue_peek(request_queue* queue) -> struct Queue_Node_s*
request_queue_peek Get pointer to the head of queue.
auto request_queue_empty(request_queue* queue) -> bool
request_queue_empty Returns true if queue is empty.
auto request_queue_move(request_queue* from, request_queue* to) -> enum RequestQueueErrorCode

Function documentation

request_queue* request_queue_new(TALLOC_CTX* ctx, unsigned int capacity)

request_queue_new Creates new request_queue.

Parameters
ctx in Memory context to operate upon.
capacity in Maximum size of the queue.
Returns
  • NULL on error.
  • Pointer to queue on success.

struct Queue_Node_s* request_queue_pop(request_queue* queue)

request_queue_pop Get node from the top of queue and remove it.

Parameters
queue in Current queue to receive element from.
Returns
  • NULL on underflow.
  • Pointer to element on success.

struct Queue_Node_s* request_queue_peek(request_queue* queue)

request_queue_peek Get pointer to the head of queue.

Parameters
queue in Current queue to receive element from.
Returns
  • NULL on underflow.
  • Pointer to element on success.

bool request_queue_empty(request_queue* queue)

request_queue_empty Returns true if queue is empty.

Parameters
queue in Current queue to operate upon.
Returns
  • true if empty.
  • false if there are elements in queue.