123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- #ifndef __EXIF_LOG_H__
- #define __EXIF_LOG_H__
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include <libexif/exif-mem.h>
- #include <stdarg.h>
- typedef struct _ExifLog ExifLog;
- ExifLog *exif_log_new (void);
- ExifLog *exif_log_new_mem (ExifMem *);
- void exif_log_ref (ExifLog *log);
- void exif_log_unref (ExifLog *log);
- void exif_log_free (ExifLog *log);
- typedef enum {
- EXIF_LOG_CODE_NONE,
- EXIF_LOG_CODE_DEBUG,
- EXIF_LOG_CODE_NO_MEMORY,
- EXIF_LOG_CODE_CORRUPT_DATA
- } ExifLogCode;
- const char *exif_log_code_get_title (ExifLogCode code);
- const char *exif_log_code_get_message (ExifLogCode code);
- typedef void (* ExifLogFunc) (ExifLog *log, ExifLogCode, const char *domain,
- const char *format, va_list args, void *data);
- void exif_log_set_func (ExifLog *log, ExifLogFunc func, void *data);
- #ifndef NO_VERBOSE_TAG_STRINGS
- void exif_log (ExifLog *log, ExifLogCode, const char *domain,
- const char *format, ...)
- #ifdef __GNUC__
- __attribute__((__format__(printf,4,5)))
- #endif
- ;
- #else
- #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
- #define exif_log(...) do { } while (0)
- #elif defined(__GNUC__)
- #define exif_log(x...) do { } while (0)
- #else
- #define exif_log (void)
- #endif
- #endif
- void exif_logv (ExifLog *log, ExifLogCode, const char *domain,
- const char *format, va_list args);
- #define EXIF_LOG_NO_MEMORY(l,d,s) exif_log ((l), EXIF_LOG_CODE_NO_MEMORY, (d), "Could not allocate %lu byte(s).", (unsigned long)(s))
- #ifdef __cplusplus
- }
- #endif
- #endif
|