libmobi
C library for handling MOBI format ebook documents
Functions
debug.c File Reference

Debugging functions, enable by running configure –enable-debug. More...

#include <stdlib.h>
#include "debug.h"
#include "index.h"

Functions

void debug_free (void *ptr, const char *file, const int line)
 Debugging wrapper for free(void *ptr) More...
 
void * debug_malloc (const size_t size, const char *file, const int line)
 Debugging wrapper for malloc(size_t size) More...
 
void * debug_realloc (void *ptr, const size_t size, const char *file, const int line)
 Debugging wrapper for realloc(void* ptr, size_t size) More...
 
void * debug_calloc (const size_t num, const size_t size, const char *file, const int line)
 Debugging wrapper for calloc(size_t num, size_t size) More...
 
void print_indx (const MOBIIndx *indx)
 Dump index values. More...
 
void print_indx_infl_old (const MOBIIndx *indx)
 Dump inflections index (old version) More...
 
void print_indx_orth_old (const MOBIIndx *indx)
 Dump orthographic index (old version) More...
 

Detailed Description

Debugging functions, enable by running configure –enable-debug.

Copyright (c) 2014 Bartek Fabiszewski http://www.fabiszewski.net

This file is part of libmobi. Licensed under LGPL, either version 3, or any later. See http://www.gnu.org/licenses/

Function Documentation

◆ debug_calloc()

void* debug_calloc ( const size_t  num,
const size_t  size,
const char *  file,
const int  line 
)

Debugging wrapper for calloc(size_t num, size_t size)

Parameters
[in]numNumber of elements to allocate
[in]sizeSize of each element
[in]fileCalling file
[in]lineCalling line
Returns
A pointer to the allocated memory block on success, NULL on failure

◆ debug_free()

void debug_free ( void *  ptr,
const char *  file,
const int  line 
)

Debugging wrapper for free(void *ptr)

Parameters
[in]ptrPointer
[in]fileCalling file
[in]lineCalling line

◆ debug_malloc()

void* debug_malloc ( const size_t  size,
const char *  file,
const int  line 
)

Debugging wrapper for malloc(size_t size)

Parameters
[in]sizeSize of memory
[in]fileCalling file
[in]lineCalling line
Returns
A pointer to the allocated memory block on success, NULL on failure

◆ debug_realloc()

void* debug_realloc ( void *  ptr,
const size_t  size,
const char *  file,
const int  line 
)

Debugging wrapper for realloc(void* ptr, size_t size)

Parameters
[in]ptrPointer
[in]sizeSize of memory
[in]fileCalling file
[in]lineCalling line
Returns
A pointer to the reallocated memory block on success, NULL on failure

◆ print_indx()

void print_indx ( const MOBIIndx indx)

Dump index values.

Parameters
[in]indxParsed index

◆ print_indx_infl_old()

void print_indx_infl_old ( const MOBIIndx indx)

Dump inflections index (old version)

Parameters
[in]indxParsed index

◆ print_indx_orth_old()

void print_indx_orth_old ( const MOBIIndx indx)

Dump orthographic index (old version)

Parameters
[in]indxParsed index