YACDB
Yet Another C(rappy) Database
cursor.h File Reference

Operations on b-plus-trees using a cursor. More...

Include dependency graph for cursor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Cursor
 

Functions

int insert (Page root, struct key_value *kv)
 Inserts a key value pair inside the tree. The key value will be freed. More...
 
Cursorfind_leaf (Page root, Key key)
 find the correct leaf node for a given key More...
 
int cursor_next (Cursor *cursor)
 
Cursorcreate_at_start (Page root)
 Create a cursor object on the leftmost leaf.
 
void step_in (Cursor *cursor)
 
struct key_valuecreate_kv (Key key, void *value, size_t size)
 
void insert_in_arr_Page (Page pages[], size_t size, Page val, size_t offset)
 
void insert_in_arr_kv (struct key_value *key_vals[], size_t size, struct key_value *val, size_t offset)
 Inserts the value into the array at a given index. More...
 
void free_cursor (Cursor *cursor)
 

Detailed Description

Operations on b-plus-trees using a cursor.

Author
Jack Royer
Date
2022-05-29

Function Documentation

◆ find_leaf()

Cursor * find_leaf ( Page  root,
Key  key 
)

find the correct leaf node for a given key

find the correct leaf node for a given key

◆ insert()

int insert ( Page  root,
struct key_value kv 
)

Inserts a key value pair inside the tree. The key value will be freed.

Inserts a key value pair inside the tree. The key value will be freed.

◆ insert_in_arr_kv()

void insert_in_arr_kv ( struct key_value key_vals[],
size_t  size,
struct key_value val,
size_t  offset 
)

Inserts the value into the array at a given index.

Parameters
sizeis the size of the array BEFORE the insertion