aboutsummaryrefslogtreecommitdiff
path: root/bitmapped_patricia_tree.c
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-09-01 19:44:42 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-09-01 19:44:42 +0200
commit35fb513a0814f2d41816ef4aa1211e08e402cdf6 (patch)
tree0bfae6a3122f64a2e6c074905d76c27cd1e3e98c /bitmapped_patricia_tree.c
parentd17d12b3fa15e1bf69cdfbe3181a63540e0132d1 (diff)
Rename bpt_leaf.release_hook -> bpt_leaf.dealloc_hook.
Diffstat (limited to 'bitmapped_patricia_tree.c')
-rw-r--r--bitmapped_patricia_tree.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/bitmapped_patricia_tree.c b/bitmapped_patricia_tree.c
index 7575c5e..ca36271 100644
--- a/bitmapped_patricia_tree.c
+++ b/bitmapped_patricia_tree.c
@@ -70,8 +70,8 @@ struct bpt {
struct bpt_leaf {
struct bpt bpt; // poor man's inheritance
void *value;
-#ifdef BPT_ENABLE_RELEASE_HOOKS
- void (*release_hook)(bpt_key_t, void *); // not actually used anywhere in client code
+#ifdef BPT_ENABLE_DEALLOC_HOOKS
+ void (*dealloc_hook)(bpt_key_t, void *); // not actually used anywhere in client code
#endif
};
@@ -89,8 +89,8 @@ void init_bpt_leaf(bpt_t a_leaf, bpt_key_t key, void *value) {
leaf->bpt.mutable = true;
leaf->bpt.prefix = key;
leaf->value = value;
-#ifdef BPT_ENABLE_RELEASE_HOOKS
- leaf->release_hook = NULL;
+#ifdef BPT_ENABLE_DEALLOC_HOOKS
+ leaf->dealloc_hook = NULL;
#endif
leaf->bpt.refcount = 1;
}
@@ -451,9 +451,9 @@ void bpt_dealloc(bpt_t bpt) {
if (bpt) {
if (bpt->tag == BPT_LEAF) {
bpt_leaf_t b = (bpt_leaf_t)bpt;
-#ifdef BPT_ENABLE_RELEASE_HOOKS
- if (b->release_hook) {
- b->release_hook(b->bpt.prefix, b->value);
+#ifdef BPT_ENABLE_DEALLOC_HOOKS
+ if (b->dealloc_hook) {
+ b->dealloc_hook(b->bpt.prefix, b->value);
}
#endif
free(b);
@@ -466,10 +466,10 @@ void bpt_dealloc(bpt_t bpt) {
}
}
-#ifdef BPT_ENABLE_RELEASE_HOOKS
+#ifdef BPT_ENABLE_DEALLOC_HOOKS
void bpt_leaf_set_dealloc_hook(bpt_leaf_t bpt, void (*hook)(bpt_key_t, void*)) {
if (bpt) {
- bpt->release_hook = hook;
+ bpt->dealloc_hook = hook;
}
}