X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=pdf%2Fxpdf%2FError.cc;h=3eae5c9c117d72df5d55e5b10c072b15e6cd8e25;hb=refs%2Ftags%2FGPDF_FOR_GNOME_1_4;hp=485a7cb479c06027fb74730df2f89fffcfe75e0e;hpb=7aac8dc8533347e21311b15186e0af82f1b22fd6;p=evince.git diff --git a/pdf/xpdf/Error.cc b/pdf/xpdf/Error.cc index 485a7cb4..3eae5c9c 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 #include #include #include -#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); }