exif-log.h

Go to the documentation of this file.
00001 
00022 #ifndef __EXIF_LOG_H__
00023 #define __EXIF_LOG_H__
00024 
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif /* __cplusplus */
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); /* Title for dialog   */
00047 const char *exif_log_code_get_message (ExifLogCode); /* Message for dialog */
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 #ifndef NO_VERBOSE_TAG_STRINGS
00059 void     exif_log  (ExifLog *log, ExifLogCode, const char *domain,
00060                     const char *format, ...)
00061 #ifdef __GNUC__
00062                         __attribute__((__format__(printf,4,5)))
00063 #endif
00064 ;
00065 #else
00066 #if defined(__STDC_VERSION__) &&  __STDC_VERSION__ >= 199901L
00067 #define exif_log(...) do { } while (0)
00068 #elif defined(__GNUC__)
00069 #define exif_log(x...) do { } while (0)
00070 #else
00071 #define exif_log (void)
00072 #endif
00073 #endif
00074 
00075 void     exif_logv (ExifLog *log, ExifLogCode, const char *domain,
00076                     const char *format, va_list args);
00077 
00078 /* For your convenience */
00079 #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))
00080 
00081 #ifdef __cplusplus
00082 }
00083 #endif /* __cplusplus */
00084 
00085 #endif /* __EXIF_LOG_H__ */

Generated on Thu Dec 17 11:55:34 2009 for EXIF library (libexif) API by  doxygen 1.5.6