Add media type string conversion and update info display in info.c

This commit is contained in:
2025-10-09 00:53:38 +01:00
parent 802048b957
commit d24bf749c4
3 changed files with 1084 additions and 19 deletions

View File

@@ -23,19 +23,20 @@
#include <aaruformat.h>
int identify(const char *path);
int info(const char *path);
char *byte_array_to_hex_string(const unsigned char *array, int array_size);
int read(unsigned long long sector_no, const char *path);
int printhex(unsigned char *array, unsigned int length, int width, bool color);
int read_long(unsigned long long sector_no, const char *path);
int verify(const char *path);
int verify_sectors(const char *path);
bool check_cd_sector_channel(CdEccContext *context, const uint8_t *sector, bool *unknown, bool *has_edc,
bool *edc_correct, bool *has_ecc_p, bool *ecc_p_correct, bool *has_ecc_q,
bool *ecc_q_correct);
int compare(const char *path1, const char *path2);
int cli_compare(const char *path1, const char *path2);
int convert(const char *input_path, const char *output_path);
int identify(const char *path);
int info(const char *path);
char *byte_array_to_hex_string(const unsigned char *array, int array_size);
const char *media_type_to_string(MediaType type);
int read(unsigned long long sector_no, const char *path);
int printhex(unsigned char *array, unsigned int length, int width, bool color);
int read_long(unsigned long long sector_no, const char *path);
int verify(const char *path);
int verify_sectors(const char *path);
bool check_cd_sector_channel(CdEccContext *context, const uint8_t *sector, bool *unknown, bool *has_edc,
bool *edc_correct, bool *has_ecc_p, bool *ecc_p_correct, bool *has_ecc_q,
bool *ecc_q_correct);
int compare(const char *path1, const char *path2);
int cli_compare(const char *path1, const char *path2);
int convert(const char *input_path, const char *output_path);
#endif // LIBAARUFORMAT_TOOL_AARUFORMATTOOL_H_

File diff suppressed because it is too large Load Diff

View File

@@ -58,7 +58,7 @@ int info(const char *path)
printf("\tApplication version: %d.%d\n", ctx->header.applicationMajorVersion, ctx->header.applicationMinorVersion);
printf("\tImage format version: %d.%d\n", ctx->header.imageMajorVersion, ctx->header.imageMinorVersion);
printf("\tMedia type: %u\n", ctx->header.mediaType);
printf("\tMedia type: %u (%s)\n", ctx->header.mediaType, media_type_to_string(ctx->header.mediaType));
printf("\tIndex offset: %llu\n", ctx->header.indexOffset);
printf("\tCreation time: %lld\n", ctx->header.creationTime);
printf("\tLast written time: %lld\n", ctx->header.lastWrittenTime);
@@ -427,7 +427,7 @@ int info(const char *path)
printf("\tMedia serial number: %s\n", ctx->imageInfo.MediaSerialNumber);
if(ctx->imageInfo.MediaBarcode != NULL) printf("\tMedia barcode: %s\n", ctx->imageInfo.MediaBarcode);
if(ctx->imageInfo.MediaPartNumber != NULL) printf("\tMedia part number: %s\n", ctx->imageInfo.MediaPartNumber);
printf("\tMedia type: %u\n", ctx->imageInfo.MediaType);
printf("\tMedia type: %u (%s)\n", ctx->imageInfo.MediaType, media_type_to_string(ctx->imageInfo.MediaType));
if(ctx->imageInfo.MediaSequence > 0 || ctx->imageInfo.LastMediaSequence > 0)
printf("\tMedia is number %d in a set of %d media\n", ctx->imageInfo.MediaSequence,