gml_Errors.h

Go to the documentation of this file.
00001 /**
00002  * @file gml_Errors.h
00003  *
00004  *    Manages error codes and their corresponding textual description.
00005  *
00006  *  Copyright (c) 1995-2004 CLIPS-IMAG
00007  *
00008  *  See the file "gml_LicenseTerms.txt" for information on usage and redistribution
00009  *  of this file, and for a DISCLAIMER OF ALL WARRANTIES.
00010  *
00011  *  Created on July, 1995 (FB).
00012  */
00013 
00014 #ifndef __GMLERRORS__
00015 #define __GMLERRORS__
00016 
00017 #include "gml/base/gml_Types.h"
00018 
00019 /**
00020  * gml_TError --
00021  *
00022  * The type representing errors in Gml.
00023  */
00024 typedef short gml_TError;
00025 
00026 /*
00027  * Predefined errors.
00028  */
00029 
00030 static const gml_TError gml_cNoError = 0;         /**< no error */
00031 
00032 extern gml_TError   gml_gErrorNotImplemented;     /**< not implemented */
00033 extern gml_TError   gml_gErrorMemFull;            /**< no more memory */
00034 extern gml_TError   gml_gErrorWrongParameterVal;  /**< parameter value not acceptable */
00035 extern gml_TError   gml_gDivideByZero;            /**< divide by zero of singularity */
00036 
00037 extern gml_TError   gml_gErrorFileOpenRead;       /**< could not open file for reading */
00038 extern gml_TError   gml_gErrorFileOpenWrite;      /**< could not open file for writing */
00039 extern gml_TError   gml_gErrorFileRead;           /**< while reading data from file */
00040 extern gml_TError   gml_gErrorFileWrite;          /**< while writing data to file */
00041 
00042 
00043 
00044 /**
00045  * gml_ErrorNew --
00046  *
00047  *  Register a new error message and return its code.
00048  *  @param[in]  message   the error message
00049  */
00050 GML_EXTERN_C
00051 gml_TError          gml_ErrorNew        (char* message);
00052 
00053 
00054 /**
00055  * gml_ErrorGetMessage --
00056  *
00057  *  Return the message corresponding to a given error code.
00058  *  @param[in]  error     the error code
00059  */
00060 GML_EXTERN_C
00061 char*               gml_ErrorGetMessage (gml_TError error);
00062 
00063 
00064 
00065 
00066 /**
00067  * gml_ErrorDispose --
00068  *
00069  *  Releases all error manager resources.
00070  */
00071 GML_EXTERN_C
00072 void                gml_ErrorDispose ();
00073 
00074 
00075 #endif
Generated on Tue Jun 12 14:03:27 2007 for gml by Doxygen 1.5.2.