Eval
Syntax | |||||||||||
int Eval(char *sum,double *ptr,int (*dvar)(char *ptr,double *val,void *data),void *vdata,int (*dfun)(char *ptr,int argnum,double *argptr,double *val,void *data),void *fdata); | |||||||||||
Header | |||||||||||
general/reval.h | |||||||||||
Library | |||||||||||
reval | |||||||||||
Description | |||||||||||
The The zero terminated string pointed to by the argument sum contains the expression to evaluate. The result is stored at the location pointed to by the argument result. The argument dvar is a pointer to a function of the form:
This function returns the value of each operand in the expression. The zero terminated string pointed to by str contains the operand. If the operand is a simple numeric value, the function should evaluate it and store the value at the location pointed to by val. If the operand is a variable name the function should set val to the value of this variable. The vdata argument of the eval function is passed directly as the data argument of the If the operand is successfully evaluated the function should return zero, otherwise a non-zero value should be returned. The argument dfun is a pointer to a function of the form:
This function evaluates a function call within an expression. The zero terminated string pointed to by str contains the name of the function. The argument argnum gives the number of arguments passed to the function, and the argument argptr contains an array of pointers to the actual arguments. The function should be evaluated and the value returned stored at the location pointed to by val. The fdata argument of the eval function is passed directly as the data argument of the dfun function. If the function is successfully evaluated then zero should be returned, otherwise a non-zero value should be returned. | |||||||||||
Returns | |||||||||||
Returns zero on success. On error, a non-zero value indicating the error is returned. | |||||||||||
Errors | |||||||||||
On error, a non-zero value indicating the error is returned:
| |||||||||||
Example | |||||||||||
|