annotate 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
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
seanhalle@34 11
seanhalle@34 12 #include "VMS_impl/VMS_primitive_data_types.h"
seanhalle@34 13
Me@19 14
Me@19 15 #define TRUE 1
Me@19 16 #define FALSE 0
Me@19 17
Me@19 18 #define LOCKED 1
Me@19 19 #define UNLOCKED 0
Me@19 20
Me@19 21
Me@19 22 /* It is the data that is shared so only need one mutex. */
Me@19 23 typedef struct
Me@19 24 { void **insertPos;
Me@19 25 void **extractPos;
Me@19 26 void **startOfData; //data is pointers
Me@19 27 void **endOfData; //set when alloc data
Me@19 28 }
Me@19 29 PrivQueueStruc;
Me@19 30
seanhalle@34 31 typedef void (*DynArrayFnPtr) ( void * ); //fn has to cast void *
Me@19 32
Me@19 33 PrivQueueStruc* makePrivQ ( );
seanhalle@34 34 void* readPrivQ ( PrivQueueStruc *Q ); //ret NULL if empty
Me@19 35 void writePrivQ( void *in, PrivQueueStruc *Q );
seanhalle@34 36 //return false when full
seanhalle@34 37 bool32 writeIfSpacePrivQ( void * in, PrivQueueStruc* Q );
seanhalle@34 38 int32 numInPrivQ( PrivQueueStruc *Q );
seanhalle@34 39 void pushPrivQ( void * in, PrivQueueStruc* Q );
seanhalle@34 40 void freePrivQ( PrivQueueStruc *Q );
Me@19 41
Me@19 42 #endif /* _PRIVATE_QUEUE_H */
Me@19 43