00001 00007 #ifndef _PATH_QUEUE_H 00008 #define _PATH_QUEUE_H 00009 00010 00011 #include <stdlib.h> 00012 #include <stdio.h> 00013 00014 #ifdef __cplusplus 00015 extern "C" { 00016 #endif 00017 00021 typedef struct _Node{ 00022 int x; 00023 int y; 00024 struct _Node * next; 00025 } Node; 00026 00030 typedef struct _NodeQueue{ 00031 Node *first; 00032 Node *last; 00033 } NodeQueue; 00034 00035 int queueIsEmpty(NodeQueue *q); 00036 00037 void pushNode(NodeQueue * q, int x, int y); 00038 00039 void pushNodeLast(NodeQueue * q, int x, int y); 00040 00041 int popNode(NodeQueue * q, Node * n); 00042 00043 void printQueue(NodeQueue * q); 00044 00045 NodeQueue * newQueue( void ); 00046 00047 int delQueue(NodeQueue * q); 00048 00049 int isInQueue(NodeQueue * q, int x, int y); 00050 00051 void drainQueue(NodeQueue * q); 00052 00053 00054 00055 00056 #ifdef __cplusplus 00057 } 00058 #endif 00059 00060 #endif /*_PATH_QUEUE_H*/ 00061