3 * Copyright © 2004 Lutz Müller <lutz@users.sourceforge.net>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
22 #include <libexif/exif-log.h>
28 unsigned int ref_count;
39 log = malloc (sizeof (ExifLog));
40 if (!log) return NULL;
41 memset (log, 0, sizeof (ExifLog));
48 exif_log_ref (ExifLog *log)
55 exif_log_unref (ExifLog *log)
58 if (log->ref_count > 0) log->ref_count--;
59 if (!log->ref_count) exif_log_free (log);
63 exif_log_free (ExifLog *log)
66 memset (log, 0, sizeof (log));
71 exif_log_set_func (ExifLog *log, ExifLogFunc func, void *data)
79 exif_log (ExifLog *log, ExifLogCode code, const char *domain,
80 const char *format, ...)
84 va_start (args, format);
85 exif_logv (log, code, domain, format, args);
90 exif_logv (ExifLog *log, ExifLogCode code, const char *domain,
91 const char *format, va_list args)
94 if (!log->func) return;
95 log->func (log, code, domain, format, args, log->data);