libaaruformat 1.0
Aaru Data Preservation Suite - Format Library
Loading...
Searching...
No Matches
metadata.c
Go to the documentation of this file.
1/*
2 * This file is part of the Aaru Data Preservation Suite.
3 * Copyright (c) 2019-2025 Natalia Portillo.
4 *
5 * This library is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation; either version 2.1 of the
8 * License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include <inttypes.h>
20#include <stdint.h>
21#include <stdio.h>
22#include <stdlib.h>
23
24#include "aaruformat.h"
25#include "log.h"
26
36{
37 TRACE("Entering process_metadata_block(%p, %p)", ctx, entry);
38 int pos = 0;
39 size_t read_bytes = 0;
40
41 // Check if the context and image stream are valid
42 if(ctx == NULL || ctx->imageStream == NULL)
43 {
44 FATAL("Invalid context or image stream.");
45 TRACE("Exiting process_metadata_block()");
46 return;
47 }
48
49 // Seek to block
50 TRACE("Seeking to metadata block at position %" PRIu64, entry->offset);
51 pos = fseek(ctx->imageStream, entry->offset, SEEK_SET);
52 if(pos < 0 || ftell(ctx->imageStream) != entry->offset)
53 {
54 FATAL("Could not seek to %" PRIu64 " as indicated by index entry...", entry->offset);
55
56 TRACE("Exiting process_metadata_block()");
57 return;
58 }
59
60 // Even if those two checks shall have been done before
61 TRACE("Reading metadata block header at position %" PRIu64, entry->offset);
62 read_bytes = fread(&ctx->metadata_block_header, 1, sizeof(MetadataBlockHeader), ctx->imageStream);
63
64 if(read_bytes != sizeof(MetadataBlockHeader))
65 {
66 memset(&ctx->metadata_block_header, 0, sizeof(MetadataBlockHeader));
67 FATAL("Could not read metadata block header, continuing...");
68
69 TRACE("Exiting process_metadata_block()");
70 return;
71 }
72
74 {
75 memset(&ctx->metadata_block_header, 0, sizeof(MetadataBlockHeader));
76 TRACE("Incorrect identifier for data block at position %" PRIu64 "", entry->offset);
77
78 TRACE("Exiting process_metadata_block()");
79 return;
80 }
81
83
84 ctx->metadata_block = (uint8_t *)malloc(ctx->metadata_block_header.blockSize + sizeof(MetadataBlockHeader));
85
86 if(ctx->metadata_block == NULL)
87 {
88 memset(&ctx->metadata_block_header, 0, sizeof(MetadataBlockHeader));
89 FATAL("Could not allocate memory for metadata block, continuing...");
90
91 TRACE("Exiting process_metadata_block()");
92 return;
93 }
94
95 TRACE("Reading metadata block of size %u at position %" PRIu64,
97
98 fseek(ctx->imageStream, entry->offset, SEEK_SET);
99 read_bytes = fread(ctx->metadata_block, 1, ctx->metadata_block_header.blockSize + sizeof(MetadataBlockHeader),
100 ctx->imageStream);
101
102 if(read_bytes != ctx->metadata_block_header.blockSize + sizeof(MetadataBlockHeader))
103 {
104 memset(&ctx->metadata_block_header, 0, sizeof(MetadataBlockHeader));
105 free(ctx->metadata_block);
106 FATAL("Could not read metadata block, continuing...");
107
108 return;
109 }
110
112 {
115 TRACE("Setting media sequence as %d of %d", ctx->media_sequence, ctx->last_media_sequence);
116 }
117
121 {
122 ctx->creator = (uint8_t *)malloc(ctx->metadata_block_header.creatorLength);
123 if(ctx->creator != NULL)
126 }
127
131 {
132 ctx->comments = (uint8_t *)malloc(ctx->metadata_block_header.commentsLength);
133 if(ctx->comments != NULL)
136 }
137
141 {
142 ctx->media_title = (uint8_t *)malloc(ctx->metadata_block_header.mediaTitleLength);
143 if(ctx->media_title != NULL)
146 }
147
151 {
153 if(ctx->media_manufacturer != NULL)
156 }
157
161 {
162 ctx->media_model = (uint8_t *)malloc(ctx->metadata_block_header.mediaModelLength);
163 if(ctx->media_model != NULL)
166 }
167
171 {
173 if(ctx->media_serial_number != NULL)
176 }
177
181 {
182 ctx->media_barcode = (uint8_t *)malloc(ctx->metadata_block_header.mediaBarcodeLength);
183 if(ctx->media_barcode != NULL)
186 }
187
191 {
193 if(ctx->media_part_number != NULL)
196 }
197
201 {
203 if(ctx->drive_manufacturer != NULL)
206 }
207
211 {
212 ctx->drive_model = (uint8_t *)malloc(ctx->metadata_block_header.driveModelLength);
213 if(ctx->drive_model != NULL)
216 }
217
221 {
223 if(ctx->drive_serial_number != NULL)
226 }
227
232 {
234 if(ctx->drive_firmware_revision != NULL)
235 memcpy(ctx->drive_firmware_revision,
238 }
239
240 TRACE("Exiting process_metadata_block()");
241}
242
252{
253 TRACE("Entering process_geometry_block(%p, %p)", ctx, entry);
254 size_t read_bytes = 0;
255
256 // Check if the context and image stream are valid
257 if(ctx == NULL || ctx->imageStream == NULL)
258 {
259 FATAL("Invalid context or image stream.");
260
261 TRACE("Exiting process_geometry_block()");
262 return;
263 }
264
265 // Seek to block
266 if(fseek(ctx->imageStream, entry->offset, SEEK_SET) != 0)
267 {
268 FATAL("Could not seek to %" PRIu64 " as indicated by index entry...", entry->offset);
269
270 TRACE("Exiting process_geometry_block()");
271 return;
272 }
273
274 TRACE("Reading geometry block header at position %" PRIu64, entry->offset);
275 read_bytes = fread(&ctx->geometry_block, 1, sizeof(GeometryBlockHeader), ctx->imageStream);
276
277 if(read_bytes != sizeof(GeometryBlockHeader))
278 {
279 memset(&ctx->geometry_block, 0, sizeof(GeometryBlockHeader));
280 TRACE("Could not read geometry block header, continuing...");
281 return;
282 }
283
285 {
286 memset(&ctx->geometry_block, 0, sizeof(GeometryBlockHeader));
287 TRACE("Incorrect identifier for geometry block at position %" PRIu64 "", entry->offset);
288 return;
289 }
290
292
293 TRACE("Geometry set to %d cylinders %d heads %d sectors per track", ctx->geometry_block.cylinders,
295
297 ctx->heads = ctx->geometry_block.heads;
299
300 TRACE("Exiting process_geometry_block()");
301}
302
312{
313 TRACE("Entering process_cicm_block(%p, %p)", ctx, entry);
314 int pos = 0;
315 size_t read_bytes = 0;
316
317 // Check if the context and image stream are valid
318 if(ctx == NULL || ctx->imageStream == NULL)
319 {
320 FATAL("Invalid context or image stream.");
321
322 TRACE("Exiting process_cicm_block()");
323 return;
324 }
325
326 // Seek to block
327 TRACE("Seeking to CICM XML metadata block at position %" PRIu64, entry->offset);
328 pos = fseek(ctx->imageStream, entry->offset, SEEK_SET);
329 if(pos < 0 || ftell(ctx->imageStream) != entry->offset)
330 {
331 FATAL("Could not seek to %" PRIu64 " as indicated by index entry...", entry->offset);
332
333 TRACE("Exiting process_cicm_block()");
334 return;
335 }
336
337 // Even if those two checks shall have been done before
338 TRACE("Reading CICM XML metadata block header at position %" PRIu64, entry->offset);
339 read_bytes = fread(&ctx->cicm_block_header, 1, sizeof(CicmMetadataBlock), ctx->imageStream);
340
341 if(read_bytes != sizeof(CicmMetadataBlock))
342 {
343 memset(&ctx->cicm_block_header, 0, sizeof(CicmMetadataBlock));
344 TRACE("Could not read CICM XML metadata header, continuing...");
345 return;
346 }
347
349 {
350 memset(&ctx->cicm_block_header, 0, sizeof(CicmMetadataBlock));
351 TRACE("Incorrect identifier for data block at position %" PRIu64 "", entry->offset);
352 }
353
355
356 ctx->cicm_block = (uint8_t *)malloc(ctx->cicm_block_header.length);
357
358 if(ctx->cicm_block == NULL)
359 {
360 memset(&ctx->cicm_block_header, 0, sizeof(CicmMetadataBlock));
361 TRACE("Could not allocate memory for CICM XML metadata block, continuing...");
362
363 TRACE("Exiting process_cicm_block()");
364 return;
365 }
366
367 TRACE("Reading CICM XML metadata block of size %u at position %" PRIu64, ctx->cicm_block_header.length,
368 entry->offset + sizeof(CicmMetadataBlock));
369 read_bytes = fread(ctx->cicm_block, 1, ctx->cicm_block_header.length, ctx->imageStream);
370
371 if(read_bytes != ctx->cicm_block_header.length)
372 {
373 memset(&ctx->cicm_block_header, 0, sizeof(CicmMetadataBlock));
374 free(ctx->cicm_block);
375 TRACE("Could not read CICM XML metadata block, continuing...");
376 }
377
378 TRACE("Found CICM XML metadata block %" PRIu64 ".", entry->offset);
379
380 TRACE("Exiting process_cicm_block()");
381}
382
476{
477 TRACE("Entering process_aaru_metadata_json_block(%p, %p)", ctx, entry);
478 int pos = 0;
479 size_t read_bytes = 0;
480
481 // Check if the context and image stream are valid
482 if(ctx == NULL || ctx->imageStream == NULL)
483 {
484 FATAL("Invalid context or image stream.");
485
486 TRACE("Exiting process_aaru_metadata_json_block()");
487 return;
488 }
489
490 // Seek to block
491 TRACE("Seeking to Aaru metadata JSON block at position %" PRIu64, entry->offset);
492 pos = fseek(ctx->imageStream, entry->offset, SEEK_SET);
493 if(pos < 0 || ftell(ctx->imageStream) != entry->offset)
494 {
495 FATAL("Could not seek to %" PRIu64 " as indicated by index entry...", entry->offset);
496
497 TRACE("Exiting process_aaru_metadata_json_block()");
498 return;
499 }
500
501 // Even if those two checks shall have been done before
502 TRACE("Reading Aaru metadata JSON block header at position %" PRIu64, entry->offset);
503 read_bytes = fread(&ctx->json_block_header, 1, sizeof(AaruMetadataJsonBlockHeader), ctx->imageStream);
504
505 if(read_bytes != sizeof(AaruMetadataJsonBlockHeader))
506 {
507 memset(&ctx->json_block_header, 0, sizeof(AaruMetadataJsonBlockHeader));
508 TRACE("Could not read Aaru metadata JSON header, continuing...");
509 return;
510 }
511
513 {
514 memset(&ctx->json_block_header, 0, sizeof(AaruMetadataJsonBlockHeader));
515 TRACE("Incorrect identifier for data block at position %" PRIu64 "", entry->offset);
516 }
517
519
520 ctx->json_block = (uint8_t *)malloc(ctx->json_block_header.length);
521
522 if(ctx->json_block == NULL)
523 {
524 memset(&ctx->json_block_header, 0, sizeof(AaruMetadataJsonBlockHeader));
525 TRACE("Could not allocate memory for Aaru metadata JSON block, continuing...");
526
527 TRACE("Exiting process_aaru_metadata_json_block()");
528 return;
529 }
530
531 TRACE("Reading Aaru metadata JSON block of size %u at position %" PRIu64, ctx->json_block_header.length,
532 entry->offset + sizeof(AaruMetadataJsonBlockHeader));
533 read_bytes = fread(ctx->json_block, 1, ctx->json_block_header.length, ctx->imageStream);
534
535 if(read_bytes != ctx->json_block_header.length)
536 {
537 memset(&ctx->json_block_header, 0, sizeof(AaruMetadataJsonBlockHeader));
538 free(ctx->json_block);
539 TRACE("Could not read Aaru metadata JSON block, continuing...");
540 }
541
542 TRACE("Found Aaru metadata JSON block %" PRIu64 ".", entry->offset);
543
544 TRACE("Exiting process_aaru_metadata_json_block()");
545}
546
623AARU_EXPORT int32_t AARU_CALL aaruf_get_readable_sector_tags(const void *context, uint8_t *buffer, size_t *length)
624{
625 TRACE("Entering aaruf_get_readable_sector_tags(%p, %p, %zu)", context, buffer, (length ? *length : 0));
626
627 // Check context is correct AaruFormat context
628 if(context == NULL)
629 {
630 FATAL("Invalid context");
631
632 TRACE("Exiting aaruf_get_readable_sector_tags() = AARUF_ERROR_NOT_AARUFORMAT");
634 }
635
636 const aaruformat_context *ctx = context;
637
638 // Not a libaaruformat context
639 if(ctx->magic != AARU_MAGIC)
640 {
641 FATAL("Invalid context");
642
643 TRACE("Exiting aaruf_get_readable_sector_tags() = AARUF_ERROR_NOT_AARUFORMAT");
645 }
646
647 if(ctx->readableSectorTags == NULL)
648 {
649 FATAL("Image contains no readable sector tags");
650
651 TRACE("Exiting aaruf_get_readable_sector_tags() = AARUF_ERROR_METADATA_NOT_PRESENT");
653 }
654
655 size_t required_length = sizeof(bool) * (MaxSectorTag + 1);
656
657 if(buffer == NULL || length == NULL || *length < required_length)
658 {
659 if(length) *length = required_length;
660 TRACE("Buffer too small for readable sector tags, required %zu bytes", required_length);
661
662 TRACE("Exiting aaruf_get_readable_sector_tags() = AARUF_ERROR_BUFFER_TOO_SMALL");
664 }
665
666 memcpy(buffer, ctx->readableSectorTags, required_length);
667 *length = required_length;
668
669 TRACE("Exiting aaruf_get_readable_sector_tags(%p, %p, %zu) = AARUF_STATUS_OK", context, buffer, *length);
670 return AARUF_STATUS_OK;
671}
672
711AARU_EXPORT int32_t AARU_CALL aaruf_get_readable_media_tags(const void *context, uint8_t *buffer, size_t *length)
712{
713 TRACE("Entering aaruf_get_readable_media_tags(%p, %p, %zu)", context, buffer, (length ? *length : 0));
714
715 // Check context is correct AaruFormat context
716 if(context == NULL)
717 {
718 FATAL("Invalid context");
719
720 TRACE("Exiting aaruf_get_readable_media_tags() = AARUF_ERROR_NOT_AARUFORMAT");
722 }
723
724 const aaruformat_context *ctx = context;
725
726 // Not a libaaruformat context
727 if(ctx->magic != AARU_MAGIC)
728 {
729 FATAL("Invalid context");
730
731 TRACE("Exiting aaruf_get_readable_media_tags() = AARUF_ERROR_NOT_AARUFORMAT");
733 }
734
735 // Required size: one byte for each MediaTagType (0 to MaxMediaTag)
736 size_t required_length = MaxMediaTag + 1;
737
738 if(buffer == NULL || length == NULL || *length < required_length)
739 {
740 if(length) *length = required_length;
741 TRACE("Buffer too small for readable media tags, required %zu bytes", required_length);
742
743 TRACE("Exiting aaruf_get_readable_media_tags() = AARUF_ERROR_BUFFER_TOO_SMALL");
745 }
746
747 // Initialize all bytes to false (0)
748 memset(buffer, 0, required_length);
749
750 // Iterate through all media tag types and mark present ones as true
751 for(int32_t tag_type = 0; tag_type <= MaxMediaTag; tag_type++)
752 {
753 mediaTagEntry *item = NULL;
754 HASH_FIND_INT(ctx->mediaTags, &tag_type, item);
755
756 if(item != NULL)
757 {
758 buffer[tag_type] = 1;
759 TRACE("Media tag type %d is present", tag_type);
760 }
761 }
762
763 *length = required_length;
764
765 TRACE("Exiting aaruf_get_readable_media_tags(%p, %p, %zu) = AARUF_STATUS_OK", context, buffer, *length);
766 return AARUF_STATUS_OK;
767}
void process_metadata_block(aaruformat_context *ctx, const IndexEntry *entry)
Processes a metadata block from the image stream.
Definition metadata.c:35
void process_cicm_block(aaruformat_context *ctx, const IndexEntry *entry)
Processes a CICM XML metadata block from the image stream.
Definition metadata.c:311
void process_geometry_block(aaruformat_context *ctx, const IndexEntry *entry)
Processes a logical geometry block from the image stream.
Definition metadata.c:251
void process_aaru_metadata_json_block(aaruformat_context *ctx, const IndexEntry *entry)
Processes an Aaru metadata JSON block from the image stream during image opening.
Definition metadata.c:475
int32_t aaruf_get_readable_media_tags(const void *context, uint8_t *buffer, size_t *length)
Retrieves which media tags are present in the AaruFormat image.
Definition metadata.c:711
int32_t aaruf_get_readable_sector_tags(const void *context, uint8_t *buffer, size_t *length)
Retrieves which sector tags are readable in the AaruFormat image.
Definition metadata.c:623
#define AARU_MAGIC
Magic identifier for AaruFormat container (ASCII "AARUFRMT").
Definition consts.h:64
#define AARU_CALL
Definition decls.h:45
#define AARU_EXPORT
Definition decls.h:54
@ GeometryBlock
Block containing logical geometry.
Definition enums.h:149
@ AaruMetadataJsonBlock
Block containing JSON version of Aaru Metadata.
Definition enums.h:160
@ CicmBlock
Block containing CICM XML metadata.
Definition enums.h:152
#define AARUF_STATUS_OK
Sector present and read without uncorrectable errors.
Definition errors.h:75
#define AARUF_ERROR_METADATA_NOT_PRESENT
Requested metadata not present in image.
Definition errors.h:69
#define AARUF_ERROR_NOT_AARUFORMAT
Input file/stream failed magic or structural validation.
Definition errors.h:40
#define AARUF_ERROR_BUFFER_TOO_SMALL
Caller-supplied buffer insufficient for data.
Definition errors.h:49
@ MaxMediaTag
Definition aaru.h:1064
@ MaxSectorTag
Definition aaru.h:970
#define FATAL(fmt,...)
Definition log.h:40
#define TRACE(fmt,...)
Definition log.h:25
Header for an Aaru metadata JSON block (identifier == BlockType::AaruMetadataJsonBlock).
Definition metadata.h:120
uint32_t identifier
Block identifier, must be BlockType::AaruMetadataJsonBlock.
Definition metadata.h:121
uint32_t length
Length in bytes of the Aaru metadata JSON payload that follows.
Definition metadata.h:122
Header for a CICM XML metadata block (identifier == BlockType::CicmBlock).
Definition metadata.h:108
uint32_t length
Length in bytes of the CICM metadata payload that follows.
Definition metadata.h:110
uint32_t identifier
Block identifier, must be BlockType::CicmBlock.
Definition metadata.h:109
Legacy CHS style logical geometry metadata (BlockType::GeometryBlock).
Definition data.h:91
uint32_t identifier
Block identifier, must be BlockType::GeometryBlock.
Definition data.h:92
uint32_t cylinders
Number of cylinders.
Definition data.h:93
uint32_t heads
Number of heads (tracks per cylinder).
Definition data.h:94
uint32_t sectorsPerTrack
Number of sectors per track.
Definition data.h:95
uint64_t ImageSize
Size of the image payload in bytes (excludes headers/metadata)
Definition aaru.h:925
Single index entry describing a block's type, (optional) data classification, and file offset.
Definition index.h:109
uint32_t blockType
Block identifier of the referenced block (value from BlockType).
Definition index.h:110
uint64_t offset
Absolute byte offset in the image where the referenced block header begins.
Definition index.h:112
Header for a metadata block containing offsets and lengths to UTF-16LE descriptive strings.
Definition metadata.h:69
uint32_t commentsLength
Length in bytes (including null) of comments string.
Definition metadata.h:78
int32_t mediaSequence
Sequence number within a multi-disc / multi-volume set (0-based or 1-based as producer defines).
Definition metadata.h:72
uint32_t identifier
Block identifier, must be BlockType::MetadataBlock.
Definition metadata.h:70
uint32_t mediaTitleOffset
Offset to UTF-16LE media title string.
Definition metadata.h:79
uint32_t driveModelLength
Length in bytes (including null) of drive model string.
Definition metadata.h:94
uint32_t driveManufacturerLength
Length in bytes (including null) of drive manufacturer string.
Definition metadata.h:92
uint32_t blockSize
Total size in bytes of the entire metadata block (header + strings).
Definition metadata.h:71
uint32_t driveModelOffset
Offset to UTF-16LE drive model string.
Definition metadata.h:93
uint32_t mediaModelOffset
Offset to UTF-16LE media model string.
Definition metadata.h:83
uint32_t creatorOffset
Offset to UTF-16LE creator string (or undefined if creatorLength==0).
Definition metadata.h:75
uint32_t mediaTitleLength
Length in bytes (including null) of media title string.
Definition metadata.h:80
uint32_t mediaManufacturerOffset
Offset to UTF-16LE media manufacturer string.
Definition metadata.h:81
uint32_t driveSerialNumberLength
Length in bytes (including null) of drive serial number string.
Definition metadata.h:96
uint32_t driveSerialNumberOffset
Offset to UTF-16LE drive serial number string.
Definition metadata.h:95
uint32_t mediaManufacturerLength
Length in bytes (including null) of media manufacturer string.
Definition metadata.h:82
uint32_t mediaModelLength
Length in bytes (including null) of media model string.
Definition metadata.h:84
uint32_t driveFirmwareRevisionOffset
Offset to UTF-16LE drive firmware revision string.
Definition metadata.h:97
int32_t lastMediaSequence
Total number of media in the set; 0 or 1 if single item.
Definition metadata.h:74
uint32_t commentsOffset
Offset to UTF-16LE comments string.
Definition metadata.h:77
uint32_t driveManufacturerOffset
Offset to UTF-16LE drive manufacturer string.
Definition metadata.h:91
uint32_t mediaSerialNumberOffset
Offset to UTF-16LE media serial number string.
Definition metadata.h:85
uint32_t mediaSerialNumberLength
Length in bytes (including null) of media serial number string.
Definition metadata.h:86
uint32_t mediaPartNumberOffset
Offset to UTF-16LE media part number string.
Definition metadata.h:89
uint32_t mediaPartNumberLength
Length in bytes (including null) of media part number string.
Definition metadata.h:90
uint32_t mediaBarcodeLength
Length in bytes (including null) of media barcode string.
Definition metadata.h:88
uint32_t creatorLength
Length in bytes (including null) of creator string (0 if absent).
Definition metadata.h:76
uint32_t driveFirmwareRevisionLength
Length in bytes (including null) of drive firmware revision string.
Definition metadata.h:98
uint32_t mediaBarcodeOffset
Offset to UTF-16LE media barcode string.
Definition metadata.h:87
Master context representing an open or in‑creation Aaru image.
Definition context.h:172
uint8_t * media_barcode
Barcode of the media represented by the image.
Definition context.h:222
uint8_t * creator
Who (person) created the image?
Definition context.h:216
uint8_t * cicm_block
CICM XML payload.
Definition context.h:214
uint32_t cylinders
Cylinders of the media represented by the image.
Definition context.h:234
uint8_t * drive_firmware_revision
Firmware revision of the drive used to read the media represented by the image.
Definition context.h:228
uint8_t * media_serial_number
Serial number of the media represented by the image.
Definition context.h:221
MetadataBlockHeader metadata_block_header
Metadata block header.
Definition context.h:230
int32_t media_sequence
Number in sequence for the media represented by the image.
Definition context.h:238
uint8_t * media_model
Model of the media represented by the image.
Definition context.h:220
uint8_t * drive_serial_number
Serial number of the drive used to read the media represented by the image.
Definition context.h:226
uint8_t * drive_manufacturer
Manufacturer of the drive used to read the media represented by the image.
Definition context.h:224
CicmMetadataBlock cicm_block_header
CICM metadata header (if present).
Definition context.h:231
uint8_t * drive_model
Model of the drive used to read the media represented by the image.
Definition context.h:225
uint64_t magic
File magic (AARU_MAGIC) post-open.
Definition context.h:174
mediaTagEntry * mediaTags
Hash table of extra media tags (uthash root).
Definition context.h:264
GeometryBlockHeader geometry_block
Logical geometry block (if present).
Definition context.h:229
uint8_t * json_block
JSON metadata block payload (UTF-8).
Definition context.h:215
uint8_t * media_part_number
Part number of the media represented by the image.
Definition context.h:223
AaruMetadataJsonBlockHeader json_block_header
JSON metadata block header (if present).
Definition context.h:233
uint32_t sectors_per_track
Sectors per track of the media represented by the image (for variable image, the smallest)
Definition context.h:236
uint8_t * comments
Image comments.
Definition context.h:218
uint32_t heads
Heads of the media represented by the image.
Definition context.h:235
FILE * imageStream
Underlying FILE* stream (binary mode).
Definition context.h:176
ImageInfo image_info
Exposed high-level image info summary.
Definition context.h:260
bool * readableSectorTags
Per-sector boolean array (optical tags read successfully?).
Definition context.h:263
uint8_t * metadata_block
Raw metadata UTF-16LE concatenated strings.
Definition context.h:213
uint8_t * media_title
Title of the media represented by the image.
Definition context.h:217
int32_t last_media_sequence
Last media of the sequence the media represented by the image corresponds to.
Definition context.h:239
uint8_t * media_manufacturer
Manufacturer of the media represented by the image.
Definition context.h:219
Hash table entry for an arbitrary media tag (e.g., proprietary drive/medium descriptor).
Definition context.h:119