EXIF library (libexif) API  0.6.24
exif-mem.h File Reference

Define the ExifMem data type and the associated functions. More...

Go to the source code of this file.

Typedefs

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

Functions

ExifMemexif_mem_new (ExifMemAllocFunc a, ExifMemReallocFunc r, ExifMemFreeFunc f)
 Create a new ExifMem. More...
 
void exif_mem_ref (ExifMem *)
 Refcount an ExifMem.
 
void exif_mem_unref (ExifMem *)
 Unrefcount an ExifMem. More...
 
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. More...
 

Detailed Description

Define the ExifMem data type and the associated functions.

ExifMem defines the memory management functions used within libexif.

Typedef Documentation

◆ ExifMemAllocFunc

typedef void*(* ExifMemAllocFunc) (ExifLong s)

Should work like calloc()

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

◆ ExifMemFreeFunc

typedef void(* ExifMemFreeFunc) (void *p)

Free method for ExifMem.

Parameters
[in]pthe pointer to free
Returns
the freed pointer

◆ ExifMemReallocFunc

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

Should work like realloc()

Parameters
[in]pthe pointer to reallocate
[in]sthe size of the reallocated block
Returns
allocated memory

Function Documentation

◆ exif_mem_new()

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

Create a new ExifMem.

Parameters
[in]athe allocator function
[in]rthe reallocator function
[in]fthe free function
Returns
allocated ExifMem, or NULL on error

Referenced by exif_mem_new_default().

◆ exif_mem_new_default()

ExifMem* exif_mem_new_default ( void  )

Create a new ExifMem with default values for your convenience.

Returns
return a new default ExifMem

References exif_mem_new().

Referenced by exif_content_new(), exif_data_new(), exif_entry_new(), exif_loader_new(), and exif_log_new().

◆ exif_mem_unref()

void exif_mem_unref ( ExifMem mem)

Unrefcount an ExifMem.

If the refcount reaches 0, the ExifMem is freed

Referenced by exif_content_new(), exif_data_new(), exif_entry_new(), and exif_loader_new().