queue.c File Reference

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

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

Go to the source code of this file.

Functions

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

Variables

static queuekdqueue = NULL
 A queue for infokdnode data structures.

Detailed Description

A First In-First Out (FIFO) data structure: source 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.c.


Function Documentation

void qbuild ( void   ) 

Building an empty queue.

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.

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.

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.

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 ( qnode new  ) 

Inserting a new element.

The element new is inserted in the last position of the queue.

Parameters:
new The new information.
Returns:
None.

Definition at line 53 of file queue.c.

Here is the caller graph for this function:

qnode* qretrieve ( void   ) 

Retrieving a pointer to the first element from the queue.

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:


Variable Documentation

queue* kdqueue = NULL [static]

A queue for infokdnode data structures.

Definition at line 23 of file queue.c.

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