BOOTSTRAP (kexpr) functions


LIBRARY ROUTINE

kexpr_evaluate_ubyte - evaluate unsigned byte/char expression

LIBRARY CALL

int kexpr_evaluate_ubyte(
   long     id,
   char     *string,
   unsigned char *value,
   char     *error)

INPUT

OUTPUT

RETURN VALUE

TRUE (1) on success, FALSE (0) otherwise

DESCRIPTION

This routine performs two functions: it sets unsigned byte variables and evaluates unsigned byte expressions. It will return TRUE (1) on success, FALSE (0) on failure. If the routine fails for some reason, an error message will be passed back in the error string. If the error string is NULL then the error is output using the kerror facility.

The string passed in will indicate which function (variable or expression) kexpr_evaluate_ubyte() is to perform, and the ubyte value returned will reflect this. Let us illustrate with an example. Suppose a string of "i = 10" is passed to kexpr_evaluate_ubyte(). This indicates that the variable i is to be defined and assigned the value of 10; the value returned will be 10. Later, suppose kexpr_evaluate_ubyte() is called again with the same id, with a string of "i*2+5". Now, kexpr_evaluate_ubyte() will evaluate the expression, using the value of i defined by the previous call - [10*2+5]. The value returned in this case would be 25.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

none

FILES

$BOOTSTRAP/include/kexpr/kevaluate.h

SEE ALSO

kexpr(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.