  
    
main.htmlMain Page     
classes.htmlData Structures     
files.htmlFiles     
dirs.htmlDirectories   
  
    
files.htmlFile List     
globals.htmlGlobals   
dir_20715630405f3b63e7ab7a5c713843d9.htmllibexif exif-log.c
exif-log_8c.htmlGo 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.htmllibexif/exif-log.h > 00024 #include < i18n_8h.htmllibexif/i18n.h > 00025 
00026 #include <stdlib.h> 00027 #include <string.h> 00028 
struct__ExifLog.html00029  struct struct__ExifLog.html_ExifLog  {
struct__ExifLog.html#5a32ff6c007ac30a9b7374d5e5582c8d00030          unsigned int struct__ExifLog.html#5a32ff6c007ac30a9b7374d5e5582c8dref_count ;
00031 
struct__ExifLog.html#463035413700bb362a10e56c5ac161e400032          exif-log_8h.html#f18e20994ca6a2bbcfcd5fb8694cc0e2ExifLogFunc  struct__ExifLog.html#463035413700bb362a10e56c5ac161e4func ;
struct__ExifLog.html#711a7929b5bb089519738e5e4b44068800033          void * struct__ExifLog.html#711a7929b5bb089519738e5e4b440688data ;
00034 
struct__ExifLog.html#74209e87601900d3a9190fa07f3f872c00035          struct__ExifMem.htmlExifMem  * struct__ExifLog.html#74209e87601900d3a9190fa07f3f872cmem ;
00036 };
00037 
00038 static struct {
exif-log_8c.html#84ec5624b4f8d60e5baac4d2a88c3d4a00039          exif-log_8h.html#d7dbc9f25878759b54247de66204b7f2ExifLogCode  exif-log_8c.html#84ec5624b4f8d60e5baac4d2a88c3d4acode ;
exif-log_8c.html#e9443c4196223b5970622e355e12a8c800040          const char * mnote-canon-tag_8c.html#e9443c4196223b5970622e355e12a8c8title ;
exif-log_8c.html#47aabd0c542d14a4ade2310eb39caaa500041          const char * exif-log_8c.html#47aabd0c542d14a4ade2310eb39caaa5message ;
00042 } exif-log_8c.html#55624245b45edb4ade7aa8f44c6b2a6dcodes [] = {
00043         { exif-log_8h.html#d7dbc9f25878759b54247de66204b7f2e8386f9a77a68764087d7f3d692f383eEXIF_LOG_CODE_DEBUG , i18n_8h.html#3a5ebfb532ab1a97cf24a0c0320b9c58N_ ("Debugging information"),
00044           i18n_8h.html#3a5ebfb532ab1a97cf24a0c0320b9c58N_ ("Debugging information is available.") },
00045         { exif-log_8h.html#d7dbc9f25878759b54247de66204b7f25410ae7063f803e48d5e8b8d912a0365EXIF_LOG_CODE_NO_MEMORY , i18n_8h.html#3a5ebfb532ab1a97cf24a0c0320b9c58N_ ("Not enough memory"),
00046           i18n_8h.html#3a5ebfb532ab1a97cf24a0c0320b9c58N_ ("The system cannot provide enough memory.") },
00047         { exif-log_8h.html#d7dbc9f25878759b54247de66204b7f2375f88a49d1bdaaafc38597bf60e6d25EXIF_LOG_CODE_CORRUPT_DATA , i18n_8h.html#3a5ebfb532ab1a97cf24a0c0320b9c58N_ ("Corrupt data"),
00048           i18n_8h.html#3a5ebfb532ab1a97cf24a0c0320b9c58N_ ("The data provided does not follow the specification.") },
00049         { 0, NULL, NULL }
00050 };
00051 
00052 const char *
exif-log_8h.html#f01cdd951184a5cc50475ca34eec57af00053  exif-log_8c.html#ddbd115624a0e103b183a0fd65abec43exif_log_code_get_title  ( exif-log_8h.html#d7dbc9f25878759b54247de66204b7f2ExifLogCode  exif-log_8c.html#84ec5624b4f8d60e5baac4d2a88c3d4acode )
00054 {
00055         unsigned int i;
00056 
00057         for (i = 0; exif-log_8c.html#55624245b45edb4ade7aa8f44c6b2a6dcodes [i].title; i++) if ( exif-log_8c.html#55624245b45edb4ade7aa8f44c6b2a6dcodes [i].code == code) break;
00058         return i18n_8h.html#709240620a80c25aca1c4e2576c3cba8_ ( exif-log_8c.html#55624245b45edb4ade7aa8f44c6b2a6dcodes [i]. mnote-canon-tag_8c.html#e9443c4196223b5970622e355e12a8c8title );
00059 }
00060 
00061 const char *
exif-log_8h.html#ef563202bdc0bf872b6bad715185fe0d00062  exif-log_8c.html#35fcc42225020fc3c9a39448f7df875dexif_log_code_get_message  ( exif-log_8h.html#d7dbc9f25878759b54247de66204b7f2ExifLogCode  exif-log_8c.html#84ec5624b4f8d60e5baac4d2a88c3d4acode )
00063 {
00064         unsigned int i;
00065 
00066         for (i = 0; exif-log_8c.html#55624245b45edb4ade7aa8f44c6b2a6dcodes [i].message; i++) if ( exif-log_8c.html#55624245b45edb4ade7aa8f44c6b2a6dcodes [i].code == code) break;
00067         return i18n_8h.html#709240620a80c25aca1c4e2576c3cba8_ ( exif-log_8c.html#55624245b45edb4ade7aa8f44c6b2a6dcodes [i]. exif-log_8c.html#47aabd0c542d14a4ade2310eb39caaa5message );
00068 }
00069 
00070 struct__ExifLog.htmlExifLog  *
exif-log_8h.html#0d0f0dcfe7fef36650010118fdfdf9cf00071  exif-log_8c.html#bc34f13a7dcbd42f4499c5d8b64341e2exif_log_new_mem  ( struct__ExifMem.htmlExifMem  *mem)
00072 {
00073         struct__ExifLog.htmlExifLog  *log;
00074 
00075         log = exif-mem_8c.html#28065115ce31c8c9c7701df5b3f4ada5exif_mem_alloc  (mem, sizeof ( struct__ExifLog.htmlExifLog ));
00076         if (!log) return NULL;
00077         log-> struct__ExifLog.html#5a32ff6c007ac30a9b7374d5e5582c8dref_count  = 1;
00078 
00079         log-> struct__ExifLog.html#74209e87601900d3a9190fa07f3f872cmem  = mem;
00080         exif-mem_8c.html#5e444d744fdb19c0c8d4438d9aad2b0bexif_mem_ref  (mem);
00081 
00082         return log;
00083 }
00084 
00085 struct__ExifLog.htmlExifLog  *
exif-log_8h.html#67484e28102e44fb1b90480c8b65089000086  exif-log_8c.html#67484e28102e44fb1b90480c8b650890exif_log_new  (void)
00087 {
00088         struct__ExifMem.htmlExifMem  *mem = exif-mem_8c.html#44af1bc2ce5eecf37e731c5fe5dc98e0exif_mem_new_default  ();
00089         struct__ExifLog.htmlExifLog  *log = exif-log_8c.html#bc34f13a7dcbd42f4499c5d8b64341e2exif_log_new_mem  (mem);
00090 
00091         exif-mem_8c.html#fd6959367336c1459125c43e3f16fec8exif_mem_unref  (mem);
00092 
00093         return log;
00094 }
00095 
00096 void exif-log_8h.html#926f0e50e2afab52db87acfbf76ff87800097  exif-log_8c.html#926f0e50e2afab52db87acfbf76ff878exif_log_ref  ( struct__ExifLog.htmlExifLog  *log)
00098 {
00099         if (!log) return;
00100         log-> struct__ExifLog.html#5a32ff6c007ac30a9b7374d5e5582c8dref_count ++;
00101 }
00102 
00103 void exif-log_8h.html#a4f16b2e2aa992cd5d1598fbf68d2fb700104  exif-log_8c.html#a4f16b2e2aa992cd5d1598fbf68d2fb7exif_log_unref  ( struct__ExifLog.htmlExifLog  *log)
00105 {
00106         if (!log) return;
00107         if (log-> struct__ExifLog.html#5a32ff6c007ac30a9b7374d5e5582c8dref_count  > 0) log-> struct__ExifLog.html#5a32ff6c007ac30a9b7374d5e5582c8dref_count --;
00108         if (!log-> struct__ExifLog.html#5a32ff6c007ac30a9b7374d5e5582c8dref_count ) exif-log_8c.html#8a16dfde94b2133add7212f06647aa6fexif_log_free  (log);
00109 }
00110 
00111 void exif-log_8h.html#8a16dfde94b2133add7212f06647aa6f00112  exif-log_8c.html#8a16dfde94b2133add7212f06647aa6fexif_log_free  ( struct__ExifLog.htmlExifLog  *log)
00113 {
00114         struct__ExifMem.htmlExifMem  *mem = log ? log-> struct__ExifLog.html#74209e87601900d3a9190fa07f3f872cmem  : NULL;
00115 
00116         if (!log) return;
00117 
00118         exif-mem_8c.html#c18517acd3216e21942966d3dfab5f53exif_mem_free  (mem, log);
00119         exif-mem_8c.html#fd6959367336c1459125c43e3f16fec8exif_mem_unref  (mem);
00120 }
00121 
00122 void exif-log_8h.html#ec70ca0bc3df57254821b854bce898ca00123  exif-log_8c.html#ec70ca0bc3df57254821b854bce898caexif_log_set_func  ( struct__ExifLog.htmlExifLog  *log, exif-log_8h.html#f18e20994ca6a2bbcfcd5fb8694cc0e2ExifLogFunc  func, void *data)
00124 {
00125         if (!log) return;
00126         log-> struct__ExifLog.html#463035413700bb362a10e56c5ac161e4func  = func;
00127         log-> struct__ExifLog.html#711a7929b5bb089519738e5e4b440688data  = data;
00128 }
00129 
00130 void exif-log_8h.html#d14b8cf7701e1cc9b46e2b037c22281300131  exif-log_8c.html#2252b03f7df6cd3688d6647cd7ba3fccexif_log  ( struct__ExifLog.htmlExifLog  *log, exif-log_8h.html#d7dbc9f25878759b54247de66204b7f2ExifLogCode  exif-log_8c.html#84ec5624b4f8d60e5baac4d2a88c3d4acode , const char *domain,
00132           const char * exif-format_8c.html#822b1c4c8023ab88c62ef13a295cc9f4format , ...)
00133 {
00134         va_list args;
00135 
00136         va_start (args, format);
00137         exif-log_8c.html#1bf21046f51df753035a243cd91c9d18exif_logv  (log, code, domain, format, args);
00138         va_end (args);
00139 }
00140 
00141 void exif-log_8h.html#dbc4bdafee400a164fe7f993b96f765500142  exif-log_8c.html#1bf21046f51df753035a243cd91c9d18exif_logv  ( struct__ExifLog.htmlExifLog  *log, exif-log_8h.html#d7dbc9f25878759b54247de66204b7f2ExifLogCode  exif-log_8c.html#84ec5624b4f8d60e5baac4d2a88c3d4acode , const char *domain,
00143            const char * exif-format_8c.html#822b1c4c8023ab88c62ef13a295cc9f4format , va_list args)
00144 {
00145         if (!log) return;
00146         if (!log-> struct__ExifLog.html#463035413700bb362a10e56c5ac161e4func ) return;
00147         log-> struct__ExifLog.html#463035413700bb362a10e56c5ac161e4func  (log, code, domain, format, args, log-> struct__ExifLog.html#711a7929b5bb089519738e5e4b440688data );
00148 }
Generated on Sun Apr 23 01:22:39 2006 for EXIF library (libexif) Internals by 
http://www.doxygen.org/index.htmldoxygen  1.4.6 