start implementing cluster table using b_tree

This commit is contained in:
2025-02-01 22:13:00 +00:00
parent fea949f1f4
commit 8ca50e4888
2 changed files with 68 additions and 0 deletions

27
src/cluster.h Normal file
View File

@@ -0,0 +1,27 @@
#ifndef CLUSTER_H_
#define CLUSTER_H_
#include <stdio.h>
#include "b-tree.h"
struct cluster_table {
struct b_tree t_base;
FILE *t_storage;
};
struct cluster {
unsigned long c_id;
size_t c_base;
size_t c_len;
unsigned long c_checksum;
unsigned int c_flags;
};
extern void cluster_table_init(struct cluster_table *table, FILE *storage);
extern void cluster_table_finish(struct cluster_table *table);
extern int cluster_table_get(struct cluster_table *table, unsigned long id, struct cluster *out);
extern int cluster_table_put(struct cluster_table *table, const struct cluster *in);
#endif