Initialize index entries array and update index management for DDT entries

This commit is contained in:
2025-09-28 17:08:33 +01:00
parent 1fd250220a
commit 90ca1ee872
5 changed files with 230 additions and 7 deletions

View File

@@ -153,7 +153,15 @@ int32_t aaruf_close_current_block(aaruformatContext *ctx)
ctx->currentBlockHeader.cmpLength = ctx->currentBlockHeader.length;
}
// TODO: Add to index
// Add to index
TRACE("Adding block to index");
IndexEntry indexEntry;
indexEntry.blockType = DataBlock;
indexEntry.dataType = UserData;
indexEntry.offset = ctx->nextBlockPosition;
utarray_push_back(ctx->indexEntries, &indexEntry);
TRACE("Block added to index at offset %" PRIu64, indexEntry.offset);
// Write block header to file