main.html
Main Page
|
classes.html
Alphabetical List
|
annotated.html
Data Structures
|
dirs.html
Directories
|
files.html
File List
|
functions.html
Data Fields
|
globals.html
Globals
dir_000000.html
libexif
exif-log.c
exif-log_8c.html
Go to the documentation of this file.
00001
/* exif-log.c
00002
*
00003
* Copyright ? 2004 Lutz M?ller <lutz@users.sourceforge.net>
00004
*
00005
* This library is free software; you can redistribute it and/or
00006
* modify it under the terms of the GNU Lesser General Public
00007
* License as published by the Free Software Foundation; either
00008
* version 2 of the License, or (at your option) any later version.
00009
*
00010
* This library is distributed in the hope that it will be useful,
00011
* but WITHOUT ANY WARRANTY; without even the implied warranty of
00012
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013
* Lesser General Public License for more details.
00014
*
00015
* You should have received a copy of the GNU Lesser General Public
00016
* License along with this library; if not, write to the
00017
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018
* Boston, MA 02111-1307, USA.
00019
*/
00020
00021
#include <config.h>
00022
00023
#include <
exif-log_8h.html
libexif/exif-log.h
>
00024
#include <
i18n_8h.html
libexif/i18n.h
>
00025
00026
#include <stdlib.h>
00027
#include <string.h>
00028
struct__ExifLog.html
00029
struct
struct__ExifLog.html
_ExifLog
{
struct__ExifLog.html#o0
00030
unsigned
int
struct__ExifLog.html#o0
ref_count
;
00031
struct__ExifLog.html#o1
00032
exif-log_8h.html#a2
ExifLogFunc
struct__ExifLog.html#o1
func
;
struct__ExifLog.html#o2
00033
void
*
struct__ExifLog.html#o2
data
;
00034
struct__ExifLog.html#o3
00035
struct__ExifMem.html
ExifMem
*
struct__ExifLog.html#o3
mem
;
00036 };
00037
00038
static
struct
{
exif-log_8c.html#a0
00039
exif-log_8h.html#a17
ExifLogCode
exif-log_8c.html#a0
code
;
exif-log_8c.html#a1
00040
const
char
*
mnote-canon-tag_8c.html#a2
title
;
exif-log_8c.html#a2
00041
const
char
*
exif-log_8c.html#a2
message
;
00042 }
exif-log_8c.html#a3
codes
[] = {
00043         {
exif-log_8h.html#a17a4
EXIF_LOG_CODE_DEBUG
,
i18n_8h.html#a7
N_
(
"Debugging information"
),
00044
i18n_8h.html#a7
N_
(
"Debugging information is available."
) },
00045         {
exif-log_8h.html#a17a5
EXIF_LOG_CODE_NO_MEMORY
,
i18n_8h.html#a7
N_
(
"Not enough memory"
),
00046
i18n_8h.html#a7
N_
(
"The system cannot provide enough memory."
) },
00047         {
exif-log_8h.html#a17a6
EXIF_LOG_CODE_CORRUPT_DATA
,
i18n_8h.html#a7
N_
(
"Corrupt data"
),
00048
i18n_8h.html#a7
N_
(
"The data provided does not follow the specification."
) },
00049         { 0, NULL, NULL }
00050 };
00051
00052
const
char
*
exif-log_8h.html#a12
00053
exif-log_8c.html#a4
exif_log_code_get_title
(
exif-log_8h.html#a17
ExifLogCode
exif-log_8c.html#a0
code
)
00054 {
00055
unsigned
int
i;
00056
00057
for
(i = 0;
exif-log_8c.html#a3
codes
[i].
mnote-canon-tag_8c.html#a2
title
; i++)
if
(
exif-log_8c.html#a3
codes
[i].code == code)
break
;
00058
return
i18n_8h.html#a6
_
(
exif-log_8c.html#a3
codes
[i].
mnote-canon-tag_8c.html#a2
title
);
00059 }
00060
00061
const
char
*
exif-log_8h.html#a13
00062
exif-log_8c.html#a5
exif_log_code_get_message
(
exif-log_8h.html#a17
ExifLogCode
exif-log_8c.html#a0
code
)
00063 {
00064
unsigned
int
i;
00065
00066
for
(i = 0;
exif-log_8c.html#a3
codes
[i].
exif-log_8c.html#a2
message
; i++)
if
(
exif-log_8c.html#a3
codes
[i].code == code)
break
;
00067
return
i18n_8h.html#a6
_
(
exif-log_8c.html#a3
codes
[i].
exif-log_8c.html#a2
message
);
00068 }
00069
00070
struct__ExifLog.html
ExifLog
*
exif-log_8h.html#a8
00071
exif-log_8c.html#a6
exif_log_new_mem
(
struct__ExifMem.html
ExifMem
*mem)
00072 {
00073
struct__ExifLog.html
ExifLog
*log;
00074
00075         log =
exif-mem_8c.html#a7
exif_mem_alloc
(mem,
sizeof
(
struct__ExifLog.html
ExifLog
));
00076
if
(!log)
return
NULL;
00077         log->
struct__ExifLog.html#o0
ref_count
= 1;
00078
00079         log->
struct__ExifLog.html#o3
mem
= mem;
00080
exif-mem_8c.html#a4
exif_mem_ref
(mem);
00081
00082
return
log;
00083 }
00084
00085
struct__ExifLog.html
ExifLog
*
exif-log_8h.html#a7
00086
exif-log_8c.html#a7
exif_log_new
(
void
)
00087 {
00088
struct__ExifMem.html
ExifMem
*mem =
exif-mem_8c.html#a9
exif_mem_new_default
();
00089
struct__ExifLog.html
ExifLog
*log =
exif-log_8c.html#a6
exif_log_new_mem
(mem);
00090
00091
exif-mem_8c.html#a5
exif_mem_unref
(mem);
00092
00093
return
log;
00094 }
00095
00096
void
exif-log_8h.html#a9
00097
exif-log_8c.html#a8
exif_log_ref
(
struct__ExifLog.html
ExifLog
*log)
00098 {
00099
if
(!log)
return
;
00100         log->
struct__ExifLog.html#o0
ref_count
++;
00101 }
00102
00103
void
exif-log_8h.html#a10
00104
exif-log_8c.html#a9
exif_log_unref
(
struct__ExifLog.html
ExifLog
*log)
00105 {
00106
if
(!log)
return
;
00107
if
(log->
struct__ExifLog.html#o0
ref_count
> 0) log->
struct__ExifLog.html#o0
ref_count
--;
00108
if
(!log->
struct__ExifLog.html#o0
ref_count
)
exif-log_8c.html#a10
exif_log_free
(log);
00109 }
00110
00111
void
exif-log_8h.html#a11
00112
exif-log_8c.html#a10
exif_log_free
(
struct__ExifLog.html
ExifLog
*log)
00113 {
00114
struct__ExifMem.html
ExifMem
*mem = log ? log->
struct__ExifLog.html#o3
mem
: NULL;
00115
00116
if
(!log)
return
;
00117
00118
exif-mem_8c.html#a6
exif_mem_free
(mem, log);
00119
exif-mem_8c.html#a5
exif_mem_unref
(mem);
00120 }
00121
00122
void
exif-log_8h.html#a14
00123
exif-log_8c.html#a11
exif_log_set_func
(
struct__ExifLog.html
ExifLog
*log,
exif-log_8h.html#a2
ExifLogFunc
func,
void
*data)
00124 {
00125
if
(!log)
return
;
00126         log->
struct__ExifLog.html#o1
func
= func;
00127         log->
struct__ExifLog.html#o2
data
= data;
00128 }
00129
00130
void
exif-log_8h.html#a15
00131
exif-log_8c.html#a12
exif_log
(
struct__ExifLog.html
ExifLog
*log,
exif-log_8h.html#a17
ExifLogCode
exif-log_8c.html#a0
code
,
const
char
*domain,
00132
const
char
*
exif-format_8c.html#a0
format
, ...)
00133 {
00134         va_list args;
00135
00136         va_start (args, format);
00137
exif-log_8c.html#a13
exif_logv
(log, code, domain, format, args);
00138         va_end (args);
00139 }
00140
00141
void
exif-log_8h.html#a16
00142
exif-log_8c.html#a13
exif_logv
(
struct__ExifLog.html
ExifLog
*log,
exif-log_8h.html#a17
ExifLogCode
exif-log_8c.html#a0
code
,
const
char
*domain,
00143
const
char
*
exif-format_8c.html#a0
format
, va_list args)
00144 {
00145
if
(!log)
return
;
00146
if
(!log->
struct__ExifLog.html#o1
func
)
return
;
00147         log->
struct__ExifLog.html#o1
func
(log, code, domain, format, args, log->
struct__ExifLog.html#o2
data
);
00148 }
Generated on Fri Sep 9 16:28:11 2005 for EXIF library (libexif) Internals by
http://www.doxygen.org/index.html
doxygen
1.4.4
