X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=include%2Fbabeltrace%2Fprio_heap.h;fp=include%2Fbabeltrace%2Fprio_heap.h;h=52de47c86d50f1864abe6fd4c876e85514bae5cd;hp=90aec8f8cacd976edb08a0ec06b404da2a677ccc;hb=dd06413f0a5c638a20f000f3046755ee229c821d;hpb=c8c981321e028ae65247badf220f6106fa106cb7 diff --git a/include/babeltrace/prio_heap.h b/include/babeltrace/prio_heap.h index 90aec8f8..52de47c8 100644 --- a/include/babeltrace/prio_heap.h +++ b/include/babeltrace/prio_heap.h @@ -47,38 +47,38 @@ void check_heap(const struct ptr_heap *heap) #endif /** - * heap_maximum - return the largest element in the heap + * bt_heap_maximum - return the largest element in the heap * @heap: the heap to be operated on * * Returns the largest element in the heap, without performing any modification * to the heap structure. Returns NULL if the heap is empty. */ -static inline void *heap_maximum(const struct ptr_heap *heap) +static inline void *bt_heap_maximum(const struct ptr_heap *heap) { check_heap(heap); return likely(heap->len) ? heap->ptrs[0] : NULL; } /** - * heap_init - initialize the heap + * bt_heap_init - initialize the heap * @heap: the heap to initialize * @alloc_len: number of elements initially allocated * @gt: function to compare the elements * * Returns -ENOMEM if out of memory. */ -extern int heap_init(struct ptr_heap *heap, +extern int bt_heap_init(struct ptr_heap *heap, size_t alloc_len, int gt(void *a, void *b)); /** - * heap_free - free the heap + * bt_heap_free - free the heap * @heap: the heap to free */ -extern void heap_free(struct ptr_heap *heap); +extern void bt_heap_free(struct ptr_heap *heap); /** - * heap_insert - insert an element into the heap + * bt_heap_insert - insert an element into the heap * @heap: the heap to be operated on * @p: the element to add * @@ -86,19 +86,19 @@ extern void heap_free(struct ptr_heap *heap); * * Returns -ENOMEM if out of memory. */ -extern int heap_insert(struct ptr_heap *heap, void *p); +extern int bt_heap_insert(struct ptr_heap *heap, void *p); /** - * heap_remove - remove the largest element from the heap + * bt_heap_remove - remove the largest element from the heap * @heap: the heap to be operated on * * Returns the largest element in the heap. It removes this element from the * heap. Returns NULL if the heap is empty. */ -extern void *heap_remove(struct ptr_heap *heap); +extern void *bt_heap_remove(struct ptr_heap *heap); /** - * heap_cherrypick - remove a given element from the heap + * bt_heap_cherrypick - remove a given element from the heap * @heap: the heap to be operated on * @p: the element * @@ -106,10 +106,10 @@ extern void *heap_remove(struct ptr_heap *heap); * return NULL. This algorithm has a complexity of O(n), which is higher than * O(log(n)) provided by the rest of this API. */ -extern void *heap_cherrypick(struct ptr_heap *heap, void *p); +extern void *bt_heap_cherrypick(struct ptr_heap *heap, void *p); /** - * heap_replace_max - replace the the largest element from the heap + * bt_heap_replace_max - replace the the largest element from the heap * @heap: the heap to be operated on * @p: the pointer to be inserted as topmost element replacement * @@ -117,18 +117,18 @@ extern void *heap_cherrypick(struct ptr_heap *heap, void *p); * heap. The heap is rebalanced only once after the insertion. Returns NULL if * the heap is empty. * - * This is the equivalent of calling heap_remove() and then heap_insert(), but + * This is the equivalent of calling bt_heap_remove() and then bt_heap_insert(), but * it only rebalances the heap once. It never allocates memory. */ -extern void *heap_replace_max(struct ptr_heap *heap, void *p); +extern void *bt_heap_replace_max(struct ptr_heap *heap, void *p); /** - * heap_copy - copy a heap + * bt_heap_copy - copy a heap * @dst: the destination heap (must be allocated) * @src: the source heap * * Returns -ENOMEM if out of memory. */ -extern int heap_copy(struct ptr_heap *dst, struct ptr_heap *src); +extern int bt_heap_copy(struct ptr_heap *dst, struct ptr_heap *src); #endif /* _BABELTRACE_PRIO_HEAP_H */