X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=pdf%2Fxpdf%2FError.cc;h=c03f75f4835f862b24f32026eb68eb706e6e7fc1;hb=refs%2Ftags%2FGNOME_2_8_ANCHOR;hp=0dc8150591d7afca559d4ea4bd66fbc3b5b03e07;hpb=50e9d31c05e9ca11ad43cc570556094782c1b956;p=evince.git diff --git a/pdf/xpdf/Error.cc b/pdf/xpdf/Error.cc index 0dc81505..c03f75f4 100644 --- a/pdf/xpdf/Error.cc +++ b/pdf/xpdf/Error.cc @@ -2,53 +2,37 @@ // // Error.cc // -// Copyright 1996 Derek B. Noonburg +// Copyright 1996-2003 Glyph & Cog, LLC // //======================================================================== -#ifdef __GNUC__ +#include + +#ifdef USE_GCC_PRAGMAS #pragma implementation #endif #include #include #include -#include "gtypes.h" -#include "Params.h" +#include "GlobalParams.h" #include "Error.h" -// Send error messages to /dev/tty instead of stderr. -GBool errorsToTTY = gFalse; - -FILE *errFile; -GBool errQuiet; - -void errorInit() { - if (errQuiet) { - errFile = NULL; - } else { - if (!errorsToTTY || !(errFile = fopen("/dev/tty", "w"))) - 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); }