summaryrefslogtreecommitdiff
path: root/navit/command.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2012-06-16 18:28:55 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2012-06-16 18:28:55 +0000
commit6c94a2686b7ce42481a51559ce674d2efadf6de5 (patch)
tree2d4947a7fe1face42ceb4981f56ffb01e215ab8b /navit/command.c
parent0c3156ef854dc6674c8bb0042ab89be3f838ec96 (diff)
downloadnavit-6c94a2686b7ce42481a51559ce674d2efadf6de5.tar.gz
Add:Core:Make asynchonicity for saved commands optional
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5142 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/command.c')
-rw-r--r--navit/command.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/navit/command.c b/navit/command.c
index 1523b6f16..84fb1f271 100644
--- a/navit/command.c
+++ b/navit/command.c
@@ -65,6 +65,7 @@ struct command_saved {
struct command_saved_cb *cbs; // List of callbacks for this saved command
struct callback *cb; // Callback that should be called when we re-evaluate
int error;
+ int async;
};
enum error {
@@ -1016,6 +1017,10 @@ command_saved_evaluate_idle (struct command_saved *cs)
static void
command_saved_evaluate(struct command_saved *cs)
{
+ if (!cs->async) {
+ command_saved_evaluate_idle(cs);
+ return;
+ }
if (cs->idle_ev) {
// We're already scheduled for reevaluation
return;
@@ -1127,8 +1132,8 @@ command_register_callbacks(struct command_saved *cs)
return 1;
}
-struct command_saved
-*command_saved_new(char *command, struct navit *navit, struct callback *cb)
+struct command_saved *
+command_saved_new(char *command, struct navit *navit, struct callback *cb, int async)
{
struct command_saved *ret;
@@ -1138,6 +1143,7 @@ struct command_saved
ret->navit.type = attr_navit;
ret->cb = cb;
ret->error = not_ready;
+ ret->async = async;
if (!command_register_callbacks(ret)) {
// We try this as an idle call again