mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 19:24:40 +00:00
Rename structures.
This commit is contained in:
@@ -1095,7 +1095,7 @@ typedef enum
|
|||||||
CdSectorEccP = 5, /** CD sector ECC P, 172 bytes */
|
CdSectorEccP = 5, /** CD sector ECC P, 172 bytes */
|
||||||
CdSectorEccQ = 6, /** CD sector ECC Q, 104 bytes */
|
CdSectorEccQ = 6, /** CD sector ECC Q, 104 bytes */
|
||||||
CdSectorEcc = 7, /** CD sector ECC (P and Q), 276 bytes */
|
CdSectorEcc = 7, /** CD sector ECC (P and Q), 276 bytes */
|
||||||
CdSectorSubchannelDic = 8, /** CD sector subchannel, 96 bytes */
|
CdSectorSubchannelAaru = 8, /** CD sector subchannel, 96 bytes */
|
||||||
CdTrackIsrc = 9, /** CD track ISRC, string, 12 bytes */
|
CdTrackIsrc = 9, /** CD track ISRC, string, 12 bytes */
|
||||||
CdTrackText = 10, /** CD track text, string, 13 bytes */
|
CdTrackText = 10, /** CD track text, string, 13 bytes */
|
||||||
CdTrackFlags = 11, /** CD track flags, 1 byte */
|
CdTrackFlags = 11, /** CD track flags, 1 byte */
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ typedef struct aaruformatContext
|
|||||||
uint8_t libraryMajorVersion;
|
uint8_t libraryMajorVersion;
|
||||||
uint8_t libraryMinorVersion;
|
uint8_t libraryMinorVersion;
|
||||||
FILE* imageStream;
|
FILE* imageStream;
|
||||||
DicHeader header;
|
AaruHeader header;
|
||||||
struct dataLinkedList* mediaTagsHead;
|
struct dataLinkedList* mediaTagsHead;
|
||||||
struct dataLinkedList* mediaTagsTail;
|
struct dataLinkedList* mediaTagsTail;
|
||||||
uint8_t* sectorPrefix;
|
uint8_t* sectorPrefix;
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ typedef enum
|
|||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
AARUF_STATUS_INVALID_CONTEXT = -1,
|
AARUF_STATUS_INVALID_CONTEXT = -1,
|
||||||
} DicformatStatus;
|
} AaruformatStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enumeration of media types defined in CICM metadata
|
* Enumeration of media types defined in CICM metadata
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
/**Header, at start of file */
|
/**Header, at start of file */
|
||||||
typedef struct DicHeader
|
typedef struct AaruHeader
|
||||||
{
|
{
|
||||||
/**Header identifier, <see cref="AARU_MAGIC" /> */
|
/**Header identifier, <see cref="AARU_MAGIC" /> */
|
||||||
uint64_t identifier;
|
uint64_t identifier;
|
||||||
@@ -66,7 +66,7 @@ typedef struct DicHeader
|
|||||||
int64_t creationTime;
|
int64_t creationTime;
|
||||||
/**Windows filetime (100 nanoseconds since 1601/01/01 00:00:00 UTC) of image last written time */
|
/**Windows filetime (100 nanoseconds since 1601/01/01 00:00:00 UTC) of image last written time */
|
||||||
int64_t lastWrittenTime;
|
int64_t lastWrittenTime;
|
||||||
} DicHeader;
|
} AaruHeader;
|
||||||
|
|
||||||
/**Header for a deduplication table. Table follows it */
|
/**Header for a deduplication table. Table follows it */
|
||||||
typedef struct DdtHeader
|
typedef struct DdtHeader
|
||||||
|
|||||||
@@ -67,11 +67,11 @@ int identifyStream(FILE* imageStream)
|
|||||||
{
|
{
|
||||||
fseek(imageStream, 0, SEEK_SET);
|
fseek(imageStream, 0, SEEK_SET);
|
||||||
|
|
||||||
DicHeader header;
|
AaruHeader header;
|
||||||
|
|
||||||
size_t ret = fread(&header, sizeof(DicHeader), 1, imageStream);
|
size_t ret = fread(&header, sizeof(AaruHeader), 1, imageStream);
|
||||||
|
|
||||||
if(ret < sizeof(DicHeader)) return 0;
|
if(ret < sizeof(AaruHeader)) return 0;
|
||||||
|
|
||||||
if(header.identifier == DIC_MAGIC && header.imageMajorVersion <= AARUF_VERSION) return 100;
|
if(header.identifier == DIC_MAGIC && header.imageMajorVersion <= AARUF_VERSION) return 100;
|
||||||
|
|
||||||
|
|||||||
@@ -70,9 +70,9 @@ void* open(const char* filepath)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fseek(ctx->imageStream, 0, SEEK_SET);
|
fseek(ctx->imageStream, 0, SEEK_SET);
|
||||||
readBytes = fread(&ctx->header, sizeof(DicHeader), 1, ctx->imageStream);
|
readBytes = fread(&ctx->header, sizeof(AaruHeader), 1, ctx->imageStream);
|
||||||
|
|
||||||
if(readBytes != sizeof(DicHeader))
|
if(readBytes != sizeof(AaruHeader))
|
||||||
{
|
{
|
||||||
free(ctx);
|
free(ctx);
|
||||||
errno = AARUF_ERROR_FILE_TOO_SMALL;
|
errno = AARUF_ERROR_FILE_TOO_SMALL;
|
||||||
|
|||||||
Reference in New Issue
Block a user