#ifndef IPLTRANS_H
#define IPLTRANS_H

/*
 * 'type' field in ipl_transform_t
 */
#define IPL_VECTOR_TRANSFORM			1
#define IPL_VECTOR_PAIR_TRANSFORM	   2
#define IPL_MATRIX_TRANSFORM			3
#define IPL_MATRIX_PAIR_TRANSFORM	   4
#define IPL_CARTESIAN_TRANSFORM		 5
#define IPL_CARTESIAN_PAIR_TRANSFORM	6
#define IPL_POLAR_TRANSFORM			 7
#define IPL_POLAR_PAIR_TRANSFORM		8

extern nsl_const_entry_t ipl_builtin_consts[];

/*
 * If the transform exists, stores its index in 'index_ret', optionally
 * stores required number of arguments in 'nargs_ret' and returns true.
 * If the transform don't exists, returns 'false'.
 * Preserves the position of 'lexer'.
 */
vboolean iplFindTransform(u32_t type,char *name,vhandle_t lexer,
	u32_t *index_ret,u32_t *nargs_ret);

vboolean
iplExecuteTransform(u32_t index, /* as returned by iplFindTransform() */
	u32_t left,
	u32_t top, /* ignored for vectors; better to set to 0 */
	u32_t right,
	u32_t bottom, /* ignored for vectors; better to set to 0 */
	vector_p v1, vector_p v2, /* ignored for matrix transforms */
	matrix_p m1, matrix_p m2, /* ignored for vector transforms */
	vec_p args);

void iplListTransformTypes(void);
void iplListBuiltinVariables(void);
void iplListBuiltinConstants(void);

void	iplFreeTransforms(void);

#endif  /* !IPLTRANS_H */
