Diffstat (limited to 'noncore/unsupported/qpdf/xpdf/Error.cc') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/qpdf/xpdf/Error.cc | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/noncore/unsupported/qpdf/xpdf/Error.cc b/noncore/unsupported/qpdf/xpdf/Error.cc new file mode 100644 index 0000000..8763846 --- a/dev/null +++ b/noncore/unsupported/qpdf/xpdf/Error.cc @@ -0,0 +1,37 @@ +//======================================================================== +// +// Error.cc +// +// Copyright 1996 Derek B. Noonburg +// +//======================================================================== + +#ifdef __GNUC__ +#pragma implementation +#endif + +#include <aconf.h> +#include <stdio.h> +#include <stddef.h> +#include <stdarg.h> +#include "GlobalParams.h" +#include "Error.h" + +void CDECL error(int pos, char *msg, ...) { + va_list args; + + // NB: this can be called before the globalParams object is created + if (globalParams && globalParams->getErrQuiet()) { + return; + } + if (pos >= 0) { + fprintf(stderr, "Error (%d): ", pos); + } else { + fprintf(stderr, "Error: "); + } + va_start(args, msg); + vfprintf(stderr, msg, args); + va_end(args); + fprintf(stderr, "\n"); + fflush(stderr); +} |