exif-mem.h File Reference

#include <libexif/exif-utils.h>

Go to the source code of this file.

Typedefs

typedef void *(* ExifMemAllocFunc )(ExifLong s)
 Should work like calloc().
typedef void *(* ExifMemReallocFunc )(void *p, ExifLong s)
 Should work like realloc().
typedef void(* ExifMemFreeFunc )(void *p)
 Free method for ExifMem.
typedef struct _ExifMem ExifMem
 ExifMem define a memory allocator.

Functions

ExifMemexif_mem_new (ExifMemAllocFunc a, ExifMemReallocFunc r, ExifMemFreeFunc f)
 Create a new ExifMem.
void exif_mem_ref (ExifMem *)
 Refcount an ExifMem.
void exif_mem_unref (ExifMem *)
 Unrefcount an ExifMem.
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)
ExifMemexif_mem_new_default (void)
 Create a new ExifMem with default values for your convenience.


Detailed Description

Define the ExifMem data type and the associated functions. ExifMem defines the memory management functions used within libexif.

Definition in file exif-mem.h.


Typedef Documentation

typedef struct _ExifMem ExifMem

ExifMem define a memory allocator.

Definition at line 57 of file exif-mem.h.

typedef void*(* ExifMemAllocFunc)(ExifLong s)

Should work like calloc().

Parameters:
[in] s the size of the block to allocate.
Returns:
the allocated memory and initialized.

Definition at line 39 of file exif-mem.h.

typedef void(* ExifMemFreeFunc)(void *p)

Free method for ExifMem.

Parameters:
[in] p the pointer to free
Returns:
the freed pointer

Definition at line 54 of file exif-mem.h.

typedef void*(* ExifMemReallocFunc)(void *p, ExifLong s)

Should work like realloc().

Parameters:
[in] p the pointer to reallocate
[in] s the size of the reallocated block
Returns:
allocated memory

Definition at line 47 of file exif-mem.h.


Function Documentation

void* exif_mem_alloc ( ExifMem m,
ExifLong  s 
)

Definition at line 79 of file exif-mem.c.

References _ExifMem::alloc_func, and _ExifMem::realloc_func.

void exif_mem_free ( ExifMem m,
void *  p 
)

Definition at line 69 of file exif-mem.c.

References _ExifMem::free_func.

ExifMem* exif_mem_new ( ExifMemAllocFunc  a,
ExifMemReallocFunc  r,
ExifMemFreeFunc  f 
)

Create a new ExifMem.

Parameters:
[in] a the allocator function
[in] r the reallocator function
[in] f the free function

Definition at line 34 of file exif-mem.c.

References _ExifMem::alloc_func, _ExifMem::free_func, _ExifMem::realloc_func, and _ExifMem::ref_count.

ExifMem* exif_mem_new_default ( void   ) 

Create a new ExifMem with default values for your convenience.

Returns:
return a new default ExifMem

Definition at line 95 of file exif-mem.c.

References exif_mem_alloc_func(), exif_mem_free_func(), exif_mem_new(), and exif_mem_realloc_func().

void* exif_mem_realloc ( ExifMem m,
void *  p,
ExifLong  s 
)

Definition at line 89 of file exif-mem.c.

References _ExifMem::realloc_func.

void exif_mem_ref ( ExifMem  ) 

Refcount an ExifMem.

Definition at line 54 of file exif-mem.c.

References _ExifMem::ref_count.

void exif_mem_unref ( ExifMem  ) 

Unrefcount an ExifMem.

If the refcount reaches 0, the ExifMem is freed

Definition at line 61 of file exif-mem.c.

References exif_mem_free(), and _ExifMem::ref_count.


SourceForge.net Logo Generated by doxygen