/****************************************************************************
	Kalkulon - A programmable calculator for programmers

	This file is part of the Kalkulon core.
	
	If you find this source code useful, your are encouraged to use it in your own projects.
	Please give me credit!

	COPYRIGHT by Juergen Holetzeck 2003 - 2008
	e-mail:		contact@kalkulon.de
	homepage:	www.kalkulon.de
****************************************************************************/



/*************** DON'T MODIFY THIS FILE !!! *************************/
/*************** DON'T MODIFY THIS FILE !!! *************************/
/*************** DON'T MODIFY THIS FILE !!! *************************/

/*
	Use this header to build a funcdll for KALKULON
	
	funcdll.dll must export the following functions:
	  __declspec(dllexport) int GetInterfaceVersion() {return FUNCDLLINTERFACEVERSION;};
	  __declspec(dllexport) const fn_list_t* GetFnList();	

	if you want to use user defined error handling also export the following:	
	  __declspec(dllexport) const char* GetErrorMessage();
	  __declspec(dllexport) int GetLastError();
*/

#if !defined(FNLIST__INCLUDED_)
#define FNLIST__INCLUDED_


#define FUNCDLLINTERFACEVERSION 0x0102

//////////////////////////////////////////////////////////////////////
// supported function prototypes
//
// BEWARE: prototype must fit exactly!
//
// defines FP_xxx must have the following values 0xNNAA
// where AA the number of arguments
// the whole number must be unique so NN could be an incrementing index, e. g.

typedef double (* fp_void) (void);
#define FP_VOID 0x0100

typedef double (* fp_double) (double);
#define FP_DOUBLE 0x0101

typedef double (* fp_double_double) (double, double);
#define FP_DOUBLE_DOUBLE 0x0102

typedef double (* fp_double_double_double) (double, double, double);
#define FP_DOUBLE_DOUBLE_DOUBLE 0x0103

typedef double (* fp_double_double_double_double) (double, double, double, double);
#define FP_DOUBLE_DOUBLE_DOUBLE_DOUBLE 0x0104

typedef double (* fp_int) (int);
#define FP_INT 0x0201

typedef double (* fp_int_int) (int, int);
#define FP_INT_INT 0x0202

typedef double (* fp_int_int_int) (int, int, int);
#define FP_INT_INT_INT 0x0203

typedef double (* fp_int_int_int_int) (int, int, int, int);
#define FP_INT_INT_INT_INT 0x0204

typedef double (* fp_double_int) (double, int);
#define FP_DOUBLE_INT 0x0302

typedef double (* fp_int_double) (int, double);
#define FP_INT_DOUBLE 0x0402

//////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////
struct fn_list_item_t
{
	const char *name;
	unsigned int type;
	void *fp;
};


struct fn_list_t
{
	const fn_list_item_t *fn_list_item;
	size_t size;
};
//////////////////////////////////////////////////////////////////////

#endif
