metadata.h

00001 /*****************************************************************
00002  * gavl - a general purpose audio/video processing library
00003  *
00004  * Copyright (c) 2001 - 2011 Members of the Gmerlin project
00005  * gmerlin-general@lists.sourceforge.net
00006  * http://gmerlin.sourceforge.net
00007  *
00008  * This program is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation, either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00020  * *****************************************************************/
00021 
00022 #ifndef GAVL_METADATA_H_INCLUDED
00023 #define GAVL_METADATA_H_INCLUDED
00024 
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028 
00029 #include <gavl/gavldefs.h>
00030 
00054 #define GAVL_METADATA_DATE_STRING_LEN 11
00055 
00059 #define GAVL_METADATA_DATE_TIME_STRING_LEN 20 
00060 
00064 typedef struct
00065   {
00066   char * key; 
00067   char * val; 
00068   } gavl_metadata_tag_t;
00069 
00074 typedef struct
00075   {
00076   gavl_metadata_tag_t * tags;  
00077   int tags_alloc;              
00078   int num_tags;                
00079   } gavl_metadata_t;
00080 
00085 GAVL_PUBLIC void
00086 gavl_metadata_free(gavl_metadata_t * m);
00087 
00096 GAVL_PUBLIC void
00097 gavl_metadata_init(gavl_metadata_t * m);
00098 
00107 GAVL_PUBLIC void
00108 gavl_metadata_set(gavl_metadata_t * m,
00109                   const char * key,
00110                   const char * val);
00111 
00121 GAVL_PUBLIC void
00122 gavl_metadata_set_nocpy(gavl_metadata_t * m,
00123                         const char * key,
00124                         char * val);
00125 
00132 GAVL_PUBLIC 
00133 const char * gavl_metadata_get(const gavl_metadata_t * m,
00134                                const char * key);
00135 
00142 GAVL_PUBLIC void
00143 gavl_metadata_set_int(gavl_metadata_t * m,
00144                       const char * key,
00145                       int val);
00146 
00154 GAVL_PUBLIC 
00155 int gavl_metadata_get_int(const gavl_metadata_t * m,
00156                           const char * key, int * ret);
00157 
00166 GAVL_PUBLIC void
00167 gavl_metadata_set_date(gavl_metadata_t * m,
00168                        const char * key,
00169                        int year,
00170                        int month,
00171                        int day);
00172 
00182 GAVL_PUBLIC int
00183 gavl_metadata_get_date(gavl_metadata_t * m,
00184                        const char * key,
00185                        int * year,
00186                        int * month,
00187                        int * day);
00188 
00200 GAVL_PUBLIC void
00201 gavl_metadata_set_date_time(gavl_metadata_t * m,
00202                             const char * key,
00203                             int year,
00204                             int month,
00205                             int day,
00206                             int hour,
00207                             int minute,
00208                             int second);
00209 
00222 GAVL_PUBLIC int
00223 gavl_metadata_get_date_time(gavl_metadata_t * m,
00224                             const char * key,
00225                             int * year,
00226                             int * month,
00227                             int * day,
00228                             int * hour,
00229                             int * minute,
00230                             int * second);
00231 
00242 GAVL_PUBLIC void
00243 gavl_metadata_date_to_string(int year,
00244                              int month,
00245                              int day, char * ret);
00246 
00260 GAVL_PUBLIC void
00261 gavl_metadata_date_time_to_string(int year,
00262                                   int month,
00263                                   int day,
00264                                   int hour,
00265                                   int minute,
00266                                   int second,
00267                                   char * ret);
00268 
00279 GAVL_PUBLIC 
00280 void gavl_metadata_merge(gavl_metadata_t * dst,
00281                          const gavl_metadata_t * src1,
00282                          const gavl_metadata_t * src2);
00283 
00292 GAVL_PUBLIC
00293 void gavl_metadata_merge2(gavl_metadata_t * dst,
00294                           const gavl_metadata_t * src);
00295 
00303 GAVL_PUBLIC void
00304 gavl_metadata_copy(gavl_metadata_t * dst,
00305                    const gavl_metadata_t * src);
00306 
00312 GAVL_PUBLIC void
00313 gavl_metadata_dump(const gavl_metadata_t * m, int indent);
00314 
00321 GAVL_PUBLIC int
00322 gavl_metadata_equal(const gavl_metadata_t * m1,
00323                     const gavl_metadata_t * m2);
00324 
00329 #ifdef __cplusplus
00330 }
00331 #endif
00332 
00333 #endif // GAVL_METADATA_H_INCLUDED
Generated on Fri Jun 8 17:27:53 2012 for gavl by  doxygen 1.6.3