|
libaaruformat 1.0
Aaru Data Preservation Suite - Format Library
|
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_set_geometry (void *context, const uint32_t cylinders, const uint32_t heads, const uint32_t sectors_per_track) |
| Sets the logical CHS geometry for the AaruFormat image. | |
| int32_t | aaruf_set_media_sequence (void *context, const int32_t sequence, const int32_t last_sequence) |
| Sets the media sequence information for multi-volume media sets. | |
| int32_t | aaruf_set_creator (void *context, const uint8_t *data, const int32_t length) |
| Sets the creator (person/operator) information for the image. | |
| int32_t | aaruf_set_comments (void *context, const uint8_t *data, const int32_t length) |
| Sets user comments or notes for the image. | |
| int32_t | aaruf_set_media_title (void *context, const uint8_t *data, const int32_t length) |
| Sets the media title or label for the image. | |
| int32_t | aaruf_set_media_manufacturer (void *context, const uint8_t *data, const int32_t length) |
| Sets the media manufacturer information for the image. | |
| int32_t | aaruf_set_media_model (void *context, const uint8_t *data, const int32_t length) |
| Sets the media model or product designation for the image. | |
| int32_t | aaruf_set_media_serial_number (void *context, const uint8_t *data, const int32_t length) |
| Sets the media serial number for the image. | |
| int32_t | aaruf_set_media_barcode (void *context, const uint8_t *data, const int32_t length) |
| Sets the media barcode information for the image. | |
| int32_t | aaruf_set_media_part_number (void *context, const uint8_t *data, const int32_t length) |
| Sets the media part number or model designation for the image. | |
| int32_t | aaruf_set_drive_manufacturer (void *context, const uint8_t *data, const int32_t length) |
| Sets the drive manufacturer information for the image. | |
| int32_t | aaruf_set_drive_model (void *context, const uint8_t *data, const int32_t length) |
| Sets the drive model information for the image. | |
| int32_t | aaruf_set_drive_serial_number (void *context, const uint8_t *data, const int32_t length) |
| Sets the drive serial number for the image. | |
| int32_t | aaruf_set_drive_firmware_revision (void *context, const uint8_t *data, const int32_t length) |
| Sets the drive firmware revision for the 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_set_aaru_json_metadata (void *context, uint8_t *data, size_t length) |
| Sets the Aaru metadata JSON for the image during creation. | |
| 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, uint16_t *sectors) |
| Retrieves the number of negative (pre-gap) sectors in the AaruFormat image. | |
| int32_t | aaruf_get_overflow_sectors (const void *context, uint16_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. | |
| 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 | (-6) 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 2099 of file metadata.c.
References 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 | (-6) 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 1944 of file metadata.c.
References 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 2476 of file metadata.c.
References 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 2404 of file metadata.c.
References 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 3178 of file metadata.c.
References 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 2968 of file metadata.c.
References 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 3038 of file metadata.c.
References 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 3108 of file metadata.c.
References 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 | (-6) The geometry block is not present. This occurs when:
|
Definition at line 94 of file metadata.c.
References 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 3634 of file metadata.c.
References 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 2825 of file metadata.c.
References 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 2616 of file metadata.c.
References 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 2686 of file metadata.c.
References 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 2896 of file metadata.c.
References 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 2337 of file metadata.c.
References 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 2756 of file metadata.c.
References 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 2546 of file metadata.c.
References 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, |
| uint16_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 3417 of file metadata.c.
References 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, |
| uint16_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 3552 of file metadata.c.
References 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 3292 of file metadata.c.
References AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_STATUS_OK, DdtHeader2::blocks, FATAL, aaruformat_context::magic, TRACE, and aaruformat_context::user_data_ddt_header.
| int32_t aaruf_set_aaru_json_metadata | ( | void * | context, |
| uint8_t * | data, | ||
| size_t | length ) |
Sets the Aaru metadata JSON for the image during creation.
Embeds Aaru metadata JSON into the image being created. The Aaru metadata JSON format is a structured, machine-readable representation of comprehensive image metadata including media information, imaging session details, hardware configuration, optical disc tracks and sessions, checksums, and preservation metadata. This function stores the JSON payload in its original form without parsing or validation, allowing callers to provide pre-generated JSON conforming to the Aaru metadata schema. The JSON data will be written to the image file during aaruf_close() as an AaruMetadataJsonBlock.
The function accepts raw UTF-8 encoded JSON data as an opaque byte array and creates an internal copy that persists for the lifetime of the context. If Aaru JSON metadata was previously set on this context, the old data is freed and replaced with the new JSON. The JSON is treated as opaque binary data by the library; no parsing, interpretation, or schema validation is performed during the set operation.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| data | Pointer to the Aaru metadata JSON data in UTF-8 encoding (opaque byte array). The JSON should conform to the Aaru metadata schema, though this is not validated. Must not be NULL. |
| length | Length of the JSON data in bytes. The payload may or may not be null-terminated; the length should reflect the actual JSON data size. |
| AARUF_STATUS_OK | (0) Successfully set Aaru metadata JSON. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
| AARUF_READ_ONLY | (-13) The context is not opened for writing. This occurs when:
|
| AARUF_ERROR_NOT_ENOUGH_MEMORY | (-8) Memory allocation failed. This occurs when:
|
Definition at line 2258 of file metadata.c.
References AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_ERROR_NOT_ENOUGH_MEMORY, AARUF_READ_ONLY, AARUF_STATUS_OK, AaruMetadataJsonBlock, FATAL, AaruMetadataJsonBlockHeader::identifier, aaruformat_context::is_writing, aaruformat_context::json_block, aaruformat_context::json_block_header, AaruMetadataJsonBlockHeader::length, aaruformat_context::magic, and TRACE.
| int32_t aaruf_set_comments | ( | void * | context, |
| const uint8_t * | data, | ||
| const int32_t | length ) |
Sets user comments or notes for the image.
Records arbitrary user-provided comments, notes, or annotations associated with the AaruFormat image. This metadata field allows users to document the image's purpose, provenance, condition, or any other relevant information. Comments are stored in UTF-16LE encoding and can contain multi-line text, special characters, and detailed descriptions.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| data | Pointer to the comments string data in UTF-16LE encoding (opaque byte array). |
| length | Length of the comments data in bytes (must include full UTF-16LE character sequences). |
| AARUF_STATUS_OK | (0) Successfully set comments. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
| AARUF_READ_ONLY | (-13) The context is not opened for writing. This occurs when:
|
| AARUF_ERROR_NOT_ENOUGH_MEMORY | (-8) Memory allocation failed. This occurs when:
|
Definition at line 607 of file metadata.c.
References AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_ERROR_NOT_ENOUGH_MEMORY, AARUF_READ_ONLY, AARUF_STATUS_OK, aaruformat_context::comments, MetadataBlockHeader::commentsLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, aaruformat_context::magic, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_set_creator | ( | void * | context, |
| const uint8_t * | data, | ||
| const int32_t | length ) |
Sets the creator (person/operator) information for the image.
Records the name of the person or operator who created the AaruFormat image. This metadata identifies the individual responsible for the imaging process, which is valuable for provenance tracking, accountability, and understanding the human context in which the image was created. The creator name is stored in UTF-16LE encoding and preserved exactly as provided by the caller.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| data | Pointer to the creator name string data in UTF-16LE encoding (opaque byte array). |
| length | Length of the creator data in bytes (must include full UTF-16LE character sequences). |
| AARUF_STATUS_OK | (0) Successfully set creator information. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
| AARUF_READ_ONLY | (-13) The context is not opened for writing. This occurs when:
|
| AARUF_ERROR_NOT_ENOUGH_MEMORY | (-8) Memory allocation failed. This occurs when:
|
Definition at line 493 of file metadata.c.
References AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_ERROR_NOT_ENOUGH_MEMORY, AARUF_READ_ONLY, AARUF_STATUS_OK, aaruformat_context::creator, MetadataBlockHeader::creatorLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, aaruformat_context::magic, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_set_drive_firmware_revision | ( | void * | context, |
| const uint8_t * | data, | ||
| const int32_t | length ) |
Sets the drive firmware revision for the image.
Records the firmware version or revision of the drive or device used to read or write the physical storage media. Firmware revisions can significantly affect drive behavior, error handling, performance, and compatibility. This metadata is crucial for understanding the imaging environment, troubleshooting issues, and ensuring reproducibility. Different firmware versions of the same drive model can behave quite differently, making this information essential for comprehensive documentation. The firmware revision is stored in UTF-16LE encoding.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| data | Pointer to the drive firmware revision string data in UTF-16LE encoding (opaque byte array). |
| length | Length of the drive firmware revision data in bytes (must include full UTF-16LE character sequences). |
| AARUF_STATUS_OK | (0) Successfully set drive firmware revision. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
| AARUF_READ_ONLY | (-13) The context is not opened for writing. This occurs when:
|
| AARUF_ERROR_NOT_ENOUGH_MEMORY | (-8) Memory allocation failed. This occurs when:
|
Definition at line 1793 of file metadata.c.
References AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_ERROR_NOT_ENOUGH_MEMORY, AARUF_READ_ONLY, AARUF_STATUS_OK, aaruformat_context::drive_firmware_revision, MetadataBlockHeader::driveFirmwareRevisionLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, aaruformat_context::magic, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_set_drive_manufacturer | ( | void * | context, |
| const uint8_t * | data, | ||
| const int32_t | length ) |
Sets the drive manufacturer information for the image.
Records the name of the company that manufactured the drive or device used to read or write the physical storage media. This metadata provides valuable context about the imaging process, as different drives may have different capabilities, error handling characteristics, and compatibility with specific media types. The manufacturer name is stored in UTF-16LE encoding.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| data | Pointer to the drive manufacturer string data in UTF-16LE encoding (opaque byte array). |
| length | Length of the drive manufacturer data in bytes (must include full UTF-16LE character sequences). |
| AARUF_STATUS_OK | (0) Successfully set drive manufacturer. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
| AARUF_READ_ONLY | (-13) The context is not opened for writing. This occurs when:
|
| AARUF_ERROR_NOT_ENOUGH_MEMORY | (-8) Memory allocation failed. This occurs when:
|
Definition at line 1412 of file metadata.c.
References AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_ERROR_NOT_ENOUGH_MEMORY, AARUF_READ_ONLY, AARUF_STATUS_OK, aaruformat_context::drive_manufacturer, MetadataBlockHeader::driveManufacturerLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, aaruformat_context::magic, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_set_drive_model | ( | void * | context, |
| const uint8_t * | data, | ||
| const int32_t | length ) |
Sets the drive model information for the image.
Records the specific model or product designation of the drive or device used to read or write the physical storage media. This metadata provides detailed information about the imaging equipment, which can be important for understanding the capabilities, limitations, and characteristics of the imaging process. Different drive models within the same manufacturer's product line may have significantly different features and performance characteristics. The model information is stored in UTF-16LE encoding.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| data | Pointer to the drive model string data in UTF-16LE encoding (opaque byte array). |
| length | Length of the drive model data in bytes (must include full UTF-16LE character sequences). |
| AARUF_STATUS_OK | (0) Successfully set drive model. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
| AARUF_READ_ONLY | (-13) The context is not opened for writing. This occurs when:
|
| AARUF_ERROR_NOT_ENOUGH_MEMORY | (-8) Memory allocation failed. This occurs when:
|
Definition at line 1534 of file metadata.c.
References AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_ERROR_NOT_ENOUGH_MEMORY, AARUF_READ_ONLY, AARUF_STATUS_OK, aaruformat_context::drive_model, MetadataBlockHeader::driveModelLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, aaruformat_context::magic, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_set_drive_serial_number | ( | void * | context, |
| const uint8_t * | data, | ||
| const int32_t | length ) |
Sets the drive serial number for the image.
Records the unique serial number of the drive or device used to read or write the physical storage media. This metadata provides a unique identifier for the specific piece of hardware used in the imaging process, which is particularly important for forensic work, equipment tracking, and quality assurance. The serial number enables correlation between multiple images created with the same drive and can help identify drive-specific issues or characteristics. The serial number is stored in UTF-16LE encoding.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| data | Pointer to the drive serial number string data in UTF-16LE encoding (opaque byte array). |
| length | Length of the drive serial number data in bytes (must include full UTF-16LE character sequences). |
| AARUF_STATUS_OK | (0) Successfully set drive serial number. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
| AARUF_READ_ONLY | (-13) The context is not opened for writing. This occurs when:
|
| AARUF_ERROR_NOT_ENOUGH_MEMORY | (-8) Memory allocation failed. This occurs when:
|
Definition at line 1658 of file metadata.c.
References AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_ERROR_NOT_ENOUGH_MEMORY, AARUF_READ_ONLY, AARUF_STATUS_OK, aaruformat_context::drive_serial_number, MetadataBlockHeader::driveSerialNumberLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, aaruformat_context::magic, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_set_geometry | ( | void * | context, |
| const uint32_t | cylinders, | ||
| const uint32_t | heads, | ||
| const uint32_t | sectors_per_track ) |
Sets the logical CHS geometry for the AaruFormat image.
Configures the Cylinder-Head-Sector (CHS) geometry information for the image being created or modified. This function populates both the geometry block (used for storage in the image file) and the image information structure (used for runtime calculations). The geometry block contains legacy-style logical addressing parameters that describe how the storage medium should be logically organized in terms of cylinders, heads (tracks per cylinder), and sectors per track. This information is crucial for creating images that will be used with software requiring CHS addressing or for accurately preserving the original medium's logical structure.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| cylinders | The number of cylinders to set for the geometry. |
| heads | The number of heads (tracks per cylinder) to set for the geometry. |
| sectors_per_track | The number of sectors per track to set for the geometry. |
| AARUF_STATUS_OK | (0) Successfully set geometry information. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
| AARUF_READ_ONLY | (-13) The context is not opened for writing. This occurs when:
|
Definition at line 229 of file metadata.c.
References AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_READ_ONLY, AARUF_STATUS_OK, aaruformat_context::cylinders, GeometryBlockHeader::cylinders, FATAL, aaruformat_context::geometry_block, GeometryBlock, aaruformat_context::heads, GeometryBlockHeader::heads, GeometryBlockHeader::identifier, aaruformat_context::is_writing, aaruformat_context::magic, aaruformat_context::sectors_per_track, GeometryBlockHeader::sectorsPerTrack, and TRACE.
| int32_t aaruf_set_media_barcode | ( | void * | context, |
| const uint8_t * | data, | ||
| const int32_t | length ) |
Sets the media barcode information for the image.
Records the barcode affixed to the physical storage media or its packaging. Barcodes are commonly used in professional archival and library environments for automated inventory management, tracking, and retrieval systems. This metadata enables correlation between physical media location systems and digital image files. The barcode is stored in UTF-16LE encoding.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| data | Pointer to the media barcode string data in UTF-16LE encoding (opaque byte array). |
| length | Length of the media barcode data in bytes (must include full UTF-16LE character sequences). |
| AARUF_STATUS_OK | (0) Successfully set media barcode. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
| AARUF_READ_ONLY | (-13) The context is not opened for writing. This occurs when:
|
| AARUF_ERROR_NOT_ENOUGH_MEMORY | (-8) Memory allocation failed. This occurs when:
|
Definition at line 1176 of file metadata.c.
References AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_ERROR_NOT_ENOUGH_MEMORY, AARUF_READ_ONLY, AARUF_STATUS_OK, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, aaruformat_context::magic, aaruformat_context::media_barcode, MetadataBlockHeader::mediaBarcodeLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_set_media_manufacturer | ( | void * | context, |
| const uint8_t * | data, | ||
| const int32_t | length ) |
Sets the media manufacturer information for the image.
Records the name of the company that manufactured the physical storage media. This metadata is valuable for preservation and forensic purposes, as it can help identify the media type, quality characteristics, and manufacturing period. The manufacturer name is stored in UTF-16LE encoding.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| data | Pointer to the media manufacturer string data in UTF-16LE encoding (opaque byte array). |
| length | Length of the media manufacturer data in bytes (must include full UTF-16LE character sequences). |
| AARUF_STATUS_OK | (0) Successfully set media manufacturer. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
| AARUF_READ_ONLY | (-13) The context is not opened for writing. This occurs when:
|
| AARUF_ERROR_NOT_ENOUGH_MEMORY | (-8) Memory allocation failed. This occurs when:
|
Definition at line 832 of file metadata.c.
References AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_ERROR_NOT_ENOUGH_MEMORY, AARUF_READ_ONLY, AARUF_STATUS_OK, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, aaruformat_context::magic, aaruformat_context::media_manufacturer, MetadataBlockHeader::mediaManufacturerLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_set_media_model | ( | void * | context, |
| const uint8_t * | data, | ||
| const int32_t | length ) |
Sets the media model or product designation for the image.
Records the specific model, product line, or type designation of the physical storage media. This is more specific than the manufacturer and identifies the exact product variant. This metadata helps in identifying specific media characteristics, performance specifications, and compatibility information. The model information is stored in UTF-16LE encoding.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| data | Pointer to the media model string data in UTF-16LE encoding (opaque byte array). |
| length | Length of the media model data in bytes (must include full UTF-16LE character sequences). |
| AARUF_STATUS_OK | (0) Successfully set media model. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
| AARUF_READ_ONLY | (-13) The context is not opened for writing. This occurs when:
|
| AARUF_ERROR_NOT_ENOUGH_MEMORY | (-8) Memory allocation failed. This occurs when:
|
Definition at line 939 of file metadata.c.
References AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_ERROR_NOT_ENOUGH_MEMORY, AARUF_READ_ONLY, AARUF_STATUS_OK, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, aaruformat_context::magic, aaruformat_context::media_model, MetadataBlockHeader::mediaModelLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_set_media_part_number | ( | void * | context, |
| const uint8_t * | data, | ||
| const int32_t | length ) |
Sets the media part number or model designation for the image.
Records the manufacturer's part number or catalog designation for the specific type of physical storage media. This is distinct from the media model in that it represents the exact ordering or catalog number used for procurement and inventory purposes. Part numbers are particularly important for sourcing compatible replacement media and for precise identification in technical documentation. The part number is stored in UTF-16LE encoding.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| data | Pointer to the media part number string data in UTF-16LE encoding (opaque byte array). |
| length | Length of the media part number data in bytes (must include full UTF-16LE character sequences). |
| AARUF_STATUS_OK | (0) Successfully set media part number. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
| AARUF_READ_ONLY | (-13) The context is not opened for writing. This occurs when:
|
| AARUF_ERROR_NOT_ENOUGH_MEMORY | (-8) Memory allocation failed. This occurs when:
|
Definition at line 1297 of file metadata.c.
References AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_ERROR_NOT_ENOUGH_MEMORY, AARUF_READ_ONLY, AARUF_STATUS_OK, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, aaruformat_context::magic, aaruformat_context::media_part_number, MetadataBlockHeader::mediaPartNumberLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_set_media_sequence | ( | void * | context, |
| const int32_t | sequence, | ||
| const int32_t | last_sequence ) |
Sets the media sequence information for multi-volume media sets.
Configures the sequence numbering for media that is part of a larger set, such as multi-disk software distributions, backup sets spanning multiple tapes, or optical disc sets. This function records both the current media's position in the sequence and the total number of media in the complete set. This metadata is essential for proper ordering and completeness verification when working with multi-volume archives.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| sequence | The sequence number of this media (1-based index indicating position in the set). |
| last_sequence | The total number of media in the complete set (indicates the final sequence number). |
| AARUF_STATUS_OK | (0) Successfully set media sequence information. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
| AARUF_READ_ONLY | (-13) The context is not opened for writing. This occurs when:
|
Definition at line 363 of file metadata.c.
References AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_READ_ONLY, AARUF_STATUS_OK, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, MetadataBlockHeader::lastMediaSequence, aaruformat_context::magic, MetadataBlockHeader::mediaSequence, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_set_media_serial_number | ( | void * | context, |
| const uint8_t * | data, | ||
| const int32_t | length ) |
Sets the media serial number for the image.
Records the unique serial number assigned to the physical storage media by the manufacturer. This metadata provides a unique identifier for the specific piece of media, which is invaluable for tracking, authentication, and forensic analysis. Not all media types have serial numbers; this is most common with professional-grade media and some consumer optical discs. The serial number is stored in UTF-16LE encoding.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| data | Pointer to the media serial number string data in UTF-16LE encoding (opaque byte array). |
| length | Length of the media serial number data in bytes (must include full UTF-16LE character sequences). |
| AARUF_STATUS_OK | (0) Successfully set media serial number. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
| AARUF_READ_ONLY | (-13) The context is not opened for writing. This occurs when:
|
| AARUF_ERROR_NOT_ENOUGH_MEMORY | (-8) Memory allocation failed. This occurs when:
|
Definition at line 1054 of file metadata.c.
References AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_ERROR_NOT_ENOUGH_MEMORY, AARUF_READ_ONLY, AARUF_STATUS_OK, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, aaruformat_context::magic, aaruformat_context::media_serial_number, MetadataBlockHeader::mediaSerialNumberLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_set_media_title | ( | void * | context, |
| const uint8_t * | data, | ||
| const int32_t | length ) |
Sets the media title or label for the image.
Records the title, label, or name printed or written on the physical storage media. This metadata is particularly useful for identifying discs, tapes, or other media that have user-applied labels or manufacturer-printed titles. The title is stored in UTF-16LE encoding to support international characters and special symbols.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| data | Pointer to the media title string data in UTF-16LE encoding (opaque byte array). |
| length | Length of the media title data in bytes (must include full UTF-16LE character sequences). |
| AARUF_STATUS_OK | (0) Successfully set media title. This is returned when:
|
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. This occurs when:
|
| AARUF_READ_ONLY | (-13) The context is not opened for writing. This occurs when:
|
| AARUF_ERROR_NOT_ENOUGH_MEMORY | (-8) Memory allocation failed. This occurs when:
|
Definition at line 720 of file metadata.c.
References AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_ERROR_NOT_ENOUGH_MEMORY, AARUF_READ_ONLY, AARUF_STATUS_OK, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, aaruformat_context::magic, aaruformat_context::media_title, MetadataBlockHeader::mediaTitleLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.