EXIF library (libexif) API: libexif/exif-log.h Source File

EXIF library (libexif) API 0.6.22

exif-log.h
Go to the documentation of this file.
1
4/*
5 * Copyright (c) 2004 Lutz Mueller <lutz@users.sourceforge.net>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301 USA.
21 */
22
23#ifndef __EXIF_LOG_H__
24#define __EXIF_LOG_H__
25
26#ifdef __cplusplus
27extern "C" {
28#endif /* __cplusplus */
29
30#include <libexif/exifmem.h>
31#include <stdarg.h>
32
33typedef struct _ExifLog ExifLog;
34
35typedef enum {
36 EXIF_LOG_CODE_NONE,
37 EXIF_LOG_CODE_DEBUG,
38 EXIF_LOG_CODE_NO_MEMORY,
39 EXIF_LOG_CODE_CORRUPT_DATA
40} ExifLogCode;
41
44 typedef void EXIF_CALLBACK (* ExifLogFunc) (ExifLog *log, exif_enum(ExifLogCode), const char *domain,
45 const char *format, va_list args, void *data);
46
47
53 EXIF_API(ExifLog *) exif_log_new (void);
54 EXIF_API(ExifLog *) exif_log_new_mem (ExifMem *);
55EXIF_API(void) exif_log_ref (ExifLog *log);
56 EXIF_API(void) exif_log_unref (ExifLog *log);
57
64 EXIF_API(void) exif_log_free (ExifLog *log);
65
71 EXIF_API(const char *) exif_log_code_get_title (exif_enum(ExifLogCode) code);
72
78 EXIF_API(const char *) exif_log_code_get_message (exif_enum(ExifLogCode) code);
79
87 EXIF_API(void) exif_log_set_func (ExifLog *log, ExifLogFunc func, void *data);
88
89#ifndef NO_VERBOSE_TAG_STRINGS
90 EXIF_API(void) exif_log (ExifLog *log, exif_enum(ExifLogCode), const char *domain,
91 const char *format, ...)
92#ifdef __GNUC__
93 __attribute__((__format__(printf,4,5)))
94#endif
95;
96#else
97#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
98#define exif_log(...) do { } while (0)
99#elif defined(__GNUC__)
100#define exif_log(x...) do { } while (0)
101#else
102#define exif_log (void)
103#endif
104#endif
105
106 EXIF_API(void) exif_logv (ExifLog *log, exif_enum(ExifLogCode), const char *domain,
107 const char *format, va_list args);
108
109/* For your convenience */
110#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))
111
112#ifdef __cplusplus
113}
114#endif /* __cplusplus */
115
116#endif /* __EXIF_LOG_H__ */
EXIF_API
EXIF_API(void) exif_log_ref(ExifLog *log)
Delete instance of ExifLog.
ExifLogFunc
void EXIF_CALLBACK(* ExifLogFunc)(ExifLog *log, exif_enum(ExifLogCode), const char *domain, const char *format, va_list args, void *data)
Log callback function prototype.
Definition: exif-log.h:44