00001
00022 #ifndef __EXIF_LOG_H__
00023 #define __EXIF_LOG_H__
00024
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028
00029 #include <libexif/exif-mem.h>
00030 #include <stdarg.h>
00031
00032 typedef struct _ExifLog ExifLog;
00033
00034 ExifLog *exif_log_new (void);
00035 ExifLog *exif_log_new_mem (ExifMem *);
00036 void exif_log_ref (ExifLog *log);
00037 void exif_log_unref (ExifLog *log);
00038 void exif_log_free (ExifLog *log);
00039
00040 typedef enum {
00041 EXIF_LOG_CODE_NONE,
00042 EXIF_LOG_CODE_DEBUG,
00043 EXIF_LOG_CODE_NO_MEMORY,
00044 EXIF_LOG_CODE_CORRUPT_DATA
00045 } ExifLogCode;
00046 const char *exif_log_code_get_title (ExifLogCode);
00047 const char *exif_log_code_get_message (ExifLogCode);
00048
00051 typedef void (* ExifLogFunc) (ExifLog *log, ExifLogCode, const char *domain,
00052 const char *format, va_list args, void *data);
00053
00056 void exif_log_set_func (ExifLog *log, ExifLogFunc func, void *data);
00057
00058 void exif_log (ExifLog *log, ExifLogCode, const char *domain,
00059 const char *format, ...)
00060 #ifdef __GNUC__
00061 __attribute__((__format__(printf,4,5)))
00062 #endif
00063 ;
00064
00065 void exif_logv (ExifLog *log, ExifLogCode, const char *domain,
00066 const char *format, va_list args);
00067
00068
00069 #define EXIF_LOG_NO_MEMORY(l,d,s) exif_log (l, EXIF_LOG_CODE_NO_MEMORY, d, "Could not allocate %i byte(s).", s)
00070
00071 #ifdef __cplusplus
00072 }
00073 #endif
00074
00075 #endif