cp_heap_callback(3)

cp_heap(3) libcprops - cp_heap cp_heap(3)

NAME

cp_heap_callback - run a callback on all items in a heap

SYNOPSIS

#include <cprops/heap.h>

void cp_heap_callback(cp_heap *heap, cp_callback_fn cb, void *prm);

DESCRIPTION

cp_heap_callback locks the heap unless the COLLECTION_MODE_NOSYNC bit is set, iterates over heap items and invokes the callback function cb. The callback function should follow this prototype:

int cb(void *item, void *prm);

The callback function is invoked on each heap item. The prm parameter is set to the value given in the call to cp_heap_callback. The callback iteration is stopped if the callback invocation returns non-zero.

JULY 2006 libcprops.0.1.5