expr_plugin.c
/* iVal will extract the integer value from the node */
iVal will extract the integer value from the node
iVal will extract the integer value from the node
int iVal(nodeType *v)
{
	int result = 0;
    switch(v->type) {
        case typeCon:       result = v->node.con.value;
							break;
        case typeStr:       result = atoi(v->node.str.value);
							break;
        case typeId:        if ( strcmp(v->node.sym.name, "random") == 0)
                                result = random();
                            else
                                result = get_integer_value(variables, v->node.sym.name);
							break;
		case typeOpr:
							fprintf(stderr, "an operator cannot be used where a value is required\n"); 
							break;
	}
	freeNode(v);
	return result;
}
int iVal ( nodeType * v ) { int result = 0 ; switch ( v -> type ) { case typeCon : result = v -> node . con . value ; break ; case typeStr : result = atoi ( v -> node . str . value ) ; break ; case typeId : if ( strcmp ( v -> node . sym . name , " " ) == 0 ) result = random ( ) ; else result = get_integer_value ( variables , v -> node . sym . name ) ; break ; case typeOpr : fprintf ( stderr , " \n " ) ; break ; } freeNode ( v ) ; return result ; }
iVal will extract the integer value from the node
iVal will extract the integer value from the node