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 ExifEntry *exif_entry_new (void);
58 ExifEntry *exif_entry_new_mem (ExifMem *);
60 /*! Increase reference counter for #ExifEntry*
61 * \param[in] entry #ExifEntry
63 void exif_entry_ref (ExifEntry *entry);
65 /*! Decrease reference counter for #ExifEntry*
66 * \param[in] entry #ExifEntry
68 void exif_entry_unref (ExifEntry *entry);
70 /*! Actually free the #ExifEntry*
72 * \deprecated Should not be called directly. Use exif_entry_ref() and
73 * exif_entry_unref() instead.
75 * \param[in] entry EXIF entry
77 void exif_entry_free (ExifEntry *entry);
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
84 void exif_entry_initialize (ExifEntry *e, ExifTag tag);
86 void exif_entry_fix (ExifEntry *entry);
88 /* For your convenience */
90 /*! Return a textual representation of the value of the EXIF entry.
92 * CAUTION: The character set of the returned string may be in
93 * the encoding of the current locale or the native encoding
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
101 const char *exif_entry_get_value (ExifEntry *entry, char *val,
102 unsigned int maxlen);
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
109 void exif_entry_dump (ExifEntry *entry, unsigned int indent);
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
115 #define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_IFD_COUNT)
119 #endif /* __cplusplus */
121 #endif /* __EXIF_ENTRY_H__ */