write a function for deleting a specific chunk.

This commit is contained in:
2025-08-26 12:12:26 +02:00
parent 2f68574aea
commit 1c863099a9
2 changed files with 26 additions and 1 deletions

View File

@@ -11,9 +11,13 @@
struct mcx_chunk {
size_t idx; // byte offset for start of chunk data
u32 len; // byte length of chunk (+ padding)
u32 time; // modification time in epoch seconds
u32 time; // modification time in epoch seconds
};
// TODO: should return some form of feedback about its success
/* Deletes chunk `idx` from `buf`, moving all chunks downwards in the process. */
void mcx_delchunk(u8 *restrict buf, int idx);
/* indexes the chunks in an `*.mcX` file, writing `0x400` of entries to `chunks` */
void mcx_index(const u8 *restrict buf, struct mcx_chunk *restrict chunks) NONNULL((1, 2));