  
    
main.htmlMain Page     
classes.htmlData Structures     
files.htmlFiles     
dirs.htmlDirectories   
  
    
files.htmlFile List     
globals.htmlGlobals   
dir_20715630405f3b63e7ab7a5c713843d9.htmllibexif  &raquo dir_57e6ecf440319940c3301c1b4e94982a.htmlolympus exif-mnote-data-olympus.c
exif-mnote-data-olympus_8c.htmlGo to the documentation of this file. 00001 /* exif-mnote-data-olympus.c 00002  * 00003  * Copyright © 2002, 2003 Lutz Mueller <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 #include " exif-mnote-data-olympus_8h.htmlexif-mnote-data-olympus.h " 00023 
00024 #include <stdlib.h> 00025 #include <string.h> 00026 #include <stdio.h> 00027 
00028 #include < exif-utils_8h.htmllibexif/exif-utils.h > 00029 #include < exif-data_8h.htmllibexif/exif-data.h > 00030 
exif-mnote-data-olympus_8c.html#ac47fa634ceaa64ebda2d1f75475520500031  #define DEBUG 00032 00033 static void exif-mnote-data-olympus_8c.html#9eb2a8a13e2fd9c20a930744a6c3a3e900034  exif-mnote-data-olympus_8c.html#9eb2a8a13e2fd9c20a930744a6c3a3e9exif_mnote_data_olympus_clear  ( struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *n)
00035 {
00036         struct__ExifMnoteData.htmlExifMnoteData  *d = ( struct__ExifMnoteData.htmlExifMnoteData  *) n;
00037         unsigned int i;
00038 
00039         if (!n) return;
00040 
00041         if (n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries ) {
00042                 for (i = 0; i < n-> struct__ExifMnoteDataOlympus.html#42233a1a1e56ad8f1c249f400cf116c2count ; i++)
00043                         if (n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#5950390b898f6b3c75fb6cea276ee673data ) {
00044                                 exif-mem_8c.html#c18517acd3216e21942966d3dfab5f53exif_mem_free  (d-> struct__ExifMnoteData.html#5af61de00f29058de1d06484f96145fcmem , n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#5950390b898f6b3c75fb6cea276ee673data );
00045                                 n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#5950390b898f6b3c75fb6cea276ee673data  = NULL;
00046                         }
00047                 exif-mem_8c.html#c18517acd3216e21942966d3dfab5f53exif_mem_free  (d-> struct__ExifMnoteData.html#5af61de00f29058de1d06484f96145fcmem , n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries );
00048                 n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries  = NULL;
00049                 n-> struct__ExifMnoteDataOlympus.html#42233a1a1e56ad8f1c249f400cf116c2count  = 0;
00050         }
00051 }
00052 
00053 static void exif-mnote-data-olympus_8c.html#9806f05e7096f2d7cf1735814b12cd0600054  exif-mnote-data-olympus_8c.html#9806f05e7096f2d7cf1735814b12cd06exif_mnote_data_olympus_free  ( struct__ExifMnoteData.htmlExifMnoteData  *n)
00055 {
00056         if (!n) return;
00057 
00058         exif-mnote-data-olympus_8c.html#9eb2a8a13e2fd9c20a930744a6c3a3e9exif_mnote_data_olympus_clear  (( struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *) n);
00059 }
00060 
00061 static char *
exif-mnote-data-olympus_8c.html#7405ddb800a8bcff869e8023b76b540d00062  exif-mnote-data-olympus_8c.html#7405ddb800a8bcff869e8023b76b540dexif_mnote_data_olympus_get_value  ( struct__ExifMnoteData.htmlExifMnoteData  *d, unsigned int i, char *val, unsigned int maxlen)
00063 {
00064         struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *n = ( struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *) d;
00065 
00066         if (!d || !val) return NULL;
00067         if (i > n-> struct__ExifMnoteDataOlympus.html#42233a1a1e56ad8f1c249f400cf116c2count  -1) return NULL;
00068         exif-log_8c.html#2252b03f7df6cd3688d6647cd7ba3fccexif_log  (d-> struct__ExifMnoteData.html#84321b0981574521dcae4fcba760c787log , exif-log_8h.html#d7dbc9f25878759b54247de66204b7f2e8386f9a77a68764087d7f3d692f383eEXIF_LOG_CODE_DEBUG , "ExifMnoteDataOlympus",
00069                   "Querying value for tag '%s'...",
00070                   mnote-olympus-tag_8c.html#7cf5d3cd4ce1f2ae19f327817b2351efmnote_olympus_tag_get_name  (n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#5992d58d3aec91729b86961c50591ab4tag ));
00071         return mnote-olympus-entry_8c.html#16a9c1f2c418bf3b1338460907a0f47emnote_olympus_entry_get_value  (&n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i], val, maxlen);
00072 }
00073 
00074 
00075 
00076 
00084 static void exif-mnote-data-olympus_8c.html#7c5e6ca3785538559fa854287f48e91700085  exif-mnote-data-olympus_8c.html#7c5e6ca3785538559fa854287f48e917exif_mnote_data_olympus_save  ( struct__ExifMnoteData.htmlExifMnoteData  *ne,
00086                 unsigned char **buf, unsigned int *buf_size)
00087 {
00088         struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *n = ( struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *) ne;
00089         unsigned int i, o, s, doff, base = 0, o2 = 6;
00090         int datao = 0;
00091 
00092         if (!n || !buf || !buf_size) return;
00093 
00094         /* 00095          * Allocate enough memory for all entries and the number of entries. 00096          */ 00097         *buf_size = 6 + 2 + 2 + n-> struct__ExifMnoteDataOlympus.html#42233a1a1e56ad8f1c249f400cf116c2count  * 12;
00098         o2 += 2;
00099         switch (n-> struct__ExifMnoteDataOlympus.html#7a84a9fce6af2ae108011c0e4bac93a5version ) {
00100         case exif-mnote-data-olympus_8h.html#d16b56fc7bd1ed93aff1629b379c3265d9b194d8ac50c089d2bf807df5580180olympus : 
00101                 *buf = exif-mem_8c.html#28065115ce31c8c9c7701df5b3f4ada5exif_mem_alloc  (ne-> struct__ExifMnoteData.html#5af61de00f29058de1d06484f96145fcmem , *buf_size);
00102                 if (!*buf) return;
00103 
00104                 /* Write the header and the number of entries. */ 00105                 strcpy ((char *)*buf, "OLYMP");
00106                 datao = n-> struct__ExifMnoteDataOlympus.html#a9ee4d6f69dd7014a62ffabd34d93198offset ;
00107                 break;
00108         case exif-mnote-data-olympus_8h.html#d16b56fc7bd1ed93aff1629b379c3265c6d32341d6cf95a29424fd5f78a4cee8nikonV1 : 
00109                 base = mnote-olympus-tag_8h.html#64882ebb5d0f52da719e82e33fb97b5b4e5f99e08fcefb6468060c0e44cd8485MNOTE_NIKON1_TAG_BASE ;
00110 
00111                 /* subtract the size here, so the increment in the next case will not harm us */ 00112                 *buf_size -= 8;
00113                 /* Fall through */ 00114         case exif-mnote-data-olympus_8h.html#d16b56fc7bd1ed93aff1629b379c3265ee533c9fa23a9d963e370f497af986ecnikonV2 : 
00115                 *buf_size += 8;
00116                 *buf = exif-mem_8c.html#28065115ce31c8c9c7701df5b3f4ada5exif_mem_alloc  (ne-> struct__ExifMnoteData.html#5af61de00f29058de1d06484f96145fcmem , *buf_size);
00117                 if (!*buf) return;
00118 
00119                 /* Write the header and the number of entries. */ 00120                 strcpy ((char *)*buf, "Nikon");
00121                 (*buf)[6] = n-> struct__ExifMnoteDataOlympus.html#7a84a9fce6af2ae108011c0e4bac93a5version ;
00122 
00123                 *buf_size += 2;
00124                 if (n-> struct__ExifMnoteDataOlympus.html#7a84a9fce6af2ae108011c0e4bac93a5version  == exif-mnote-data-olympus_8h.html#d16b56fc7bd1ed93aff1629b379c3265ee533c9fa23a9d963e370f497af986ecnikonV2 ) {
00125                         exif-utils_8c.html#3c3f4df2af5ea90902c44b23b05e20c3exif_set_short  (*buf + 10, n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order , ( exif-utils_8h.html#23497f35004fb9e65a70b29fd1622a9cExifShort ) (
00126                                 (n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order  == exif-byte-order_8h.html#de4a9c512c9cd4723485181c5679f1d58f11995303c860a57dc560623b0df1f3EXIF_BYTE_ORDER_INTEL ) ?
00127                                 ('I' << 8) | 'I' :
00128                                 ('M' << 8) | 'M'));
00129                         exif-utils_8c.html#3c3f4df2af5ea90902c44b23b05e20c3exif_set_short  (*buf + 12, n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order , ( exif-utils_8h.html#23497f35004fb9e65a70b29fd1622a9cExifShort ) 0x2A);
00130                         exif-utils_8c.html#73d539019fccab7808a97c9501e3154dexif_set_long  (*buf + 14, n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order , ( exif-utils_8h.html#23497f35004fb9e65a70b29fd1622a9cExifShort ) 8);
00131                         o2 += 2 + 8;
00132                 }
00133                 datao = -10;
00134                 break;
00135 
00136         default:
00137                 return;
00138         }
00139 
00140         exif-utils_8c.html#3c3f4df2af5ea90902c44b23b05e20c3exif_set_short  (*buf + o2, n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order , ( exif-utils_8h.html#23497f35004fb9e65a70b29fd1622a9cExifShort ) n-> struct__ExifMnoteDataOlympus.html#42233a1a1e56ad8f1c249f400cf116c2count );
00141         o2 += 2;
00142 
00143         /* Save each entry */ 00144         for (i = 0; i < n-> struct__ExifMnoteDataOlympus.html#42233a1a1e56ad8f1c249f400cf116c2count ; i++) {
00145                 o = o2 + i * 12;
00146                 exif-utils_8c.html#3c3f4df2af5ea90902c44b23b05e20c3exif_set_short  (*buf + o + 0, n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order ,
00147                                 ( exif-utils_8h.html#23497f35004fb9e65a70b29fd1622a9cExifShort ) (n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#5992d58d3aec91729b86961c50591ab4tag  - base));
00148                 exif-utils_8c.html#3c3f4df2af5ea90902c44b23b05e20c3exif_set_short  (*buf + o + 2, n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order ,
00149                                 ( exif-utils_8h.html#23497f35004fb9e65a70b29fd1622a9cExifShort ) n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#716be53025dd917b980d9180309c12c1format );
00150                 exif-utils_8c.html#73d539019fccab7808a97c9501e3154dexif_set_long   (*buf + o + 4, n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order ,
00151                                 n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#3347bf2da36313878aee0bb274778ccacomponents );
00152                 o += 8;
00153                 s = exif-format_8c.html#0cd0c832a16f47c39d50aeaeb6c07e83exif_format_get_size  (n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#716be53025dd917b980d9180309c12c1format ) *
00154                                                 n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#3347bf2da36313878aee0bb274778ccacomponents ;
00155                 if (s > 4) {
00156                         doff = *buf_size;
00157                         *buf_size += s;
00158                         *buf = exif-mem_8c.html#e29eb09328c6a3b7e24fb69e0078942cexif_mem_realloc  (ne-> struct__ExifMnoteData.html#5af61de00f29058de1d06484f96145fcmem , *buf,
00159                                                  sizeof (char) * *buf_size);
00160                         if (!*buf) return;
00161                         exif-utils_8c.html#73d539019fccab7808a97c9501e3154dexif_set_long  (*buf + o, n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order , datao + doff);
00162                 } else 00163                         doff = o;
00164 
00165                 /* Write the data. */ 00166                 if (n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#5950390b898f6b3c75fb6cea276ee673data ) {
00167                         memcpy (*buf + doff, n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#5950390b898f6b3c75fb6cea276ee673data , s);
00168                 } else {
00169                         /* Most certainly damaged input file */ 00170                         memset (*buf + doff, 0, s);
00171                 }
00172         }
00173 }
00174 
00175 static void exif-mnote-data-olympus_8c.html#9347ff77b87fb9ddf2cb16f0930e395d00176  exif-mnote-data-olympus_8c.html#9347ff77b87fb9ddf2cb16f0930e395dexif_mnote_data_olympus_load  ( struct__ExifMnoteData.htmlExifMnoteData  *en,
00177                               const unsigned char *buf, unsigned int buf_size)
00178 {
00179         struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *n = ( struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *) en;
00180         exif-utils_8h.html#23497f35004fb9e65a70b29fd1622a9cExifShort  c;
00181         unsigned int i, s, o, o2 = 0, datao = 6, base = 0;
00182 
00183         if (!n || !buf) return;
00184 
00185         /* Start of interesting data */ 00186         o2 = 6 + n-> struct__ExifMnoteDataOlympus.html#a9ee4d6f69dd7014a62ffabd34d93198offset ;
00187 
00188         /* 00189          * Olympus headers start with "OLYMP" and need to have at least 00190          * a size of 22 bytes (6 for 'OLYMP', 2 other bytes, 2 for the 00191          * number of entries, and 12 for one entry. 00192          * 00193          * Nikon headers start with "Nikon" (6 bytes including '\0'), 00194          * version number (1 or 2). 00195          * 00196          * Version 1 continues with 0, 1, 0, number_of_tags, 00197          * or just with number_of_tags (models D1H, D1X...). 00198          * 00199          * Version 2 continues with an unknown byte (0 or 10), 00200          * two unknown bytes (0), "MM" or "II", another byte 0 and 00201          * lastly 0x2A. 00202          */ 00203         if (buf_size - n-> struct__ExifMnoteDataOlympus.html#a9ee4d6f69dd7014a62ffabd34d93198offset  < 22) return;
00204         if (!memcmp (buf + o2, "OLYMP", 5)) {
00205                 exif-log_8c.html#2252b03f7df6cd3688d6647cd7ba3fccexif_log  (en-> struct__ExifMnoteData.html#84321b0981574521dcae4fcba760c787log , exif-log_8h.html#d7dbc9f25878759b54247de66204b7f2e8386f9a77a68764087d7f3d692f383eEXIF_LOG_CODE_DEBUG , "ExifMnoteDataOlympus",
00206                         "Parsing Olympus maker note...");
00207 
00208                 /* The number of entries is at position 8. */ 00209                 n-> struct__ExifMnoteDataOlympus.html#7a84a9fce6af2ae108011c0e4bac93a5version  = exif-mnote-data-olympus_8h.html#d16b56fc7bd1ed93aff1629b379c3265d9b194d8ac50c089d2bf807df5580180olympus ;
00210                 o2 += 8;
00211 
00212         } else if (!memcmp (buf + o2, "Nikon", 6)) {
00213                 o2 += 6;
00214                 exif-log_8c.html#2252b03f7df6cd3688d6647cd7ba3fccexif_log  (en-> struct__ExifMnoteData.html#84321b0981574521dcae4fcba760c787log , exif-log_8h.html#d7dbc9f25878759b54247de66204b7f2e8386f9a77a68764087d7f3d692f383eEXIF_LOG_CODE_DEBUG , "ExifMnoteDataOlympus",
00215                         "Parsing Nikon maker note (0x%02x, %02x, %02x, " 00216                         "%02x, %02x, %02x, %02x, %02x)...",
00217                         buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3], 
00218                         buf[o2 + 4], buf[o2 + 5], buf[o2 + 6], buf[o2 + 7]);
00219                 /* The first byte is the version. */ 00220                 if (o2 >= buf_size) return;
00221                 n-> struct__ExifMnoteDataOlympus.html#7a84a9fce6af2ae108011c0e4bac93a5version  = buf[o2];
00222                 o2 += 1;
00223 
00224                 /* Skip an unknown byte (00 or 0A). */ 00225                 o2 += 1;
00226 
00227                 switch (n-> struct__ExifMnoteDataOlympus.html#7a84a9fce6af2ae108011c0e4bac93a5version ) {
00228                 case exif-mnote-data-olympus_8h.html#d16b56fc7bd1ed93aff1629b379c3265c6d32341d6cf95a29424fd5f78a4cee8nikonV1 :
00229 
00230                         base = mnote-olympus-tag_8h.html#64882ebb5d0f52da719e82e33fb97b5b4e5f99e08fcefb6468060c0e44cd8485MNOTE_NIKON1_TAG_BASE ;
00231                         break;
00232 
00233                 case exif-mnote-data-olympus_8h.html#d16b56fc7bd1ed93aff1629b379c3265ee533c9fa23a9d963e370f497af986ecnikonV2 :
00234 
00235                         /* Skip 2 unknown bytes (00 00). */ 00236                         o2 += 2;
00237 
00238                         /* 00239                          * Byte order. From here the data offset 00240                          * gets calculated. 00241                          */ 00242                         datao = o2;
00243                         if (o2 >= buf_size) return;
00244                         if (!strncmp ((char *)&buf[o2], "II", 2))
00245                                 n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order  = exif-byte-order_8h.html#de4a9c512c9cd4723485181c5679f1d58f11995303c860a57dc560623b0df1f3EXIF_BYTE_ORDER_INTEL ;
00246                         else if (!strncmp ((char *)&buf[o2], "MM", 2))
00247                                 n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order  = exif-byte-order_8h.html#de4a9c512c9cd4723485181c5679f1d5bdbfc66d5e97a77e4bea9f5ba9cf2b15EXIF_BYTE_ORDER_MOTOROLA ;
00248                         else {
00249                                 exif-log_8c.html#2252b03f7df6cd3688d6647cd7ba3fccexif_log  (en-> struct__ExifMnoteData.html#84321b0981574521dcae4fcba760c787log , exif-log_8h.html#d7dbc9f25878759b54247de66204b7f2e8386f9a77a68764087d7f3d692f383eEXIF_LOG_CODE_DEBUG ,
00250                                         "ExifMnoteDatalympus", "Unknown " 00251                                         "byte order '%c%c'", buf[o2],
00252                                         buf[o2 + 1]);
00253                                 return;
00254                         }
00255                         o2 += 2;
00256 
00257                         /* Skip 2 unknown bytes (00 2A). */ 00258                         o2 += 2;
00259 
00260                         /* Go to where the number of entries is. */ 00261                         if (o2 >= buf_size) return;
00262                         o2 = datao + exif-utils_8c.html#c8ce446b600340ccf5f120d8735319f3exif_get_long  (buf + o2, n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order );
00263                         break;
00264 
00265                 default:
00266                         exif-log_8c.html#2252b03f7df6cd3688d6647cd7ba3fccexif_log  (en-> struct__ExifMnoteData.html#84321b0981574521dcae4fcba760c787log , exif-log_8h.html#d7dbc9f25878759b54247de66204b7f2e8386f9a77a68764087d7f3d692f383eEXIF_LOG_CODE_DEBUG ,
00267                                 "ExifMnoteDataOlympus", "Unknown version " 00268                                 "number %i.", n-> struct__ExifMnoteDataOlympus.html#7a84a9fce6af2ae108011c0e4bac93a5version );
00269                         return;
00270                 }
00271         } else if (!memcmp (buf + o2, "\0\x1b", 2)) {
00272                 n-> struct__ExifMnoteDataOlympus.html#7a84a9fce6af2ae108011c0e4bac93a5version  = exif-mnote-data-olympus_8h.html#d16b56fc7bd1ed93aff1629b379c3265ee533c9fa23a9d963e370f497af986ecnikonV2 ;
00273         } else {
00274                 return;
00275         }
00276 
00277         /* Number of entries */ 00278         if (o2 >= buf_size) return;
00279         c = exif-utils_8c.html#28505bc3777648fce6676fc01d74eb40exif_get_short  (buf + o2, n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order );
00280         o2 += 2;
00281 
00282         /* Read the number of entries and remove old ones. */ 00283         exif-mnote-data-olympus_8c.html#9eb2a8a13e2fd9c20a930744a6c3a3e9exif_mnote_data_olympus_clear  (n);
00284 
00285         n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries  = exif-mem_8c.html#28065115ce31c8c9c7701df5b3f4ada5exif_mem_alloc  (en-> struct__ExifMnoteData.html#5af61de00f29058de1d06484f96145fcmem , sizeof ( struct__MnoteOlympusEntry.htmlMnoteOlympusEntry ) * c);
00286         if (!n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries ) return;
00287 
00288         /* Parse the entries */ 00289         for (i = 0; i < c; i++) {
00290             o = o2 + 12 * i;
00291             if (o + 12 > buf_size) return;
00292 
00293             n-> struct__ExifMnoteDataOlympus.html#42233a1a1e56ad8f1c249f400cf116c2count  = i + 1;
00294             n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#5992d58d3aec91729b86961c50591ab4tag         = exif-utils_8c.html#28505bc3777648fce6676fc01d74eb40exif_get_short  (buf + o, n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order ) + base;
00295             n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#716be53025dd917b980d9180309c12c1format      = exif-utils_8c.html#28505bc3777648fce6676fc01d74eb40exif_get_short  (buf + o + 2, n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order );
00296             n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#3347bf2da36313878aee0bb274778ccacomponents  = exif-utils_8c.html#c8ce446b600340ccf5f120d8735319f3exif_get_long  (buf + o + 4, n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order );
00297             n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#69e417d7a6aa6d2b02b667f4c892ff7eorder       = n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order ;
00298 
00299             exif-log_8c.html#2252b03f7df6cd3688d6647cd7ba3fccexif_log  (en-> struct__ExifMnoteData.html#84321b0981574521dcae4fcba760c787log , exif-log_8h.html#d7dbc9f25878759b54247de66204b7f2e8386f9a77a68764087d7f3d692f383eEXIF_LOG_CODE_DEBUG , "ExifMnoteOlympus",
00300                       "Loading entry 0x%x ('%s')...", n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#5992d58d3aec91729b86961c50591ab4tag ,
00301                       mnote-olympus-tag_8c.html#7cf5d3cd4ce1f2ae19f327817b2351efmnote_olympus_tag_get_name  (n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#5992d58d3aec91729b86961c50591ab4tag ));
00302 
00303             /* 00304              * Size? If bigger than 4 bytes, the actual data is not 00305              * in the entry but somewhere else (offset). 00306              */ 00307             s = exif-format_8c.html#0cd0c832a16f47c39d50aeaeb6c07e83exif_format_get_size  (n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#716be53025dd917b980d9180309c12c1format ) *
00308                                          n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#3347bf2da36313878aee0bb274778ccacomponents ;
00309             if (!s) continue;
00310             o += 8;
00311             if (s > 4) o = exif-utils_8c.html#c8ce446b600340ccf5f120d8735319f3exif_get_long  (buf + o, n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order ) + datao;
00312             if (o + s > buf_size) continue;
00313 
00314             /* Sanity check */ 00315             n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#5950390b898f6b3c75fb6cea276ee673data  = exif-mem_8c.html#28065115ce31c8c9c7701df5b3f4ada5exif_mem_alloc  (en-> struct__ExifMnoteData.html#5af61de00f29058de1d06484f96145fcmem , s);
00316             if (!n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#5950390b898f6b3c75fb6cea276ee673data ) continue;
00317             n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#2bb331c82d0d388093b362ea1bdd1e65size  = s;
00318             memcpy (n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#5950390b898f6b3c75fb6cea276ee673data , buf + o, s);
00319         }
00320 }
00321 
00322 static unsigned int exif-mnote-data-olympus_8c.html#72686c6150eab330a73936f694b8487000323  exif-mnote-data-olympus_8c.html#72686c6150eab330a73936f694b84870exif_mnote_data_olympus_count  ( struct__ExifMnoteData.htmlExifMnoteData  *n)
00324 {
00325         return n ? (( struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *) n)->count : 0;
00326 }
00327 
00328 static unsigned int exif-mnote-data-olympus_8c.html#531142757945da218c1cc48ec70add8a00329  exif-mnote-data-olympus_8c.html#531142757945da218c1cc48ec70add8aexif_mnote_data_olympus_get_id  ( struct__ExifMnoteData.htmlExifMnoteData  *d, unsigned int n)
00330 {
00331         struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *note = ( struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *) d;
00332 
00333         if (!note) return 0;
00334         if (note-> struct__ExifMnoteDataOlympus.html#42233a1a1e56ad8f1c249f400cf116c2count  <= n) return 0;
00335         return note-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [n]. struct__MnoteOlympusEntry.html#5992d58d3aec91729b86961c50591ab4tag ;
00336 }
00337 
00338 static const char *
exif-mnote-data-olympus_8c.html#0bfed8dbecac202c3a6f4915c5e8ee0c00339  exif-mnote-data-olympus_8c.html#0bfed8dbecac202c3a6f4915c5e8ee0cexif_mnote_data_olympus_get_name  ( struct__ExifMnoteData.htmlExifMnoteData  *d, unsigned int i)
00340 {
00341         struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *n = ( struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *) d;
00342 
00343         if (!n) return NULL;
00344         if (i >= n-> struct__ExifMnoteDataOlympus.html#42233a1a1e56ad8f1c249f400cf116c2count ) return NULL;
00345         return mnote-olympus-tag_8c.html#7cf5d3cd4ce1f2ae19f327817b2351efmnote_olympus_tag_get_name  (n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#5992d58d3aec91729b86961c50591ab4tag );
00346 }
00347 
00348 static const char *
exif-mnote-data-olympus_8c.html#cabde5b87e0a4dc721ac854cb85b890000349  exif-mnote-data-olympus_8c.html#cabde5b87e0a4dc721ac854cb85b8900exif_mnote_data_olympus_get_title  ( struct__ExifMnoteData.htmlExifMnoteData  *d, unsigned int i)
00350 {
00351         struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *n = ( struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *) d;
00352         
00353         if (!n) return NULL;
00354         if (i >= n-> struct__ExifMnoteDataOlympus.html#42233a1a1e56ad8f1c249f400cf116c2count ) return NULL;
00355         return mnote-olympus-tag_8c.html#9791f417fc6dd5a0dfe6558b8dde1835mnote_olympus_tag_get_title  (n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#5992d58d3aec91729b86961c50591ab4tag );
00356 }
00357 
00358 static const char *
exif-mnote-data-olympus_8c.html#6a9e70581d6d6d277fd350e72da0077800359  exif-mnote-data-olympus_8c.html#6a9e70581d6d6d277fd350e72da00778exif_mnote_data_olympus_get_description  ( struct__ExifMnoteData.htmlExifMnoteData  *d, unsigned int i)
00360 {
00361         struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *n = ( struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *) d;
00362         
00363         if (!n) return NULL;
00364         if (i >= n-> struct__ExifMnoteDataOlympus.html#42233a1a1e56ad8f1c249f400cf116c2count ) return NULL;
00365         return mnote-olympus-tag_8c.html#9791f417fc6dd5a0dfe6558b8dde1835mnote_olympus_tag_get_title  (n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#5992d58d3aec91729b86961c50591ab4tag );
00366 }
00367 
00368 static void exif-mnote-data-olympus_8c.html#c2a587922b9698b0e0b2cb620d5de4da00369  exif-mnote-data-olympus_8c.html#c2a587922b9698b0e0b2cb620d5de4daexif_mnote_data_olympus_set_byte_order  ( struct__ExifMnoteData.htmlExifMnoteData  *d, exif-byte-order_8h.html#de4a9c512c9cd4723485181c5679f1d5ExifByteOrder  o)
00370 {
00371         exif-byte-order_8h.html#de4a9c512c9cd4723485181c5679f1d5ExifByteOrder  o_orig;
00372         struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *n = ( struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *) d;
00373         unsigned int i;
00374 
00375         if (!n) return;
00376 
00377         o_orig = n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order ;
00378         n-> struct__ExifMnoteDataOlympus.html#6c37d1ae36f6780fc212b23ffb642cc7order  = o;
00379         for (i = 0; i < n-> struct__ExifMnoteDataOlympus.html#42233a1a1e56ad8f1c249f400cf116c2count ; i++) {
00380                 n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#69e417d7a6aa6d2b02b667f4c892ff7eorder  = o;
00381                 exif-utils_8c.html#a54ca56c1ccaeb730631f1c1e7ce807aexif_array_set_byte_order  (n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#716be53025dd917b980d9180309c12c1format , n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#5950390b898f6b3c75fb6cea276ee673data ,
00382                                 n-> struct__ExifMnoteDataOlympus.html#bdef486a395dc11f83ba8bd5f26d9520entries [i]. struct__MnoteOlympusEntry.html#3347bf2da36313878aee0bb274778ccacomponents , o_orig, o);
00383         }
00384 }
00385 
00386 static void exif-mnote-data-olympus_8c.html#f8f6b044f1cfad0abf2ff48ffdf0f38c00387  exif-mnote-data-olympus_8c.html#f8f6b044f1cfad0abf2ff48ffdf0f38cexif_mnote_data_olympus_set_offset  ( struct__ExifMnoteData.htmlExifMnoteData  *n, unsigned int o)
00388 {
00389         if (n) (( struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus  *) n)->offset = o;
00390 }
00391 
00392 struct__ExifMnoteData.htmlExifMnoteData  *
exif-mnote-data-olympus_8h.html#0b55e8fba774934093a9b7eecc6b505700393  exif-mnote-data-olympus_8c.html#270bc935e8d8cf13d2dde4007ed76eb3exif_mnote_data_olympus_new  ( struct__ExifMem.htmlExifMem  *mem)
00394 {
00395         struct__ExifMnoteData.htmlExifMnoteData  *d;
00396 
00397         if (!mem) return NULL;
00398         
00399         d = exif-mem_8c.html#28065115ce31c8c9c7701df5b3f4ada5exif_mem_alloc  (mem, sizeof ( struct__ExifMnoteDataOlympus.htmlExifMnoteDataOlympus ));
00400         if (!d) return NULL;
00401 
00402         exif-mnote-data-priv_8h.html#4851f7dbe71b3c0faec2970bcd39e284exif_mnote_data_construct  (d, mem);
00403 
00404         /* Set up function pointers */ 00405         d-> struct__ExifMnoteData.html#8aa4201e4ba43f3b45356ae8d9bb4bc5methods . struct__ExifMnoteDataMethods.html#235b911b5e76cad1172c5551e6edd609free             = exif-mnote-data-olympus_8c.html#9806f05e7096f2d7cf1735814b12cd06exif_mnote_data_olympus_free ;
00406         d-> struct__ExifMnoteData.html#8aa4201e4ba43f3b45356ae8d9bb4bc5methods . struct__ExifMnoteDataMethods.html#d841cedf65defa767e26d59479dbe59bset_byte_order   = exif-mnote-data-olympus_8c.html#c2a587922b9698b0e0b2cb620d5de4daexif_mnote_data_olympus_set_byte_order ;
00407         d-> struct__ExifMnoteData.html#8aa4201e4ba43f3b45356ae8d9bb4bc5methods . struct__ExifMnoteDataMethods.html#23a49245e91ceeb7b8693da10544e84eset_offset       = exif-mnote-data-olympus_8c.html#f8f6b044f1cfad0abf2ff48ffdf0f38cexif_mnote_data_olympus_set_offset ;
00408         d-> struct__ExifMnoteData.html#8aa4201e4ba43f3b45356ae8d9bb4bc5methods . struct__ExifMnoteDataMethods.html#70dd60ad580375fe7533eaea4bf36386load             = exif-mnote-data-olympus_8c.html#9347ff77b87fb9ddf2cb16f0930e395dexif_mnote_data_olympus_load ;
00409         d-> struct__ExifMnoteData.html#8aa4201e4ba43f3b45356ae8d9bb4bc5methods . struct__ExifMnoteDataMethods.html#bd9b0c209efcccfd92be7b3f16f1ff2dsave             = exif-mnote-data-olympus_8c.html#7c5e6ca3785538559fa854287f48e917exif_mnote_data_olympus_save ;
00410         d-> struct__ExifMnoteData.html#8aa4201e4ba43f3b45356ae8d9bb4bc5methods . struct__ExifMnoteDataMethods.html#8c5c9588e9360c9d98362e52563cfdcdcount            = exif-mnote-data-olympus_8c.html#72686c6150eab330a73936f694b84870exif_mnote_data_olympus_count ;
00411         d-> struct__ExifMnoteData.html#8aa4201e4ba43f3b45356ae8d9bb4bc5methods . struct__ExifMnoteDataMethods.html#6f13f4a3b196ae98e0c8e52011e25f1eget_id           = exif-mnote-data-olympus_8c.html#531142757945da218c1cc48ec70add8aexif_mnote_data_olympus_get_id ;
00412         d-> struct__ExifMnoteData.html#8aa4201e4ba43f3b45356ae8d9bb4bc5methods . struct__ExifMnoteDataMethods.html#d5578f1f1352a9d4f0d5ebcd15ee6347get_name         = exif-mnote-data-olympus_8c.html#0bfed8dbecac202c3a6f4915c5e8ee0cexif_mnote_data_olympus_get_name ;
00413         d-> struct__ExifMnoteData.html#8aa4201e4ba43f3b45356ae8d9bb4bc5methods . struct__ExifMnoteDataMethods.html#dcec364c97ceb5ebb9620a51aef6bebcget_title        = exif-mnote-data-olympus_8c.html#cabde5b87e0a4dc721ac854cb85b8900exif_mnote_data_olympus_get_title ;
00414         d-> struct__ExifMnoteData.html#8aa4201e4ba43f3b45356ae8d9bb4bc5methods . struct__ExifMnoteDataMethods.html#53535571495924097f7c882cab4eb848get_description  = exif-mnote-data-olympus_8c.html#6a9e70581d6d6d277fd350e72da00778exif_mnote_data_olympus_get_description ;
00415         d-> struct__ExifMnoteData.html#8aa4201e4ba43f3b45356ae8d9bb4bc5methods . struct__ExifMnoteDataMethods.html#68d48f72ec7505897fdd344781af5e6bget_value        = exif-mnote-data-olympus_8c.html#7405ddb800a8bcff869e8023b76b540dexif_mnote_data_olympus_get_value ;
00416 
00417         return d;
00418 }
Generated on Sun Apr 23 01:22:39 2006 for EXIF library (libexif) Internals by 
http://www.doxygen.org/index.htmldoxygen  1.4.6 