|
libaaruformat 1.0
Aaru Data Preservation Suite - Format Library
|
Read-only metadata accessors for libaaruformat. More...
Go to the source code of this file.
Functions | |
| int32_t | aaruf_get_geometry (const void *context, uint32_t *cylinders, uint32_t *heads, uint32_t *sectors_per_track) |
| Retrieves the logical CHS geometry from the AaruFormat image. | |
| int32_t | aaruf_get_cicm_metadata (const void *context, uint8_t *buffer, size_t *length) |
| Retrieves the embedded CICM XML metadata sidecar from the image. | |
| int32_t | aaruf_get_aaru_json_metadata (const void *context, uint8_t *buffer, size_t *length) |
| Retrieves the embedded Aaru metadata JSON from the image. | |
| int32_t | aaruf_get_media_sequence (const void *context, int32_t *sequence, int32_t *last_sequence) |
| Retrieves the media sequence metadata for multi-volume image sets. | |
| int32_t | aaruf_get_creator (const void *context, uint8_t *buffer, int32_t *length) |
| Retrieves the recorded creator (operator) name from the MetadataBlock. | |
| int32_t | aaruf_get_comments (const void *context, uint8_t *buffer, int32_t *length) |
| Retrieves the user comments or notes stored in the MetadataBlock. | |
| int32_t | aaruf_get_media_title (const void *context, uint8_t *buffer, int32_t *length) |
| Retrieves the media title or label captured during image creation. | |
| int32_t | aaruf_get_media_manufacturer (const void *context, uint8_t *buffer, int32_t *length) |
| Retrieves the recorded media manufacturer name. | |
| int32_t | aaruf_get_media_model (const void *context, uint8_t *buffer, int32_t *length) |
| Retrieves the media model or product designation metadata. | |
| int32_t | aaruf_get_media_serial_number (const void *context, uint8_t *buffer, int32_t *length) |
| Retrieves the media serial number recorded in the image metadata. | |
| int32_t | aaruf_get_media_barcode (const void *context, uint8_t *buffer, int32_t *length) |
| Retrieves the barcode assigned to the physical media or its packaging. | |
| int32_t | aaruf_get_media_part_number (const void *context, uint8_t *buffer, int32_t *length) |
| Retrieves the media part number recorded in the MetadataBlock. | |
| int32_t | aaruf_get_drive_manufacturer (const void *context, uint8_t *buffer, int32_t *length) |
| Retrieves the drive manufacturer metadata captured during imaging. | |
| int32_t | aaruf_get_drive_model (const void *context, uint8_t *buffer, int32_t *length) |
| Retrieves the device model information for the imaging drive. | |
| int32_t | aaruf_get_drive_serial_number (const void *context, uint8_t *buffer, int32_t *length) |
| Retrieves the imaging drive's serial number metadata. | |
| int32_t | aaruf_get_drive_firmware_revision (const void *context, uint8_t *buffer, int32_t *length) |
| Retrieves the firmware revision metadata for the imaging drive. | |
| int32_t | aaruf_get_user_sectors (const void *context, uint64_t *sectors) |
| Retrieves the total number of user-accessible sectors in the AaruFormat image. | |
| int32_t | aaruf_get_negative_sectors (const void *context, uint32_t *sectors) |
| Retrieves the number of negative (pre-gap) sectors in the AaruFormat image. | |
| int32_t | aaruf_get_overflow_sectors (const void *context, uint32_t *sectors) |
| Retrieves the number of overflow (post-gap) sectors in the AaruFormat image. | |
| int32_t | aaruf_get_image_info (const void *context, ImageInfo *image_info) |
| Retrieves a deep copy of the ImageInfo structure from the AaruFormat image. | |
Read-only metadata accessors for libaaruformat.
Contains all aaruf_get_* functions that retrieve metadata from an opened AaruFormat image context. Writer-side functions (aaruf_set_*, aaruf_clear_*) are in metadata_write.c.
Definition in file metadata.c.
| int32_t aaruf_get_aaru_json_metadata | ( | const void * | context, |
| uint8_t * | buffer, | ||
| size_t * | length ) |
Retrieves the embedded Aaru metadata JSON from the image.
Aaru metadata JSON is a structured metadata format that provides machine-readable, comprehensive information about the image, media, imaging session details, hardware configuration, optical disc tracks and sessions, checksums, and preservation metadata. This function extracts the raw JSON payload that was embedded in the AaruFormat image during creation. The JSON data is preserved in its original form without parsing or interpretation by the library, allowing callers to process the structured metadata using standard JSON parsing libraries.
This function supports a two-call pattern for buffer size determination:
Alternatively, if the caller already knows the buffer is large enough, a single call will succeed and populate the buffer with the Aaru JSON data.
| context | Pointer to the aaruformat context (must be a valid, opened image context). |
| buffer | Pointer to a buffer that will receive the Aaru metadata JSON. Must be large enough to hold the entire JSON payload (at least *length bytes on input). The buffer will contain raw UTF-8 encoded JSON data on success. |
| length | Pointer to a size_t that serves dual purpose:
|
| AARUF_STATUS_OK | (0) Successfully retrieved Aaru metadata JSON. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
| AARUF_ERROR_CANNOT_READ_BLOCK | (-7) The Aaru JSON block is not present. This occurs when:
|
| AARUF_ERROR_BUFFER_TOO_SMALL | (-10) The provided buffer is insufficient. This occurs when:
|
Definition at line 399 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_BUFFER_TOO_SMALL, AARUF_ERROR_CANNOT_READ_BLOCK, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, AaruMetadataJsonBlock, FATAL, AaruMetadataJsonBlockHeader::identifier, aaruformat_context::json_block, aaruformat_context::json_block_header, AaruMetadataJsonBlockHeader::length, aaruformat_context::magic, and TRACE.
| int32_t aaruf_get_cicm_metadata | ( | const void * | context, |
| uint8_t * | buffer, | ||
| size_t * | length ) |
Retrieves the embedded CICM XML metadata sidecar from the image.
CICM (Canary Islands Computer Museum) XML is a standardized metadata format used for documenting preservation and archival information about media and disk images. This function extracts the raw CICM XML payload that was embedded in the AaruFormat image during creation. The XML data is preserved in its original form without parsing, interpretation, or validation by the library. The metadata typically includes detailed information about the physical media, imaging process, checksums, device information, and preservation metadata following the CICM schema.
This function supports a two-call pattern for buffer size determination:
Alternatively, if the caller already knows the buffer is large enough, a single call will succeed and populate the buffer with the CICM XML data.
| context | Pointer to the aaruformat context (must be a valid, opened image context). |
| buffer | Pointer to a buffer that will receive the CICM XML metadata. Must be large enough to hold the entire XML payload (at least *length bytes on input). The buffer will contain raw UTF-8 encoded XML data on success. |
| length | Pointer to a size_t that serves dual purpose:
|
| AARUF_STATUS_OK | (0) Successfully retrieved CICM XML metadata. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
| AARUF_ERROR_CANNOT_READ_BLOCK | (-7) The CICM block is not present. This occurs when:
|
| AARUF_ERROR_BUFFER_TOO_SMALL | (-10) The provided buffer is insufficient. This occurs when:
|
Definition at line 244 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_BUFFER_TOO_SMALL, AARUF_ERROR_CANNOT_READ_BLOCK, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, aaruformat_context::cicm_block, aaruformat_context::cicm_block_header, CicmBlock, FATAL, CicmMetadataBlock::identifier, CicmMetadataBlock::length, aaruformat_context::magic, and TRACE.
| int32_t aaruf_get_comments | ( | const void * | context, |
| uint8_t * | buffer, | ||
| int32_t * | length ) |
Retrieves the user comments or notes stored in the MetadataBlock.
Provides access to the UTF-16LE encoded comments associated with the image. Comments are often used for provenance notes, imaging details, or curator remarks. The function follows the same two-call buffer sizing pattern used by other metadata retrieval APIs: the caller may probe the required size before allocating memory.
| context | Pointer to a valid aaruformat context opened with aaruf_open() or aaruf_create(). |
| buffer | Destination buffer that receives the comments data. May be NULL when probing size. |
| length | Pointer to an int32_t. On input it contains the size of buffer in bytes; on output it is updated with the actual comments length. |
| AARUF_STATUS_OK | (0) Comments were available and copied successfully. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context pointer is invalid or not a libaaruformat context. |
| AARUF_ERROR_METADATA_NOT_PRESENT | (-30) No comments metadata exists in the image. |
| AARUF_ERROR_BUFFER_TOO_SMALL | (-10) The supplied buffer was too small. *length is updated with the required size and no data is copied. |
Definition at line 616 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_BUFFER_TOO_SMALL, AARUF_ERROR_METADATA_NOT_PRESENT, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, aaruformat_context::comments, MetadataBlockHeader::commentsLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::magic, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_get_creator | ( | const void * | context, |
| uint8_t * | buffer, | ||
| int32_t * | length ) |
Retrieves the recorded creator (operator) name from the MetadataBlock.
Copies the UTF-16LE encoded creator string that identifies the person or operator who created the image. The function supports the common two-call pattern: the caller first determines the required buffer size by passing a buffer that may be NULL or too small, then allocates sufficient memory and calls again to obtain the actual data. On success the buffer contains an opaque UTF-16LE string of length *length bytes (not null-terminated).
| context | Pointer to a valid aaruformat context opened for reading or writing. |
| buffer | Pointer to the destination buffer that will receive the creator string. May be NULL to query the required size. |
| length | Pointer to an int32_t that on input specifies the size of buffer in bytes and on output receives the actual length of the creator metadata. |
| AARUF_STATUS_OK | (0) The creator string was copied successfully. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is NULL or not an aaruformat context. |
| AARUF_ERROR_METADATA_NOT_PRESENT | (-30) Creator metadata has not been recorded in the image. |
| AARUF_ERROR_BUFFER_TOO_SMALL | (-10) The provided buffer was insufficient; *length contains the required size and no data was copied. |
buffer is large enough before requesting the data. Definition at line 544 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_BUFFER_TOO_SMALL, AARUF_ERROR_METADATA_NOT_PRESENT, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, aaruformat_context::creator, MetadataBlockHeader::creatorLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::magic, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_get_drive_firmware_revision | ( | const void * | context, |
| uint8_t * | buffer, | ||
| int32_t * | length ) |
Retrieves the firmware revision metadata for the imaging drive.
Returns the UTF-16LE encoded firmware revision string that was captured when the image was created. Firmware information is critical for reproducing imaging environments and diagnosing drive-specific behavior or bugs.
| context | Pointer to a valid aaruformat context. |
| buffer | Destination buffer for the firmware revision string. May be NULL when probing size. |
| length | Pointer to an int32_t that specifies the buffer capacity in bytes on input and is updated with the actual metadata length on output. |
| AARUF_STATUS_OK | (0) Firmware revision metadata was present and copied successfully. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context pointer is invalid. |
| AARUF_ERROR_METADATA_NOT_PRESENT | (-30) No firmware metadata exists in the image. |
| AARUF_ERROR_BUFFER_TOO_SMALL | (-10) The supplied buffer was too small; *length is updated. |
Definition at line 1318 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_BUFFER_TOO_SMALL, AARUF_ERROR_METADATA_NOT_PRESENT, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, aaruformat_context::drive_firmware_revision, MetadataBlockHeader::driveFirmwareRevisionLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::magic, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_get_drive_manufacturer | ( | const void * | context, |
| uint8_t * | buffer, | ||
| int32_t * | length ) |
Retrieves the drive manufacturer metadata captured during imaging.
Copies the UTF-16LE encoded manufacturer name of the device used to read or write the medium. This information documents the hardware involved in the imaging process, which is crucial for forensic reporting and reproducibility studies.
| context | Pointer to a valid aaruformat context. |
| buffer | Destination buffer for the manufacturer string. May be NULL when querying required length. |
| length | Pointer to an int32_t specifying the buffer size on input and receiving the actual metadata length on output. |
| AARUF_STATUS_OK | (0) Drive manufacturer metadata was copied successfully. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context pointer is invalid. |
| AARUF_ERROR_METADATA_NOT_PRESENT | (-30) The image lacks drive manufacturer metadata. |
| AARUF_ERROR_BUFFER_TOO_SMALL | (-10) The provided buffer is too small; *length holds the required size for a subsequent call. |
Definition at line 1108 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_BUFFER_TOO_SMALL, AARUF_ERROR_METADATA_NOT_PRESENT, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, aaruformat_context::drive_manufacturer, MetadataBlockHeader::driveManufacturerLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::magic, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_get_drive_model | ( | const void * | context, |
| uint8_t * | buffer, | ||
| int32_t * | length ) |
Retrieves the device model information for the imaging drive.
Returns the UTF-16LE encoded model identifier for the drive used during acquisition. The model metadata provides finer granularity than the manufacturer name, enabling detailed documentation of imaging hardware capabilities and behavior.
| context | Pointer to a valid aaruformat context. |
| buffer | Buffer that receives the model string; may be NULL while probing required capacity. |
| length | Pointer to an int32_t indicating buffer size on input and receiving the metadata length on output. |
| AARUF_STATUS_OK | (0) Drive model metadata was available and copied. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context pointer is invalid. |
| AARUF_ERROR_METADATA_NOT_PRESENT | (-30) No drive model metadata exists in the image. |
| AARUF_ERROR_BUFFER_TOO_SMALL | (-10) The supplied buffer was insufficient; *length is updated. |
Definition at line 1178 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_BUFFER_TOO_SMALL, AARUF_ERROR_METADATA_NOT_PRESENT, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, aaruformat_context::drive_model, MetadataBlockHeader::driveModelLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::magic, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_get_drive_serial_number | ( | const void * | context, |
| uint8_t * | buffer, | ||
| int32_t * | length ) |
Retrieves the imaging drive's serial number metadata.
Copies the UTF-16LE encoded serial number reported for the drive used during the imaging session. This metadata enables correlation between images and specific hardware units for forensic chain of custody or quality assurance workflows.
| context | Pointer to a valid aaruformat context. |
| buffer | Destination buffer for the serial number; may be NULL when querying size. |
| length | Pointer to an int32_t carrying the buffer size on input and receiving the actual serial number length on output. |
| AARUF_STATUS_OK | (0) Drive serial number metadata was copied to buffer. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context pointer is invalid. |
| AARUF_ERROR_METADATA_NOT_PRESENT | (-30) No drive serial number metadata is available. |
| AARUF_ERROR_BUFFER_TOO_SMALL | (-10) The provided buffer was insufficient. |
Definition at line 1248 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_BUFFER_TOO_SMALL, AARUF_ERROR_METADATA_NOT_PRESENT, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, aaruformat_context::drive_serial_number, MetadataBlockHeader::driveSerialNumberLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::magic, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_get_geometry | ( | const void * | context, |
| uint32_t * | cylinders, | ||
| uint32_t * | heads, | ||
| uint32_t * | sectors_per_track ) |
Retrieves the logical CHS geometry from the AaruFormat image.
Reads the Cylinder-Head-Sector (CHS) geometry information from the image's geometry block and returns the values through output parameters. The geometry block contains legacy-style logical addressing parameters that describe how the storage medium was originally organized in terms of cylinders, heads (tracks per cylinder), and sectors per track. This information is essential for software that requires CHS addressing or for accurately representing the original medium's logical structure.
| context | Pointer to the aaruformat context (must be a valid, opened image context). |
| cylinders | Pointer to store the number of cylinders. Updated on success. |
| heads | Pointer to store the number of heads (tracks per cylinder). Updated on success. |
| sectors_per_track | Pointer to store the number of sectors per track. Updated on success. |
| AARUF_STATUS_OK | (0) Successfully retrieved geometry information. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
| AARUF_ERROR_CANNOT_READ_BLOCK | (-7) The geometry block is not present. This occurs when:
|
Definition at line 104 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_CANNOT_READ_BLOCK, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, GeometryBlockHeader::cylinders, FATAL, aaruformat_context::geometry_block, GeometryBlock, GeometryBlockHeader::heads, GeometryBlockHeader::identifier, aaruformat_context::magic, GeometryBlockHeader::sectorsPerTrack, and TRACE.
| int32_t aaruf_get_image_info | ( | const void * | context, |
| ImageInfo * | image_info ) |
Retrieves a deep copy of the ImageInfo structure from the AaruFormat image.
Returns a complete copy of the high-level image information summary containing metadata such as image size, sector count, sector size, version information, creation timestamps, and media type. This function performs a deep copy of all fields including string buffers, ensuring the caller receives a complete, independent copy of the image information.
| context | Pointer to the aaruformat context (must be a valid, opened image context). |
| image_info | Pointer to an ImageInfo structure to receive the copied data. Must be a valid pointer to allocated memory. |
| AARUF_STATUS_OK | (0) Successfully copied image info. The image_info parameter contains a complete copy of all fields including:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
Definition at line 1774 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_INCORRECT_DATA_SIZE, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, FATAL, aaruformat_context::image_info, aaruformat_context::magic, and TRACE.
| int32_t aaruf_get_media_barcode | ( | const void * | context, |
| uint8_t * | buffer, | ||
| int32_t * | length ) |
Retrieves the barcode assigned to the physical media or its packaging.
Returns the UTF-16LE encoded barcode string that was captured when the image was created. Barcodes are commonly used in institutional workflows for inventory tracking and automated retrieval.
| context | Pointer to a valid aaruformat context. |
| buffer | Buffer that receives the barcode string; may be NULL when probing size requirements. |
| length | Pointer to an int32_t specifying the buffer size on input and receiving the actual barcode length on output. |
| AARUF_STATUS_OK | (0) Barcode metadata was present and copied successfully. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context pointer is invalid. |
| AARUF_ERROR_METADATA_NOT_PRESENT | (-30) No barcode metadata exists in the image. |
| AARUF_ERROR_BUFFER_TOO_SMALL | (-10) The supplied buffer was too small. |
Definition at line 965 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_BUFFER_TOO_SMALL, AARUF_ERROR_METADATA_NOT_PRESENT, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, FATAL, MetadataBlockHeader::identifier, aaruformat_context::magic, aaruformat_context::media_barcode, MetadataBlockHeader::mediaBarcodeLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_get_media_manufacturer | ( | const void * | context, |
| uint8_t * | buffer, | ||
| int32_t * | length ) |
Retrieves the recorded media manufacturer name.
Provides access to the UTF-16LE encoded manufacturer metadata that identifies the company which produced the physical medium. This information is taken from the MetadataBlock and mirrors the value previously stored via aaruf_set_media_manufacturer().
| context | Pointer to a valid aaruformat context. |
| buffer | Buffer that receives the manufacturer string. May be NULL when probing size. |
| length | Pointer to an int32_t specifying the buffer size on input and receiving the actual manufacturer string length on output. |
| AARUF_STATUS_OK | (0) Manufacturer metadata was available and copied. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context pointer is invalid. |
| AARUF_ERROR_METADATA_NOT_PRESENT | (-30) The image lacks manufacturer metadata. |
| AARUF_ERROR_BUFFER_TOO_SMALL | (-10) The provided buffer was too small; *length indicates size. |
Definition at line 756 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_BUFFER_TOO_SMALL, AARUF_ERROR_METADATA_NOT_PRESENT, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, FATAL, MetadataBlockHeader::identifier, aaruformat_context::magic, aaruformat_context::media_manufacturer, MetadataBlockHeader::mediaManufacturerLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_get_media_model | ( | const void * | context, |
| uint8_t * | buffer, | ||
| int32_t * | length ) |
Retrieves the media model or product designation metadata.
Returns the UTF-16LE encoded model name that specifies the exact product variant of the physical medium. The function mirrors the set counterpart and is useful for accurately documenting media specifications during preservation workflows.
| context | Pointer to a valid aaruformat context. |
| buffer | Destination buffer for the model string; may be NULL when querying required size. |
| length | Pointer to an int32_t that on input contains the buffer capacity in bytes and on output is updated with the actual metadata length. |
| AARUF_STATUS_OK | (0) Model metadata was successfully copied. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context pointer is invalid. |
| AARUF_ERROR_METADATA_NOT_PRESENT | (-30) No media model metadata is present in the image. |
| AARUF_ERROR_BUFFER_TOO_SMALL | (-10) The caller-provided buffer is too small. |
Definition at line 826 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_BUFFER_TOO_SMALL, AARUF_ERROR_METADATA_NOT_PRESENT, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, FATAL, MetadataBlockHeader::identifier, aaruformat_context::magic, aaruformat_context::media_model, MetadataBlockHeader::mediaModelLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_get_media_part_number | ( | const void * | context, |
| uint8_t * | buffer, | ||
| int32_t * | length ) |
Retrieves the media part number recorded in the MetadataBlock.
Provides access to the UTF-16LE encoded part number identifying the precise catalog or ordering code for the physical medium. Part numbers help archivists procure exact replacements and document specific media variants used during acquisition.
| context | Pointer to a valid aaruformat context. |
| buffer | Destination buffer for the part number string. May be NULL while querying size. |
| length | Pointer to an int32_t that supplies the buffer size on input and is updated with the actual part number length on output. |
| AARUF_STATUS_OK | (0) Part number metadata was returned successfully. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context pointer is invalid. |
| AARUF_ERROR_METADATA_NOT_PRESENT | (-30) No part number metadata exists. |
| AARUF_ERROR_BUFFER_TOO_SMALL | (-10) The provided buffer was insufficient; *length contains the required size. |
Definition at line 1036 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_BUFFER_TOO_SMALL, AARUF_ERROR_METADATA_NOT_PRESENT, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, FATAL, MetadataBlockHeader::identifier, aaruformat_context::magic, aaruformat_context::media_part_number, MetadataBlockHeader::mediaPartNumberLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_get_media_sequence | ( | const void * | context, |
| int32_t * | sequence, | ||
| int32_t * | last_sequence ) |
Retrieves the media sequence metadata for multi-volume image sets.
Reads the media sequence fields stored in the MetadataBlock header and returns the current media number together with the final media number for the complete set. This information indicates the position of the imaged medium within a multi-volume collection (for example, "disc 2 of 5"). The function operates entirely on in-memory structures populated during aaruf_open(); no additional disk I/O is performed.
| context | Pointer to an initialized aaruformat context opened for reading or writing. |
| sequence | Pointer that receives the current media sequence number (typically 1-based). |
| last_sequence | Pointer that receives the total number of media in the set. |
| AARUF_STATUS_OK | (0) Metadata was present and the output parameters were populated. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The provided context pointer is NULL or not an aaruformat context (magic mismatch). |
| AARUF_ERROR_METADATA_NOT_PRESENT | (-30) The MetadataBlock was not present in the image, making sequence data unavailable. |
Definition at line 477 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_METADATA_NOT_PRESENT, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, FATAL, MetadataBlockHeader::identifier, MetadataBlockHeader::lastMediaSequence, aaruformat_context::magic, MetadataBlockHeader::mediaSequence, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_get_media_serial_number | ( | const void * | context, |
| uint8_t * | buffer, | ||
| int32_t * | length ) |
Retrieves the media serial number recorded in the image metadata.
Copies the UTF-16LE encoded serial number identifying the specific physical medium. Serial numbers are particularly important for forensic tracking and archival provenance, enabling correlation between the physical item and its digital representation.
| context | Pointer to a valid aaruformat context. |
| buffer | Destination buffer for the serial number. May be NULL to determine required size. |
| length | Pointer to an int32_t that on input holds the buffer size and on output receives the actual serial number length. |
| AARUF_STATUS_OK | (0) Serial number metadata was copied into buffer. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context pointer is invalid. |
| AARUF_ERROR_METADATA_NOT_PRESENT | (-30) No serial number metadata was stored in the image. |
| AARUF_ERROR_BUFFER_TOO_SMALL | (-10) The provided buffer was too small. |
Definition at line 896 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_BUFFER_TOO_SMALL, AARUF_ERROR_METADATA_NOT_PRESENT, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, FATAL, MetadataBlockHeader::identifier, aaruformat_context::magic, aaruformat_context::media_serial_number, MetadataBlockHeader::mediaSerialNumberLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_get_media_title | ( | const void * | context, |
| uint8_t * | buffer, | ||
| int32_t * | length ) |
Retrieves the media title or label captured during image creation.
Returns the UTF-16LE encoded media title string, representing markings or labels present on the original physical media. This function allows applications to present or archive the media title alongside the image, preserving contextual information from the physical artifact.
| context | Pointer to a valid aaruformat context. |
| buffer | Destination buffer for the UTF-16LE title string. May be NULL when querying size. |
| length | Pointer to an int32_t that on input holds the buffer capacity in bytes and on output receives the actual title length. |
| AARUF_STATUS_OK | (0) The media title was available and copied to buffer. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context pointer is invalid. |
| AARUF_ERROR_METADATA_NOT_PRESENT | (-30) No media title metadata exists. |
| AARUF_ERROR_BUFFER_TOO_SMALL | (-10) The supplied buffer was insufficient. |
Definition at line 686 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_BUFFER_TOO_SMALL, AARUF_ERROR_METADATA_NOT_PRESENT, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, FATAL, MetadataBlockHeader::identifier, aaruformat_context::magic, aaruformat_context::media_title, MetadataBlockHeader::mediaTitleLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_get_negative_sectors | ( | const void * | context, |
| uint32_t * | sectors ) |
Retrieves the number of negative (pre-gap) sectors in the AaruFormat image.
Returns the count of negative sectors that precede the standard user data area. Negative sectors are used to capture pre-gap data, lead-in areas, and other metadata that exists before the main user-accessible storage region. This is particularly important for optical media (CD, DVD, BD) where the lead-in contains the Table of Contents (TOC) and other essential disc structures, and for audio CDs where pre-gap sectors contain silence or hidden tracks. For most hard disk and floppy disk images, this value is typically zero.
| context | Pointer to a valid aaruformat context (must be properly initialized). |
| sectors | Pointer to a uint16_t that receives the negative sector count on success. |
| AARUF_STATUS_OK | (0) Successfully retrieved the negative sector count. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
Definition at line 1557 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, FATAL, aaruformat_context::magic, DdtHeader2::negative, TRACE, and aaruformat_context::user_data_ddt_header.
| int32_t aaruf_get_overflow_sectors | ( | const void * | context, |
| uint32_t * | sectors ) |
Retrieves the number of overflow (post-gap) sectors in the AaruFormat image.
Returns the count of overflow sectors that follow the standard user data area. Overflow sectors are used to capture post-gap data, lead-out areas, and other metadata that exists after the main user-accessible storage region. This is particularly important for optical media (CD, DVD, BD) where the lead-out marks the physical end of the recorded data and contains disc finalization information, and for multi-session discs where gaps between sessions need to be preserved. For most hard disk and floppy disk images, this value is typically zero.
| context | Pointer to a valid aaruformat context (must be properly initialized). |
| sectors | Pointer to a uint16_t that receives the overflow sector count on success. |
| AARUF_STATUS_OK | (0) Successfully retrieved the overflow sector count. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
Definition at line 1692 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, FATAL, aaruformat_context::magic, DdtHeader2::overflow, TRACE, and aaruformat_context::user_data_ddt_header.
| int32_t aaruf_get_user_sectors | ( | const void * | context, |
| uint64_t * | sectors ) |
Retrieves the total number of user-accessible sectors in the AaruFormat image.
Returns the count of standard user data sectors in the image, excluding any negative (pre-gap) or overflow (post-gap) sectors. This represents the primary addressable sector range that contains the main user data, typically corresponding to the logical capacity of the storage medium as it would be seen by an operating system or file system. For optical media, this excludes lead-in and lead-out areas. For hard disks, this represents the standard LBA-addressable range.
| context | Pointer to a valid aaruformat context (must be properly initialized). |
| sectors | Pointer to a uint64_t that receives the total user sector count on success. |
| AARUF_STATUS_OK | (0) Successfully retrieved the user sector count. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
Definition at line 1432 of file metadata.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, DdtHeader2::blocks, FATAL, aaruformat_context::magic, TRACE, and aaruformat_context::user_data_ddt_header.