137 lines
4.6 KiB
C
Raw Normal View History

/* General includes for Greenleaf Financial MathLib
*
* Include this file with ALL programs using the MathLib.
* Contains error code definitions and numerous globals
*
* Copyright (C) 1986-1990 Greenleaf Software Inc. All rights reserved.
*/
#ifndef GMDOTH
#define GMDOTH
#include <gmsys1.h>
/* including gf.h must come first!!*/
#ifndef GFDOTH
#include <gf.h>
#endif
#define MATHLIB_VERSION 110
#ifndef LINT
#include <gmfncnum.h>
#endif
#define GM_SUCCESS 0
#define GM_FAILURE 1
#define GM_POS 0
#define GM_NEG 0x0001
#define GM_MAXID 18
#define GM_MINID 0
#define GM_DEQ 0 /* case criteria */
#define GM_DGEQ 1 /* arguments for */
#define GM_DLEQ -1 /* list */
#define GM_DLT -2 /* comparsion */
#define GM_DGT 2 /* functions like */
#define GM_DNE 3 /* dcmplst() */
#define GM_INC 1
#define GM_DEC 2
#define GM_N 0 /* next 4 used by SimpleInterest36x */
#define GM_I 1
#define GM_PV 2
#define GM_INTR 3
#define GM_PMT 4 /* next 4 used by compound interest */
#define GM_FV 5
#define GM_BEGIN 1
#define GM_END 2
#define GM_CONTINUOUS -1 /* used by nomtoeff & efftonom */
#define GM_BASE -300
#define GM_NULLPOINTER GM_BASE - 1 /* Null pointer to DEC structure */
#define GM_NULLSTRING GM_BASE - 2 /* Null pointer to string passed */
#define GM_INIT GM_BASE - 3 /* Uninitialized input DEC */
#define GM_OVERFLOW GM_BASE - 4 /* Arithmetic overflow occured */
#define GM_UNDERFLOW GM_BASE - 5 /* Arithmetic underflow occured */
#define GM_NAN GM_BASE - 6 /* Ptr or result is Not A Number */
#define GM_CNVRE GM_BASE - 7 /* Significant digits trunc on conv */
#define GM_CNVRW GM_BASE - 8 /* Insignif digits trunc on conv */
#define GM_DIV0 GM_BASE - 9 /* Attempted divide by zero */
#define GM_PWR0 GM_BASE - 10 /* Attempted raising zero to power */
#define GM_IMAG GM_BASE - 11 /* Imaginary result, eg sqrt(-1) */
#define GM_NOMEMORY GM_BASE - 12 /* when calloc() fails */
#define GM_INVALIDID GM_BASE - 13 /* invalid ID range passed to () */
#define GM_NOTFOUND GM_BASE - 14 /* list criteria not found */
#define GM_ARGVAL GM_BASE - 15 /* Bad Argument value */
#define GM_EOF GM_BASE - 16 /* File read/write problems */
#ifdef _LDATA
#define GM_NULL (DEC *) 0L
#define GM_NULLARR (DEC **) 0L
#else
#define GM_NULL (DEC *) 0
#define GM_NULLARR (DEC **) 0
#endif
#ifndef NULLF
#define NULLF (int (*)()) 0
#endif
#ifndef GFDECL
#include <gfd.h>
#endif
/* these MUST BE IN THIS ORDER */
#include <gmfequs.h>
#include <gmfuncts.h>
extern int wGMError; /* global error variable */
extern void (*pfnGMErrVector)(int, int); /* ptr to error handler */
void GMDefErrHandler(int,int); /* name of error handler */
extern int wGMFunErrNum; /* func number setting wGMError */
/* global storage for internal use */
extern int wGMTemp1; /* temporary global storage */
extern int wGMTemp2;
extern mbool wfGMRound; /* these 3 used for formatted conversions */
extern mbool wfFlagNumber;
extern char cGMSymExp;
extern int wGMStar; /* storage of * arguments for dtoaf */
extern int wGMStar2;
extern char cGMFmt; /* next 6 format string types */
extern char cGMFmtComma;
extern char cGMFmtSci;
extern char cGMFmtSciE;
extern char cGMFmtEng;
extern char cGMFmtEngE;
extern DEC *pGMStatA; /* linear estimation */
extern DEC *pGMStatB;
extern char cGMFmtRnd;
extern char cGMFmtTrunc;
extern char cGMFmtDlr;
extern char cGMFmtNegRgt1;
extern char cGMFmtNegRgt2;
extern char cGMFmtNegPar;
extern char cGMFmtNegBrkt;
extern char cGMFmtZeroBlC;
extern char cGMFmtZeroBlS;
extern char cGMFmtZero;
extern char *sGMFmtZeroStr;
extern char cGMFmtSurrL;
extern char cGMFmtSurrR;
extern char *sGMFmt1Pos;
extern char *sGMFmt1Neg;
extern char *sGMFmt1Zero;
extern char *sGMFmt2Pos;
extern char *sGMFmt2Neg;
extern char *sGMFmt2Zero;
extern mbool wfGM3Color; /* next 4 for 3-Color Interface Output */
extern char cGMCodePos;
extern char cGMCodeNeg;
extern char cGMCodeNon;
extern int wIntrPrec;
extern DEC *pGMIRRGuess;
#define SetMathError(a,b) (*pfnGMErrVector)(a,b)
#endif