btnut/btnode/include/utils/fifo_queue.h File Reference


Detailed Description

Implementation of a first-in first-out (FIFO) queue.

Author:
Kevin Martin <kevmarti@tik.ee.ethz.ch>
Date:
11-22-05


Data Structures

struct  _fifo_queue_t
 Representation of a FIFO queue. More...

Typedefs

typedef _fifo_queue_t fifo_queue_t
 Representation of a FIFO queue.

Functions

fifo_queue_tfifo_queue_create (u_short size)
void fifo_queue_destroy (fifo_queue_t *que)
u_short fifo_queue_max_size (fifo_queue_t *que)
void * fifo_queue_pop (fifo_queue_t *que)
 Removes the first element of the FIFO queue specified.
short fifo_queue_push (fifo_queue_t *que, void *elem)
 Adds an element to the end of a fifo queue.
u_short fifo_queue_size (fifo_queue_t *que)
void * fifo_queue_top (fifo_queue_t *que)
 Gets the first element of the FIFO queue specified.


Typedef Documentation

typedef struct _fifo_queue_t fifo_queue_t

Representation of a FIFO queue.

Contains all the information needed to control a FIFO queue.


Function Documentation

void* fifo_queue_pop ( fifo_queue_t que  )  [inline]

Removes the first element of the FIFO queue specified.

"Pops" the topmost element from the FIFO queue specified.

Parameters:
que Pointer to the queue.
Returns:
  • pointer to the first element in the queue
  • NULL if the list is empty

short fifo_queue_push ( fifo_queue_t que,
void *  elem 
) [inline]

Adds an element to the end of a fifo queue.

"Pushes" an element into the fifo queue specified.

Parameters:
que Pointer to the fifo queue.
elem Pointer to the element to be added
Returns:
  • 0 if success
  • -1 if queue is full

void* fifo_queue_top ( fifo_queue_t que  )  [inline]

Gets the first element of the FIFO queue specified.

Returns a pointer to the topmost element in the queue without removing it.

Parameters:
que Pointer to the queue.
Returns:
  • Pointer to the first element in the queue
  • NULL if the queue is empty


Generated on Wed Apr 29 11:12:30 2009 for BTnut System Software by doxygen 1.5.1