1
//========================================================================
5
// Copyright 1996-2003 Glyph & Cog, LLC
7
//========================================================================
9
//========================================================================
11
// Modified under the Poppler project - http://poppler.freedesktop.org
13
// All changes made under the Poppler project to this file are licensed
14
// under GPL version 2 or later
16
// Copyright (C) 2005, 2007 Jeff Muizelaar <jeff@infidigm.net>
17
// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org>
18
// Copyright (C) 2007 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
20
// To see a description of the changes please see the Changelog file that
21
// came with your tarball or type make ChangeLog if you are building from git
23
//========================================================================
27
#ifdef USE_GCC_PRAGMAS
28
#pragma implementation
34
#include "GlobalParams.h"
37
static void defaultErrorFunction(int pos, char *msg, va_list args)
40
fprintf(stderr, "Error (%d): ", pos);
42
fprintf(stderr, "Error: ");
44
vfprintf(stderr, msg, args);
45
fprintf(stderr, "\n");
49
static void (*errorFunction)(int, char *, va_list args) = defaultErrorFunction;
51
void setErrorFunction(void (* f)(int, char *, va_list args))
56
void CDECL error(int pos, char *msg, ...) {
58
// NB: this can be called before the globalParams object is created
59
if (globalParams && globalParams->getErrQuiet()) {
63
(*errorFunction)(pos, msg, args);
67
void warning(char *msg, ...) {