diff --git a/include/aaruformat/context.h b/include/aaruformat/context.h index a1973f4..ba2f6dd 100644 --- a/include/aaruformat/context.h +++ b/include/aaruformat/context.h @@ -132,7 +132,7 @@ typedef struct mediaTagEntry * * Field grouping: * - Core & header: magic, library*Version, imageStream, header. - * - Optical sector adjuncts: sectorPrefix/sectorSuffix/subchannel plus corrected variants & mode2Subheaders. + * - Optical sector adjuncts: sectorPrefix/sectorSuffix/subchannel plus corrected variants & mode2_subheaders. * - Deduplication: inMemoryDdt, userDataDdt*, userDataDdtHeader, mini/big/cached secondary arrays, version tags. * - Metadata & geometry: geometryBlock, metadataBlockHeader+metadataBlock, cicmBlockHeader+cicmBlock, tracksHeader. * - Tracks & hardware: trackEntries, dataTracks, dumpHardwareHeader, dumpHardwareEntriesWithData. @@ -161,7 +161,7 @@ typedef struct aaruformatContext uint8_t *sectorSuffix; ///< Raw per-sector suffix (EDC/ECC) uncorrected. uint8_t *sectorSuffixCorrected; ///< Corrected suffix if stored separately. uint8_t *sectorSubchannel; ///< Raw 96-byte subchannel (if captured). - uint8_t *mode2Subheaders; ///< MODE2 Form1/Form2 8-byte subheaders (concatenated). + uint8_t *mode2_subheaders; ///< MODE2 Form1/Form2 8-byte subheaders (concatenated). uint8_t shift; ///< Legacy overall shift (deprecated by data_shift/table_shift). bool inMemoryDdt; ///< True if primary (and possibly secondary) DDT loaded. @@ -238,7 +238,6 @@ typedef struct aaruformatContext size_t sectorSuffixBufferLength; ///< Length of sectorSuffixBuffer size_t sectorPrefixBufferOffset; ///< Current position in sectorPrefixBuffer size_t sectorSuffixBufferOffset; ///< Current position in sectorSuffixBuffer - uint8_t *mode2_subheaders; ///< Buffer for storing MODE2 subheaders when writing MODE2 tracks } aaruformatContext; /** \struct DumpHardwareEntriesWithData diff --git a/src/blocks/data.c b/src/blocks/data.c index 739d77e..a1a6d3a 100644 --- a/src/blocks/data.c +++ b/src/blocks/data.c @@ -334,7 +334,7 @@ int32_t process_data_block(aaruformatContext *ctx, IndexEntry *entry) ctx->readableSectorTags[AppleSectorTag] = true; break; case CompactDiscMode2Subheader: - ctx->mode2Subheaders = data; + ctx->mode2_subheaders = data; break; default: media_tag = (mediaTagEntry *)malloc(sizeof(mediaTagEntry)); diff --git a/src/close.c b/src/close.c index 071e97f..ce8b33e 100644 --- a/src/close.c +++ b/src/close.c @@ -884,8 +884,8 @@ int aaruf_close(void *context) ctx->sectorSuffixCorrected = NULL; free(ctx->sectorSubchannel); ctx->sectorSubchannel = NULL; - free(ctx->mode2Subheaders); - ctx->mode2Subheaders = NULL; + free(ctx->mode2_subheaders); + ctx->mode2_subheaders = NULL; TRACE("Freeing media tags"); if(ctx->mediaTags != NULL) HASH_ITER(hh, ctx->mediaTags, media_tag, tmp_media_tag) diff --git a/src/read.c b/src/read.c index 3169df2..044b73b 100644 --- a/src/read.c +++ b/src/read.c @@ -959,9 +959,9 @@ int32_t aaruf_read_sector_long(void *context, const uint64_t sector_address, boo if(res != AARUF_STATUS_OK) return res; - if(ctx->mode2Subheaders != NULL && ctx->sectorSuffixDdt != NULL) + if(ctx->mode2_subheaders != NULL && ctx->sectorSuffixDdt != NULL) { - memcpy(data + 16, ctx->mode2Subheaders + corrected_sector_address * 8, 8); + memcpy(data + 16, ctx->mode2_subheaders + corrected_sector_address * 8, 8); if((ctx->sectorSuffixDdt[corrected_sector_address] & CD_XFIX_MASK) == Mode2Form1Ok) { @@ -981,9 +981,9 @@ int32_t aaruf_read_sector_long(void *context, const uint64_t sector_address, boo // Mode 2 where ECC failed memcpy(data + 24, bare_data, 2328); } - else if(ctx->mode2Subheaders != NULL) + else if(ctx->mode2_subheaders != NULL) { - memcpy(data + 16, ctx->mode2Subheaders + corrected_sector_address * 8, 8); + memcpy(data + 16, ctx->mode2_subheaders + corrected_sector_address * 8, 8); memcpy(data + 24, bare_data, 2328); } else diff --git a/tool/info.c b/tool/info.c index 1dc6842..4cb57a3 100644 --- a/tool/info.c +++ b/tool/info.c @@ -75,7 +75,7 @@ int info(const char *path) if(ctx->sectorSubchannel != NULL) printf("Sector subchannel array has been read.\n"); - if(ctx->mode2Subheaders != NULL) printf("Sector mode 2 subheaders array has been read.\n"); + if(ctx->mode2_subheaders != NULL) printf("Sector mode 2 subheaders array has been read.\n"); printf("Shift is %d (%d bytes).\n", ctx->shift, 1 << ctx->shift);