diff options
Diffstat (limited to 'filters/kword/pdf/xpdf/xpdf/Error.cpp')
-rw-r--r-- | filters/kword/pdf/xpdf/xpdf/Error.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/filters/kword/pdf/xpdf/xpdf/Error.cpp b/filters/kword/pdf/xpdf/xpdf/Error.cpp new file mode 100644 index 000000000..e7312a006 --- /dev/null +++ b/filters/kword/pdf/xpdf/xpdf/Error.cpp @@ -0,0 +1,38 @@ +//======================================================================== +// +// Error.cpp +// +// Copyright 1996-2002 Glyph & Cog, LLC +// +//======================================================================== + +#include <aconf.h> + +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + +#include <stdio.h> +#include <stddef.h> +#include <stdarg.h> +#include "GlobalParams.h" +#include "Error.h" + +void CDECL error(int pos, const 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); +} |