Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > Queue_impl
view PrivateQueue.h @ 36:d6da470bbd38
fixed bug in pure c queue -- enlarges correctly now
| author | Some Random Person <seanhalle@yahoo.com> |
|---|---|
| date | Thu, 24 May 2012 07:53:13 -0700 |
| parents | c5d2f2a94133 |
| children |
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"
13 #include "VMS_impl/Services_Offered_by_VMS/Memory_Handling/vmalloc.h"
16 #define TRUE 1
17 #define FALSE 0
19 #define LOCKED 1
20 #define UNLOCKED 0
23 /* It is the data that is shared so only need one mutex. */
24 typedef struct
25 { void **insertPos;
26 void **extractPos;
27 void **startOfData; //data is pointers
28 void **endOfData; //set when alloc data
29 }
30 PrivQueueStruc;
32 typedef void (*DynArrayFnPtr) ( void * ); //fn has to cast void *
34 PrivQueueStruc* makePrivQ ( );
35 void* readPrivQ ( PrivQueueStruc *Q ); //ret NULL if empty
36 void writePrivQ( void *in, PrivQueueStruc *Q );
37 //return false when full
38 bool32 writeIfSpacePrivQ( void * in, PrivQueueStruc* Q );
39 int32 numInPrivQ( PrivQueueStruc *Q );
40 void pushPrivQ( void * in, PrivQueueStruc* Q );
41 void freePrivQ( PrivQueueStruc *Q );
43 #endif /* _PRIVATE_QUEUE_H */
