/*
 *  Copyright 2009 OpenSourceStewardshipFoundation.org
 *  Licensed under GNU General Public License version 2
 *
 * Author: seanhalle@yahoo.com
 */

#ifndef _PRIVATE_QUEUE_H
#define	_PRIVATE_QUEUE_H


#include "VMS_impl/VMS_primitive_data_types.h"


#define TRUE     1
#define FALSE    0

#define LOCKED   1
#define UNLOCKED 0


/* It is the data that is shared so only need one mutex. */
typedef struct
 { void      **insertPos;
   void      **extractPos;
   void      **startOfData;  //data is pointers
   void      **endOfData;    //set when alloc data
 }
PrivQueueStruc;

typedef void  (*DynArrayFnPtr)  ( void * );  //fn has to cast void *

PrivQueueStruc*  makePrivQ ( );
void*            readPrivQ ( PrivQueueStruc *Q ); //ret NULL if empty
void             writePrivQ( void *in, PrivQueueStruc *Q );
                    //return false when full
bool32           writeIfSpacePrivQ( void * in, PrivQueueStruc* Q );
int32            numInPrivQ( PrivQueueStruc *Q );
void             pushPrivQ( void * in, PrivQueueStruc* Q );
void             freePrivQ( PrivQueueStruc *Q );

#endif	/* _PRIVATE_QUEUE_H */

