kexpr_evaluate_generic - evaluate an expression and return result using the desired data type
LIBRARY CALL
int kexpr_evaluate_generic(
long id,
char *string,
int type,
kaddr value,
char *error)
INPUT
id - the variable identifier.
string - the string to be evaluated.
type - the data type for the value pointer. Valid data
types are: KBYTE, KUBYTE, KSHORT, KUSHORT, KINT,
KUINT, KLONG, KULONG, KFLOAT, KDOUBLE, KCOMPLEX,
KDCOMPLEX, KSTRING.
OUTPUT
value - if no error occurred then the value of
the expression is stored and True returned.
error - if an error occurred the error message is stored in
the error string array and False returned. The
error string array must be at least a 1024 string
array that is allocated by the calling routine. If
the error string array has not been allocated by the
calling routine (error is passed in as NULL) then the
error message is output with the kerror facility.
RETURN VALUE
TRUE (1) on success, FALSE (0) otherwise
DESCRIPTION
This routine evaluates the input string and returns
a generic value of the expression according to the
desired data type. See the kexpr_evaluate_{data type}
for specific information about evaluation of an expression
for the desired data type.
ADDITIONAL INFORMATION
none
EXAMPLES
none
SIDE EFFECTS
Variable values may be changed by assignment statements.
RESTRICTIONS
none
MODIFICATION
none
FILES
$BOOTSTRAP/objects/library/kexpr/src/routines.c
SEE ALSO
kexpr(3)
COPYRIGHT
Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.