{
struct result res;
struct context ctx;
- dbg(0,"command=%s attr.type=%s\n", expr, attr_to_name(attr->type));
memset(&res, 0, sizeof(res));
memset(&ctx, 0, sizeof(ctx));
ctx.attr=attr;
resolve(&ctx, &res, NULL);
}
+void
+command_evaluate(struct attr *attr, char *expr)
+{
+ struct result res;
+ struct context ctx;
+ memset(&res, 0, sizeof(res));
+ memset(&ctx, 0, sizeof(ctx));
+ ctx.attr=attr;
+ ctx.error=0;
+ ctx.expr=expr;
+ for (;;) {
+ eval_comma(&ctx,&res);
+ if (ctx.error)
+ return;
+ resolve(&ctx, &res, NULL);
+ if (ctx.error)
+ return;
+ if (!get_op(&ctx,0,";",NULL)) return;
+ }
+}
+
#if 0
void
command_interpreter(struct attr *attr)
#define command_cast(x) (int (*)(void *, char *, struct attr **, struct attr ***))(x)
void command_evaluate_to_void(struct attr *attr, char *expr);
+void command_evaluate(struct attr *attr, char *expr);
void command_add_table(struct callback_list *cbl, struct command_table *table, int count, void *data);