|
libaaruformat 1.0
Aaru Data Preservation Suite - Format Library
|
Write-path metadata mutators for libaaruformat. More...
Go to the source code of this file.
Functions | |
| 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_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_clear_media_sequence (void *context) |
| Clears the media sequence information from the image metadata. | |
| int32_t | aaruf_clear_creator (void *context) |
| Clears the creator (person/operator) information from the image metadata. | |
| int32_t | aaruf_clear_comments (void *context) |
| Clears user comments or notes from the image metadata. | |
| int32_t | aaruf_clear_media_title (void *context) |
| Clears the media title or label from the image metadata. | |
| int32_t | aaruf_clear_media_manufacturer (void *context) |
| Clears the media manufacturer information from the image metadata. | |
| int32_t | aaruf_clear_media_model (void *context) |
| Clears the media model or product designation from the image metadata. | |
| int32_t | aaruf_clear_media_serial_number (void *context) |
| Clears the media serial number from the image metadata. | |
| int32_t | aaruf_clear_media_barcode (void *context) |
| Clears the media barcode information from the image metadata. | |
| int32_t | aaruf_clear_media_part_number (void *context) |
| Clears the media part number or model designation from the image metadata. | |
| int32_t | aaruf_clear_drive_manufacturer (void *context) |
| Clears the drive manufacturer information from the image metadata. | |
| int32_t | aaruf_clear_drive_model (void *context) |
| Clears the drive model information from the image metadata. | |
| int32_t | aaruf_clear_drive_serial_number (void *context) |
| Clears the drive serial number from the image metadata. | |
| int32_t | aaruf_clear_drive_firmware_revision (void *context) |
| Clears the drive firmware revision from the image metadata. | |
Write-path metadata mutators for libaaruformat.
Contains all aaruf_set_* and aaruf_clear_* functions that modify metadata in an AaruFormat image context opened for writing. Read-only accessors (aaruf_get_*) are in metadata.c.
Definition in file metadata_write.c.
| int32_t aaruf_clear_comments | ( | void * | context | ) |
Clears user comments or notes from the image metadata.
Removes the comments string from the AaruFormat image's metadata block, freeing the associated memory and resetting the length field to zero. This effectively removes any user-provided annotations, notes, or descriptions associated with the image. If this operation results in all metadata fields being empty, the entire metadata block is deinitialized to avoid writing an empty metadata block to the image file.
This function is useful when removing outdated notes, clearing test comments before production deployment, sanitizing images for distribution, or resetting an image to a clean metadata state for repurposing.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| AARUF_STATUS_OK | (0) Successfully cleared 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:
|
Definition at line 2238 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_READ_ONLY, AARUF_STATUS_OK, aaruformat_context::comments, MetadataBlockHeader::commentsLength, MetadataBlockHeader::creatorLength, MetadataBlockHeader::driveFirmwareRevisionLength, MetadataBlockHeader::driveManufacturerLength, MetadataBlockHeader::driveModelLength, MetadataBlockHeader::driveSerialNumberLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, MetadataBlockHeader::lastMediaSequence, aaruformat_context::magic, MetadataBlockHeader::mediaBarcodeLength, MetadataBlockHeader::mediaManufacturerLength, MetadataBlockHeader::mediaModelLength, MetadataBlockHeader::mediaPartNumberLength, MetadataBlockHeader::mediaSequence, MetadataBlockHeader::mediaSerialNumberLength, MetadataBlockHeader::mediaTitleLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_clear_creator | ( | void * | context | ) |
Clears the creator (person/operator) information from the image metadata.
Removes the creator name string from the AaruFormat image's metadata block, freeing the associated memory and resetting the length field to zero. This effectively removes any record of who created the image. If this operation results in all metadata fields being empty, the entire metadata block is deinitialized to avoid writing an empty metadata block to the image file.
This function is useful when anonymizing images for distribution, removing personally identifiable information for privacy compliance (e.g., GDPR), or correcting metadata that was set incorrectly during image creation.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| AARUF_STATUS_OK | (0) Successfully cleared 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:
|
Definition at line 2109 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_READ_ONLY, AARUF_STATUS_OK, MetadataBlockHeader::commentsLength, aaruformat_context::creator, MetadataBlockHeader::creatorLength, MetadataBlockHeader::driveFirmwareRevisionLength, MetadataBlockHeader::driveManufacturerLength, MetadataBlockHeader::driveModelLength, MetadataBlockHeader::driveSerialNumberLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, MetadataBlockHeader::lastMediaSequence, aaruformat_context::magic, MetadataBlockHeader::mediaBarcodeLength, MetadataBlockHeader::mediaManufacturerLength, MetadataBlockHeader::mediaModelLength, MetadataBlockHeader::mediaPartNumberLength, MetadataBlockHeader::mediaSequence, MetadataBlockHeader::mediaSerialNumberLength, MetadataBlockHeader::mediaTitleLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_clear_drive_firmware_revision | ( | void * | context | ) |
Clears the drive firmware revision from the image metadata.
Removes the drive firmware revision string from the AaruFormat image's metadata block, freeing the associated memory and resetting the length field to zero. This removes any record of the firmware version or revision of the drive or device used to read or write the physical storage media during the imaging process. If this operation results in all metadata fields being empty, the entire metadata block is deinitialized.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| AARUF_STATUS_OK | (0) Successfully cleared drive firmware revision. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. |
| AARUF_READ_ONLY | (-13) The context is not opened for writing. |
Definition at line 3096 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_READ_ONLY, AARUF_STATUS_OK, MetadataBlockHeader::commentsLength, MetadataBlockHeader::creatorLength, aaruformat_context::drive_firmware_revision, MetadataBlockHeader::driveFirmwareRevisionLength, MetadataBlockHeader::driveManufacturerLength, MetadataBlockHeader::driveModelLength, MetadataBlockHeader::driveSerialNumberLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, MetadataBlockHeader::lastMediaSequence, aaruformat_context::magic, MetadataBlockHeader::mediaBarcodeLength, MetadataBlockHeader::mediaManufacturerLength, MetadataBlockHeader::mediaModelLength, MetadataBlockHeader::mediaPartNumberLength, MetadataBlockHeader::mediaSequence, MetadataBlockHeader::mediaSerialNumberLength, MetadataBlockHeader::mediaTitleLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_clear_drive_manufacturer | ( | void * | context | ) |
Clears the drive manufacturer information from the image metadata.
Removes the drive manufacturer name string from the AaruFormat image's metadata block, freeing the associated memory and resetting the length field to zero. This removes any record of the company that manufactured the drive or device used to read or write the physical storage media during the imaging process. If this operation results in all metadata fields being empty, the entire metadata block is deinitialized.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| AARUF_STATUS_OK | (0) Successfully cleared drive manufacturer. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. |
| AARUF_READ_ONLY | (-13) The context is not opened for writing. |
Definition at line 2833 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_READ_ONLY, AARUF_STATUS_OK, MetadataBlockHeader::commentsLength, MetadataBlockHeader::creatorLength, aaruformat_context::drive_manufacturer, MetadataBlockHeader::driveFirmwareRevisionLength, MetadataBlockHeader::driveManufacturerLength, MetadataBlockHeader::driveModelLength, MetadataBlockHeader::driveSerialNumberLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, MetadataBlockHeader::lastMediaSequence, aaruformat_context::magic, MetadataBlockHeader::mediaBarcodeLength, MetadataBlockHeader::mediaManufacturerLength, MetadataBlockHeader::mediaModelLength, MetadataBlockHeader::mediaPartNumberLength, MetadataBlockHeader::mediaSequence, MetadataBlockHeader::mediaSerialNumberLength, MetadataBlockHeader::mediaTitleLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_clear_drive_model | ( | void * | context | ) |
Clears the drive model information from the image metadata.
Removes the drive model string from the AaruFormat image's metadata block, freeing the associated memory and resetting the length field to zero. This removes any record of the specific model or product designation of the drive or device used to read or write the physical storage media during the imaging process. If this operation results in all metadata fields being empty, the entire metadata block is deinitialized.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| AARUF_STATUS_OK | (0) Successfully cleared drive model. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. |
| AARUF_READ_ONLY | (-13) The context is not opened for writing. |
Definition at line 2919 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_READ_ONLY, AARUF_STATUS_OK, MetadataBlockHeader::commentsLength, MetadataBlockHeader::creatorLength, aaruformat_context::drive_model, MetadataBlockHeader::driveFirmwareRevisionLength, MetadataBlockHeader::driveManufacturerLength, MetadataBlockHeader::driveModelLength, MetadataBlockHeader::driveSerialNumberLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, MetadataBlockHeader::lastMediaSequence, aaruformat_context::magic, MetadataBlockHeader::mediaBarcodeLength, MetadataBlockHeader::mediaManufacturerLength, MetadataBlockHeader::mediaModelLength, MetadataBlockHeader::mediaPartNumberLength, MetadataBlockHeader::mediaSequence, MetadataBlockHeader::mediaSerialNumberLength, MetadataBlockHeader::mediaTitleLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_clear_drive_serial_number | ( | void * | context | ) |
Clears the drive serial number from the image metadata.
Removes the drive serial number string from the AaruFormat image's metadata block, freeing the associated memory and resetting the length field to zero. This removes the unique identifier of the specific drive or device used to read or write the physical storage media during the imaging process. If this operation results in all metadata fields being empty, the entire metadata block is deinitialized.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| AARUF_STATUS_OK | (0) Successfully cleared drive serial number. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. |
| AARUF_READ_ONLY | (-13) The context is not opened for writing. |
Definition at line 3008 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_READ_ONLY, AARUF_STATUS_OK, MetadataBlockHeader::commentsLength, MetadataBlockHeader::creatorLength, aaruformat_context::drive_serial_number, MetadataBlockHeader::driveFirmwareRevisionLength, MetadataBlockHeader::driveManufacturerLength, MetadataBlockHeader::driveModelLength, MetadataBlockHeader::driveSerialNumberLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, MetadataBlockHeader::lastMediaSequence, aaruformat_context::magic, MetadataBlockHeader::mediaBarcodeLength, MetadataBlockHeader::mediaManufacturerLength, MetadataBlockHeader::mediaModelLength, MetadataBlockHeader::mediaPartNumberLength, MetadataBlockHeader::mediaSequence, MetadataBlockHeader::mediaSerialNumberLength, MetadataBlockHeader::mediaTitleLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_clear_media_barcode | ( | void * | context | ) |
Clears the media barcode information from the image metadata.
Removes the media barcode string from the AaruFormat image's metadata block, freeing the associated memory and resetting the length field to zero. This removes any record of the barcode affixed to the physical storage media or its packaging, typically used in professional archival and library inventory systems. If this operation results in all metadata fields being empty, the entire metadata block is deinitialized.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| AARUF_STATUS_OK | (0) Successfully cleared media barcode. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. |
| AARUF_READ_ONLY | (-13) The context is not opened for writing. |
Definition at line 2661 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_READ_ONLY, AARUF_STATUS_OK, MetadataBlockHeader::commentsLength, MetadataBlockHeader::creatorLength, MetadataBlockHeader::driveFirmwareRevisionLength, MetadataBlockHeader::driveManufacturerLength, MetadataBlockHeader::driveModelLength, MetadataBlockHeader::driveSerialNumberLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, MetadataBlockHeader::lastMediaSequence, aaruformat_context::magic, aaruformat_context::media_barcode, MetadataBlockHeader::mediaBarcodeLength, MetadataBlockHeader::mediaManufacturerLength, MetadataBlockHeader::mediaModelLength, MetadataBlockHeader::mediaPartNumberLength, MetadataBlockHeader::mediaSequence, MetadataBlockHeader::mediaSerialNumberLength, MetadataBlockHeader::mediaTitleLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_clear_media_manufacturer | ( | void * | context | ) |
Clears the media manufacturer information from the image metadata.
Removes the media manufacturer name string from the AaruFormat image's metadata block, freeing the associated memory and resetting the length field to zero. This removes any record of the company that manufactured the physical storage media. If this operation results in all metadata fields being empty, the entire metadata block is deinitialized.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| AARUF_STATUS_OK | (0) Successfully cleared media manufacturer. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. |
| AARUF_READ_ONLY | (-13) The context is not opened for writing. |
Definition at line 2405 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_READ_ONLY, AARUF_STATUS_OK, MetadataBlockHeader::commentsLength, MetadataBlockHeader::creatorLength, MetadataBlockHeader::driveFirmwareRevisionLength, MetadataBlockHeader::driveManufacturerLength, MetadataBlockHeader::driveModelLength, MetadataBlockHeader::driveSerialNumberLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, MetadataBlockHeader::lastMediaSequence, aaruformat_context::magic, aaruformat_context::media_manufacturer, MetadataBlockHeader::mediaBarcodeLength, MetadataBlockHeader::mediaManufacturerLength, MetadataBlockHeader::mediaModelLength, MetadataBlockHeader::mediaPartNumberLength, MetadataBlockHeader::mediaSequence, MetadataBlockHeader::mediaSerialNumberLength, MetadataBlockHeader::mediaTitleLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_clear_media_model | ( | void * | context | ) |
Clears the media model or product designation from the image metadata.
Removes the media model string from the AaruFormat image's metadata block, freeing the associated memory and resetting the length field to zero. This removes any record of the specific model, product line, or type designation of the physical storage media. If this operation results in all metadata fields being empty, the entire metadata block is deinitialized.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| AARUF_STATUS_OK | (0) Successfully cleared media model. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. |
| AARUF_READ_ONLY | (-13) The context is not opened for writing. |
Definition at line 2489 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_READ_ONLY, AARUF_STATUS_OK, MetadataBlockHeader::commentsLength, MetadataBlockHeader::creatorLength, MetadataBlockHeader::driveFirmwareRevisionLength, MetadataBlockHeader::driveManufacturerLength, MetadataBlockHeader::driveModelLength, MetadataBlockHeader::driveSerialNumberLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, MetadataBlockHeader::lastMediaSequence, aaruformat_context::magic, aaruformat_context::media_model, MetadataBlockHeader::mediaBarcodeLength, MetadataBlockHeader::mediaManufacturerLength, MetadataBlockHeader::mediaModelLength, MetadataBlockHeader::mediaPartNumberLength, MetadataBlockHeader::mediaSequence, MetadataBlockHeader::mediaSerialNumberLength, MetadataBlockHeader::mediaTitleLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_clear_media_part_number | ( | void * | context | ) |
Clears the media part number or model designation from the image metadata.
Removes the media part number string from the AaruFormat image's metadata block, freeing the associated memory and resetting the length field to zero. This removes the manufacturer's part number or catalog designation used for procurement and exact product identification. If this operation results in all metadata fields being empty, the entire metadata block is deinitialized.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| AARUF_STATUS_OK | (0) Successfully cleared media part number. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. |
| AARUF_READ_ONLY | (-13) The context is not opened for writing. |
Definition at line 2747 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_READ_ONLY, AARUF_STATUS_OK, MetadataBlockHeader::commentsLength, MetadataBlockHeader::creatorLength, MetadataBlockHeader::driveFirmwareRevisionLength, MetadataBlockHeader::driveManufacturerLength, MetadataBlockHeader::driveModelLength, MetadataBlockHeader::driveSerialNumberLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, MetadataBlockHeader::lastMediaSequence, aaruformat_context::magic, aaruformat_context::media_part_number, MetadataBlockHeader::mediaBarcodeLength, MetadataBlockHeader::mediaManufacturerLength, MetadataBlockHeader::mediaModelLength, MetadataBlockHeader::mediaPartNumberLength, MetadataBlockHeader::mediaSequence, MetadataBlockHeader::mediaSerialNumberLength, MetadataBlockHeader::mediaTitleLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_clear_media_sequence | ( | void * | context | ) |
Clears the media sequence information from the image metadata.
Removes the media sequence and last media sequence fields from the AaruFormat image's metadata block, effectively removing any indication that this media is part of a multi-volume set. Both the current sequence number and the total sequence count are reset to zero. If this operation results in all metadata fields being empty, the entire metadata block is deinitialized (identifier set to 0) to avoid writing an empty metadata block to the image file.
This function is useful when repurposing an image that was originally part of a multi-disc set but is now being treated as standalone media, or when correcting metadata that was set incorrectly.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| AARUF_STATUS_OK | (0) Successfully cleared 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 1978 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_READ_ONLY, AARUF_STATUS_OK, MetadataBlockHeader::commentsLength, MetadataBlockHeader::creatorLength, MetadataBlockHeader::driveFirmwareRevisionLength, MetadataBlockHeader::driveManufacturerLength, MetadataBlockHeader::driveModelLength, MetadataBlockHeader::driveSerialNumberLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, MetadataBlockHeader::lastMediaSequence, aaruformat_context::magic, MetadataBlockHeader::mediaBarcodeLength, MetadataBlockHeader::mediaManufacturerLength, MetadataBlockHeader::mediaModelLength, MetadataBlockHeader::mediaPartNumberLength, MetadataBlockHeader::mediaSequence, MetadataBlockHeader::mediaSerialNumberLength, MetadataBlockHeader::mediaTitleLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_clear_media_serial_number | ( | void * | context | ) |
Clears the media serial number from the image metadata.
Removes the media serial number string from the AaruFormat image's metadata block, freeing the associated memory and resetting the length field to zero. This removes the unique identifier assigned to the specific piece of physical storage media by the manufacturer. If this operation results in all metadata fields being empty, the entire metadata block is deinitialized.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| AARUF_STATUS_OK | (0) Successfully cleared media serial number. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. |
| AARUF_READ_ONLY | (-13) The context is not opened for writing. |
Definition at line 2575 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_READ_ONLY, AARUF_STATUS_OK, MetadataBlockHeader::commentsLength, MetadataBlockHeader::creatorLength, MetadataBlockHeader::driveFirmwareRevisionLength, MetadataBlockHeader::driveManufacturerLength, MetadataBlockHeader::driveModelLength, MetadataBlockHeader::driveSerialNumberLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, MetadataBlockHeader::lastMediaSequence, aaruformat_context::magic, aaruformat_context::media_serial_number, MetadataBlockHeader::mediaBarcodeLength, MetadataBlockHeader::mediaManufacturerLength, MetadataBlockHeader::mediaModelLength, MetadataBlockHeader::mediaPartNumberLength, MetadataBlockHeader::mediaSequence, MetadataBlockHeader::mediaSerialNumberLength, MetadataBlockHeader::mediaTitleLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| int32_t aaruf_clear_media_title | ( | void * | context | ) |
Clears the media title or label from the image metadata.
Removes the media title string from the AaruFormat image's metadata block, freeing the associated memory and resetting the length field to zero. This effectively removes any record of the title, label, or name that was printed or written on the physical storage media. If this operation results in all metadata fields being empty, the entire metadata block is deinitialized.
| context | Pointer to the aaruformat context (must be a valid, write-enabled image context). |
| AARUF_STATUS_OK | (0) Successfully cleared media title. |
| AARUF_ERROR_NOT_AARUFORMAT | (-1) The context is invalid. |
| AARUF_READ_ONLY | (-13) The context is not opened for writing. |
Definition at line 2321 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_READ_ONLY, AARUF_STATUS_OK, MetadataBlockHeader::commentsLength, MetadataBlockHeader::creatorLength, MetadataBlockHeader::driveFirmwareRevisionLength, MetadataBlockHeader::driveManufacturerLength, MetadataBlockHeader::driveModelLength, MetadataBlockHeader::driveSerialNumberLength, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, MetadataBlockHeader::lastMediaSequence, aaruformat_context::magic, aaruformat_context::media_title, MetadataBlockHeader::mediaBarcodeLength, MetadataBlockHeader::mediaManufacturerLength, MetadataBlockHeader::mediaModelLength, MetadataBlockHeader::mediaPartNumberLength, MetadataBlockHeader::mediaSequence, MetadataBlockHeader::mediaSerialNumberLength, MetadataBlockHeader::mediaTitleLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.
| 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 | (-9) Memory allocation failed. This occurs when:
|
Definition at line 1858 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_ERROR_NOT_ENOUGH_MEMORY, AARUF_READ_ONLY, AARUF_STATUS_OK, AaruMetadataJsonBlock, aaruformat_context::dirty_json_block, 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 | (-9) Memory allocation failed. This occurs when:
|
Definition at line 508 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, 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 | (-9) Memory allocation failed. This occurs when:
|
Definition at line 394 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, 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 | (-9) Memory allocation failed. This occurs when:
|
Definition at line 1695 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, 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 | (-9) Memory allocation failed. This occurs when:
|
Definition at line 1314 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, 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 | (-9) Memory allocation failed. This occurs when:
|
Definition at line 1436 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, 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 | (-9) Memory allocation failed. This occurs when:
|
Definition at line 1560 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, 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 128 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_READ_ONLY, AARUF_STATUS_OK, aaruformat_context::cylinders, GeometryBlockHeader::cylinders, aaruformat_context::dirty_geometry_block, 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 | (-9) Memory allocation failed. This occurs when:
|
Definition at line 1078 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, 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 | (-9) Memory allocation failed. This occurs when:
|
Definition at line 734 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, 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 | (-9) Memory allocation failed. This occurs when:
|
Definition at line 841 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, 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 | (-9) Memory allocation failed. This occurs when:
|
Definition at line 1199 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, 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 263 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, 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 | (-9) Memory allocation failed. This occurs when:
|
Definition at line 956 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, 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 | (-9) Memory allocation failed. This occurs when:
|
Definition at line 621 of file metadata_write.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, AARUF_ERROR_NOT_AARUFORMAT, AARUF_ERROR_NOT_ENOUGH_MEMORY, AARUF_READ_ONLY, AARUF_STATUS_OK, aaruformat_context::dirty_metadata_block, FATAL, MetadataBlockHeader::identifier, aaruformat_context::is_writing, aaruformat_context::magic, aaruformat_context::media_title, MetadataBlockHeader::mediaTitleLength, aaruformat_context::metadata_block_header, MetadataBlock, and TRACE.