debug.h File Reference
`#include <stdio.h>`
`#include <gwenhywfar/gwenhywfarapi.h>`
`#include <gwenhywfar/logger.h>`
`#include <gwenhywfar/error.h>`
`#include <gwenhywfar/types.h>`

Go to the source code of this file.

## Macros

#define | DBG_DEBUG(dbg_logger, format, ...)
#define | DBG_DEBUG_ERR(dbg_logger, dbg_err)
#define | DBG_ENTER
#define | DBG_ERROR(dbg_logger, format, ...)
#define | DBG_ERROR_ERR(dbg_logger, dbg_err)
#define | DBG_INFO(dbg_logger, format, ...)
#define | DBG_INFO_ERR(dbg_logger, dbg_err)
#define | DBG_LEAVE
#define | DBG_MEM_DEC(o)
#define | DBG_MEM_INC(o, attach)
#define | DBG_NOTICE(dbg_logger, format, ...)
#define | DBG_NOTICE_ERR(dbg_logger, dbg_err)
#define | DBG_VERBOUS(dbg_logger, format, ...)
#define | DBG_VERBOUS_ERR(dbg_logger, dbg_err)
#define | DBG_WARN(dbg_logger, format, ...)
#define | DBG_WARN_ERR(dbg_logger, dbg_err)
#define | GWEN_MEMORY_DEBUG_MODE_ALL 0
#define | GWEN_MEMORY_DEBUG_MODE_DETAILED 2
#define | GWEN_MEMORY_DEBUG_MODE_OPEN 1
#define | GWEN_MEMORY_DEBUG_MODE_SHORT 3

## Typedefs

typedef struct GWEN_MEMORY_DEBUG_OBJECT | GWEN_MEMORY_DEBUG_OBJECT

## Functions

GWENHYWFAR_API uint32_t | GWEN_Debug_Snprintf (char *buffer, uint32_t size, const char *fmt,...)
GWENHYWFAR_API void | GWEN_MemoryDebug_CleanUp (void)
GWENHYWFAR_API void | GWEN_MemoryDebug_Decrement (const char *name, const char *wFile, int wLine)
GWENHYWFAR_API void | GWEN_MemoryDebug_Dump (uint32_t mode)
GWENHYWFAR_API void | GWEN_MemoryDebug_DumpObject (const char *name, uint32_t mode)
GWENHYWFAR_API long int | GWEN_MemoryDebug_GetObjectCount (const char *name)
GWENHYWFAR_API void | GWEN_MemoryDebug_Increment (const char *name, const char *wFile, int wLine, int attach)

## Macro Definition Documentation

## DBG_DEBUG

#define DBG_DEBUG | ( |  | dbg_logger,
|  |  | format,
|  |  | ... )

Value:
if (GWEN_Logger_GetLevel(dbg_logger)>=GWEN_LoggerLevel_Debug) {\
char dbg_buffer[300]; \
\
if (snprintf(dbg_buffer, sizeof(dbg_buffer)-1, __FILE__":%5d: " format , __LINE__ , ## __VA_ARGS__)>0) { \
dbg_buffer[sizeof(dbg_buffer)-1]=0; \
GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Debug, dbg_buffer);\
}\
};
GWEN_Logger_GetLevel
GWENHYWFAR_API int GWEN_Logger_GetLevel(const char *logDomain)
GWEN_LoggerLevel_Debug
@ GWEN_LoggerLevel_Debug
Definition logger.h:69

Definition at line 214 of file debug.h.

## DBG_DEBUG_ERR

#define DBG_DEBUG_ERR | ( |  | dbg_logger,
|  |  | dbg_err )

Value:
if (GWEN_Logger_GetLevel(dbg_logger)>=GWEN_LoggerLevel_Debug) {\
char dbg_buffer[300]; \
char dbg_errbuff[256]; \
\
GWEN_Error_ToString(dbg_err,dbg_errbuff, sizeof(dbg_errbuff)); \
if (snprintf(dbg_buffer, sizeof(dbg_buffer)-1, __FILE__":%5d: %s" , __LINE__ , dbg_errbuff)>0) { \
dbg_buffer[sizeof(dbg_buffer)-1]=0; \
GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Debug, dbg_buffer);\
}\
};

Definition at line 235 of file debug.h.

## DBG_ENTER

#define DBG_ENTER

Definition at line 46 of file debug.h.

## DBG_ERROR

#define DBG_ERROR | ( |  | dbg_logger,
|  |  | format,
|  |  | ... )

Value:
{\
if (GWEN_Logger_GetLevel(dbg_logger)>=GWEN_LoggerLevel_Error) {\
char dbg_buffer[300]; \
\
if (snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\
__FILE__":%5d: " format , __LINE__ , ## __VA_ARGS__)>0) { \
dbg_buffer[sizeof(dbg_buffer)-1]=(char)0; \
GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Error, dbg_buffer);\
}\
}\
};
GWEN_LoggerLevel_Error
@ GWEN_LoggerLevel_Error
Definition logger.h:65

Definition at line 97 of file debug.h.

## DBG_ERROR_ERR

#define DBG_ERROR_ERR | ( |  | dbg_logger,
|  |  | dbg_err )

Value:
{\
char dbg_buffer[300]; \
char dbg_errbuff[256]; \
\
GWEN_Error_ToString(dbg_err,dbg_errbuff, sizeof(dbg_errbuff)); \
if (snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\
__FILE__":%5d: %s" , __LINE__ , dbg_errbuff)>0) { \
dbg_buffer[sizeof(dbg_buffer)-1]=0; \
GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Error, dbg_buffer);}; \
};

Definition at line 113 of file debug.h.

## DBG_INFO

#define DBG_INFO | ( |  | dbg_logger,
|  |  | format,
|  |  | ... )

Value:
if (GWEN_Logger_GetLevel(dbg_logger)>=GWEN_LoggerLevel_Info) {\
char dbg_buffer[300]; \
\
if (snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\
__FILE__":%5d: " format , __LINE__ , ## __VA_ARGS__)>0) { \
dbg_buffer[sizeof(dbg_buffer)-1]=(char)0; \
GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Info, dbg_buffer);\
}\
};
GWEN_LoggerLevel_Info
@ GWEN_LoggerLevel_Info
Definition logger.h:68

Definition at line 181 of file debug.h.

## DBG_INFO_ERR

#define DBG_INFO_ERR | ( |  | dbg_logger,
|  |  | dbg_err )

Value:
if (GWEN_Logger_GetLevel(dbg_logger)>=GWEN_LoggerLevel_Info) {\
char dbg_buffer[300]; \
char dbg_errbuff[256]; \
\
GWEN_Error_ToString(dbg_err,dbg_errbuff, sizeof(dbg_errbuff)); \
if (snprintf(dbg_buffer, sizeof(dbg_buffer)-1, __FILE__":%5d: %s" , __LINE__ , dbg_errbuff)>0) { \
dbg_buffer[sizeof(dbg_buffer)-1]=0; \
GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Info, dbg_buffer);\
}\
};

Definition at line 196 of file debug.h.

## DBG_LEAVE

#define DBG_LEAVE

Definition at line 47 of file debug.h.

## DBG_MEM_DEC

#define DBG_MEM_DEC | ( |  | o | ) |

Definition at line 88 of file debug.h.

## DBG_MEM_INC

#define DBG_MEM_INC | ( |  | o,
|  |  | attach )

Definition at line 87 of file debug.h.

## DBG_NOTICE

#define DBG_NOTICE | ( |  | dbg_logger,
|  |  | format,
|  |  | ... )

Value:
if (GWEN_Logger_GetLevel(dbg_logger)>=GWEN_LoggerLevel_Notice) {\
char dbg_buffer[300]; \
\
if (snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\
__FILE__":%5d: " format , __LINE__ , ## __VA_ARGS__)>0) { \
dbg_buffer[sizeof(dbg_buffer)-1]=(char)0; \
GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Notice, dbg_buffer);\
}\
};
GWEN_LoggerLevel_Notice
@ GWEN_LoggerLevel_Notice
Definition logger.h:67

Definition at line 152 of file debug.h.

## DBG_NOTICE_ERR

#define DBG_NOTICE_ERR | ( |  | dbg_logger,
|  |  | dbg_err )

Value:
if (GWEN_Logger_GetLevel(dbg_logger)>=GWEN_LoggerLevel_Notice) {\
char dbg_buffer[300]; \
char dbg_errbuff[256]; \
\
GWEN_Error_ToString(dbg_err,dbg_errbuff, sizeof(dbg_errbuff)); \
if (snprintf(dbg_buffer, sizeof(dbg_buffer)-1, __FILE__":%5d: %s" , __LINE__ , dbg_errbuff)>0) {\
dbg_buffer[sizeof(dbg_buffer)-1]=0; \
GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Notice, dbg_buffer);\
} \
};

Definition at line 167 of file debug.h.

## DBG_VERBOUS

#define DBG_VERBOUS | ( |  | dbg_logger,
|  |  | format,
|  |  | ... )

Value:
if (GWEN_Logger_GetLevel(dbg_logger)>=GWEN_LoggerLevel_Verbous) {\
char dbg_buffer[300]; \
\
if (snprintf(dbg_buffer, sizeof(dbg_buffer)-1, __FILE__":%5d: " format , __LINE__ , ## __VA_ARGS__)>0) { \
dbg_buffer[sizeof(dbg_buffer)-1]=0; \
GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Verbous, dbg_buffer);\
}\
};
GWEN_LoggerLevel_Verbous
@ GWEN_LoggerLevel_Verbous
Definition logger.h:70

Definition at line 224 of file debug.h.

## DBG_VERBOUS_ERR

#define DBG_VERBOUS_ERR | ( |  | dbg_logger,
|  |  | dbg_err )

Value:
if (GWEN_Logger_GetLevel(dbg_logger)>=GWEN_LoggerLevel_Verbous) {\
char dbg_buffer[300]; \
char dbg_errbuff[256]; \
\
GWEN_Error_ToString(dbg_err,dbg_errbuff, sizeof(dbg_errbuff)); \
if (snprintf(dbg_buffer, sizeof(dbg_buffer)-1, __FILE__":%5d: %s" , __LINE__ , dbg_errbuff)>0) {\
dbg_buffer[sizeof(dbg_buffer)-1]=0; \
GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Verbous, dbg_buffer);\
}\
};

Definition at line 247 of file debug.h.

## DBG_WARN

#define DBG_WARN | ( |  | dbg_logger,
|  |  | format,
|  |  | ... )

Value:
{\
if (GWEN_Logger_GetLevel(dbg_logger)>=GWEN_LoggerLevel_Warning) {\
char dbg_buffer[300]; \
\
if (snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\
__FILE__":%5d: " format , __LINE__ , ## __VA_ARGS__)>0) { \
dbg_buffer[sizeof(dbg_buffer)-1]=(char)0; \
GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Warning, dbg_buffer);\
}\
}\
};
GWEN_LoggerLevel_Warning
@ GWEN_LoggerLevel_Warning
Definition logger.h:66

Definition at line 125 of file debug.h.

## DBG_WARN_ERR

#define DBG_WARN_ERR | ( |  | dbg_logger,
|  |  | dbg_err )

Value:
{\
char dbg_buffer[300]; \
char dbg_errbuff[256]; \
GWEN_Error_ToString(dbg_err,dbg_errbuff, sizeof(dbg_errbuff)); \
if (snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\
__FILE__":%5d: %s" , __LINE__ , dbg_errbuff)>0) { \
dbg_buffer[sizeof(dbg_buffer)-1]=0; \
GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Warning, dbg_buffer);}; \
};

Definition at line 141 of file debug.h.

## GWEN_MEMORY_DEBUG_MODE_ALL

#define GWEN_MEMORY_DEBUG_MODE_ALL 0

Definition at line 50 of file debug.h.

## GWEN_MEMORY_DEBUG_MODE_DETAILED

#define GWEN_MEMORY_DEBUG_MODE_DETAILED 2

Definition at line 52 of file debug.h.

## GWEN_MEMORY_DEBUG_MODE_OPEN

#define GWEN_MEMORY_DEBUG_MODE_OPEN 1

Definition at line 51 of file debug.h.

## GWEN_MEMORY_DEBUG_MODE_SHORT

#define GWEN_MEMORY_DEBUG_MODE_SHORT 3

Definition at line 53 of file debug.h.

## Typedef Documentation

## GWEN_MEMORY_DEBUG_OBJECT

typedef struct GWEN_MEMORY_DEBUG_OBJECT GWEN_MEMORY_DEBUG_OBJECT

Definition at line 55 of file debug.h.

## Function Documentation

## GWEN_Debug_Snprintf()

GWENHYWFAR_API uint32_t GWEN_Debug_Snprintf | ( | char * | buffer,
|  | uint32_t | size,
|  | const char * | fmt,
|  |  | ... )

References fmt.

## GWEN_MemoryDebug_CleanUp()

GWENHYWFAR_API void GWEN_MemoryDebug_CleanUp | ( | void |  | ) |

## GWEN_MemoryDebug_Decrement()

GWENHYWFAR_API void GWEN_MemoryDebug_Decrement | ( | const char * | name,
|  | const char * | wFile,
|  | int | wLine )

References GWENHYWFAR_API.

## GWEN_MemoryDebug_Dump()

GWENHYWFAR_API void GWEN_MemoryDebug_Dump | ( | uint32_t | mode | ) |

References GWENHYWFAR_API.

## GWEN_MemoryDebug_DumpObject()

GWENHYWFAR_API void GWEN_MemoryDebug_DumpObject | ( | const char * | name,
|  | uint32_t | mode )

References GWENHYWFAR_API.

## GWEN_MemoryDebug_GetObjectCount()

GWENHYWFAR_API long int GWEN_MemoryDebug_GetObjectCount | ( | const char * | name | ) |

References GWENHYWFAR_API.

## GWEN_MemoryDebug_Increment()

GWENHYWFAR_API void GWEN_MemoryDebug_Increment | ( | const char * | name,
|  | const char * | wFile,
|  | int | wLine,
|  | int | attach )

References GWENHYWFAR_API.