2005-04-27 Lutz Mueller <lutz@users.sourceforge.net>
[platform/upstream/libexif.git] / libexif / exif-entry.h
1 /* exif-entry.h
2  *
3  * Copyright © 2001 Lutz Müller <lutz@users.sourceforge.net>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful, 
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details. 
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #ifndef __EXIF_ENTRY_H__
22 #define __EXIF_ENTRY_H__
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif /* __cplusplus */
27
28 typedef struct _ExifEntry        ExifEntry;
29 typedef struct _ExifEntryPrivate ExifEntryPrivate;
30
31 #include <libexif/exif-content.h>
32 #include <libexif/exif-format.h>
33 #include <libexif/exif-mem.h>
34
35 struct _ExifEntry {
36         ExifTag tag;
37         ExifFormat format;
38         unsigned long components;
39
40         unsigned char *data;
41         unsigned int size;
42
43         /* Content containing this entry */
44         ExifContent *parent;
45
46         ExifEntryPrivate *priv;
47 };
48
49 /* Lifecycle */
50 ExifEntry  *exif_entry_new     (void);
51 ExifEntry  *exif_entry_new_mem (ExifMem *);
52 void        exif_entry_ref     (ExifEntry *entry);
53 void        exif_entry_unref   (ExifEntry *entry);
54 void        exif_entry_free  (ExifEntry *entry);
55
56 void        exif_entry_initialize (ExifEntry *entry, ExifTag tag);
57 void        exif_entry_fix        (ExifEntry *entry);
58
59 /* For your convenience */
60 const char *exif_entry_get_value (ExifEntry *entry, char *val,
61                                   unsigned int maxlen);
62
63 void        exif_entry_dump      (ExifEntry *entry, unsigned int indent);
64
65 #define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_IFD_COUNT)
66
67 #ifdef __cplusplus
68 }
69 #endif /* __cplusplus */
70
71 #endif /* __EXIF_ENTRY_H__ */