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 {
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;
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;
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