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
void command_saved_set_cb(struct command_saved *cs, struct callback *cb);
int command_saved_get_int(struct command_saved *cs);
int command_saved_error(struct command_saved *cs);
-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);
void command_saved_destroy(struct command_saved *cs);
/* end of prototypes */
#ifdef __cplusplus