#ifndef _CHAT_H #define _CHAT_H #define LBUFFSIZE 128 #define CBUFFSIZE 331 #define INCRSLOT(V) { \ ++(*V) ; \ if ((*V) >= CBUFFSIZE) \ (*V) = 0 ; \ } enum Lstates {UNUSED, MESSAGE} ; struct linebuff { enum Lstates status; /* status of this linebuffer */ int created ; /* Time (seconds since 1970?) entry was made */ int size ; /* number of characters used in buffer */ char buff[LBUFFSIZE] ; /* characters of the buffer */ } ; struct chatbuff { int nextSlot ; /* Index of nextSlot to use */ struct linebuff buff[CBUFFSIZE] ; } ; struct ptGenericArg { struct chatbuff *G ; /* Pointer to the global chatbuff */ int sock ; /* File Descriptor for socket */ } ; /* prototypes for pthread_create */ void *InputFromUser(void *) ; void *OutputToUser(void *) ; void *InputRecept(void *) ; void *OutputRecept(void *) ; void *MessageReaper(void *) ; #endif