start implementing cluster table using b_tree
This commit is contained in:
27
src/cluster.h
Normal file
27
src/cluster.h
Normal 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
|
||||
Reference in New Issue
Block a user