Ion C
C library for Ion
ion_debug.h File Reference
#include "ion_types.h"
#include "ion_platform_config.h"

Go to the source code of this file.

Macros

#define ION_ERROR_MESSAGE_MAX_LENGTH   1024
 
#define DEBUG_ERR(x)   /* nothing */
 
#define DEBUG_ERRMSG(x, m)   /* nothing */
 
#define BREAK   ion_helper_breakpoint() /* nothing */
 
#define ENTER(f, l, c)   /* nothing */
 
#define RETURN(f, l, c, e)   return e
 
#define FN_DEF   /* nothing */
 
#define iENTER   FN_DEF iERR err = IERR_OK
 
#define DONTFAILWITH(x)   { err = x; goto fail; }
 
#define FAILWITH(x)   { BREAK; DEBUG_ERR(x); err = x; goto fail; }
 
#define FAILWITHMSG(x, s)   { BREAK; DEBUG_ERRMSG(x,s); err = x; goto fail; }
 
#define IONCHECK(x)   { err = x; if (err) goto fail; }
 
#define SUCCEED()   { err = IERR_OK; goto fail; }
 
#define iRETURN   fail: RETURN(__location_name__, __line__, __count__++, err)
 
#define UPDATEERROR(x)   { iERR errBackup = (x); if (err == IERR_OK) { err = errBackup; }}
 
#define ION_TIMESTAMP_STRING_LENGTH   55 /* does NOT include null terminator */
 
#define ION_VERSION_MARKER_LENGTH   4
 

Functions

GLOBAL BOOL g_ion_debug_tracing INITTO (FALSE)
 
ION_API_EXPORT BOOL ion_debug_has_tracing (void)
 
ION_API_EXPORT void ion_debug_set_tracing (BOOL state)
 

Macro Definition Documentation

◆ UPDATEERROR

#define UPDATEERROR (   x)    { iERR errBackup = (x); if (err == IERR_OK) { err = errBackup; }}

The purpose of this Macro is enabling executing a list of functions while keeping the first error encountered.

Each function(x) to be executed must have return type of iERR, and need to be enclosed by this Macro.

If error has already happened before, the error code of the current function will be ignored. If there're no previous errors, the return code of the current function will be kept.

Function Documentation

◆ INITTO()

GLOBAL BOOL g_ion_debug_tracing INITTO ( FALSE  )

DEPRECATED - use the accessor functions below.