libmobi
C library for handling MOBI format ebook documents
Macros | Functions
debug.h File Reference
#include "config.h"
#include "mobi.h"

Go to the source code of this file.

Macros

#define MOBI_DEBUG   0
 
#define debug_print(fmt, ...)
 Macro for printing debug info to stderr. Wrapper for fprintf. More...
 

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

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/

Macro Definition Documentation

◆ debug_print

#define debug_print (   fmt,
  ... 
)

Macro for printing debug info to stderr. Wrapper for fprintf.

Parameters
[in]fmtFormat
[in]...Additional arguments

◆ MOBI_DEBUG

#define MOBI_DEBUG   0

Turn on debugging, set this on by running "configure --enable-debug"

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