Added Doxygen comments for the main API entry points and data
[platform/upstream/libexif.git] / libexif / exif-entry.h
1 /*! \file exif-entry.h
2  *  \brief Handling EXIF entries
3  */
4 /*
5  * Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful, 
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details. 
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22
23 #ifndef __EXIF_ENTRY_H__
24 #define __EXIF_ENTRY_H__
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
29
30 /*! Data found in one EXIF tag */
31 typedef struct _ExifEntry        ExifEntry;
32 typedef struct _ExifEntryPrivate ExifEntryPrivate;
33
34 #include <libexif/exif-content.h>
35 #include <libexif/exif-format.h>
36 #include <libexif/exif-mem.h>
37
38 /*! */
39 struct _ExifEntry {
40         ExifTag tag;
41         ExifFormat format;
42         unsigned long components;
43
44         unsigned char *data;
45         unsigned int size;
46
47         /* Content containing this entry */
48         ExifContent *parent;
49
50         ExifEntryPrivate *priv;
51 };
52
53 /* Lifecycle */
54
55 /*! Reserve memory for and initialize new #ExifEntry* */
56 ExifEntry  *exif_entry_new     (void);
57
58 ExifEntry  *exif_entry_new_mem (ExifMem *);
59
60 /*! Increase reference counter for #ExifEntry*
61  * \param[in] entry #ExifEntry
62  */
63 void        exif_entry_ref     (ExifEntry *entry);
64
65 /*! Decrease reference counter for #ExifEntry*
66  * \param[in] entry #ExifEntry
67  */
68 void        exif_entry_unref   (ExifEntry *entry);
69
70 /*! Actually free the #ExifEntry*
71  *
72  * \deprecated Should not be called directly. Use exif_entry_ref() and
73  *             exif_entry_unref() instead.
74  *
75  * \param[in] entry EXIF entry
76  */
77 void        exif_entry_free  (ExifEntry *entry);
78
79 /*! Initialize an empty #ExifEntry with default data for the given tag.
80  * If the entry is already initialized, this function does nothing.
81  * \param[out] e entry to initialize
82  * \param[in] tag tag number to initialize as
83  */
84 void        exif_entry_initialize (ExifEntry *e, ExifTag tag);
85
86 void        exif_entry_fix        (ExifEntry *entry);
87
88 /* For your convenience */
89
90 /*! Return a textual representation of the value of the EXIF entry.
91  *
92  * CAUTION: The character set of the returned string may be in
93  *          the encoding of the current locale or the native encoding
94  *          of the camera.
95  *
96  * \param[in] entry EXIF entry
97  * \param[out] val buffer in which to store value
98  * \param[in] maxlen length of the buffer val
99  * \return val pointer
100  */
101 const char *exif_entry_get_value (ExifEntry *entry, char *val,
102                                   unsigned int maxlen);
103
104 /*! Dump text representation of #ExifEntry to stdout.
105  * This is intended for diagnostic purposes only.
106  * \param[in] entry EXIF tag data
107  * \param[in] indent how many levels deep to indent the data
108  */
109 void        exif_entry_dump      (ExifEntry *entry, unsigned int indent);
110
111 /*! Returns the IFD number of the given #ExifEntry
112  * \param[in] e an #ExifEntry*
113  * \return IFD number, or EXIF_IFD_COUNT on error
114  */
115 #define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_IFD_COUNT)
116
117 #ifdef __cplusplus
118 }
119 #endif /* __cplusplus */
120
121 #endif /* __EXIF_ENTRY_H__ */