queue.h File Reference

A First In-First Out (FIFO) data structure: header file. More...

#include "tdkdtree.h"
Include dependency graph for queue.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  qnode
 Node definition. The variable info is a pointer to the information contained in the node and next is a pointer to the next element in the queue. More...
struct  queue
 Queue definition. A queue is a standard queue that has infokdnode data structures as elements. The variable first is a pointer to the first element and last is a pointer to the last element in the queue. More...

Typedefs

typedef struct qnode qnode
 Node definition. The variable info is a pointer to the information contained in the node and next is a pointer to the next element in the queue.
typedef struct queue queue
 Queue definition. A queue is a standard queue that has infokdnode data structures as elements. The variable first is a pointer to the first element and last is a pointer to the last element in the queue.

Functions

void qbuild ()
 Building an empty queue.
void qinsert ()
qnodeqretrieve ()
 Retrieving a pointer to the first element from the queue.
void qdelete ()
 Deleting the first element from the queue.
int qempty ()
 Checking if the queue is empty.
void qdestroy ()
 Destroying a queue object.

Detailed Description

A First In-First Out (FIFO) data structure: header file.

Version:
10.10
Author:
Julio José Águila Guerrero
Date:
October 19th, 2010

A straightforward implementation of a queue data structure for FIFO storing-strategy based on a description of J. Villalobos (1996).

Note:
Last change was in October 19th, 2010.

Definition in file queue.h.


Typedef Documentation

typedef struct qnode qnode

Node definition. The variable info is a pointer to the information contained in the node and next is a pointer to the next element in the queue.

typedef struct queue queue

Queue definition. A queue is a standard queue that has infokdnode data structures as elements. The variable first is a pointer to the first element and last is a pointer to the last element in the queue.


Function Documentation

void qbuild ( void   ) 

Building an empty queue.

See also:
qbuild
Returns:
None.

Definition at line 31 of file queue.c.

Here is the caller graph for this function:

void qdelete ( void   ) 

Deleting the first element from the queue.

See also:
qdelete

The element pointed by first is release and the element pointed by next is now the first element.

Returns:
None.

Definition at line 97 of file queue.c.

Here is the caller graph for this function:

void qdestroy ( void   ) 

Destroying a queue object.

See also:
qdestroy

All elements in the queue are released. Finally the own queue is released.

Returns:
None.

Definition at line 147 of file queue.c.

Here is the caller graph for this function:

int qempty ( void   ) 

Checking if the queue is empty.

See also:
qempty

The queue is checked asking for the value of the first element. If the value of first is null then the queue is empty, if not at least there is a one element.

Returns:
If the queue is empty return 1, 0 if not.

Definition at line 131 of file queue.c.

void qinsert (  ) 
See also:
qinsert
qnode* qretrieve ( void   ) 

Retrieving a pointer to the first element from the queue.

See also:
qretrieve

The element pointed by first is retrieved by the function that done the calling. The element is not deleted from the queue.

Returns:
A pointer to the first element.

Definition at line 81 of file queue.c.

Here is the caller graph for this function:

Generated on Tue Nov 16 18:24:44 2010 by  doxygen 1.6.3