MCPcopy Create free account
hub / github.com/creatale/node-dv / lqueueCreate

Function lqueueCreate

deps/leptonica/src/queue.c:89–107  ·  view source on GitHub ↗

--------------------------------------------------------------------------* * L_Queue create/destroy * *--------------------------------------------------------------------------*/ ! * \brief lqueueCreate() * * \param[in] nalloc size of ptr array to be alloc'd; 0 for default * \return lqueue, or NULL on error * * * Notes:

Source from the content-addressed store, hash-verified

87 * </pre>
88 */
89L_QUEUE *
90lqueueCreate(l_int32 nalloc)
91{
92L_QUEUE *lq;
93
94 PROCNAME("lqueueCreate");
95
96 if (nalloc < MIN_BUFFER_SIZE)
97 nalloc = INITIAL_BUFFER_ARRAYSIZE;
98
99 lq = (L_QUEUE *)LEPT_CALLOC(1, sizeof(L_QUEUE));
100 if ((lq->array = (void **)LEPT_CALLOC(nalloc, sizeof(void *))) == NULL) {
101 lqueueDestroy(&lq, 0);
102 return (L_QUEUE *)ERROR_PTR("ptr array not made", procName, NULL);
103 }
104 lq->nalloc = nalloc;
105 lq->nhead = lq->nelem = 0;
106 return lq;
107}
108
109
110/*!

Callers 5

generateBinaryMazeFunction · 0.85
pixSearchBinaryMazeFunction · 0.85
identifyWatershedBasinFunction · 0.85
seedfillGrayLowFunction · 0.85
seedfillGrayInvLowFunction · 0.85

Calls 1

lqueueDestroyFunction · 0.85

Tested by

no test coverage detected