msg.h File Reference
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include "msg_undef.h"
Go to the source code of this file.
Defines |
#define | NPS_MSG |
#define | DIE die=1 ; val=0 |
#define | WRN wrn=1 ; val=0 |
#define | ABT abt=1 ; val=0 |
#define | MSG_(x) nps_msg_##x |
#define | MSG(level_statement, args...) |
#define | ZOD(x) |
#define | DOZ(x) |
Functions |
void MSG_() | die (long code, const char *file, const long line, const char *s,...) |
Define Documentation
#define ABT abt=1 ; val=0 |
#define DIE die=1 ; val=0 |
Value:{ \
char errsert_msg[2048]; \
if (!(x)) MSG(DIE-1,"%s in %s:%d\n", strerror_r(errno,errsert_msg,256),__FILE__,__LINE__); \
}
#define MSG |
( |
level_statement, |
|
|
args... |
|
) |
|
Value:{ \
long die=0,wrn=0,abt=0,val=0; \
level_statement; \
val = (val >= 0 ? val : -val); \
if (die) { nps_msg_die(val,__FILE__,__LINE__, ##args); } \
else if (wrn) { nps_msg_wrn(val,__FILE__,__LINE__, ##args); } \
else if (abt && !val) { nps_msg_die(0, __FILE__, __LINE__,##args); } \
else { \
fprintf(stderr,"ill-formed MSG... %s:%d\n",__FILE__,__LINE__); \
abort(); \
} \
} \
#define MSG_ |
( |
x |
|
) |
nps_msg_##x |
#define WRN wrn=1 ; val=0 |
Value:{ \
char errsert_msg[2048]; \
if ((x)) MSG(DIE-1,"%s in %s:%d\n", strerror_r(errno,errsert_msg,256),__FILE__,__LINE__); \
}
Function Documentation
void MSG_() die |
( |
long |
code, |
|
|
const char * |
file, |
|
|
const long |
line, |
|
|
const char * |
s, |
|
|
|
... | |
|
) |
| | |