From 1b2a7cf35eb187f1d5362220ab0bd7148eb3ba75 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sun, 1 Mar 2020 19:51:13 +0000 Subject: [PATCH] Rename library. --- CMakeLists.txt | 4 +- include/aaruformat/consts.h | 2 +- include/aaruformat/context.h | 8 +- include/aaruformat/decls.h | 2 +- include/dic.h | 2 +- include/dicformat.h | 14 ++-- src/close.c | 8 +- src/crc64.c | 2 +- src/cst.c | 2 +- src/ecc_cd.c | 2 +- src/helpers.c | 2 +- src/identify.c | 2 +- src/open.c | 140 ++++++++++++++++++----------------- src/read.c | 28 +++---- 14 files changed, 110 insertions(+), 108 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 528f016..3c44a55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,10 @@ cmake_minimum_required(VERSION 3.13) -project(libdicformat C) +project(libaaruformat C) set(CMAKE_C_STANDARD 90) add_compile_definitions(__STDC_FORMAT_MACROS=1) -add_library(dicformat SHARED include/aaruformat/consts.h include/aaruformat/enums.h include/dic.h include/dicformat.h +add_library(aaruformat SHARED include/aaruformat/consts.h include/aaruformat/enums.h include/dic.h include/aaruformat.h include/aaruformat/decls.h include/aaruformat/structs.h src/identify.c src/open.c include/aaruformat/context.h src/close.c include/aaruformat/errors.h src/read.c src/crc64.c src/cst.c src/ecc_cd.c src/helpers.c) diff --git a/include/aaruformat/consts.h b/include/aaruformat/consts.h index b202130..0c704d4 100644 --- a/include/aaruformat/consts.h +++ b/include/aaruformat/consts.h @@ -5,7 +5,7 @@ // Filename : consts.h // Author(s) : Natalia Portillo // -// Component : libdicformat. +// Component : libaaruformat. // // --[ Description ] ---------------------------------------------------------- // diff --git a/include/aaruformat/context.h b/include/aaruformat/context.h index 1809545..4528d75 100644 --- a/include/aaruformat/context.h +++ b/include/aaruformat/context.h @@ -5,11 +5,11 @@ // Filename : context.h // Author(s) : Natalia Portillo // -// Component : libdicformat. +// Component : libaaruformat. // // --[ Description ] ---------------------------------------------------------- // -// Describes context to be passed between libdicformat functions. +// Describes context to be passed between libaaruformat functions. // // --[ License ] -------------------------------------------------------------- // @@ -38,7 +38,7 @@ #include #include -typedef struct dicformatContext +typedef struct aaruformatContext { uint64_t magic; uint8_t libraryMajorVersion; @@ -73,7 +73,7 @@ typedef struct dicformatContext uint8_t numberOfDataTracks; TrackEntry* dataTracks; bool* readableSectorTags; -} dicformatContext; +} aaruformatContext; typedef struct dataLinkedList { diff --git a/include/aaruformat/decls.h b/include/aaruformat/decls.h index 8752fb1..6d558b7 100644 --- a/include/aaruformat/decls.h +++ b/include/aaruformat/decls.h @@ -5,7 +5,7 @@ // Filename : decls.h // Author(s) : Natalia Portillo // -// Component : libdicformat. +// Component : libaaruformat. // // --[ Description ] ---------------------------------------------------------- // diff --git a/include/dic.h b/include/dic.h index 4bc9147..28a8f75 100644 --- a/include/dic.h +++ b/include/dic.h @@ -5,7 +5,7 @@ // Filename : dic.h // Author(s) : Natalia Portillo // -// Component : libdicformat. +// Component : libaaruformat. // // --[ Description ] ---------------------------------------------------------- // diff --git a/include/dicformat.h b/include/dicformat.h index d54452f..82cbf41 100644 --- a/include/dicformat.h +++ b/include/dicformat.h @@ -5,7 +5,7 @@ // Filename : aaruformat.h // Author(s) : Natalia Portillo // -// Component : libdicformat. +// Component : libaaruformat. // // --[ Description ] ---------------------------------------------------------- // @@ -36,11 +36,11 @@ #define LIBDICFORMAT_MAJOR_VERSION 1 #define LIBDICFORMAT_MINOR_VERSION 0 -#include "dicformat/consts.h" -#include "dicformat/context.h" -#include "dicformat/decls.h" -#include "dicformat/enums.h" -#include "dicformat/errors.h" -#include "dicformat/structs.h" +#include "aaruformat/consts.h" +#include "aaruformat/context.h" +#include "aaruformat/decls.h" +#include "aaruformat/enums.h" +#include "aaruformat/errors.h" +#include "aaruformat/structs.h" #endif // LIBDICFORMAT_DICFORMAT_H diff --git a/src/close.c b/src/close.c index 5a99b18..9af5e64 100644 --- a/src/close.c +++ b/src/close.c @@ -5,7 +5,7 @@ // Filename : close.c // Author(s) : Natalia Portillo // -// Component : libdicformat. +// Component : libaaruformat. // // --[ Description ] ---------------------------------------------------------- // @@ -30,7 +30,7 @@ // Copyright © 2011-2020 Natalia Portillo // ****************************************************************************/ -#include +#include #include #include #include @@ -46,9 +46,9 @@ int close(void* context) return -1; } - dicformatContext* ctx = context; + aaruformatContext* ctx = context; - // Not a libdicformat context + // Not a libaaruformat context if(ctx->magic != DIC_MAGIC) { errno = EINVAL; diff --git a/src/crc64.c b/src/crc64.c index 39ffcc4..7cab870 100644 --- a/src/crc64.c +++ b/src/crc64.c @@ -30,7 +30,7 @@ // Copyright © 2011-2020 Natalia Portillo // ****************************************************************************/ -#include +#include #include #include #include diff --git a/src/cst.c b/src/cst.c index f11ed99..aea4232 100644 --- a/src/cst.c +++ b/src/cst.c @@ -30,7 +30,7 @@ // Copyright © 2011-2020 Natalia Portillo // ****************************************************************************/ -#include +#include #include #include #include diff --git a/src/ecc_cd.c b/src/ecc_cd.c index 2ff10be..eb11298 100644 --- a/src/ecc_cd.c +++ b/src/ecc_cd.c @@ -31,7 +31,7 @@ // ECC algorithm from ECM(c) 2002-2011 Neill Corlett // ****************************************************************************/ -#include +#include #include #include #include diff --git a/src/helpers.c b/src/helpers.c index 0e80e91..9c89872 100644 --- a/src/helpers.c +++ b/src/helpers.c @@ -30,8 +30,8 @@ // Copyright © 2011-2020 Natalia Portillo // ****************************************************************************/ +#include #include -#include // Converts between image data type and dic media tag type int32_t GetMediaTagTypeForDataType(int32_t type) diff --git a/src/identify.c b/src/identify.c index bc94b10..175522b 100644 --- a/src/identify.c +++ b/src/identify.c @@ -30,7 +30,7 @@ // Copyright © 2011-2020 Natalia Portillo // ****************************************************************************/ -#include +#include #include #include diff --git a/src/open.c b/src/open.c index 540c1cd..fe73488 100644 --- a/src/open.c +++ b/src/open.c @@ -5,7 +5,7 @@ // Filename : open.c // Author(s) : Natalia Portillo // -// Component : libdicformat. +// Component : libaaruformat. // // --[ Description ] ---------------------------------------------------------- // @@ -30,7 +30,7 @@ // Copyright © 2011-2020 Natalia Portillo // ****************************************************************************/ -#include +#include #include #include #include @@ -40,21 +40,21 @@ void* open(const char* filepath) { - dicformatContext* ctx; - int errorNo; + aaruformatContext* ctx; + int errorNo; size_t readBytes; - long pos; - IndexHeader idxHeader; - IndexEntry* idxEntries; - uint8_t* data; - uint32_t* cdDdt; - uint64_t crc64; - uint8_t temp8u; - int i; - uint16_t e; + long pos; + IndexHeader idxHeader; + IndexEntry* idxEntries; + uint8_t* data; + uint32_t* cdDdt; + uint64_t crc64; + uint8_t temp8u; + int i; + uint16_t e; - ctx = (dicformatContext*)malloc(sizeof(dicformatContext)); - memset(ctx, 0, sizeof(dicformatContext)); + ctx = (aaruformatContext*)malloc(sizeof(aaruformatContext)); + memset(ctx, 0, sizeof(aaruformatContext)); if(ctx == NULL) return NULL; @@ -97,7 +97,7 @@ void* open(const char* filepath) } fprintf(stderr, - "libdicformat: Opening image version %d.%d", + "libaaruformat: Opening image version %d.%d", ctx->header.imageMajorVersion, ctx->header.imageMinorVersion); @@ -161,7 +161,7 @@ void* open(const char* filepath) } fprintf( - stderr, "libdicformat: Index at %" PRIu64 " contains %d entries", ctx->header.indexOffset, idxHeader.entries); + stderr, "libaaruformat: Index at %" PRIu64 " contains %d entries", ctx->header.indexOffset, idxHeader.entries); idxEntries = (IndexEntry*)malloc(sizeof(IndexEntry) * idxHeader.entries); @@ -189,7 +189,7 @@ void* open(const char* filepath) for(i = 0; i < idxHeader.entries; i++) { fprintf(stderr, - "libdicformat: Block type %4.4s with data type %4.4s is indexed to be at %" PRIu64 "", + "libaaruformat: Block type %4.4s with data type %4.4s is indexed to be at %" PRIu64 "", (char*)&idxEntries[i].blockType, (char*)&idxEntries[i].dataType, idxEntries[i].offset); @@ -204,7 +204,7 @@ void* open(const char* filepath) if(pos < 0 || ftell(ctx->imageStream) != idxEntries[i].offset) { fprintf(stderr, - "libdicformat: Could not seek to %" PRIu64 " as indicated by index entry %d, continuing...", + "libaaruformat: Could not seek to %" PRIu64 " as indicated by index entry %d, continuing...", idxEntries[i].offset, i); @@ -224,7 +224,7 @@ void* open(const char* filepath) if(readBytes != sizeof(BlockHeader)) { - fprintf(stderr, "libdicformat: Could not read block header at %" PRIu64 "", idxEntries[i].offset); + fprintf(stderr, "libaaruformat: Could not read block header at %" PRIu64 "", idxEntries[i].offset); break; } @@ -243,7 +243,7 @@ void* open(const char* filepath) if(blockHeader.identifier != idxEntries[i].blockType) { fprintf(stderr, - "libdicformat: Incorrect identifier for data block at position %" PRIu64 "", + "libaaruformat: Incorrect identifier for data block at position %" PRIu64 "", idxEntries[i].offset); break; } @@ -251,7 +251,7 @@ void* open(const char* filepath) if(blockHeader.type != idxEntries[i].dataType) { fprintf(stderr, - "libdicformat: Expected block with data type %4.4s at position %" PRIu64 + "libaaruformat: Expected block with data type %4.4s at position %" PRIu64 " but found data type %4.4s", (char*)&idxEntries[i].blockType, idxEntries[i].offset, @@ -260,7 +260,7 @@ void* open(const char* filepath) } fprintf(stderr, - "libdicformat: Found data block with type %4.4s at position %" PRIu64 "", + "libaaruformat: Found data block with type %4.4s at position %" PRIu64 "", (char*)&idxEntries[i].blockType, idxEntries[i].offset); @@ -285,7 +285,7 @@ void* open(const char* filepath) else { fprintf(stderr, - "libdicformat: Found unknown compression type %d, continuing...", + "libaaruformat: Found unknown compression type %d, continuing...", blockHeader.compression); break; } @@ -294,7 +294,7 @@ void* open(const char* filepath) if(crc64 != blockHeader.crc64) { fprintf(stderr, - "libdicformat: Incorrect CRC found: 0x%" PRIx64 " found, expected 0x%" PRIx64 + "libaaruformat: Incorrect CRC found: 0x%" PRIx64 " found, expected 0x%" PRIx64 ", continuing...", crc64, blockHeader.crc64); @@ -349,7 +349,7 @@ void* open(const char* filepath) if(mediaTag->type == blockHeader.type) { fprintf(stderr, - "libdicformat: Media tag type %d duplicated, removing previous entry...", + "libaaruformat: Media tag type %d duplicated, removing previous entry...", blockHeader.type); free(mediaTag->data); mediaTag->data = data; @@ -368,7 +368,7 @@ void* open(const char* filepath) if(mediaTag == NULL) { - fprintf(stderr, "libdicformat: Cannot allocate memory for media tag list entry."); + fprintf(stderr, "libaaruformat: Cannot allocate memory for media tag list entry."); break; } memset(mediaTag, 0, sizeof(dataLinkedList)); @@ -395,7 +395,7 @@ void* open(const char* filepath) if(readBytes != sizeof(DdtHeader)) { - fprintf(stderr, "libdicformat: Could not read block header at %" PRIu64 "", idxEntries[i].offset); + fprintf(stderr, "libaaruformat: Could not read block header at %" PRIu64 "", idxEntries[i].offset); break; } @@ -424,7 +424,7 @@ void* open(const char* filepath) if(ctx->userDataDdt == MAP_FAILED) { foundUserDataDdt = false; - fprintf(stderr, "libdicformat: Could not read map deduplication table."); + fprintf(stderr, "libaaruformat: Could not read map deduplication table."); break; } @@ -432,7 +432,7 @@ void* open(const char* filepath) break; default: fprintf(stderr, - "libdicformat: Found unknown compression type %d, continuing...", + "libaaruformat: Found unknown compression type %d, continuing...", blockHeader.compression); foundUserDataDdt = false; break; @@ -448,7 +448,7 @@ void* open(const char* filepath) if(mediaTag == NULL) { - fprintf(stderr, "libdicformat: Cannot allocate memory for deduplication table."); + fprintf(stderr, "libaaruformat: Cannot allocate memory for deduplication table."); break; } @@ -457,7 +457,7 @@ void* open(const char* filepath) if(readBytes != ddtHeader.entries * sizeof(uint32_t)) { free(data); - fprintf(stderr, "libdicformat: Could not read deduplication table, continuing..."); + fprintf(stderr, "libaaruformat: Could not read deduplication table, continuing..."); break; } @@ -471,7 +471,7 @@ void* open(const char* filepath) break; default: fprintf(stderr, - "libdicformat: Found unknown compression type %d, continuing...", + "libaaruformat: Found unknown compression type %d, continuing...", blockHeader.compression); break; } @@ -484,14 +484,14 @@ void* open(const char* filepath) if(readBytes != sizeof(GeometryBlockHeader)) { memset(&ctx->geometryBlock, 0, sizeof(GeometryBlockHeader)); - fprintf(stderr, "libdicformat: Could not read geometry block, continuing..."); + fprintf(stderr, "libaaruformat: Could not read geometry block, continuing..."); break; } if(ctx->geometryBlock.identifier == GeometryBlock) { fprintf(stderr, - "libdicformat: Geometry set to %d cylinders %d heads %d sectors per track", + "libaaruformat: Geometry set to %d cylinders %d heads %d sectors per track", ctx->geometryBlock.cylinders, ctx->geometryBlock.heads, ctx->geometryBlock.sectorsPerTrack); @@ -511,7 +511,7 @@ void* open(const char* filepath) if(readBytes != sizeof(MetadataBlockHeader)) { memset(&ctx->metadataBlockHeader, 0, sizeof(MetadataBlockHeader)); - fprintf(stderr, "libdicformat: Could not read metadata block header, continuing..."); + fprintf(stderr, "libaaruformat: Could not read metadata block header, continuing..."); break; } @@ -519,7 +519,7 @@ void* open(const char* filepath) { memset(&ctx->metadataBlockHeader, 0, sizeof(MetadataBlockHeader)); fprintf(stderr, - "libdicformat: Incorrect identifier for data block at position %" PRIu64 "", + "libaaruformat: Incorrect identifier for data block at position %" PRIu64 "", idxEntries[i].offset); break; } @@ -531,7 +531,7 @@ void* open(const char* filepath) if(ctx->metadataBlock == NULL) { memset(&ctx->metadataBlockHeader, 0, sizeof(MetadataBlockHeader)); - fprintf(stderr, "libdicformat: Could not allocate memory for metadata block, continuing..."); + fprintf(stderr, "libaaruformat: Could not allocate memory for metadata block, continuing..."); break; } @@ -541,7 +541,7 @@ void* open(const char* filepath) { memset(&ctx->metadataBlockHeader, 0, sizeof(MetadataBlockHeader)); free(ctx->metadataBlock); - fprintf(stderr, "libdicformat: Could not read metadata block, continuing..."); + fprintf(stderr, "libaaruformat: Could not read metadata block, continuing..."); } if(ctx->metadataBlockHeader.mediaSequence > 0 && ctx->metadataBlockHeader.lastMediaSequence > 0) @@ -549,7 +549,7 @@ void* open(const char* filepath) ctx->imageInfo.MediaSequence = ctx->metadataBlockHeader.mediaSequence; ctx->imageInfo.LastMediaSequence = ctx->metadataBlockHeader.lastMediaSequence; fprintf(stderr, - "libdicformat: Setting media sequence as %d of %d", + "libaaruformat: Setting media sequence as %d of %d", ctx->imageInfo.MediaSequence, ctx->imageInfo.LastMediaSequence); } @@ -727,7 +727,7 @@ void* open(const char* filepath) if(readBytes != sizeof(TracksHeader)) { memset(&ctx->tracksHeader, 0, sizeof(TracksHeader)); - fprintf(stderr, "libdicformat: Could not read tracks header, continuing..."); + fprintf(stderr, "libaaruformat: Could not read tracks header, continuing..."); break; } @@ -735,7 +735,7 @@ void* open(const char* filepath) { memset(&ctx->tracksHeader, 0, sizeof(TracksHeader)); fprintf(stderr, - "libdicformat: Incorrect identifier for data block at position %" PRIu64 "", + "libaaruformat: Incorrect identifier for data block at position %" PRIu64 "", idxEntries[i].offset); } @@ -746,7 +746,7 @@ void* open(const char* filepath) if(ctx->trackEntries == NULL) { memset(&ctx->tracksHeader, 0, sizeof(TracksHeader)); - fprintf(stderr, "libdicformat: Could not allocate memory for metadata block, continuing..."); + fprintf(stderr, "libaaruformat: Could not allocate memory for metadata block, continuing..."); break; } @@ -756,7 +756,7 @@ void* open(const char* filepath) { memset(&ctx->tracksHeader, 0, sizeof(TracksHeader)); free(ctx->trackEntries); - fprintf(stderr, "libdicformat: Could not read metadata block, continuing..."); + fprintf(stderr, "libaaruformat: Could not read metadata block, continuing..."); } crc64 = @@ -764,7 +764,7 @@ void* open(const char* filepath) if(crc64 != ctx->tracksHeader.crc64) { fprintf(stderr, - "libdicformat: Incorrect CRC found: 0x%" PRIx64 " found, expected 0x%" PRIx64 + "libaaruformat: Incorrect CRC found: 0x%" PRIx64 " found, expected 0x%" PRIx64 ", continuing...", crc64, ctx->tracksHeader.crc64); @@ -772,7 +772,7 @@ void* open(const char* filepath) } fprintf(stderr, - "libdicformat: Found %d tracks at position %" PRIu64 ".", + "libaaruformat: Found %d tracks at position %" PRIu64 ".", ctx->tracksHeader.entries, idxEntries[i].offset); @@ -813,7 +813,7 @@ void* open(const char* filepath) if(readBytes != sizeof(CicmMetadataBlock)) { memset(&ctx->cicmBlockHeader, 0, sizeof(CicmMetadataBlock)); - fprintf(stderr, "libdicformat: Could not read CICM XML metadata header, continuing..."); + fprintf(stderr, "libaaruformat: Could not read CICM XML metadata header, continuing..."); break; } @@ -821,7 +821,7 @@ void* open(const char* filepath) { memset(&ctx->cicmBlockHeader, 0, sizeof(CicmMetadataBlock)); fprintf(stderr, - "libdicformat: Incorrect identifier for data block at position %" PRIu64 "", + "libaaruformat: Incorrect identifier for data block at position %" PRIu64 "", idxEntries[i].offset); } @@ -833,7 +833,7 @@ void* open(const char* filepath) { memset(&ctx->cicmBlockHeader, 0, sizeof(CicmMetadataBlock)); fprintf(stderr, - "libdicformat: Could not allocate memory for CICM XML metadata block, continuing..."); + "libaaruformat: Could not allocate memory for CICM XML metadata block, continuing..."); break; } @@ -843,10 +843,10 @@ void* open(const char* filepath) { memset(&ctx->cicmBlockHeader, 0, sizeof(CicmMetadataBlock)); free(ctx->cicmBlock); - fprintf(stderr, "libdicformat: Could not read CICM XML metadata block, continuing..."); + fprintf(stderr, "libaaruformat: Could not read CICM XML metadata block, continuing..."); } - fprintf(stderr, "libdicformat: Found CICM XML metadata block %" PRIu64 ".", idxEntries[i].offset); + fprintf(stderr, "libaaruformat: Found CICM XML metadata block %" PRIu64 ".", idxEntries[i].offset); break; // Dump hardware block case DumpHardwareBlock: @@ -855,7 +855,7 @@ void* open(const char* filepath) if(readBytes != sizeof(DumpHardwareHeader)) { memset(&ctx->dumpHardwareHeader, 0, sizeof(DumpHardwareHeader)); - fprintf(stderr, "libdicformat: Could not read dump hardware block header, continuing..."); + fprintf(stderr, "libaaruformat: Could not read dump hardware block header, continuing..."); break; } @@ -863,7 +863,7 @@ void* open(const char* filepath) { memset(&ctx->dumpHardwareHeader, 0, sizeof(DumpHardwareHeader)); fprintf(stderr, - "libdicformat: Incorrect identifier for data block at position %" PRIu64 "", + "libaaruformat: Incorrect identifier for data block at position %" PRIu64 "", idxEntries[i].offset); } @@ -879,7 +879,7 @@ void* open(const char* filepath) { free(data); fprintf(stderr, - "libdicformat: Incorrect CRC found: 0x%" PRIx64 " found, expected 0x%" PRIx64 + "libaaruformat: Incorrect CRC found: 0x%" PRIx64 " found, expected 0x%" PRIx64 ", continuing...", crc64, ctx->dumpHardwareHeader.crc64); @@ -897,7 +897,7 @@ void* open(const char* filepath) if(ctx->dumpHardwareEntriesWithData == NULL) { memset(&ctx->dumpHardwareHeader, 0, sizeof(DumpHardwareHeader)); - fprintf(stderr, "libdicformat: Could not allocate memory for dump hardware block, continuing..."); + fprintf(stderr, "libaaruformat: Could not allocate memory for dump hardware block, continuing..."); break; } @@ -913,7 +913,7 @@ void* open(const char* filepath) if(readBytes != sizeof(DumpHardwareEntry)) { ctx->dumpHardwareHeader.entries = e + (uint16_t)1; - fprintf(stderr, "libdicformat: Could not read dump hardware block entry, continuing..."); + fprintf(stderr, "libaaruformat: Could not read dump hardware block entry, continuing..."); break; } @@ -934,7 +934,7 @@ void* open(const char* filepath) free(ctx->dumpHardwareEntriesWithData[e].manufacturer); ctx->dumpHardwareEntriesWithData[e].entry.manufacturerLength = 0; fprintf(stderr, - "libdicformat: Could not read dump hardware block entry manufacturer, " + "libaaruformat: Could not read dump hardware block entry manufacturer, " "continuing..."); } } @@ -957,7 +957,7 @@ void* open(const char* filepath) free(ctx->dumpHardwareEntriesWithData[e].model); ctx->dumpHardwareEntriesWithData[e].entry.modelLength = 0; fprintf(stderr, - "libdicformat: Could not read dump hardware block entry model, continuing..."); + "libaaruformat: Could not read dump hardware block entry model, continuing..."); } } } @@ -980,7 +980,7 @@ void* open(const char* filepath) ctx->dumpHardwareEntriesWithData[e].entry.revisionLength = 0; fprintf( stderr, - "libdicformat: Could not read dump hardware block entry revision, continuing..."); + "libaaruformat: Could not read dump hardware block entry revision, continuing..."); } } } @@ -1003,7 +1003,7 @@ void* open(const char* filepath) ctx->dumpHardwareEntriesWithData[e].entry.firmwareLength = 0; fprintf( stderr, - "libdicformat: Could not read dump hardware block entry firmware, continuing..."); + "libaaruformat: Could not read dump hardware block entry firmware, continuing..."); } } } @@ -1024,8 +1024,9 @@ void* open(const char* filepath) { free(ctx->dumpHardwareEntriesWithData[e].serial); ctx->dumpHardwareEntriesWithData[e].entry.serialLength = 0; - fprintf(stderr, - "libdicformat: Could not read dump hardware block entry serial, continuing..."); + fprintf( + stderr, + "libaaruformat: Could not read dump hardware block entry serial, continuing..."); } } } @@ -1047,7 +1048,7 @@ void* open(const char* filepath) free(ctx->dumpHardwareEntriesWithData[e].softwareName); ctx->dumpHardwareEntriesWithData[e].entry.softwareNameLength = 0; fprintf(stderr, - "libdicformat: Could not read dump hardware block entry software name, " + "libaaruformat: Could not read dump hardware block entry software name, " "continuing..."); } } @@ -1070,7 +1071,7 @@ void* open(const char* filepath) free(ctx->dumpHardwareEntriesWithData[e].softwareVersion); ctx->dumpHardwareEntriesWithData[e].entry.softwareVersionLength = 0; fprintf(stderr, - "libdicformat: Could not read dump hardware block entry software version, " + "libaaruformat: Could not read dump hardware block entry software version, " "continuing..."); } } @@ -1093,7 +1094,7 @@ void* open(const char* filepath) free(ctx->dumpHardwareEntriesWithData[e].softwareOperatingSystem); ctx->dumpHardwareEntriesWithData[e].entry.softwareOperatingSystemLength = 0; fprintf(stderr, - "libdicformat: Could not read dump hardware block entry manufacturer, " + "libaaruformat: Could not read dump hardware block entry manufacturer, " "continuing..."); } } @@ -1106,7 +1107,7 @@ void* open(const char* filepath) { fprintf( stderr, - "libdicformat: Could not allocate memory for dump hardware block extents, continuing..."); + "libaaruformat: Could not allocate memory for dump hardware block extents, continuing..."); continue; } @@ -1118,7 +1119,7 @@ void* open(const char* filepath) if(readBytes != sizeof(DumpExtent) * ctx->dumpHardwareEntriesWithData->entry.extents) { free(ctx->dumpHardwareEntriesWithData[e].extents); - fprintf(stderr, "libdicformat: Could not read dump hardware block extents, continuing..."); + fprintf(stderr, "libaaruformat: Could not read dump hardware block extents, continuing..."); continue; } @@ -1128,7 +1129,8 @@ void* open(const char* filepath) break; default: fprintf(stderr, - "libdicformat: Unhandled block type %4.4s with data type %4.4s is indexed to be at %" PRIu64 "", + "libaaruformat: Unhandled block type %4.4s with data type %4.4s is indexed to be at %" PRIu64 + "", (char*)&idxEntries[i].blockType, (char*)&idxEntries[i].dataType, idxEntries[i].offset); @@ -1140,7 +1142,7 @@ void* open(const char* filepath) if(!foundUserDataDdt) { - fprintf(stderr, "libdicformat: Could not find user data deduplication table, aborting..."); + fprintf(stderr, "libaaruformat: Could not find user data deduplication table, aborting..."); close(ctx); return NULL; } diff --git a/src/read.c b/src/read.c index 37f2ba3..106eb89 100644 --- a/src/read.c +++ b/src/read.c @@ -5,7 +5,7 @@ // Filename : open.c // Author(s) : Natalia Portillo // -// Component : libdicformat. +// Component : libaaruformat. // // --[ Description ] ---------------------------------------------------------- // @@ -30,20 +30,20 @@ // Copyright © 2011-2020 Natalia Portillo // ****************************************************************************/ -#include +#include #include #include int32_t read_media_tag(void* context, uint8_t* data, int32_t tag, uint32_t* length) { - dicformatContext* ctx; - dataLinkedList* item; + aaruformatContext* ctx; + dataLinkedList* item; if(context == NULL) return DICF_ERROR_NOT_DICFORMAT; ctx = context; - // Not a libdicformat context + // Not a libaaruformat context if(ctx->magic != DIC_MAGIC) return DICF_ERROR_NOT_DICFORMAT; item = ctx->mediaTagsHead; @@ -71,8 +71,8 @@ int32_t read_media_tag(void* context, uint8_t* data, int32_t tag, uint32_t* leng int32_t read_sector(void* context, uint64_t sectorAddress, uint8_t* data, uint32_t* length) { - dicformatContext* ctx; - uint64_t ddtEntry; + aaruformatContext* ctx; + uint64_t ddtEntry; uint32_t offsetMask; uint64_t offset; uint64_t blockOffset; @@ -84,7 +84,7 @@ int32_t read_sector(void* context, uint64_t sectorAddress, uint8_t* data, uint32 ctx = context; - // Not a libdicformat context + // Not a libaaruformat context if(ctx->magic != DIC_MAGIC) return DICF_ERROR_NOT_DICFORMAT; if(sectorAddress > ctx->imageInfo.Sectors - 1) return DICF_ERROR_SECTOR_OUT_OF_BOUNDS; @@ -150,14 +150,14 @@ int32_t read_sector(void* context, uint64_t sectorAddress, uint8_t* data, uint32 int32_t read_track_sector(void* context, uint8_t* data, uint64_t sectorAddress, uint32_t* length, uint8_t track) { - dicformatContext* ctx; - int i; + aaruformatContext* ctx; + int i; if(context == NULL) return DICF_ERROR_NOT_DICFORMAT; ctx = context; - // Not a libdicformat context + // Not a libaaruformat context if(ctx->magic != DIC_MAGIC) return DICF_ERROR_NOT_DICFORMAT; if(ctx->imageInfo.XmlMediaType != OpticalDisc) return DICF_ERROR_INCORRECT_MEDIA_TYPE; @@ -173,8 +173,8 @@ int32_t read_track_sector(void* context, uint8_t* data, uint64_t sectorAddress, int32_t read_sector_long(void* context, uint8_t* data, uint64_t sectorAddress, uint32_t* length) { - dicformatContext* ctx; - uint32_t bareLength; + aaruformatContext* ctx; + uint32_t bareLength; uint32_t tagLength; uint8_t* bareData; int32_t res; @@ -186,7 +186,7 @@ int32_t read_sector_long(void* context, uint8_t* data, uint64_t sectorAddress, u ctx = context; - // Not a libdicformat context + // Not a libaaruformat context if(ctx->magic != DIC_MAGIC) return DICF_ERROR_NOT_DICFORMAT; switch(ctx->imageInfo.XmlMediaType)