write function for bulk removal of chunks

This commit is contained in:
2025-08-27 11:14:52 +02:00
parent 767f3a5c13
commit 78db656a92
2 changed files with 23 additions and 0 deletions

View File

@@ -17,6 +17,10 @@ struct mcx_chunk {
/* Deletes chunk `idx` from `buf`, moving all chunks downwards in the process. */
size_t mcx_delchunk(u8 *restrict buf, int idx);
/* Deletes `chunkc` chunks specified in `chunks` from the `*.mcX` file.
* This is done in a way to perform minimal memmove operations. */
void mcx_delchunks(u8 *restrict buf, const u16 *restrict chunks, int chunkc);
/* Computes the byte size of the `*.mcX` file in `buf` and returns it. */
size_t mcx_calcsize(const u8 *restrict buf) NONNULL((1)) PURE;