summaryrefslogtreecommitdiff
path: root/noncore/unsupported/qpdf/xpdf/Error.cc
Unidiff
Diffstat (limited to 'noncore/unsupported/qpdf/xpdf/Error.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/qpdf/xpdf/Error.cc37
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 @@
1//========================================================================
2//
3// Error.cc
4//
5// Copyright 1996 Derek B. Noonburg
6//
7//========================================================================
8
9#ifdef __GNUC__
10#pragma implementation
11#endif
12
13#include <aconf.h>
14#include <stdio.h>
15#include <stddef.h>
16#include <stdarg.h>
17#include "GlobalParams.h"
18#include "Error.h"
19
20void CDECL error(int pos, char *msg, ...) {
21 va_list args;
22
23 // NB: this can be called before the globalParams object is created
24 if (globalParams && globalParams->getErrQuiet()) {
25 return;
26 }
27 if (pos >= 0) {
28 fprintf(stderr, "Error (%d): ", pos);
29 } else {
30 fprintf(stderr, "Error: ");
31 }
32 va_start(args, msg);
33 vfprintf(stderr, msg, args);
34 va_end(args);
35 fprintf(stderr, "\n");
36 fflush(stderr);
37}