diff options
Diffstat (limited to 'bikewedge/software/RetoolingForOpenSprints/serproxy-0.1.3.src/error.c')
| -rw-r--r-- | bikewedge/software/RetoolingForOpenSprints/serproxy-0.1.3.src/error.c | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/bikewedge/software/RetoolingForOpenSprints/serproxy-0.1.3.src/error.c b/bikewedge/software/RetoolingForOpenSprints/serproxy-0.1.3.src/error.c new file mode 100644 index 0000000..8850a31 --- /dev/null +++ b/bikewedge/software/RetoolingForOpenSprints/serproxy-0.1.3.src/error.c @@ -0,0 +1,68 @@ +/* + * error.c + * + * error message routines + * + * (C)1999 Stefano Busti + * + */ + +#include "error.h" + +void error(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + va_end(ap); +} + +void errend(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + va_end(ap); + + exit(-1); +} + +void perror2(const char *fmt, ...) +{ + char buf[BUFSIZ]; + va_list ap; + + va_start(ap, fmt); + vsprintf(buf, fmt, ap); + va_end(ap); + + perror(buf); +} + +void perrend(const char *fmt, ...) +{ + char buf[BUFSIZ]; + va_list ap; + + va_start(ap, fmt); + vsprintf(buf, fmt, ap); + va_end(ap); + + perror(buf); + + exit(-1); +} + +void dbg_msg(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + va_end(ap); +} |
