int qQueueInit ( Q_QUEUE queue,
void *  datamem,
size_t  datamemsize,
size_t  objsize 
)

Initialize queue

Parameters:
queue a pointer of Q_QUEUE
datamem a pointer of data memory
datamemsize size of datamem
objsize size of queuing object
Returns:
maximum number of queuing objects
     // case of dynamic data memory
     size_t memsize = qQueueSize(10, sizeof(struct myobj));
     void *datamem = malloc(memsize);
     Q_QUEUE queue;
     if(qQueueInit(&queue, datamem, memsize, sizeof(int)) == 0) {
       printf("Can't initialize queue.\n");
       return -1;
     }

     // case of static data memory
     char datamem[1024];
     Q_QUEUE queue;
     if(qQueueInit(&queue, datamem, sizeof(datamem), sizeof(int)) == 0) {
       printf("Can't initialize queue.\n");
       return -1;
     }

Definition at line 160 of file qQueue.c.


Generated on Mon Mar 26 07:00:51 2018 for JSOC_Documentation by  doxygen 1.5.7.1