/* FILE: main.h */ /* * This file is the header file for the main.c code for the event * driven simulation module. Add your own event types here in the * #define section, and update the prototypes list as you write * your "genEvent" and "processEvent" functions * * written by Tom Laramee 11/95 * */ #define TRUE 1 #define FALSE 0 /* Types of events */ #define ARRIVAL 0 #define EVENT1 1 /* Add your own intuitive names here */ #define EVENT2 2 #define EVENT3 3 #define printEVENT(x) (x==ARRIVAL) ?"ARRIVAL ": \ (x==EVENT1) ?"Event1 ": \ (x==EVENT2) ?"Event2 ": \ (x==EVENT3) ?"Event3 ": \ "OTHER" #define fatal(F, M) { printf ("\n\nFatal error!"); \ printf ("\nProcedure: %s", F); \ printf ("\nMessage : %s\n\n", M); \ printf ("\n\n"); \ exit(-1); } /* ~~~~~~~~~~~~~~~~~~ Prototypes ~~~~~~~~~~~~~~~~~~~~~~ */ /* initialize stuff functions */ void initAll(void); short initParams(int argc, char * argv[]); /* display information functions */ void showParams(FILE * fp); void showEventList(FILE * fp); void showCurrentEvent(FILE * fp); void showReport(FILE * fp); void printStatus(void); /* Generate event functions */ void gen_arrival( int node ); void genEvent1( int node ); void genEvent2( int node ); void genEvent3( int node ); /* Process event functions */ short processEvent1( void ); short processEvent2( void ); short processEvent3( void );