exif-log.h
Go to the documentation of this file.00001 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 #ifndef __EXIF_LOG_H__
00024 #define __EXIF_LOG_H__
00025 
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif 
00029 
00030 #include <libexif/exif-mem.h>
00031 #include <stdarg.h>
00032 
00034 typedef struct _ExifLog        ExifLog;
00035 
00041 ExifLog *exif_log_new     (void);
00042 ExifLog *exif_log_new_mem (ExifMem *);
00043 void     exif_log_ref     (ExifLog *log);
00044 void     exif_log_unref   (ExifLog *log);
00045 
00052 void     exif_log_free    (ExifLog *log);
00053 
00054 typedef enum {
00055         EXIF_LOG_CODE_NONE,
00056         EXIF_LOG_CODE_DEBUG,
00057         EXIF_LOG_CODE_NO_MEMORY,
00058         EXIF_LOG_CODE_CORRUPT_DATA
00059 } ExifLogCode;
00060 
00066 const char *exif_log_code_get_title   (ExifLogCode code);
00067 
00073 const char *exif_log_code_get_message (ExifLogCode code);
00074 
00077 typedef void (* ExifLogFunc) (ExifLog *log, ExifLogCode, const char *domain,
00078                               const char *format, va_list args, void *data);
00079 
00087 void     exif_log_set_func (ExifLog *log, ExifLogFunc func, void *data);
00088 
00089 #ifndef NO_VERBOSE_TAG_STRINGS
00090 void     exif_log  (ExifLog *log, ExifLogCode, const char *domain,
00091                     const char *format, ...)
00092 #ifdef __GNUC__
00093                         __attribute__((__format__(printf,4,5)))
00094 #endif
00095 ;
00096 #else
00097 #if defined(__STDC_VERSION__) &&  __STDC_VERSION__ >= 199901L
00098 #define exif_log(...) do { } while (0)
00099 #elif defined(__GNUC__)
00100 #define exif_log(x...) do { } while (0)
00101 #else
00102 #define exif_log (void)
00103 #endif
00104 #endif
00105 
00106 void     exif_logv (ExifLog *log, ExifLogCode, const char *domain,
00107                     const char *format, va_list args);
00108 
00109 
00110 #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))
00111 
00112 #ifdef __cplusplus
00113 }
00114 #endif 
00115 
00116 #endif