examples/PIPS/opencproducerconsumerex/inc/commanheader.h

00001 
00016 #ifndef COMMANHEADER_H
00017 #define COMMANHEADER_H
00018 
00019 /* INCLUDE FILES */
00020 #include <semaphore.h>
00021 
00022 #define MAX_CLIENTS     10
00023 #define KPortNum                2222
00024 #define KMSGQKEY                1000
00025 #define KMAXSENDMSG     100
00026 
00027 #define IN_SET_LOOPBACK_ADDR(a) \
00028         { (a)->sin_addr.s_addr  = 0x0100007F; (a)->sin_family = AF_INET; }
00029 
00030 
00031 /* Structure used for sending details to the Producer and Consumers */
00032 typedef struct 
00033 {
00034         int   noOfItems;
00035         int   noOfConsumers;
00036         sem_t itemLock;
00037 } ThreadParam;
00038 
00039 /* Structure defining Items to be Produced */
00040 typedef struct 
00041 {
00042         int    itemNum;
00043         char   itemName[50];
00044 } ProducedItem;
00045 
00046 
00047 
00054 void* ProducerThreadEntryPoint( void* aParam );
00055 
00062 void* ConsumerThreadEntryPoint( void* aParam );
00063 
00064 #ifdef __cplusplus
00065 extern "C" 
00066 {
00067 #endif
00068 
00074 void CreateObserverThread( int aNoOfMsg );
00075 
00082 void PushOntoStack( ProducedItem* aItem );
00083 
00088 ProducedItem* PopFromStack();
00089 
00095 void FreeItem(ProducedItem* aItem);
00096 
00097 #ifdef __cplusplus
00098 }
00099 #endif
00100 
00101 
00102 #endif /*COMMANHEADER_H*/
00103 
00104 /*  End of File */

Generated by  doxygen 1.6.2