2010-04-16 20:39:56 +00:00
|
|
|
#ifndef _ERR_H_
|
|
|
|
#define _ERR_H_
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2010-11-17 08:29:41 +00:00
|
|
|
#define warnx(...) do { \
|
|
|
|
fprintf (stderr, __VA_ARGS__); \
|
|
|
|
fprintf (stderr, "\n"); \
|
|
|
|
} while (0)
|
|
|
|
|
2010-04-16 20:39:56 +00:00
|
|
|
#define errx(code, ...) do { \
|
|
|
|
fprintf (stderr, __VA_ARGS__); \
|
2010-11-17 08:29:41 +00:00
|
|
|
fprintf (stderr, "\n"); \
|
2010-04-16 20:39:56 +00:00
|
|
|
exit (code); \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#endif /* !_ERR_H_ */
|