ZEDA  1.6.18
Macros
error and warning messages

Macros

#define eprintf(fmt, ...)   fprintf( stderr, fmt, ##__VA_ARGS__ )
 formatted output to stderr. More...
 
#define zEchoOn()   ( __zeda_echo = true )
 
#define zEchoOff()   ( __zeda_echo = false )
 
#define ZRUNERROR(msg, ...)   ZECHO( "run-time error: " msg, ##__VA_ARGS__ )
 
#define ZRUNWARN(msg, ...)   ZECHO( "warning: " msg, ##__VA_ARGS__ )
 
#define ZECHO(msg, ...)   ( __zeda_echo ? eprintf( msg " (%s).\n", ##__VA_ARGS__, __FUNCTION__ ) : 0 )
 
#define ZOPENERROR(m)   ZRUNERROR( "cannot open file: %s", (m) )
 
#define ZALLOCERROR()   ZRUNERROR( "cannot allocate memory" )
 

Detailed Description

Macro Definition Documentation

◆ eprintf

#define eprintf (   fmt,
  ... 
)    fprintf( stderr, fmt, ##__VA_ARGS__ )

formatted output to stderr.

eprintf() outputs a string formated by fmt to stderr (the standard error). The output format conforms to the printf() family specification.

◆ zEchoOn

#define zEchoOn ( )    ( __zeda_echo = true )

make echo on.

◆ zEchoOff

#define zEchoOff ( )    ( __zeda_echo = false )

make echo off.

◆ ZRUNERROR

#define ZRUNERROR (   msg,
  ... 
)    ZECHO( "run-time error: " msg, ##__VA_ARGS__ )

output a run-time error message.

◆ ZRUNWARN

#define ZRUNWARN (   msg,
  ... 
)    ZECHO( "warning: " msg, ##__VA_ARGS__ )

output a run-time warning message.

◆ ZECHO

#define ZECHO (   msg,
  ... 
)    ( __zeda_echo ? eprintf( msg " (%s).\n", ##__VA_ARGS__, __FUNCTION__ ) : 0 )

output a run-time echo.

◆ ZOPENERROR

#define ZOPENERROR (   m)    ZRUNERROR( "cannot open file: %s", (m) )

output an error message when failing to open file m.

◆ ZALLOCERROR

#define ZALLOCERROR ( )    ZRUNERROR( "cannot allocate memory" )

output an error message whan failing to allocate memory.