EXIF library (libexif) API 0.6.20
|
00001 00004 /* 00005 * Copyright (c) 2004 Lutz Mueller <lutz@users.sourceforge.net> 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this library; if not, write to the 00019 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00020 * Boston, MA 02110-1301 USA. 00021 */ 00022 00023 #ifndef __EXIF_LOG_H__ 00024 #define __EXIF_LOG_H__ 00025 00026 #ifdef __cplusplus 00027 extern "C" { 00028 #endif /* __cplusplus */ 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 /* For your convenience */ 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 /* __cplusplus */ 00115 00116 #endif /* __EXIF_LOG_H__ */