comparison PrivateQueue.h @ 50:93a5782d064b

adding netbeans project directories to repository
author Sean Halle <seanhalle@yahoo.com>
date Fri, 14 Feb 2014 07:54:22 -0800
parents 1ea30ca7093c
children
comparison
equal deleted inserted replaced
23:9b738ca1b4e2 24:a2eb110e8c69
6 */ 6 */
7 7
8 #ifndef _PRIVATE_QUEUE_H 8 #ifndef _PRIVATE_QUEUE_H
9 #define _PRIVATE_QUEUE_H 9 #define _PRIVATE_QUEUE_H
10 10
11 #include "PR__common_includes/PR__primitive_data_types.h" 11 #include <PR__include/PR__primitive_data_types.h>
12 12
13 #define TRUE 1 13 #define TRUE 1
14 #define FALSE 0 14 #define FALSE 0
15 15
16 #define LOCKED 1 16 #define LOCKED 1
17 #define UNLOCKED 0 17 #define UNLOCKED 0
18 18
19 19
20 /* It is the data that is shared so only need one mutex. */
21 typedef struct
22 { void **insertPos;
23 void **extractPos;
24 void **startOfData; //data is pointers
25 void **endOfData; //set when alloc data
26 }
27 PrivQueueStruc;
28
29 typedef void (*DynArrayFnPtr) ( void * ); //fn has to cast void *
30
31 PrivQueueStruc* makePrivQ ( );
32 bool32 isEmptyPrivQ ( PrivQueueStruc *Q ); //ret TRUE if empty
33 void* peekPrivQ ( PrivQueueStruc *Q ); //ret NULL if empty
34 void* readPrivQ ( PrivQueueStruc *Q ); //ret NULL if empty
35 void writePrivQ( void *in, PrivQueueStruc *Q );
36 //return false when full
37 bool32 writeIfSpacePrivQ( void * in, PrivQueueStruc* Q );
38 int32 numInPrivQ( PrivQueueStruc *Q );
39 void pushPrivQ( void * in, PrivQueueStruc* Q );
40 void freePrivQ( PrivQueueStruc *Q );
41
42 #endif /* _PRIVATE_QUEUE_H */ 20 #endif /* _PRIVATE_QUEUE_H */
43 21