2 * Navit, a modular navigation system.
3 * Copyright (C) 2005-2010 Navit Team
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 #ifndef NAVIT_COMMAND_H
21 #define NAVIT_COMMAND_H
27 struct command_table {
29 int (*func)(void *data, char *cmd, struct attr **in, struct attr ***out);
32 #define command_cast(x) (int (*)(void *, char *, struct attr **, struct attr ***))(x)
42 enum attr_type command_evaluate_to_attr(struct attr *attr, char *expr, int *error, struct attr *ret);
43 void command_evaluate_to_void(struct attr *attr, char *expr, int *error);
44 char *command_evaluate_to_string(struct attr *attr, char *expr, int *error);
45 int command_evaluate_to_int(struct attr *attr, char *expr, int *error);
46 int command_evaluate_to_boolean(struct attr *attr, const char *expr, int *error);
47 void command_evaluate(struct attr *attr, const char *expr);
48 void command_add_table_attr(struct command_table *table, int count, void *data, struct attr *attr);
49 void command_add_table(struct callback_list *cbl, struct command_table *table, int count, void *data);
50 void command_saved_set_cb(struct command_saved *cs, struct callback *cb);
51 int command_saved_get_int(struct command_saved *cs);
52 int command_saved_error(struct command_saved *cs);
53 struct command_saved *command_saved_new(char *command, struct navit *navit, struct callback *cb);
54 void command_saved_destroy(struct command_saved *cs);
55 /* end of prototypes */
60 #endif /* NAVIT_COMMAND_H */