pathqueue.h File Reference

#include <stdlib.h>
#include <stdio.h>

Include dependency graph for pathqueue.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _Node
 Definition of a queue's node. More...
struct  _NodeQueue
 Definition the queue. More...

Typedefs

typedef struct _Node Node
 Definition of a queue's node.
typedef struct _NodeQueue NodeQueue
 Definition the queue.

Functions

int queueIsEmpty (NodeQueue *q)
void pushNode (NodeQueue *q, int x, int y)
void pushNodeLast (NodeQueue *q, int x, int y)
int popNode (NodeQueue *q, Node *n)
void printQueue (NodeQueue *q)
NodeQueuenewQueue (void)
int delQueue (NodeQueue *q)
int isInQueue (NodeQueue *q, int x, int y)
void drainQueue (NodeQueue *q)


Detailed Description

Header file of pathqueue.c
Author:
Jose Maria Martin Laguna <jmmartin@etud.insa-toulouse.fr>

Definition in file pathqueue.h.


Function Documentation

int delQueue ( NodeQueue q  ) 

Free queue memory

Parameters:
q Queue
Returns:
1 if memory was succesfully free 0 if the queue is not empty

Definition at line 133 of file pathqueue.c.

References queueIsEmpty().

Here is the call graph for this function:

void drainQueue ( NodeQueue q  ) 

Free memory allocated in the queue

Parameters:
q Queue

Definition at line 162 of file pathqueue.c.

References popNode().

Here is the call graph for this function:

int isInQueue ( NodeQueue q,
int  x,
int  y 
)

Finds out if the node (X,Y) is in the queue

Parameters:
q Queue
x Coordonate X of a cell
y Coordonate Y of a cell
Returns:
1 if (X,Y) was founded, 0 otherwise

Definition at line 147 of file pathqueue.c.

References _NodeQueue::first, _Node::next, _Node::x, and _Node::y.

NodeQueue* newQueue ( void   ) 

Init queue values

Parameters:
q Queue

Definition at line 121 of file pathqueue.c.

References _NodeQueue::first, and _NodeQueue::last.

int popNode ( NodeQueue q,
Node n 
)

Pop the first node of the queue

Parameters:
q Queue
n Pointer to a node
Returns:
1 if node was succesfully poped 0 if the queue is empty

Definition at line 88 of file pathqueue.c.

References _NodeQueue::first, _NodeQueue::last, _PathPoint::next, queueIsEmpty(), _PathPoint::x, _Node::x, _PathPoint::y, and _Node::y.

Here is the call graph for this function:

void printQueue ( NodeQueue q  ) 

Print the queue

Parameters:
q Queue
Note:
Used only for debug

Definition at line 106 of file pathqueue.c.

References _NodeQueue::first, _Node::next, _Node::x, and _Node::y.

void pushNode ( NodeQueue q,
int  x,
int  y 
)

Push a node into the queue in a FIFO mode

Parameters:
q Queue
x Coordonate X of a cell
y Coordonate Y of a cell

Definition at line 34 of file pathqueue.c.

References _NodeQueue::first, _NodeQueue::last, _PathPoint::next, _Node::next, queueIsEmpty(), _Node::x, and _Node::y.

Here is the call graph for this function:

void pushNodeLast ( NodeQueue q,
int  x,
int  y 
)

Push a node into the queue in a LIFO mode

Parameters:
q Queue
x Coordonate X of a cell
y Coordonate Y of a cell

Definition at line 61 of file pathqueue.c.

References _NodeQueue::first, _NodeQueue::last, _Node::next, queueIsEmpty(), _Node::x, and _Node::y.

Here is the call graph for this function:

int queueIsEmpty ( NodeQueue q  ) 

Tests if a queue is empty

Parameters:
q A queue
Returns:
1 if the queue is empty, 0 otherwise

Definition at line 23 of file pathqueue.c.

References _NodeQueue::first, and _NodeQueue::last.


Generated on Thu Sep 13 11:28:29 2007 for DCE-Eurobot by  doxygen 1.5.3