Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > Queue_impl
annotate PrivateQueue.h @ 32:a74011c0b78b
fixed expansion of queue, and added numInPrivQ and freePrivQ
| author | Some Random Person <seanhalle@yahoo.com> |
|---|---|
| date | Wed, 14 Mar 2012 22:48:50 -0700 |
| parents | 555cc068a79a |
| children | b9cb01d8ce56 |
| rev | line source |
|---|---|
| Me@19 | 1 /* |
| Me@19 | 2 * Copyright 2009 OpenSourceStewardshipFoundation.org |
| Me@19 | 3 * Licensed under GNU General Public License version 2 |
| Me@19 | 4 * |
| Me@19 | 5 * Author: seanhalle@yahoo.com |
| Me@19 | 6 */ |
| Me@19 | 7 |
| Me@19 | 8 #ifndef _PRIVATE_QUEUE_H |
| Me@19 | 9 #define _PRIVATE_QUEUE_H |
| Me@19 | 10 |
| Me@20 | 11 |
| seanhalle@28 | 12 #include "VMS_impl/VMS_primitive_data_types.h" |
| seanhalle@31 | 13 #include "VMS_impl/Services_Offered_by_VMS/Memory_Handling/vmalloc.h" |
| Me@20 | 14 |
| Me@19 | 15 |
| Me@19 | 16 #define TRUE 1 |
| Me@19 | 17 #define FALSE 0 |
| Me@19 | 18 |
| Me@19 | 19 #define LOCKED 1 |
| Me@19 | 20 #define UNLOCKED 0 |
| Me@19 | 21 |
| Me@19 | 22 |
| Me@19 | 23 /* It is the data that is shared so only need one mutex. */ |
| Me@19 | 24 typedef struct |
| Me@19 | 25 { void **insertPos; |
| Me@19 | 26 void **extractPos; |
| Me@19 | 27 void **startOfData; //data is pointers |
| Me@19 | 28 void **endOfData; //set when alloc data |
| Me@19 | 29 } |
| Me@19 | 30 PrivQueueStruc; |
| Me@19 | 31 |
| seanhalle@30 | 32 typedef void (*DynArrayFnPtr) ( void * ); //fn has to cast void * |
| Me@19 | 33 |
| Me@19 | 34 PrivQueueStruc* makePrivQ ( ); |
| seanhalle@32 | 35 void* readPrivQ ( PrivQueueStruc *Q ); //ret NULL if empty |
| Me@19 | 36 void writePrivQ( void *in, PrivQueueStruc *Q ); |
| seanhalle@32 | 37 //return false when full |
| seanhalle@32 | 38 bool32 writeIfSpacePrivQ( void * in, PrivQueueStruc* Q ); |
| seanhalle@32 | 39 int32 numInPrivQ( PrivQueueStruc *Q ); |
| seanhalle@32 | 40 void pushPrivQ( void * in, PrivQueueStruc* Q ); |
| seanhalle@32 | 41 void freePrivQ( PrivQueueStruc *Q ); |
| seanhalle@30 | 42 |
| Me@19 | 43 #endif /* _PRIVATE_QUEUE_H */ |
| Me@19 | 44 |
