  
    
main.htmlMain Page     
classes.htmlData Structures     
files.htmlFiles     
dirs.htmlDirectories   
  
    
files.htmlFile List     
globals.htmlGlobals   
dir_3c4fde49625df9344590fff295c7c38d.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#4ee744df79e288ab1c28feeacbb7f3b900030          unsigned int struct__ExifLog.html#4ee744df79e288ab1c28feeacbb7f3b9ref_count ;
00031 
struct__ExifLog.html#49088c2390158c2429a156634ccd8ecd00032          exif-log_8h.html#5f19ac102b6d554320d6afb32f85c3d3ExifLogFunc  struct__ExifLog.html#49088c2390158c2429a156634ccd8ecdfunc ;
struct__ExifLog.html#e2b124b873451f8d4514067b7bd33eb400033          void * struct__ExifLog.html#e2b124b873451f8d4514067b7bd33eb4data ;
00034 
struct__ExifLog.html#0d8f1f622e3b4570bd2f5d3da24144f500035          struct__ExifMem.htmlExifMem  * struct__ExifLog.html#0d8f1f622e3b4570bd2f5d3da24144f5mem ;
00036 };
00037 
00038 static struct {
exif-log_8c.html#1af18795ea58910152268a087852f32700039          exif-log_8h.html#36f42667fb0481f099dbc0628dae2652ExifLogCode  exif-log_8c.html#1af18795ea58910152268a087852f327code ;
exif-log_8c.html#8214780964530800368b406c681fd1d900040          const char * mnote-canon-tag_8c.html#8214780964530800368b406c681fd1d9title ;
exif-log_8c.html#254bf0858da09c96a48daf64404eb4f800041          const char * exif-log_8c.html#254bf0858da09c96a48daf64404eb4f8message ;
00042 } exif-log_8c.html#ff9e6588e6d79cf1e87aa22a1d018be5codes [] = {
00043         { exif-log_8h.html#36f42667fb0481f099dbc0628dae2652e8772b1ad05481f996ae4ab831f22860EXIF_LOG_CODE_DEBUG , i18n_8h.html#75278405e7f034d2b1af80bfd94675feN_ ("Debugging information"),
00044           i18n_8h.html#75278405e7f034d2b1af80bfd94675feN_ ("Debugging information is available.") },
00045         { exif-log_8h.html#36f42667fb0481f099dbc0628dae265258e7ceb39d196fb60b18ec9713c74336EXIF_LOG_CODE_NO_MEMORY , i18n_8h.html#75278405e7f034d2b1af80bfd94675feN_ ("Not enough memory"),
00046           i18n_8h.html#75278405e7f034d2b1af80bfd94675feN_ ("The system cannot provide enough memory.") },
00047         { exif-log_8h.html#36f42667fb0481f099dbc0628dae265284901c6bc122ed1de41cc8fb08b6ccc8EXIF_LOG_CODE_CORRUPT_DATA , i18n_8h.html#75278405e7f034d2b1af80bfd94675feN_ ("Corrupt data"),
00048           i18n_8h.html#75278405e7f034d2b1af80bfd94675feN_ ("The data provided does not follow the specification.") },
00049         { 0, NULL, NULL }
00050 };
00051 
00052 const char *
exif-log_8h.html#74a911ff438d91b7aa842a29a5fcce2a00053  exif-log_8c.html#31cf3057f5546ae2881d817c70ebca55exif_log_code_get_title  ( exif-log_8h.html#36f42667fb0481f099dbc0628dae2652ExifLogCode  exif-log_8c.html#1af18795ea58910152268a087852f327code )
00054 {
00055         unsigned int i;
00056 
00057         for (i = 0; exif-log_8c.html#ff9e6588e6d79cf1e87aa22a1d018be5codes [i].title; i++) if ( exif-log_8c.html#ff9e6588e6d79cf1e87aa22a1d018be5codes [i].code == code) break;
00058         return i18n_8h.html#32a3cf3d9dd914f5aeeca5423c157934_ ( exif-log_8c.html#ff9e6588e6d79cf1e87aa22a1d018be5codes [i]. mnote-canon-tag_8c.html#8214780964530800368b406c681fd1d9title );
00059 }
00060 
00061 const char *
exif-log_8h.html#b3ced4a07055d544dc7373162e3a56a500062  exif-log_8c.html#fe3839462dc826b72b9b13cdc6931473exif_log_code_get_message  ( exif-log_8h.html#36f42667fb0481f099dbc0628dae2652ExifLogCode  exif-log_8c.html#1af18795ea58910152268a087852f327code )
00063 {
00064         unsigned int i;
00065 
00066         for (i = 0; exif-log_8c.html#ff9e6588e6d79cf1e87aa22a1d018be5codes [i].message; i++) if ( exif-log_8c.html#ff9e6588e6d79cf1e87aa22a1d018be5codes [i].code == code) break;
00067         return i18n_8h.html#32a3cf3d9dd914f5aeeca5423c157934_ ( exif-log_8c.html#ff9e6588e6d79cf1e87aa22a1d018be5codes [i]. exif-log_8c.html#254bf0858da09c96a48daf64404eb4f8message );
00068 }
00069 
00070 struct__ExifLog.htmlExifLog  *
exif-log_8h.html#d6e1adde9d6188d369e3cc45b3aa781500071  exif-log_8c.html#b81043226e5d0ea2cf2e0869f6063b58exif_log_new_mem  ( struct__ExifMem.htmlExifMem  *mem)
00072 {
00073         struct__ExifLog.htmlExifLog  *log;
00074 
00075         log = exif-mem_8c.html#e8c09cfbcb95e435c4c4b7ec3bbd79e4exif_mem_alloc  (mem, sizeof ( struct__ExifLog.htmlExifLog ));
00076         if (!log) return NULL;
00077         log-> struct__ExifLog.html#4ee744df79e288ab1c28feeacbb7f3b9ref_count  = 1;
00078 
00079         log-> struct__ExifLog.html#0d8f1f622e3b4570bd2f5d3da24144f5mem  = mem;
00080         exif-mem_8c.html#f28c61972f529be46907956e0b3e7a60exif_mem_ref  (mem);
00081 
00082         return log;
00083 }
00084 
00085 struct__ExifLog.htmlExifLog  *
exif-log_8h.html#92d3525981d3d604521ca74ce05d0add00086  exif-log_8c.html#92d3525981d3d604521ca74ce05d0addexif_log_new  (void)
00087 {
00088         struct__ExifMem.htmlExifMem  *mem = exif-mem_8c.html#cd2926c29b470c9d43f84567a84d5acbexif_mem_new_default  ();
00089         struct__ExifLog.htmlExifLog  *log = exif-log_8c.html#b81043226e5d0ea2cf2e0869f6063b58exif_log_new_mem  (mem);
00090 
00091         exif-mem_8c.html#66744e0987af08c443df247ce55f7d87exif_mem_unref  (mem);
00092 
00093         return log;
00094 }
00095 
00096 void exif-log_8h.html#afd7e5d40ca73440976a3b684bfa105900097  exif-log_8c.html#afd7e5d40ca73440976a3b684bfa1059exif_log_ref  ( struct__ExifLog.htmlExifLog  *log)
00098 {
00099         if (!log) return;
00100         log-> struct__ExifLog.html#4ee744df79e288ab1c28feeacbb7f3b9ref_count ++;
00101 }
00102 
00103 void exif-log_8h.html#7a9b738a7429197d68c80ffedac7d8fb00104  exif-log_8c.html#7a9b738a7429197d68c80ffedac7d8fbexif_log_unref  ( struct__ExifLog.htmlExifLog  *log)
00105 {
00106         if (!log) return;
00107         if (log-> struct__ExifLog.html#4ee744df79e288ab1c28feeacbb7f3b9ref_count  > 0) log-> struct__ExifLog.html#4ee744df79e288ab1c28feeacbb7f3b9ref_count --;
00108         if (!log-> struct__ExifLog.html#4ee744df79e288ab1c28feeacbb7f3b9ref_count ) exif-log_8c.html#cd0808d6d5be73f28059797c2e2e67dcexif_log_free  (log);
00109 }
00110 
00111 void exif-log_8h.html#cd0808d6d5be73f28059797c2e2e67dc00112  exif-log_8c.html#cd0808d6d5be73f28059797c2e2e67dcexif_log_free  ( struct__ExifLog.htmlExifLog  *log)
00113 {
00114         struct__ExifMem.htmlExifMem  *mem = log ? log-> struct__ExifLog.html#0d8f1f622e3b4570bd2f5d3da24144f5mem  : NULL;
00115 
00116         if (!log) return;
00117 
00118         exif-mem_8c.html#43190b81b4b4bdb4ffb89bfb612051b1exif_mem_free  (mem, log);
00119         exif-mem_8c.html#66744e0987af08c443df247ce55f7d87exif_mem_unref  (mem);
00120 }
00121 
00122 void exif-log_8h.html#493a369b7020265971cdaf8be9a2f6fe00123  exif-log_8c.html#493a369b7020265971cdaf8be9a2f6feexif_log_set_func  ( struct__ExifLog.htmlExifLog  *log, exif-log_8h.html#5f19ac102b6d554320d6afb32f85c3d3ExifLogFunc  func, void *data)
00124 {
00125         if (!log) return;
00126         log-> struct__ExifLog.html#49088c2390158c2429a156634ccd8ecdfunc  = func;
00127         log-> struct__ExifLog.html#e2b124b873451f8d4514067b7bd33eb4data  = data;
00128 }
00129 
00130 void exif-log_8h.html#3317c341014d6ed3ea726f66116d5de000131  exif-log_8c.html#025d4a5d96544913ea6f6ebbec69cb68exif_log  ( struct__ExifLog.htmlExifLog  *log, exif-log_8h.html#36f42667fb0481f099dbc0628dae2652ExifLogCode  exif-log_8c.html#1af18795ea58910152268a087852f327code , const char *domain,
00132           const char * exif-format_8c.html#bd06ced5b3e334726a446807ba75b6c8format , ...)
00133 {
00134         va_list args;
00135 
00136         va_start (args, format);
00137         exif-log_8c.html#99101b5ad01b2d82ce9d43c9e8534627exif_logv  (log, code, domain, format, args);
00138         va_end (args);
00139 }
00140 
00141 void exif-log_8h.html#f5f451d1ffd6538a88ca59798799af4100142  exif-log_8c.html#99101b5ad01b2d82ce9d43c9e8534627exif_logv  ( struct__ExifLog.htmlExifLog  *log, exif-log_8h.html#36f42667fb0481f099dbc0628dae2652ExifLogCode  exif-log_8c.html#1af18795ea58910152268a087852f327code , const char *domain,
00143            const char * exif-format_8c.html#bd06ced5b3e334726a446807ba75b6c8format , va_list args)
00144 {
00145         if (!log) return;
00146         if (!log-> struct__ExifLog.html#49088c2390158c2429a156634ccd8ecdfunc ) return;
00147         log-> struct__ExifLog.html#49088c2390158c2429a156634ccd8ecdfunc  (log, code, domain, format, args, log-> struct__ExifLog.html#e2b124b873451f8d4514067b7bd33eb4data );
00148 }
Generated on Sun Apr 23 02:19:18 2006 for EXIF library (libexif) Internals by 
http://www.doxygen.org/index.htmldoxygen  1.4.6 