GrafX2 2.9.3227
The ultimate 256-color painting program
errors.h File Reference

Functions and macros for tracing and error reporting. More...

#include "gfx2log.h"
+ Include dependency graph for errors.h:
+ This graph shows which files directly or indirectly include this file:

Macros

#define DEBUG(y, z)   GFX2_Log(GFX2_DEBUG, "%s %d %s | %s : %d###\n",__FILE__,__LINE__,__func__,y,(unsigned int)z)
 Prints the source filename, line number, function name, a string and an integer. More...
 
#define DEBUGX(y, z)   GFX2_Log(GFX2_DEBUG, "%s %d %s | %s : %X###\n",__FILE__,__LINE__,__func__,y,(unsigned int)z)
 Same as DEBUG but in hexadecimal. More...
 
#define Error(n)   Error_function(n, __FILE__,__LINE__,__func__)
 Report a run-time error: It will print to standard output some information about the calling function, and then: More...
 

Functions

void Error_function (int error_code, const char *filename, int line_number, const char *function_name)
 Helper function used by the macro Error. More...
 

Detailed Description

Functions and macros for tracing and error reporting.

Macro Definition Documentation

◆ DEBUG

#define DEBUG (   y,
 
)    GFX2_Log(GFX2_DEBUG, "%s %d %s | %s : %d###\n",__FILE__,__LINE__,__func__,y,(unsigned int)z)

Prints the source filename, line number, function name, a string and an integer.

◆ DEBUGX

#define DEBUGX (   y,
 
)    GFX2_Log(GFX2_DEBUG, "%s %d %s | %s : %X###\n",__FILE__,__LINE__,__func__,y,(unsigned int)z)

Same as DEBUG but in hexadecimal.

◆ Error

#define Error (   n)    Error_function(n, __FILE__,__LINE__,__func__)

Report a run-time error: It will print to standard output some information about the calling function, and then:

  • If the error code is 0, just do a red screen flash and resume.
  • If the error code is non-zero, abort the program.

Function Documentation

◆ Error_function()