#ifndef DPUSER2C_UTILS_H
#define DPUSER2C_UTILS_H

#include "dpuserType.h"
#include <list>

typedef enum {none, funcID, procID} funcorproc_ID; 

void purify_typeCon(conValue &c);

 typedef struct {
 	int nargs;
 	dpString name;
	funcorproc_ID id;
   dpString displaySyntax;
} FuncProcInfo;

extern std::list<FuncProcInfo> funcProcOrder;

extern int indexBase;

void checkProcArgs(dpString name);
void checkProcArgs(dpString name, dpuserType &arg0);
void checkProcArgs(dpString name, dpuserType &arg0, dpuserType &arg1);
void checkProcArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2);
void checkProcArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3);
void checkProcArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3, dpuserType &arg4);
void checkProcArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3, dpuserType &arg4, dpuserType &arg5);
void checkProcArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3, dpuserType &arg4, dpuserType &arg5, dpuserType &arg6);
void checkProcArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3, dpuserType &arg4, dpuserType &arg5, dpuserType &arg6, dpuserType &arg7);
void checkProcArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3, dpuserType &arg4, dpuserType &arg5, dpuserType &arg6, dpuserType &arg7, dpuserType &arg8);
void checkProcArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3, dpuserType &arg4, dpuserType &arg5, dpuserType &arg6, dpuserType &arg7, dpuserType &arg8, dpuserType &arg9);
void checkProcArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3, dpuserType &arg4, dpuserType &arg5, dpuserType &arg6, dpuserType &arg7, dpuserType &arg8, dpuserType &arg9, dpuserType &arg10);
void checkProcArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3, dpuserType &arg4, dpuserType &arg5, dpuserType &arg6, dpuserType &arg7, dpuserType &arg8, dpuserType &arg9, dpuserType &arg10, dpuserType &arg11);
void checkProcArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3, dpuserType &arg4, dpuserType &arg5, dpuserType &arg6, dpuserType &arg7, dpuserType &arg8, dpuserType &arg9, dpuserType &arg10, dpuserType &arg11, dpuserType &arg12);
void checkProcArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3, dpuserType &arg4, dpuserType &arg5, dpuserType &arg6, dpuserType &arg7, dpuserType &arg8, dpuserType &arg9, dpuserType &arg10, dpuserType &arg11, dpuserType &arg12, dpuserType &arg13);

/////////////////////////////////////////////////////////////////////
// static class containing utilites for the use of dpuser2c
/////////////////////////////////////////////////////////////////////

class Dpuser2cUtils 
{
public:
	// These classes call eachself recursively, always with a parameter less. In the base function (checkFuncArgs(dpString name)) the number
	// associated to the passed function-name is found
	static void checkFuncArgs(dpString name);
	static void checkFuncArgs(dpString name, dpuserType &arg0);
	static void checkFuncArgs(dpString name, dpuserType &arg0, dpuserType &arg1);
	static void checkFuncArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2);
	static void checkFuncArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3);
	static void checkFuncArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3, dpuserType &arg4);
	static void checkFuncArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3, dpuserType &arg4, dpuserType &arg5);
	static void checkFuncArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3, dpuserType &arg4, dpuserType &arg5, dpuserType &arg6);
	static void checkFuncArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3, dpuserType &arg4, dpuserType &arg5, dpuserType &arg6, dpuserType &arg7);
	static void checkFuncArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3, dpuserType &arg4, dpuserType &arg5, dpuserType &arg6, dpuserType &arg7, dpuserType &arg8);
	static void checkFuncArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3, dpuserType &arg4, dpuserType &arg5, dpuserType &arg6, dpuserType &arg7, dpuserType &arg8, dpuserType &arg9);
	static void checkFuncArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3, dpuserType &arg4, dpuserType &arg5, dpuserType &arg6, dpuserType &arg7, dpuserType &arg8, dpuserType &arg9, dpuserType &arg10);
	static void checkFuncArgs(dpString name, dpuserType &arg0, dpuserType &arg1, dpuserType &arg2, dpuserType &arg3, dpuserType &arg4, dpuserType &arg5, dpuserType &arg6, dpuserType &arg7, dpuserType &arg8, dpuserType &arg9, dpuserType &arg10, dpuserType &arg11);
private:
	// Member holding temporarily (during the recursion of checkFuncArgs-functions) the number associated to the passed function-name
	static int whichFunc;
};

#endif /* DPUSER2C_UTILS_H */
