Distributed File System 1
Distributed file system in C
Loading...
Searching...
No Matches
inode.c File Reference
#include "inode.h"
#include "list.h"

Functions

 ImplList (INode)
ListINode ListINode_deserialize (Buffer buf)
 Deserialize a Buffer into a List of INode's.
void ListINode_print (ListINode list)
 Prints a List of INode's.
Buffer INode_serialize (INode in)
INode INode_deserialize (Buffer buf)
 Deserialize a Buffer into an INode Caller must free memory in Block.cid.
void insert_into_inode (SafeStr fname, size_t size)
 INSERT into the INode table.
ListINode select_from_inode (UUID *fid, SafeStr *fname, size_t *size)
 SELECT from the INode table.
ListINode INode_get_db (void)
 Get the INode table from the database.
void INode_set_db (ListINode dnodes)
 Write the database with the List of INode's.
void print_inode (INode inode)
 Print an INode's data as a tuple.

Function Documentation

◆ ImplList()

ImplList ( INode )

◆ INode_deserialize()

INode INode_deserialize ( Buffer buf)

Deserialize a Buffer into an INode Caller must free memory in Block.cid.

Parameters
bufferThe Buffer you want to deserialize
Returns
The INode that the Buffer represents

◆ INode_get_db()

ListINode INode_get_db ( void )

Get the INode table from the database.

Returns
a List of INode's

◆ INode_serialize()

Buffer INode_serialize ( INode in)

◆ INode_set_db()

void INode_set_db ( ListINode inodes)

Write the database with the List of INode's.

Parameters
inodesthe List of INode's that you want to overwrite the database with

◆ insert_into_inode()

void insert_into_inode ( SafeStr fname,
size_t size )

INSERT into the INode table.

Parameters
fnamethe name of the file
sizethe size of the file in Byte's

◆ ListINode_deserialize()

ListINode ListINode_deserialize ( Buffer buf)

Deserialize a Buffer into a List of INode's.

Caller must free memory in Block.cid.

Parameters
bufferThe Buffer you want to deserialize
Returns
The List of INode's that the Buffer represents

◆ ListINode_print()

void ListINode_print ( ListINode list)

Prints a List of INode's.

Parameters
listthe List of INode's that you want to print

◆ print_inode()

void print_inode ( INode inode)

Print an INode's data as a tuple.

Parameters
inodethe INode to be printed

◆ select_from_inode()

ListINode select_from_inode ( UUID * fid,
SafeStr * fname,
size_t * size )

SELECT from the INode table.

Parameters
fidthe INode's UUID or NULL
fnamethe INode's file's name or NULL @praam size the size of the file or NULL
Returns
a ListINode of the possible matches