diff options
author | Martin Kretzschmar <mkretzschmar@src.gnome.org> | 2002-09-18 22:20:42 (GMT) |
---|---|---|
committer | Martin Kretzschmar <mkretzschmar@src.gnome.org> | 2002-09-18 22:20:42 (GMT) |
commit | 2a393c134fe3fe8eb85bf818cb7ad6ae4396322a (patch) | |
tree | eba8b0dcaba42d799ed8313faee15fb74a5a0cd2 /pdf/xpdf/Error.cc | |
parent | 7aac8dc8533347e21311b15186e0af82f1b22fd6 (diff) |
Synched with Xpdf 1.01
Diffstat (limited to 'pdf/xpdf/Error.cc')
-rw-r--r-- | pdf/xpdf/Error.cc | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/pdf/xpdf/Error.cc b/pdf/xpdf/Error.cc index 485a7cb..3eae5c9 100644 --- a/pdf/xpdf/Error.cc +++ b/pdf/xpdf/Error.cc @@ -2,7 +2,7 @@ // // Error.cc // -// Copyright 1996 Derek B. Noonburg +// Copyright 1996-2002 Glyph & Cog, LLC // //======================================================================== @@ -10,41 +10,28 @@ #pragma implementation #endif +#include <aconf.h> #include <stdio.h> #include <stddef.h> #include <stdarg.h> -#include "gtypes.h" -#include "Params.h" +#include "GlobalParams.h" #include "Error.h" -FILE *errFile; -GBool errQuiet; - -void errorInit() { - if (errQuiet) { - errFile = NULL; - } else { - errFile = stderr; - } -} - void CDECL error(int pos, char *msg, ...) { va_list args; - if (errQuiet) { + // NB: this can be called before the globalParams object is created + if (globalParams && globalParams->getErrQuiet()) { return; } - if (printCommands) { - fflush(stdout); - } if (pos >= 0) { - fprintf(errFile, "Error (%d): ", pos); + fprintf(stderr, "Error (%d): ", pos); } else { - fprintf(errFile, "Error: "); + fprintf(stderr, "Error: "); } va_start(args, msg); - vfprintf(errFile, msg, args); + vfprintf(stderr, msg, args); va_end(args); - fprintf(errFile, "\n"); - fflush(errFile); + fprintf(stderr, "\n"); + fflush(stderr); } |