#ifndef _SPLINE_20110124_
#define _SPLINE_20110124_

#define GRAPH_SPLCOEFF_COUNT (30 + 1)

typedef enum _tagSPLINECONDITION
{
    NATURAL,
    CLAMPED,
    NOTaKNOT
}SPLINECONDITION;
 
typedef struct _tagSPLINECOEFFICIENT
{
    double a3;
    double b2;
    double c1;
    double d0;
}SPLINECOEFFICIENT;

typedef struct _tagSPLINEPOINT
{
    SPLINECOEFFICIENT *coe;
    double *xCoordinate;
    double *yCoordinate;
    double f0;
    double fn;
    int num;
    SPLINECONDITION con;
}SPLINEPOINT;

typedef struct _tagSPLINECALCATTRIB
{
	int nStyle;
	int nLoc;
	double dbX;
	double dbY;
}SPLINECALCATTRIB;

int Spline3(SPLINEPOINT *pPoint);

float FAR SearchSplineX(float* pfX, float* pfY, int nCount,
	SPLINECOEFFICIENT *pSplineCoef, SPLINECALCATTRIB* pAttrib,
	float fSearch);
float FAR FindSplineMax(float* pfX, float* pfY, int nCount,
	SPLINECOEFFICIENT *pSplineCoef, SPLINECALCATTRIB* pAttrib);

#endif