File indexing completed on 2024-05-12 17:22:30

0001 /* errors.h global list of error codes
0002    Copyright (C) 2007, 2008 Wolf Lammen ookami1 <at> gmx <dot> de
0003 
0004    This program is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU General Public License
0006    as published by the Free Software Foundation; either version 2
0007    of the License, or (at your option) any later version.
0008 
0009    This program is distributed in the hope that it will be useful,
0010    but WITHOUT ANY WARRANTY; without even the implied warranty of
0011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0012    GNU General Public License for more details.
0013 
0014    You should have received a copy of the GNU General Public License
0015    along with this program; see the file COPYING.  If not, write to
0016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017    Boston, MA 02110-1301, USA.
0018  */
0019 
0020 #ifndef _ERRORS_H
0021 #define _ERRORS_H
0022 
0023 #ifdef __cplusplus
0024 extern "C"{
0025 #endif
0026 
0027 typedef enum
0028 {
0029   Success = 0,
0030 
0031 /* a NaN or an empty Variant was submitted as a parameter. Only a few
0032   functions in the math engine accept such a value. All arithmetic functions
0033   fail on such an operand */
0034   NoOperand,
0035 
0036 /* This error is returned if a result is mathematically defined, but
0037   cannot be computed reliably without extending the working precision
0038   considerably and/or requiring considerable computing time */
0039   EvalUnstable,
0040 
0041 /* the result is in absolute value smaller than the smallest non-zero
0042   value the math engine can handle */
0043   Underflow,
0044 
0045 /* the result is in absolute value bigger than the biggest number
0046   the math engine can handle */
0047   Overflow,
0048 
0049 /* operation requests a division by zero, or a function was evaluated
0050   at a pole */
0051   ZeroDivide,
0052 
0053 /* One or more parameters to a function lie outside of the function's
0054   domain */
0055   OutOfDomain,
0056 
0057 /* a number exceeds the logic number range, so logic operations cannot be
0058   applied */
0059   OutOfLogicRange,
0060 
0061 /* a number or a result exceeds the integer range */
0062   OutOfIntegerRange,
0063 
0064 /* This error indicates a failed conversion from an ASCII string.
0065    Functions setting this error may also report a more detailed IO... error
0066    code*/
0067   BadLiteral,
0068 
0069 /* A request to calculate something to more places than is (currently)
0070    acceptable */
0071   InvalidPrecision,
0072 
0073 /* A parameter violates the limitations of the engine, or is completely
0074   meaningless, e.g. the evaluation of a quotient and a remainder in the same variable.
0075   This error indicates a bug, because the calling program should never submit
0076   such a parameter (combinations) */
0077   InvalidParam,
0078 
0079 /* returned when an operation request is mathematically valid, but
0080   would require too much time */
0081   TooExpensive,
0082 
0083 /* For correct conversion of a digit sequence, the IO routines need information
0084   about the radix to use. This error is returned if none was specified.
0085   This error indicates a bug, because a calling routine should always
0086   supply this information */
0087   IONoBase,
0088 
0089 /* This error occurs if you request a two's complement conversion, and either
0090   additionally specify a sign, or gave a non-zero fraction */
0091   IOInvalidComplement,
0092 
0093 /* You must specify at least one digit of the significant */
0094   IONoSignificand,
0095 
0096 /* invalid characters in exponent, e.g. a decimal dot */
0097   IOBadExp,
0098 
0099 /* the exponent exceeds the allowed range */
0100   IOExpOverflow,
0101 
0102 /* internal (string) buffer overflow in a conversion. This indicates a bug
0103   because range checking should be done in advance */
0104   IOBufferOverflow,
0105 
0106 /* request to convert more digits to another base than internal buffers
0107   can hold. This occurs when you try to convert huge values in fixpoint
0108   format */
0109   IOConversionOverflow,
0110 
0111 /* request to convert a tiny number in fixpoint format, so that only
0112   leading zeros are displayed. */
0113   IOConversionUnderflow,
0114 
0115 /* a function was called with the wrong count of parameters
0116   e.g. sin(12;13) (sin takes only 1 parameter) */
0117   InvalidParamCount,
0118 
0119 /* parameter type mismatch */
0120   TypeMismatch,
0121 
0122 /* occurs if quantities of different dimensions are compared, added, converted, etc. */
0123   DimensionMismatch,
0124 
0125 /* occurs if a non dimensionless quantity is fed to a function that requires
0126  dimensoinless arguments, or if an invalid unit is specified */
0127   InvalidDimension,
0128 
0129 /* cannot overwrite an existing key in a table */
0130 //  KeyExists,
0131 
0132 /* could not retrieve a symbol by the submitted key */
0133 //  SymbolNotFound,
0134 
0135 /* no matching close token for an open token */
0136 //  CloseSymbolMissing,
0137 
0138 /* unable to clone a symbol, most probably because it
0139    was of a special type, like a close parenthesis */
0140 //  SymbolCloneError,
0141 
0142 /* unable to perform a requested type cast */
0143 //  BadCast,
0144 
0145 /* used with variants, when an operation is not implemented
0146   for a particular data type.
0147   used with formats to indicate a not implemented property */
0148   NotImplemented,
0149 
0150 /* this value is used internally to indicate the absence of
0151   any error information altogether */
0152   NotAnError,
0153 
0154 /*
0155  */
0156 
0157 
0158 } Error;
0159 
0160 #ifdef __cplusplus
0161 }
0162 #endif
0163 
0164 #endif /* _ERRORS_H */