static int
ec_node_expr_test_eval_var(void **result, void *userctx,
- const struct ec_parse *var)
+ const struct ec_pnode *var)
{
const struct ec_strvec *vec;
const struct ec_node *node;
(void)userctx;
/* get parsed string vector, it should contain only one str */
- vec = ec_parse_strvec(var);
+ vec = ec_pnode_strvec(var);
if (ec_strvec_len(vec) != 1) {
errno = EINVAL;
return -1;
}
- node = ec_parse_get_node(var);
+ node = ec_pnode_get_node(var);
if (ec_node_int_getval(node, ec_strvec_val(vec, 0), &val) < 0)
return -1;
static int
ec_node_expr_test_eval_pre_op(void **result, void *userctx, void *operand,
- const struct ec_parse *operator)
+ const struct ec_pnode *operator)
{
const struct ec_strvec *vec;
struct my_eval_result *eval = operand;;
(void)userctx;
/* get parsed string vector, it should contain only one str */
- vec = ec_parse_strvec(operator);
+ vec = ec_pnode_strvec(operator);
if (ec_strvec_len(vec) != 1) {
errno = EINVAL;
return -1;
static int
ec_node_expr_test_eval_post_op(void **result, void *userctx, void *operand,
- const struct ec_parse *operator)
+ const struct ec_pnode *operator)
{
const struct ec_strvec *vec;
struct my_eval_result *eval = operand;;
(void)userctx;
/* get parsed string vector, it should contain only one str */
- vec = ec_parse_strvec(operator);
+ vec = ec_pnode_strvec(operator);
if (ec_strvec_len(vec) != 1) {
errno = EINVAL;
return -1;
static int
ec_node_expr_test_eval_bin_op(void **result, void *userctx, void *operand1,
- const struct ec_parse *operator, void *operand2)
+ const struct ec_pnode *operator, void *operand2)
{
const struct ec_strvec *vec;
(void)userctx;
/* get parsed string vector, it should contain only one str */
- vec = ec_parse_strvec(operator);
+ vec = ec_pnode_strvec(operator);
if (ec_strvec_len(vec) != 1) {
errno = EINVAL;
return -1;
static int
ec_node_expr_test_eval_parenthesis(void **result, void *userctx,
- const struct ec_parse *open_paren,
- const struct ec_parse *close_paren,
+ const struct ec_pnode *open_paren,
+ const struct ec_pnode *close_paren,
void *value)
{
(void)userctx;
const struct ec_node *expr_node,
const char *str, int val)
{
- struct ec_parse *p;
+ struct ec_pnode *p;
void *result;
struct my_eval_result *eval;
int ret;
- p = ec_node_parse(lex_node, str);
+ p = ec_parse(lex_node, str);
if (p == NULL)
return -1;
ret = ec_node_expr_eval(&result, expr_node, p, &test_ops, NULL);
- ec_parse_free(p);
+ ec_pnode_free(p);
if (ret < 0)
return -1;