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);
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, ctx->metadata_block_header.blockSize,
96 entry->offset + sizeof(MetadataBlockHeader));
97 read_bytes = fread(ctx->metadata_block, 1, ctx->metadata_block_header.blockSize, ctx->imageStream);
98
99 if(read_bytes != ctx->metadata_block_header.blockSize)
100 {
101 memset(&ctx->metadata_block_header, 0, sizeof(MetadataBlockHeader));
102 free(ctx->metadata_block);
103 FATAL("Could not read metadata block, continuing...");
104 }
105
107 {
110 TRACE("Setting media sequence as %d of %d", ctx->media_sequence, ctx->last_media_sequence);
111 }
112
116 {
117 ctx->creator = (uint8_t *)malloc(ctx->metadata_block_header.creatorLength);
118 if(ctx->creator != NULL)
121 }
122
126 {
127 ctx->comments = (uint8_t *)malloc(ctx->metadata_block_header.commentsLength);
128 if(ctx->comments != NULL)
131 }
132
136 {
137 ctx->media_title = (uint8_t *)malloc(ctx->metadata_block_header.mediaTitleLength);
138 if(ctx->media_title != NULL)
141 }
142
146 {
148 if(ctx->media_manufacturer != NULL)
151 }
152
156 {
157 ctx->media_model = (uint8_t *)malloc(ctx->metadata_block_header.mediaModelLength);
158 if(ctx->media_model != NULL)
161 }
162
166 {
168 if(ctx->media_serial_number != NULL)
171 }
172
176 {
177 ctx->media_barcode = (uint8_t *)malloc(ctx->metadata_block_header.mediaBarcodeLength);
178 if(ctx->media_barcode != NULL)
181 }
182
186 {
188 if(ctx->media_part_number != NULL)
191 }
192
196 {
198 if(ctx->drive_manufacturer != NULL)
201 }
202
206 {
207 ctx->drive_model = (uint8_t *)malloc(ctx->metadata_block_header.driveModelLength);
208 if(ctx->drive_model != NULL)
211 }
212
216 {
218 if(ctx->drive_serial_number != NULL)
221 }
222
227 {
229 if(ctx->drive_firmware_revision != NULL)
230 memcpy(ctx->drive_firmware_revision,
233 }
234
235 TRACE("Exiting process_metadata_block()");
236}
237
247{
248 TRACE("Entering process_geometry_block(%p, %p)", ctx, entry);
249 size_t read_bytes = 0;
250
251 // Check if the context and image stream are valid
252 if(ctx == NULL || ctx->imageStream == NULL)
253 {
254 FATAL("Invalid context or image stream.");
255
256 TRACE("Exiting process_geometry_block()");
257 return;
258 }
259
260 // Seek to block
261 if(fseek(ctx->imageStream, entry->offset, SEEK_SET) != 0)
262 {
263 FATAL("Could not seek to %" PRIu64 " as indicated by index entry...", entry->offset);
264
265 TRACE("Exiting process_geometry_block()");
266 return;
267 }
268
269 TRACE("Reading geometry block header at position %" PRIu64, entry->offset);
270 read_bytes = fread(&ctx->geometry_block, 1, sizeof(GeometryBlockHeader), ctx->imageStream);
271
272 if(read_bytes != sizeof(GeometryBlockHeader))
273 {
274 memset(&ctx->geometry_block, 0, sizeof(GeometryBlockHeader));
275 TRACE("Could not read geometry block header, continuing...");
276 return;
277 }
278
280 {
281 memset(&ctx->geometry_block, 0, sizeof(GeometryBlockHeader));
282 TRACE("Incorrect identifier for geometry block at position %" PRIu64 "", entry->offset);
283 return;
284 }
285
287
288 TRACE("Geometry set to %d cylinders %d heads %d sectors per track", ctx->geometry_block.cylinders,
290
292 ctx->heads = ctx->geometry_block.heads;
294
295 TRACE("Exiting process_geometry_block()");
296}
297
307{
308 TRACE("Entering process_cicm_block(%p, %p)", ctx, entry);
309 int pos = 0;
310 size_t read_bytes = 0;
311
312 // Check if the context and image stream are valid
313 if(ctx == NULL || ctx->imageStream == NULL)
314 {
315 FATAL("Invalid context or image stream.");
316
317 TRACE("Exiting process_cicm_block()");
318 return;
319 }
320
321 // Seek to block
322 TRACE("Seeking to CICM XML metadata block at position %" PRIu64, entry->offset);
323 pos = fseek(ctx->imageStream, entry->offset, SEEK_SET);
324 if(pos < 0 || ftell(ctx->imageStream) != entry->offset)
325 {
326 FATAL("Could not seek to %" PRIu64 " as indicated by index entry...", entry->offset);
327
328 TRACE("Exiting process_cicm_block()");
329 return;
330 }
331
332 // Even if those two checks shall have been done before
333 TRACE("Reading CICM XML metadata block header at position %" PRIu64, entry->offset);
334 read_bytes = fread(&ctx->cicm_block_header, 1, sizeof(CicmMetadataBlock), ctx->imageStream);
335
336 if(read_bytes != sizeof(CicmMetadataBlock))
337 {
338 memset(&ctx->cicm_block_header, 0, sizeof(CicmMetadataBlock));
339 TRACE("Could not read CICM XML metadata header, continuing...");
340 return;
341 }
342
344 {
345 memset(&ctx->cicm_block_header, 0, sizeof(CicmMetadataBlock));
346 TRACE("Incorrect identifier for data block at position %" PRIu64 "", entry->offset);
347 }
348
350
351 ctx->cicm_block = (uint8_t *)malloc(ctx->cicm_block_header.length);
352
353 if(ctx->cicm_block == NULL)
354 {
355 memset(&ctx->cicm_block_header, 0, sizeof(CicmMetadataBlock));
356 TRACE("Could not allocate memory for CICM XML metadata block, continuing...");
357
358 TRACE("Exiting process_cicm_block()");
359 return;
360 }
361
362 TRACE("Reading CICM XML metadata block of size %u at position %" PRIu64, ctx->cicm_block_header.length,
363 entry->offset + sizeof(CicmMetadataBlock));
364 read_bytes = fread(ctx->cicm_block, 1, ctx->cicm_block_header.length, ctx->imageStream);
365
366 if(read_bytes != ctx->cicm_block_header.length)
367 {
368 memset(&ctx->cicm_block_header, 0, sizeof(CicmMetadataBlock));
369 free(ctx->cicm_block);
370 TRACE("Could not read CICM XML metadata block, continuing...");
371 }
372
373 TRACE("Found CICM XML metadata block %" PRIu64 ".", entry->offset);
374
375 TRACE("Exiting process_cicm_block()");
376}
377
471{
472 TRACE("Entering process_aaru_metadata_json_block(%p, %p)", ctx, entry);
473 int pos = 0;
474 size_t read_bytes = 0;
475
476 // Check if the context and image stream are valid
477 if(ctx == NULL || ctx->imageStream == NULL)
478 {
479 FATAL("Invalid context or image stream.");
480
481 TRACE("Exiting process_aaru_metadata_json_block()");
482 return;
483 }
484
485 // Seek to block
486 TRACE("Seeking to Aaru metadata JSON block at position %" PRIu64, entry->offset);
487 pos = fseek(ctx->imageStream, entry->offset, SEEK_SET);
488 if(pos < 0 || ftell(ctx->imageStream) != entry->offset)
489 {
490 FATAL("Could not seek to %" PRIu64 " as indicated by index entry...", entry->offset);
491
492 TRACE("Exiting process_aaru_metadata_json_block()");
493 return;
494 }
495
496 // Even if those two checks shall have been done before
497 TRACE("Reading Aaru metadata JSON block header at position %" PRIu64, entry->offset);
498 read_bytes = fread(&ctx->json_block_header, 1, sizeof(AaruMetadataJsonBlockHeader), ctx->imageStream);
499
500 if(read_bytes != sizeof(AaruMetadataJsonBlockHeader))
501 {
502 memset(&ctx->json_block_header, 0, sizeof(AaruMetadataJsonBlockHeader));
503 TRACE("Could not read Aaru metadata JSON header, continuing...");
504 return;
505 }
506
508 {
509 memset(&ctx->json_block_header, 0, sizeof(AaruMetadataJsonBlockHeader));
510 TRACE("Incorrect identifier for data block at position %" PRIu64 "", entry->offset);
511 }
512
514
515 ctx->json_block = (uint8_t *)malloc(ctx->json_block_header.length);
516
517 if(ctx->json_block == NULL)
518 {
519 memset(&ctx->json_block_header, 0, sizeof(AaruMetadataJsonBlockHeader));
520 TRACE("Could not allocate memory for Aaru metadata JSON block, continuing...");
521
522 TRACE("Exiting process_aaru_metadata_json_block()");
523 return;
524 }
525
526 TRACE("Reading Aaru metadata JSON block of size %u at position %" PRIu64, ctx->json_block_header.length,
527 entry->offset + sizeof(AaruMetadataJsonBlockHeader));
528 read_bytes = fread(ctx->json_block, 1, ctx->json_block_header.length, ctx->imageStream);
529
530 if(read_bytes != ctx->json_block_header.length)
531 {
532 memset(&ctx->json_block_header, 0, sizeof(AaruMetadataJsonBlockHeader));
533 free(ctx->json_block);
534 TRACE("Could not read Aaru metadata JSON block, continuing...");
535 }
536
537 TRACE("Found Aaru metadata JSON block %" PRIu64 ".", entry->offset);
538
539 TRACE("Exiting process_aaru_metadata_json_block()");
540}
541
618AARU_EXPORT int32_t AARU_CALL aaruf_get_readable_sector_tags(const void *context, uint8_t *buffer, size_t *length)
619{
620 TRACE("Entering aaruf_get_readable_sector_tags(%p, %p, %zu)", context, buffer, (length ? *length : 0));
621
622 // Check context is correct AaruFormat context
623 if(context == NULL)
624 {
625 FATAL("Invalid context");
626
627 TRACE("Exiting aaruf_get_readable_sector_tags() = AARUF_ERROR_NOT_AARUFORMAT");
629 }
630
631 const aaruformat_context *ctx = context;
632
633 // Not a libaaruformat context
634 if(ctx->magic != AARU_MAGIC)
635 {
636 FATAL("Invalid context");
637
638 TRACE("Exiting aaruf_get_readable_sector_tags() = AARUF_ERROR_NOT_AARUFORMAT");
640 }
641
642 if(ctx->readableSectorTags == NULL)
643 {
644 FATAL("Image contains no readable sector tags");
645
646 TRACE("Exiting aaruf_get_readable_sector_tags() = AARUF_ERROR_METADATA_NOT_PRESENT");
648 }
649
650 size_t required_length = sizeof(bool) * (MaxSectorTag + 1);
651
652 if(buffer == NULL || length == NULL || *length < required_length)
653 {
654 if(length) *length = required_length;
655 TRACE("Buffer too small for readable sector tags, required %zu bytes", required_length);
656
657 TRACE("Exiting aaruf_get_readable_sector_tags() = AARUF_ERROR_BUFFER_TOO_SMALL");
659 }
660
661 memcpy(buffer, ctx->readableSectorTags, required_length);
662 *length = required_length;
663
664 TRACE("Exiting aaruf_get_readable_sector_tags(%p, %p, %zu) = AARUF_STATUS_OK", context, buffer, *length);
665 return AARUF_STATUS_OK;
666}
667
706AARU_EXPORT int32_t AARU_CALL aaruf_get_readable_media_tags(const void *context, uint8_t *buffer, size_t *length)
707{
708 TRACE("Entering aaruf_get_readable_media_tags(%p, %p, %zu)", context, buffer, (length ? *length : 0));
709
710 // Check context is correct AaruFormat context
711 if(context == NULL)
712 {
713 FATAL("Invalid context");
714
715 TRACE("Exiting aaruf_get_readable_media_tags() = AARUF_ERROR_NOT_AARUFORMAT");
717 }
718
719 const aaruformat_context *ctx = context;
720
721 // Not a libaaruformat context
722 if(ctx->magic != AARU_MAGIC)
723 {
724 FATAL("Invalid context");
725
726 TRACE("Exiting aaruf_get_readable_media_tags() = AARUF_ERROR_NOT_AARUFORMAT");
728 }
729
730 // Required size: one byte for each MediaTagType (0 to MaxMediaTag)
731 size_t required_length = MaxMediaTag + 1;
732
733 if(buffer == NULL || length == NULL || *length < required_length)
734 {
735 if(length) *length = required_length;
736 TRACE("Buffer too small for readable media tags, required %zu bytes", required_length);
737
738 TRACE("Exiting aaruf_get_readable_media_tags() = AARUF_ERROR_BUFFER_TOO_SMALL");
740 }
741
742 // Initialize all bytes to false (0)
743 memset(buffer, 0, required_length);
744
745 // Iterate through all media tag types and mark present ones as true
746 for(int32_t tag_type = 0; tag_type <= MaxMediaTag; tag_type++)
747 {
748 mediaTagEntry *item = NULL;
749 HASH_FIND_INT(ctx->mediaTags, &tag_type, item);
750
751 if(item != NULL)
752 {
753 buffer[tag_type] = 1;
754 TRACE("Media tag type %d is present", tag_type);
755 }
756 }
757
758 *length = required_length;
759
760 TRACE("Exiting aaruf_get_readable_media_tags(%p, %p, %zu) = AARUF_STATUS_OK", context, buffer, *length);
761 return AARUF_STATUS_OK;
762}
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:306
void process_geometry_block(aaruformat_context *ctx, const IndexEntry *entry)
Processes a logical geometry block from the image stream.
Definition metadata.c:246
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:470
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:706
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:618
#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:148
@ AaruMetadataJsonBlock
Block containing JSON version of Aaru Metadata.
Definition enums.h:159
@ CicmBlock
Block containing CICM XML metadata.
Definition enums.h:151
#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:1011
@ MaxSectorTag
Definition aaru.h:918
#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:873
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