|
libaaruformat 1.0
Aaru Data Preservation Suite - Format Library
|
Go to the source code of this file.
Functions | |
| int | aaruf_identify (const char *filename) |
| Identifies a file as an AaruFormat image using a file path. | |
| int | aaruf_identify_stream (FILE *image_stream) |
| Identifies a file as an AaruFormat image using an open stream. | |
| int aaruf_identify | ( | const char * | filename | ) |
Identifies a file as an AaruFormat image using a file path.
Opens the file at the given path and determines if it is an AaruFormat image by examining the file header for valid AaruFormat signatures and version information. This function provides a simple file-based interface that handles file opening, identification, and cleanup automatically. It delegates the actual identification logic to aaruf_identify_stream().
| filename | Path to the file to identify (must be accessible and readable). |
| 100 | Maximum confidence - Definitive AaruFormat image. This is returned when:
|
| 0 | Not recognized - File is not an AaruFormat image. This is returned when:
|
| Positive | errno values - File access errors from system calls. Common values include:
|
Definition at line 86 of file identify.c.
References AARU_CALL, AARU_EXPORT, aaruf_identify(), and aaruf_identify_stream().
Referenced by aaruf_identify().
| int aaruf_identify_stream | ( | FILE * | image_stream | ) |
Identifies a file as an AaruFormat image using an open stream.
Determines if the provided stream is an AaruFormat image by reading and validating the file header at the beginning of the stream. This function performs the core identification logic by checking for valid AaruFormat signatures and version compatibility. It's designed to work with any FILE stream, making it suitable for integration with existing file handling code.
| image_stream | Open FILE stream positioned at any location (will be repositioned to start). |
| 100 | Maximum confidence - Definitive AaruFormat image. This is returned when:
|
| 0 | Not recognized - Stream is not an AaruFormat image. This is returned when:
|
Definition at line 165 of file identify.c.
References AARU_CALL, AARU_EXPORT, AARU_MAGIC, aaruf_fseek(), aaruf_identify_stream(), AARUF_VERSION, DIC_MAGIC, AaruHeader::identifier, and AaruHeader::imageMajorVersion.
Referenced by aaruf_identify(), and aaruf_identify_stream().