summaryrefslogtreecommitdiff
path: root/navit/command.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2010-05-01 10:42:47 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2010-05-01 10:42:47 +0000
commitb5913d62f8eee3f383e6eb0ed2c12b3b0da84d37 (patch)
treef4567cb6f78e80b61eddcef9427ecdad816f7a2a /navit/command.c
parentfe95d3192d59f9b6baeb15011dbfdfcfe0636d5d (diff)
downloadnavit-b5913d62f8eee3f383e6eb0ed2c12b3b0da84d37.tar.gz
Add:Core:Possibility to get attribute type for callback from an expression
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@3214 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/command.c')
-rw-r--r--navit/command.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/navit/command.c b/navit/command.c
index 7767f0ae6..07a03066e 100644
--- a/navit/command.c
+++ b/navit/command.c
@@ -754,6 +754,20 @@ command_evaluate_to(struct attr *attr, const char *expr, struct context *ctx, st
eval_comma(ctx,res);
}
+enum attr_type
+command_evaluate_to_attr(struct attr *attr, char *expr, int *error, struct attr *ret)
+{
+ struct result res;
+ struct context ctx;
+ command_evaluate_to(attr, expr, &ctx, &res);
+ if (ctx.error)
+ return attr_none;
+ resolve_object(&ctx, &res);
+ *ret=res.attr;
+ dbg(0,"type %s\n",attr_to_name(command_attr_type(&res)));
+ return command_attr_type(&res);
+}
+
void
command_evaluate_to_void(struct attr *attr, char *expr, int *error)
{