EXIF library (libexif) Internals
0.6.24
|
Defines the ExifLoader type. More...
Go to the source code of this file.
Typedefs | |
typedef struct _ExifLoader | ExifLoader |
Data used by the loader interface. More... | |
Functions | |
ExifLoader * | exif_loader_new (void) |
Allocate a new ExifLoader. More... | |
ExifLoader * | exif_loader_new_mem (ExifMem *mem) |
Allocate a new ExifLoader using the specified memory allocator. More... | |
void | exif_loader_ref (ExifLoader *loader) |
Increase the refcount of the ExifLoader. More... | |
void | exif_loader_unref (ExifLoader *loader) |
Decrease the refcount of the ExifLoader. More... | |
void | exif_loader_write_file (ExifLoader *loader, const char *fname) |
Load a file into the given ExifLoader from the filesystem. More... | |
unsigned char | exif_loader_write (ExifLoader *loader, unsigned char *buf, unsigned int sz) |
Load a buffer into the ExifLoader from a memory buffer. More... | |
void | exif_loader_reset (ExifLoader *loader) |
Free any data previously loaded and reset the ExifLoader to its newly-initialized state. More... | |
ExifData * | exif_loader_get_data (ExifLoader *loader) |
Create an ExifData from the data in the loader. More... | |
void | exif_loader_get_buf (ExifLoader *loader, const unsigned char **buf, unsigned int *buf_size) |
Return the raw data read by the loader. More... | |
void | exif_loader_log (ExifLoader *loader, ExifLog *log) |
Set the log message object used by this ExifLoader. More... | |
Defines the ExifLoader type.
Definition in file exif-loader.h.
typedef struct _ExifLoader ExifLoader |
Data used by the loader interface.
Definition at line 1 of file exif-loader.h.
void exif_loader_get_buf | ( | ExifLoader * | loader, |
const unsigned char ** | buf, | ||
unsigned int * | buf_size | ||
) |
Return the raw data read by the loader.
The returned pointer is only guaranteed to be valid until the next call to a function modifying this ExifLoader. Either or both of buf and buf_size may be NULL on entry, in which case that value is not returned.
[in] | loader | the loader |
[out] | buf | read-only pointer to the data read by the loader, or NULL in case of error |
[out] | buf_size | size of the data at buf, or 0 in case of error |
Definition at line 442 of file exif-loader.c.
References _ExifLoader::buf, _ExifLoader::bytes_read, _ExifLoader::data_format, EL_DATA_FORMAT_UNKNOWN, exif_log(), EXIF_LOG_CODE_DEBUG, and _ExifLoader::log.
Referenced by loader_null_test().
ExifData* exif_loader_get_data | ( | ExifLoader * | loader | ) |
Create an ExifData from the data in the loader.
The loader must already contain data from a previous call to exif_loader_write_file or exif_loader_write.
[in] | loader | the loader |
Definition at line 426 of file exif-loader.c.
References _ExifLoader::buf, _ExifLoader::bytes_read, _ExifLoader::data_format, EL_DATA_FORMAT_UNKNOWN, exif_data_load_data(), exif_data_log(), exif_data_new_mem(), _ExifLoader::log, and _ExifLoader::mem.
Referenced by exif_data_new_from_file(), loader_null_test(), main(), and test_parse().
void exif_loader_log | ( | ExifLoader * | loader, |
ExifLog * | log | ||
) |
Set the log message object used by this ExifLoader.
[in] | loader | the loader |
[in] | log | ExifLog |
Definition at line 465 of file exif-loader.c.
References exif_log_ref(), exif_log_unref(), and _ExifLoader::log.
Referenced by loader_null_test().
ExifLoader* exif_loader_new | ( | void | ) |
Allocate a new ExifLoader.
Definition at line 352 of file exif-loader.c.
References exif_loader_new_mem(), exif_mem_new_default(), and exif_mem_unref().
Referenced by exif_data_new_from_file(), loader_null_test(), main(), and test_parse().
ExifLoader* exif_loader_new_mem | ( | ExifMem * | mem | ) |
Allocate a new ExifLoader using the specified memory allocator.
[in] | mem | the ExifMem |
Definition at line 363 of file exif-loader.c.
References exif_mem_alloc(), exif_mem_ref(), _ExifLoader::mem, and _ExifLoader::ref_count.
Referenced by exif_loader_new(), and loader_null_test().
void exif_loader_ref | ( | ExifLoader * | loader | ) |
Increase the refcount of the ExifLoader.
[in] | loader | the ExifLoader to increase the refcount of. |
Definition at line 382 of file exif-loader.c.
References _ExifLoader::ref_count.
Referenced by loader_null_test().
void exif_loader_reset | ( | ExifLoader * | loader | ) |
Free any data previously loaded and reset the ExifLoader to its newly-initialized state.
[in] | loader | the loader |
Definition at line 413 of file exif-loader.c.
References _ExifLoader::b_len, _ExifLoader::buf, _ExifLoader::bytes_read, _ExifLoader::data_format, EL_DATA_FORMAT_UNKNOWN, exif_mem_free(), _ExifLoader::mem, _ExifLoader::size, and _ExifLoader::state.
Referenced by exif_loader_free(), exif_loader_write(), and loader_null_test().
void exif_loader_unref | ( | ExifLoader * | loader | ) |
Decrease the refcount of the ExifLoader.
If the refcount reaches 0, the loader is freed.
[in] | loader | ExifLoader for which to decrease the refcount |
Definition at line 404 of file exif-loader.c.
References exif_loader_free(), and _ExifLoader::ref_count.
Referenced by exif_data_new_from_file(), loader_null_test(), main(), and test_parse().
unsigned char exif_loader_write | ( | ExifLoader * | loader, |
unsigned char * | buf, | ||
unsigned int | sz | ||
) |
Load a buffer into the ExifLoader from a memory buffer.
The relevant data is copied in raw form into the ExifLoader.
[in] | loader | loader to write to |
[in] | buf | buffer to read from |
[in] | sz | size of the buffer |
Definition at line 163 of file exif-loader.c.
References _, _ExifLoader::b, _ExifLoader::b_len, _ExifLoader::data_format, EL_DATA_FORMAT_EXIF, EL_DATA_FORMAT_FUJI_RAW, EL_DATA_FORMAT_JPEG, EL_DATA_FORMAT_UNKNOWN, EL_EXIF_FOUND, EL_READ, EL_READ_SIZE_BYTE_00, EL_READ_SIZE_BYTE_08, EL_READ_SIZE_BYTE_16, EL_READ_SIZE_BYTE_24, EL_SKIP_BYTES, exif_loader_copy(), exif_loader_reset(), exif_log(), EXIF_LOG_CODE_CORRUPT_DATA, EXIF_LOG_CODE_DEBUG, ExifHeader, JPEG_MARKER_APP0, JPEG_MARKER_APP1, JPEG_MARKER_APP11, JPEG_MARKER_APP13, JPEG_MARKER_APP14, JPEG_MARKER_APP2, JPEG_MARKER_APP4, JPEG_MARKER_APP5, JPEG_MARKER_COM, JPEG_MARKER_DCT, JPEG_MARKER_DHT, JPEG_MARKER_DQT, JPEG_MARKER_SOI, _ExifLoader::log, MAX, MIN, _ExifLoader::size, and _ExifLoader::state.
Referenced by exif_loader_write_file(), loader_null_test(), main(), and test_parse().
void exif_loader_write_file | ( | ExifLoader * | loader, |
const char * | fname | ||
) |
Load a file into the given ExifLoader from the filesystem.
The relevant data is copied in raw form into the ExifLoader.
[in] | loader | loader to write to |
[in] | fname | path to the file to read |
Definition at line 117 of file exif-loader.c.
References _, exif_loader_write(), exif_log(), EXIF_LOG_CODE_NONE, _ExifLoader::log, and size.
Referenced by exif_data_new_from_file(), and loader_null_test().