/* * Labyrinthe.h * * Main header file * * Gouverneur Th. - Cuisinier Gi. */ #ifndef LABYRINTHE_H #define LABYRINTHE_H #include #include "pathfinder.h" #define PATHFINDER // comment this out to disable pathfinding /* option: */ //#define DEBUG //#define DEBUG_MUTEX //#define DEBUG_CHRONO //#define DEBUG_MAITRE //#define DEBUG_CLEAN #define DEBUG_MANUAL /* Defines: */ #define NB_MAX_PIONS 30 #define DROITE 0x1 #define GAUCHE 0x2 #define HAUT 0x4 #define BAS 0x8 #define SOK 0x1 // sorti #define SNOK 0x2 // en cours... /* Structures: */ typedef struct { int lig; int col; } Pos; typedef struct { pthread_t Num; unsigned int Entree; unsigned int Sortie; unsigned int State; #ifdef PATHFINDER Trajet *pf; Pos savPos; int count; #endif } IThread; /* Prototypes: */ extern "C" { void * pthread_pion (void *); void * pthread_chrono (void *); void * pthread_compteur (void *); void * pthread_maitre (void *); void * pthread_manual (void *); } int addPion (void); int isFree (Pos); int posCmp (Pos, Pos); Pos getNextPos (Pos); void MicroWait (unsigned int); void setPos (Pos); void unsetPos (Pos); void changePos (Pos *, Pos *); extern "C" { void pthread_clean (void *); void handler_alrm (int); void handler_int (int); void handler_quit (int); void handler_start (int); void handler_move (int); } #endif