19#define BLOCK_TABLE "data/block.bin"
ListBlock select_from_block(UUID *bid, UUID *fid, UUID *nid, UUID *cid, size_t *seq)
SELECT from the Block table.
Definition block.c:115
Block Block_deserialize(Buffer buffer)
Deserialize a Buffer into a block.
Definition block.c:19
void print_block(Block block)
Print a Block's data as a tuple.
Definition block.c:159
Buffer ListBlock_serialize(ListBlock list)
Serialize a List of Block's into a Buffer.
Definition block.c:61
void insert_into_block(UUID *fid, UUID *nid, UUID *cid, size_t *seq)
INSERT into the Block table.
Definition block.c:82
ListBlock ListBlock_deserialize(Buffer buf)
Deserialize a Buffer into a List of Block's.
Definition block.c:66
void Block_set_db(ListBlock blocks)
Write the database with the List of Block's.
Definition block.c:146
ListBlock Block_get_db(void)
Get the Block table from the database.
Definition block.c:132
#define DefList(type)
Definition list.h:93
Associates a DNode's connection data with an INode's data and the data on disk at cid.
Definition block.h:24
UUID nid
Node ID (foreign from DNode) default 0.
Definition block.h:27
UUID fid
File ID (foreign from INode) default 0.
Definition block.h:26
size_t seq
The order of this chunk.
Definition block.h:29
UUID bid
Block ID (primary key)
Definition block.h:25
UUID cid
Chunk ID default "".
Definition block.h:28
Byte buffer.
Definition lib.h:92
UUID type Layout taken from: https://en.wikipedia.org/wiki/Universally_unique_identifier#Binary_repre...
Definition uuid.h:24