feat: page_get implemented in page.c

This commit is contained in:
paulhorn
2026-06-27 11:45:04 +02:00
parent 03f99a0bb3
commit 6829a98c90
+9 -4
View File
@@ -106,8 +106,13 @@ page_insert(Page * p, const void * data, size_t len)
void *
page_get(Page * p, uint16_t slot_id, size_t * out_len)
{
(void) p;
(void) slot_id;
(void) out_len;
return NULL; /* noch nicht implementiert */
PageHeader * h = header(p);
if (slot_id >= h->num_slots) return NULL; /* Slot existiert nicht */
Slot * s = (Slot *) (p->raw + sizeof(PageHeader)) + slot_id;
if (out_len) *out_len = s->length;
return p->raw + s->offset;
}