Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > Queue_impl
annotate PrivateQueue.h @ 48:1ea30ca7093c
changed headers
| author | Sean Halle <seanhalle@yahoo.com> |
|---|---|
| date | Tue, 23 Jul 2013 07:28:22 -0700 |
| parents | 8c0dcf6e15e6 |
| children | 083298a6f7b6 |
| rev | line source |
|---|---|
| Me@19 | 1 /* |
| seanhalle@44 | 2 * Copyright 2009 OpenSourceResearchInstitute.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 |
| seanhalle@48 | 11 #include "PR__common_includes/PR__primitive_data_types.h" |
| Me@19 | 12 |
| Me@19 | 13 #define TRUE 1 |
| Me@19 | 14 #define FALSE 0 |
| Me@19 | 15 |
| Me@19 | 16 #define LOCKED 1 |
| Me@19 | 17 #define UNLOCKED 0 |
| Me@19 | 18 |
| Me@19 | 19 |
| Me@19 | 20 /* It is the data that is shared so only need one mutex. */ |
| Me@19 | 21 typedef struct |
| Me@19 | 22 { void **insertPos; |
| Me@19 | 23 void **extractPos; |
| Me@19 | 24 void **startOfData; //data is pointers |
| Me@19 | 25 void **endOfData; //set when alloc data |
| Me@19 | 26 } |
| Me@19 | 27 PrivQueueStruc; |
| Me@19 | 28 |
| seanhalle@30 | 29 typedef void (*DynArrayFnPtr) ( void * ); //fn has to cast void * |
| Me@19 | 30 |
| Me@19 | 31 PrivQueueStruc* makePrivQ ( ); |
| seanhalle@37 | 32 bool32 isEmptyPrivQ ( PrivQueueStruc *Q ); //ret TRUE if empty |
| seanhalle@37 | 33 void* peekPrivQ ( PrivQueueStruc *Q ); //ret NULL if empty |
| seanhalle@32 | 34 void* readPrivQ ( PrivQueueStruc *Q ); //ret NULL if empty |
| Me@19 | 35 void writePrivQ( void *in, PrivQueueStruc *Q ); |
| seanhalle@32 | 36 //return false when full |
| seanhalle@32 | 37 bool32 writeIfSpacePrivQ( void * in, PrivQueueStruc* Q ); |
| seanhalle@32 | 38 int32 numInPrivQ( PrivQueueStruc *Q ); |
| seanhalle@32 | 39 void pushPrivQ( void * in, PrivQueueStruc* Q ); |
| seanhalle@32 | 40 void freePrivQ( PrivQueueStruc *Q ); |
| seanhalle@30 | 41 |
| Me@19 | 42 #endif /* _PRIVATE_QUEUE_H */ |
| Me@19 | 43 |
