From: Hubert F. <hfi...@us...> - 2006-01-17 03:32:28
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10003/libexif Modified Files: exif-loader.h exif-mem.h Log Message: Some Doxygen documentation Index: exif-loader.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-loader.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -p -d -r1.3 -r1.4 --- exif-loader.h 2 Oct 2004 05:55:26 -0000 1.3 +++ exif-loader.h 17 Jan 2006 03:32:15 -0000 1.4 @@ -1,5 +1,7 @@ -/* exif-loader.h - * +/*! \file exif-loader.h + * \brief Defines the ExifLoader type + */ +/* * Copyright © 2003 Lutz Müller <lu...@us...> * * This library is free software; you can redistribute it and/or @@ -32,20 +34,47 @@ extern "C" { typedef struct _ExifLoader ExifLoader; +/*! Allocate a new ExifLoader + * \returns the allocated ExifLoader + */ ExifLoader *exif_loader_new (void); +/*! Allocate a new ExifLoader using an ExifMem + * \param[in] m the ExifMem + * \returns the allocated ExifLoader + */ ExifLoader *exif_loader_new_mem (ExifMem *); +/*! Increase the refcount of the ExifLoader + * \param[in] l the ExifLoader to increase the refcount of. + */ void exif_loader_ref (ExifLoader *); +/*! Decrease the refcount of the ExifLoader + * \param[in] l the ExifLoader to decrease the refcount of. + * If the refcount reaches 0, the ExifLoader is freeed. + */ void exif_loader_unref (ExifLoader *); +/*! Write a file to the ExifLoader + * \param[in] l the loader + * \param[in] fname the path to the file to read + */ void exif_loader_write_file (ExifLoader *, const char *fname); -/* - * Returns 1 while EXIF data is read (or while there is still - * hope that there will be EXIF data later on), 0 otherwise. +/*! Write a buffer to the ExifLoader + * \param[in] l the loader to write too + * \param[in] b the buffer to read from + * \param[in] s the size of the buffer + * \returns 1 while EXIF data is read (or while there is still hope that there will be EXIF data later on), 0 otherwise. */ -unsigned char exif_loader_write (ExifLoader *, unsigned char *, unsigned int); +unsigned char exif_loader_write (ExifLoader *l, unsigned char *b, unsigned int s); +/*! Reset the ExifLoader + * \param[in] l the loader + */ void exif_loader_reset (ExifLoader *); +/*! Get an ExifData out of an ExifLoader + * \param[in] l the loader + * \returns and allocated ExifData + */ ExifData *exif_loader_get_data (ExifLoader *); void exif_loader_log (ExifLoader *, ExifLog *); Index: exif-mem.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-mem.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -p -d -r1.3 -r1.4 --- exif-mem.h 4 Oct 2004 06:32:36 -0000 1.3 +++ exif-mem.h 17 Jan 2006 03:32:15 -0000 1.4 @@ -1,3 +1,7 @@ +/*! \file exif-mem.h + * \brief Define the ExifMem data type and the associated functions. + * ExifMem defined the memory management functions used my the ExifLoader. + */ /* exif-mem.h * * Copyright © 2003 Lutz Müller <lu...@us...> @@ -27,24 +31,49 @@ extern "C" { #endif /* __cplusplus */ -/* Should work like calloc: Needs to return initialized memory. */ -typedef void * (* ExifMemAllocFunc) (ExifLong); +/*! Should work like calloc() + * \param[in] s the size of the block to allocate. + * \returns the allocated memory and initialized. + */ +typedef void * (* ExifMemAllocFunc) (ExifLong s); -typedef void * (* ExifMemReallocFunc) (void *, ExifLong); -typedef void (* ExifMemFreeFunc) (void *); +/*! Should work like realloc() + * \param[in] p the pointer to reallocate + * \param[in] s the size of the reallocated block + * \returns allocated memory + */ +typedef void * (* ExifMemReallocFunc) (void *p, ExifLong s); +/*! Free method for ExifMem + * \param[in] p the pointer to free + * \returns the freed pointer + */ +typedef void (* ExifMemFreeFunc) (void *p); +/*! ExifMem define a memory allocator */ typedef struct _ExifMem ExifMem; -ExifMem *exif_mem_new (ExifMemAllocFunc, ExifMemReallocFunc, - ExifMemFreeFunc); +/*! Create a new ExifMem + * \param[in] a the allocator function + * \param[in] r the reallocator function + * \param[in] f the free function + */ +ExifMem *exif_mem_new (ExifMemAllocFunc a, ExifMemReallocFunc r, + ExifMemFreeFunc f); +/*! Refcount an ExifMem + */ void exif_mem_ref (ExifMem *); +/*! Unrefcount an ExifMem + * If the refcount reaches 0, the ExifMem is freed + */ void exif_mem_unref (ExifMem *); -void *exif_mem_alloc (ExifMem *, ExifLong); -void *exif_mem_realloc (ExifMem *, void *, ExifLong); -void exif_mem_free (ExifMem *, void *); +void *exif_mem_alloc (ExifMem *m, ExifLong s); +void *exif_mem_realloc (ExifMem *m, void *p, ExifLong s); +void exif_mem_free (ExifMem *m, void *p); -/* For your convenience */ +/*! The default ExifMem for your convenience + * \returns return the default ExifMem + */ ExifMem *exif_mem_new_default (void); #ifdef __cplusplus |