BOOTSTRAP (kexpr) functions


LIBRARY ROUTINE

kexpr_eval - evaluate an expression

LIBRARY CALL

KexprResult *kexpr_eval(
   long        id,
   char        *string,
   KexprResult *result,
   char        *error)

INPUT

OUTPUT

RETURN VALUE

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

DESCRIPTION

This routine evaluates an input expression and stores the resulting value in a KexprResult structure. Currently, the result can be one of two types, KSTRING or KDOUBLE. The result type is stored in result->type. The result value is stored in result->string_value or result->double_value.

ADDITIONAL INFORMATION

none

EXAMPLES

res = kexpr_eval(KEXPR_GLOBAL_ID, "x = 25", NULL, NULL);

res = kexpr_eval(KEXPR_GLOBAL_ID, "ln(x)", res, myerror);

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.