~ubuntu-branches/ubuntu/precise/ipe/precise

« back to all changes in this revision

Viewing changes to src/xpdflib/error.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2005-02-24 22:09:16 UTC
  • mfrom: (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050224220916-9vxiiqjz066r5489
Tags: 6.0pre23-2
debian/control: Ipe should depend on exact version of libipe.
Closes: #296771.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//========================================================================
2
 
//
3
 
// Error.cc
4
 
//
5
 
// Copyright 1996-2002 Glyph & Cog, LLC
6
 
//
7
 
//========================================================================
8
 
 
9
 
#include "aconf.h"
10
 
 
11
 
#ifdef USE_GCC_PRAGMAS
12
 
#pragma implementation
13
 
#endif
14
 
 
15
 
#include <stdio.h>
16
 
#include "ocfile.h"
17
 
#include <stddef.h>
18
 
#include <stdarg.h>
19
 
#include "globalparams.h"
20
 
#include "error.h"
21
 
 
22
 
void CDECL error(int pos, char *msg, ...) {
23
 
  va_list args;
24
 
 
25
 
  // NB: this can be called before the globalParams object is created
26
 
  if (globalParams && globalParams->getErrQuiet()) {
27
 
    return;
28
 
  }
29
 
  if (pos >= 0) {
30
 
    fprintf(stderr, "Error (%d): ", pos);
31
 
  } else {
32
 
    fprintf(stderr, "Error: ");
33
 
  }
34
 
  va_start(args, msg);
35
 
  vfprintf(stderr, msg, args);
36
 
  va_end(args);
37
 
  fprintf(stderr, "\n");
38
 
  fflush(stderr);
39
 
}