synaps/base/Error.h

00001 /*********************************************************************
00002 *      This file is part of the source code of SYNAPS kernel.        *
00003 *   Author(s): B. Mourrain, GALAAD, INRIA                            *
00004 **********************************************************************
00005 History:
00006 $Id: Error.h,v 1.1 2005/07/11 11:23:11 mourrain Exp $
00007 **********************************************************************/
00008 //====================================================================
00009 //  Fichier d'entete contenant quelques fonctions utiles
00010 #ifndef SYNAPS_UTIL_ERROR_H
00011 #define SYNAPS_UTIL_ERROR_H
00012 
00013 
00014 #include <stdio.h>
00015 #include <stdarg.h>
00016 #include <fstream>
00017 #include <synaps/init.h>
00018 
00019 __BEGIN_NAMESPACE_SYNAPS
00020 
00021 // Messages d'erreurs
00022 const char * ERR_SPACE = "\n NOT ENOUGH MEMORY ";
00023 const char * ERR_RANGE =  "\n INDEX OUT OF RANGE ";
00024 const char * ERR_INIT =  "\n INITIALIZATIONS NOT PERFECT ";
00025 const char * ERR_OPEN_FILE =  "\n IMPOSSIBLE TO OPEN FILE ";
00026 const char * ERR_DIM =  "\n Dimension check failure ";
00027 const char * ERR_POSITIVE = "\n Exposant not positive ";
00028 const char * ERR_FUNCTION =  "Function: ";
00029 const char * ERR_CONSTRUCTOR =  "Constructor: ";
00030 const char * ERR_OPERATOR =  "Operator: ";
00031 const char * ERR_METH =  "Method: ";
00032 const char * MFORMAT = "%G" ;
00033 
00034 
00035 // Afficher les messages d'errreur
00036 void Error(char *myformat,...)
00037 {
00038   va_list argPointer;
00039   va_start(argPointer,myformat);
00040   vfprintf(stderr,myformat,argPointer);
00041   va_end(argPointer);
00042   exit(1);
00043 }
00044 
00045 __END_NAMESPACE_SYNAPS
00046 
00047 #endif // SYNAPS_UTIL_ERROR_H

SYNAPS DOCUMENTATION
logo