view PrivateQueue.h @ 34:c5d2f2a94133

updated to fixed versions from MC_shared brch, then removed VMS_ from malloc
author Some Random Person <seanhalle@yahoo.com>
date Wed, 14 Mar 2012 23:02:28 -0700
parents 1ed562d601d9
children d6da470bbd38
line source
1 /*
2 * Copyright 2009 OpenSourceStewardshipFoundation.org
3 * Licensed under GNU General Public License version 2
4 *
5 * Author: seanhalle@yahoo.com
6 */
8 #ifndef _PRIVATE_QUEUE_H
9 #define _PRIVATE_QUEUE_H
12 #include "VMS_impl/VMS_primitive_data_types.h"
15 #define TRUE 1
16 #define FALSE 0
18 #define LOCKED 1
19 #define UNLOCKED 0
22 /* It is the data that is shared so only need one mutex. */
23 typedef struct
24 { void **insertPos;
25 void **extractPos;
26 void **startOfData; //data is pointers
27 void **endOfData; //set when alloc data
28 }
29 PrivQueueStruc;
31 typedef void (*DynArrayFnPtr) ( void * ); //fn has to cast void *
33 PrivQueueStruc* makePrivQ ( );
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 );
42 #endif /* _PRIVATE_QUEUE_H */