From: Dan F. <dfa...@us...> - 2008-12-05 07:07:21
|
Update of /cvsroot/libexif/libexif/libexif In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13825/libexif Modified Files: exif-data.h exif-entry.h exif-loader.c exif-loader.h exif-log.h exif-tag.h Log Message: Improved Doxygen documentation. Index: exif-loader.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-loader.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -p -d -r1.33 -r1.34 --- exif-loader.c 25 Nov 2008 09:30:38 -0000 1.33 +++ exif-loader.c 5 Dec 2008 07:07:15 -0000 1.34 @@ -63,11 +63,12 @@ typedef enum { EL_DATA_FORMAT_FUJI_RAW } ExifLoaderDataFormat; +/*! \internal */ struct _ExifLoader { ExifLoaderState state; ExifLoaderDataFormat data_format; - /* Small buffer used for detection of format */ + /*! Small buffer used for detection of format */ unsigned char b[12]; unsigned char b_len; @@ -81,6 +82,7 @@ struct _ExifLoader { ExifMem *mem; }; +/*! Magic number for EXIF header */ static const unsigned char ExifHeader[] = {0x45, 0x78, 0x69, 0x66, 0x00, 0x00}; static void * Index: exif-tag.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-tag.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -p -d -r1.20 -r1.21 --- exif-tag.h 27 Nov 2008 06:54:45 -0000 1.20 +++ exif-tag.h 5 Dec 2008 07:07:15 -0000 1.21 @@ -210,24 +210,25 @@ ExifTag exif_tag_from_name * * \param[in] tag EXIF tag * \param[in] ifd IFD - * \return textual name of the tag + * \return textual name of the tag, or NULL if the tag is unknown */ const char *exif_tag_get_name_in_ifd (ExifTag tag, ExifIfd ifd); /*! Return a textual title of the given tag when found in the given IFD. + * The title is a short, localized description of the tag. * * \param[in] tag EXIF tag * \param[in] ifd IFD - * \return textual title of the tag + * \return textual title of the tag, or NULL if the tag is unknown */ const char *exif_tag_get_title_in_ifd (ExifTag tag, ExifIfd ifd); /*! Return a verbose textual description of the given tag when found in the - * given IFD. + * given IFD. The description is a verbose, localized description of the tag. * * \param[in] tag EXIF tag * \param[in] ifd IFD - * \return textual description of the tag + * \return textual description of the tag, or NULL if the tag is unknown */ const char *exif_tag_get_description_in_ifd (ExifTag tag, ExifIfd ifd); Index: exif-loader.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-loader.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -p -d -r1.10 -r1.11 --- exif-loader.h 27 Nov 2008 06:54:45 -0000 1.10 +++ exif-loader.h 5 Dec 2008 07:07:15 -0000 1.11 @@ -34,20 +34,20 @@ extern "C" { /*! Data used by the loader interface */ typedef struct _ExifLoader ExifLoader; -/*! Allocate a new #ExifLoader +/*! Allocate a new #ExifLoader. * * \return allocated ExifLoader */ ExifLoader *exif_loader_new (void); -/*! Allocate a new #ExifLoader using an #ExifMem +/*! Allocate a new #ExifLoader using the specified memory allocator. * * \param[in] mem the ExifMem * \return allocated ExifLoader */ ExifLoader *exif_loader_new_mem (ExifMem *mem); -/*! Increase the refcount of the #ExifLoader +/*! Increase the refcount of the #ExifLoader. * * \param[in] loader the ExifLoader to increase the refcount of. */ @@ -61,6 +61,7 @@ void exif_loader_ref (ExifLoa void exif_loader_unref (ExifLoader *loader); /*! Load a file into the given #ExifLoader from the filesystem. + * The relevant data is copied in raw form into the #ExifLoader. * * \param[in] loader loader to write to * \param[in] fname path to the file to read @@ -68,6 +69,7 @@ void exif_loader_unref (ExifLoa void exif_loader_write_file (ExifLoader *loader, const char *fname); /*! Load a buffer into the #ExifLoader from a memory buffer. + * The relevant data is copied in raw form into the #ExifLoader. * * \param[in] loader loader to write to * \param[in] buf buffer to read from @@ -77,13 +79,16 @@ void exif_loader_write_file (Exif */ unsigned char exif_loader_write (ExifLoader *loader, unsigned char *buf, unsigned int sz); -/*! Reset the ExifLoader to its newly-initialized state +/*! Free any data previously loaded and reset the #ExifLoader to its + * newly-initialized state. * * \param[in] loader the loader */ void exif_loader_reset (ExifLoader *loader); -/*! Create an ExifData from an ExifLoader +/*! Create an #ExifData from the data in the loader. The loader must + * already contain data from a previous call to #exif_loader_write_file + * or #exif_loader_write. * * \param[in] loader the loader * \return allocated ExifData Index: exif-entry.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-entry.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -p -d -r1.19 -r1.20 --- exif-entry.h 27 Nov 2008 06:54:45 -0000 1.19 +++ exif-entry.h 5 Dec 2008 07:07:15 -0000 1.20 @@ -27,7 +27,11 @@ extern "C" { #endif /* __cplusplus */ -/*! Data found in one EXIF tag */ +/*! Data found in one EXIF tag. + * The #exif_entry_get_value function can provide access to the + * formatted contents, or the struct members can be used directly to + * access the raw contents. + */ typedef struct _ExifEntry ExifEntry; typedef struct _ExifEntryPrivate ExifEntryPrivate; @@ -35,33 +39,61 @@ typedef struct _ExifEntryPrivate ExifEnt #include <libexif/exif-format.h> #include <libexif/exif-mem.h> -/*! */ +/*! Data found in one EXIF tag */ struct _ExifEntry { + /*! EXIF tag for this entry */ ExifTag tag; + + /*! Type of data in this entry */ ExifFormat format; + + /*! Number of elements in the array, if this is an array entry. + * Contains 1 for non-array data types. */ unsigned long components; + /*! Pointer to the raw EXIF data for this entry. It is allocated + * by #exif_entry_initialize and is NULL beforehand. Data contained + * here may be manipulated using the functions in exif-utils.h */ unsigned char *data; + + /*! Number of bytes in the buffer at \c data. This must be no less + * than exif_format_get_size(format)*components */ unsigned int size; - /* Content containing this entry */ + /*! #ExifContent containing this entry. + * \see #exif_entry_get_ifd */ ExifContent *parent; + /*! Internal data to be used by libexif itself */ ExifEntryPrivate *priv; }; /* Lifecycle */ -/*! Reserve memory for and initialize new #ExifEntry. - * \return new allocated #ExifEntry +/*! Reserve memory for and initialize a new #ExifEntry. + * No memory is allocated for the \c data element of the returned #ExifEntry. + * + * \return new allocated #ExifEntry, or NULL on error + * + * \see exif_entry_new_mem, exif_entry_unref */ ExifEntry *exif_entry_new (void); +/*! Reserve memory for and initialize new #ExifEntry using the specified + * memory allocator. + * No memory is allocated for the \c data element of the returned #ExifEntry. + * + * \return new allocated #ExifEntry, or NULL on error + * + * \see exif_entry_new, exif_entry_unref + */ ExifEntry *exif_entry_new_mem (ExifMem *); /*! Increase reference counter for #ExifEntry. * * \param[in] entry #ExifEntry + * + * \see exif_entry_unref */ void exif_entry_ref (ExifEntry *entry); @@ -84,19 +116,30 @@ void exif_entry_free (ExifEntry /*! Initialize an empty #ExifEntry with default data in the correct format * for the given tag. If the entry is already initialized, this function * does nothing. + * This call allocates memory for the \c data element of the given #ExifEntry. + * That memory is freed at the same time as the #ExifEntry. * * \param[out] e entry to initialize * \param[in] tag tag number to initialize as */ void exif_entry_initialize (ExifEntry *e, ExifTag tag); -/*! When necessary and possible, fix the type or format of the given - * EXIF entry when it is of the wrong type or in an invalid format. +/*! Fix the type or format of the given EXIF entry to bring it into spec. + * If the data for this EXIF tag is in of the wrong type or is in an invalid + * format according to the EXIF specification, then it is converted to make it + * valid. This may involve, for example, converting an EXIF_FORMAT_LONG into a + * EXIF_FORMAT_SHORT. If the tag is unknown, its value is untouched. + * + * \note Unfortunately, some conversions are to a type with a more resticted + * range, which could have the side effect that the converted data becomes + * invalid. This is unlikely as the range of each tag in the standard is + * designed to encompass all likely data. * * \param[in,out] entry EXIF entry */ void exif_entry_fix (ExifEntry *entry); + /* For your convenience */ /*! Return a textual representation of the value of the EXIF entry. @@ -121,7 +164,7 @@ const char *exif_entry_get_value (ExifEn */ void exif_entry_dump (ExifEntry *entry, unsigned int indent); -/*! Returns the IFD number of the given #ExifEntry +/*! Return the IFD number of the given #ExifEntry * * \param[in] e an #ExifEntry* * \return #ExifIfd, or #EXIF_IFD_COUNT on error Index: exif-log.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-log.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -p -d -r1.11 -r1.12 --- exif-log.h 27 Nov 2008 06:54:45 -0000 1.11 +++ exif-log.h 5 Dec 2008 07:07:15 -0000 1.12 @@ -78,8 +78,9 @@ typedef void (* ExifLogFunc) (ExifLog *l const char *format, va_list args, void *data); /*! Register log callback function. + * Calls to the log callback function are purely for diagnostic purposes. * - * \param[in] log #ExifLog + * \param[in] log logging state variable * \param[in] func callback function to set * \param[in] data data to pass into callback function */ Index: exif-data.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-data.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -p -d -r1.19 -r1.20 --- exif-data.h 27 Nov 2008 06:54:45 -0000 1.19 +++ exif-data.h 5 Dec 2008 07:07:15 -0000 1.20 @@ -42,6 +42,7 @@ typedef struct _ExifDataPrivate ExifData #include <libexif/exif-mnote-data.h> #include <libexif/exif-mem.h> +/*! \internal */ struct _ExifData { ExifContent *ifd[EXIF_IFD_COUNT]; |