Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Error.cc

Go to the documentation of this file.
00001 //========================================================================
00002 //
00003 // Error.cc
00004 //
00005 // Copyright 1996-2002 Glyph & Cog, LLC
00006 //
00007 //========================================================================
00008 
00009 #ifdef __GNUC__
00010 #pragma implementation
00011 #endif
00012 
00013 #include <aconf.h>
00014 #include <stdio.h>
00015 #include <stddef.h>
00016 #include <stdarg.h>
00017 #include "GlobalParams.h"
00018 #include "Error.h"
00019 
00020 void CDECL error(int pos, char *msg, ...) {
00021   va_list args;
00022 
00023   // NB: this can be called before the globalParams object is created
00024   if (globalParams && globalParams->getErrQuiet()) {
00025     return;
00026   }
00027   if (pos >= 0) {
00028     fprintf(stderr, "Error (%d): ", pos);
00029   } else {
00030     fprintf(stderr, "Error: ");
00031   }
00032   va_start(args, msg);
00033   vfprintf(stderr, msg, args);
00034   va_end(args);
00035   fprintf(stderr, "\n");
00036   fflush(stderr);
00037 }

Generated on Sat Nov 5 16:18:13 2005 for OPIE by  doxygen 1.4.2