summaryrefslogtreecommitdiff
path: root/navit/command.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-02-05 10:25:29 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-02-05 10:25:29 +0000
commit98476c56c4e5a52a25a84f87300ebe4b6f4f19fd (patch)
tree1004eabe19eb93d717614a83d82e6cd7cbd35b95 /navit/command.c
parent0212568687689ea362c3f89baad80b81c90f1d8b (diff)
downloadnavit-98476c56c4e5a52a25a84f87300ebe4b6f4f19fd.tar.gz
Add:Core:Added support for evaluating semicolon separated commands
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@2011 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/command.c')
-rw-r--r--navit/command.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/navit/command.c b/navit/command.c
index bdaf4eeb1..2a84998c8 100644
--- a/navit/command.c
+++ b/navit/command.c
@@ -626,7 +626,6 @@ command_evaluate_to_void(struct attr *attr, char *expr)
{
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;
@@ -636,6 +635,27 @@ command_evaluate_to_void(struct attr *attr, char *expr)
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)