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

Function lqueueRemove

deps/leptonica/src/queue.c:253–273  ·  view source on GitHub ↗

! * \brief lqueueRemove() * * \param[in] lq lqueue * \return ptr to item popped from the head of the queue, * or NULL if the queue is empty or on error * * * Notes: * (1) If this is the last item on the queue, so that the queue * becomes empty, nhead is reset to the beginning of the array. * */

Source from the content-addressed store, hash-verified

251 * </pre>
252 */
253void *
254lqueueRemove(L_QUEUE *lq)
255{
256void *item;
257
258 PROCNAME("lqueueRemove");
259
260 if (!lq)
261 return (void *)ERROR_PTR("lq not defined", procName, NULL);
262
263 if (lq->nelem == 0)
264 return NULL;
265 item = lq->array[lq->nhead];
266 lq->array[lq->nhead] = NULL;
267 if (lq->nelem == 1)
268 lq->nhead = 0; /* reset head ptr */
269 else
270 (lq->nhead)++; /* can't go off end of array because nelem > 1 */
271 lq->nelem--;
272 return item;
273}
274
275
276/*!

Callers 6

generateBinaryMazeFunction · 0.85
pixSearchBinaryMazeFunction · 0.85
lqueueDestroyFunction · 0.85
popNewPixelFunction · 0.85
seedfillGrayLowFunction · 0.85
seedfillGrayInvLowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected