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

- Main Page
- Files
- Directories
- Related Pages

- File List
- Globals

# exif-mem.h File Reference

Define the ExifMem data type and the associated functions. ExifMem defines the memory management functions used by the ExifLoader. More...

`#include <libexif/exif-utils.h>`

Go to the source code of this file.

## Typedefs
typedef void *(*) | ExifMemAllocFunc (ExifLong s)
typedef void *(*) | ExifMemReallocFunc (void *p, ExifLong s)
typedef void(*) | ExifMemFreeFunc (void *p)
typedef _ExifMem | ExifMem
## Functions
ExifMem * | exif_mem_new (ExifMemAllocFunc a, ExifMemReallocFunc r, ExifMemFreeFunc f)
void | exif_mem_ref (ExifMem *)
void | exif_mem_unref (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)
ExifMem * | exif_mem_new_default (void)

## Detailed Description

Define the ExifMem data type and the associated functions. ExifMem defines the memory management functions used by the ExifLoader.

## Typedef Documentation

typedef struct _ExifMem ExifMem

ExifMem define a memory allocator

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.

typedef void(* ) ExifMemFreeFunc(void *p)

Free method for ExifMem

Parameters:

  `[in]` | p | the pointer to free

Returns:
  the freed pointer

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

## Function Documentation

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

ExifMem* exif_mem_new_default | ( | void |  | ) |

The default ExifMem for your convenience

Returns:
  return the default ExifMem

void exif_mem_ref | ( | ExifMem * |  | ) |

Refcount an ExifMem

void exif_mem_unref | ( | ExifMem * |  | ) |

Unrefcount an ExifMem If the refcount reaches 0, the ExifMem is freed