SpeedCrunch  0.11
/usr/src/RPM/BUILD/speedcrunch-0.11/src/core/errors.h
Go to the documentation of this file.
00001 /* errors.h global list of error codes
00002    Copyright (C) 2007, 2008 Wolf Lammen ookami1 <at> gmx <dot> de
00003 
00004    This program is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU General Public License
00006    as published by the Free Software Foundation; either version 2
00007    of the License, or (at your option) any later version.
00008 
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012    GNU General Public License for more details.
00013 
00014    You should have received a copy of the GNU General Public License
00015    along with this program; see the file COPYING.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017    Boston, MA 02110-1301, USA.
00018  */
00019 
00020 #ifndef _ERRORS_H
00021 #define _ERRORS_H
00022 
00023 #ifdef __cplusplus
00024 extern "C"{
00025 #endif
00026 
00027 typedef enum
00028 {
00029   Success = 0,
00030 
00031 /* a NaN or an empty Variant was submitted as a parameter. Only a few
00032   functions in the math engine accept such a value. All arithmetic functions
00033   fail on such an operand */
00034   NoOperand,
00035 
00036 /* This error is returned if a result is mathematically defined, but
00037   cannot be computed reliably without extending the working precision
00038   considerably and/or requiring considerable computing time */
00039   EvalUnstable,
00040 
00041 /* the result is in absolute value smaller than the smallest non-zero
00042   value the math engine can handle */
00043   Underflow,
00044 
00045 /* the result is in absolute value bigger than the biggest number
00046   the math engine can handle */
00047   Overflow,
00048 
00049 /* operation requests a division by zero, or a function was evaluated
00050   at a pole */
00051   ZeroDivide,
00052 
00053 /* One or more parameters to a function lie outside of the function's
00054   domain */
00055   OutOfDomain,
00056 
00057 /* a number exceeds the logic number range, so logic operations cannot be
00058   applied */
00059   OutOfLogicRange,
00060 
00061 /* a number or a result exceeds the integer range */
00062   OutOfIntegerRange,
00063 
00064 /* This error indicates a failed conversion from an ASCII string.
00065    Functions setting this error may also report a more detailed IO... error
00066    code*/
00067   BadLiteral,
00068 
00069 /* A request to calculate something to more places than is (currently)
00070    acceptable */
00071   InvalidPrecision,
00072 
00073 /* A parameter violates the limitations of the engine, or is completely
00074   meaningless, e.g. the evaluation of a quotient and a remainder in the same variable.
00075   This error indicates a bug, because the calling program should never submit
00076   such a parameter (combinations) */
00077   InvalidParam,
00078 
00079 /* returned when an operation request is mathematically valid, but
00080   would require too much time */
00081   TooExpensive,
00082 
00083 /* For correct conversion of a digit sequence, the IO routines need information
00084   about the radix to use. This error is returned if none was specified.
00085   This error indicates a bug, because a calling routine should always
00086   supply this information */
00087   IONoBase,
00088 
00089 /* This error occurs if you request a two's complement conversion, and either
00090   additionally specify a sign, or gave a non-zero fraction */
00091   IOInvalidComplement,
00092 
00093 /* You must specify at least one digit of the significant */
00094   IONoSignificand,
00095 
00096 /* invalid characters in exponent, e.g. a decimal dot */
00097   IOBadExp,
00098 
00099 /* the exponent exceeds the allowed range */
00100   IOExpOverflow,
00101 
00102 /* internal (string) buffer overflow in a conversion. This indicates a bug
00103   because range checking should be done in advance */
00104   IOBufferOverflow,
00105 
00106 /* request to convert more digits to another base than internal buffers
00107   can hold. This occurs when you try to convert huge values in fixpoint
00108   format */
00109   IOConversionOverflow,
00110 
00111 /* request to convert a tiny number in fixpoint format, so that only
00112   leading zeros are displayed. */
00113   IOConversionUnderflow,
00114 
00115 /* a function was called with the wrong count of parameters
00116   e.g. sin(12;13) (sin takes only 1 parameter) */
00117   InvalidParamCount,
00118 
00119 /* parameter type mismatch */
00120   TypeMismatch,
00121 
00122 /* cannot overwrite an existing key in a table */
00123 //  KeyExists,
00124 
00125 /* could not retrieve a symbol by the submitted key */
00126 //  SymbolNotFound,
00127 
00128 /* no matching close token for an open token */
00129 //  CloseSymbolMissing,
00130 
00131 /* unable to clone a symbol, most probably because it
00132    was of a special type, like a close parenthesis */
00133 //  SymbolCloneError,
00134 
00135 /* unable to perform a requested type cast */
00136 //  BadCast,
00137 
00138 /* used with variants, when an operation is not implemented
00139   for a particular data type.
00140   used with formats to indicate a not implemented property */
00141   NotImplemented,
00142 
00143 /* this value is used internally to indicate the absence of
00144   any error information altogether */
00145   NotAnError,
00146 
00147 } Error;
00148 
00149 #ifdef __cplusplus
00150 }
00151 #endif
00152 
00153 #endif /* _ERRORS_H */