EXIF library (libexif) Internals  0.6.24
exif-mem.c File Reference
#include <libexif/exif-mem.h>
#include <stdlib.h>
Include dependency graph for exif-mem.c:

Go to the source code of this file.

Data Structures

struct  _ExifMem
 

Functions

static void * exif_mem_alloc_func (ExifLong ds)
 Default memory allocation function. More...
 
static void * exif_mem_realloc_func (void *d, ExifLong ds)
 Default memory reallocation function. More...
 
static void exif_mem_free_func (void *d)
 Default memory free function. More...
 
ExifMemexif_mem_new (ExifMemAllocFunc alloc_func, ExifMemReallocFunc realloc_func, ExifMemFreeFunc free_func)
 Create a new ExifMem. More...
 
void exif_mem_ref (ExifMem *mem)
 Refcount an ExifMem. More...
 
void exif_mem_unref (ExifMem *mem)
 Unrefcount an ExifMem. More...
 
void exif_mem_free (ExifMem *mem, void *d)
 
void * exif_mem_alloc (ExifMem *mem, ExifLong ds)
 
void * exif_mem_realloc (ExifMem *mem, void *d, ExifLong ds)
 
ExifMemexif_mem_new_default (void)
 Create a new ExifMem with default values for your convenience. More...
 

Function Documentation

◆ exif_mem_alloc()

◆ exif_mem_alloc_func()

static void* exif_mem_alloc_func ( ExifLong  ds)
static

Default memory allocation function.

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

Referenced by exif_mem_new_default().

◆ exif_mem_free()

◆ exif_mem_free_func()

static void exif_mem_free_func ( void *  d)
static

Default memory free function.

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

Referenced by exif_mem_new_default().

◆ 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

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

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

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

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().

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

Here is the call graph for this function:

◆ exif_mem_realloc()

◆ exif_mem_realloc_func()

static void* exif_mem_realloc_func ( void *  d,
ExifLong  ds 
)
static

Default memory reallocation function.

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

Referenced by exif_mem_new_default().

◆ exif_mem_ref()

void exif_mem_ref ( ExifMem mem)

◆ exif_mem_unref()

void exif_mem_unref ( ExifMem mem)

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.

Referenced by exif_content_free(), exif_content_new(), exif_data_free(), exif_data_new(), exif_entry_free(), exif_entry_new(), exif_loader_free(), exif_loader_new(), exif_log_free(), exif_log_new(), exif_mnote_data_free(), and main().

Here is the call graph for this function:

libexif Generated by doxygen