2 * \brief Handling EXIF entries
5 * Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net>
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.
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.
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.
23 #ifndef __EXIF_ENTRY_H__
24 #define __EXIF_ENTRY_H__
28 #endif /* __cplusplus */
30 /*! Data found in one EXIF tag */
31 typedef struct _ExifEntry ExifEntry;
32 typedef struct _ExifEntryPrivate ExifEntryPrivate;
34 #include <libexif/exif-content.h>
35 #include <libexif/exif-format.h>
36 #include <libexif/exif-mem.h>
42 unsigned long components;
47 /* Content containing this entry */
50 ExifEntryPrivate *priv;
55 /*! Reserve memory for and initialize new #ExifEntry.
56 * \return new allocated #ExifEntry
58 ExifEntry *exif_entry_new (void);
60 ExifEntry *exif_entry_new_mem (ExifMem *);
62 /*! Increase reference counter for #ExifEntry.
64 * \param[in] entry #ExifEntry
66 void exif_entry_ref (ExifEntry *entry);
68 /*! Decrease reference counter for #ExifEntry.
69 * When the reference count drops to zero, free the entry.
71 * \param[in] entry #ExifEntry
73 void exif_entry_unref (ExifEntry *entry);
75 /*! Actually free the #ExifEntry.
77 * \deprecated Should not be called directly. Use #exif_entry_ref and
78 * #exif_entry_unref instead.
80 * \param[in] entry EXIF entry
82 void exif_entry_free (ExifEntry *entry);
84 /*! Initialize an empty #ExifEntry with default data in the correct format
85 * for the given tag. If the entry is already initialized, this function
88 * \param[out] e entry to initialize
89 * \param[in] tag tag number to initialize as
91 void exif_entry_initialize (ExifEntry *e, ExifTag tag);
93 /*! When necessary and possible, fix the type or format of the given
94 * EXIF entry when it is of the wrong type or in an invalid format.
96 * \param[in,out] entry EXIF entry
98 void exif_entry_fix (ExifEntry *entry);
100 /* For your convenience */
102 /*! Return a textual representation of the value of the EXIF entry.
104 * \warning The character set of the returned string may be in
105 * the encoding of the current locale or the native encoding
108 * \param[in] entry EXIF entry
109 * \param[out] val buffer in which to store value
110 * \param[in] maxlen length of the buffer val
111 * \return val pointer
113 const char *exif_entry_get_value (ExifEntry *entry, char *val,
114 unsigned int maxlen);
116 /*! Dump text representation of #ExifEntry to stdout.
117 * This is intended for diagnostic purposes only.
119 * \param[in] entry EXIF tag data
120 * \param[in] indent how many levels deep to indent the data
122 void exif_entry_dump (ExifEntry *entry, unsigned int indent);
124 /*! Returns the IFD number of the given #ExifEntry
126 * \param[in] e an #ExifEntry*
127 * \return #ExifIfd, or #EXIF_IFD_COUNT on error
129 #define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_IFD_COUNT)
133 #endif /* __cplusplus */
135 #endif /* __EXIF_ENTRY_H__ */