add node and entry size as parameters to b_tree_init

This commit is contained in:
2025-02-01 22:12:31 +00:00
parent 8e7995a2da
commit 4f3fe09440
3 changed files with 21 additions and 19 deletions

View File

@@ -124,9 +124,6 @@ static int entry_compare(const b_tree_node_entry *e0, const b_tree_node_entry *e
}
static const struct b_tree_ops ops = {
.node_size = sizeof(struct node),
.entry_size = sizeof(struct entry),
.tree_get_node = tree_get_node,
.tree_put_node = tree_put_node,
.tree_alloc_node = tree_alloc_node,
@@ -221,6 +218,8 @@ static int create(
const b_arglist *opt,
const b_array *args)
{
printf("%zu\n", sizeof(struct ec3_cluster_group));
return 0;
const char *in_path = NULL, *out_path = NULL;
b_arglist_get_string(
@@ -241,7 +240,7 @@ static int create(
fwrite(&root, sizeof root, 1, fp);
struct data_tree tree;
b_tree_init(&tree.base, &ops, ORDER);
b_tree_init(&tree.base, &ops, sizeof(struct node), sizeof(struct entry), ORDER);
tree.fp = fp;