Navit SVN

/work/compile/navit/src/navit/command.h

00001 
00020 #ifndef NAVIT_COMMAND_H
00021 #define NAVIT_COMMAND_H
00022 
00023 #ifdef __cplusplus
00024 extern "C" {
00025 #endif
00026 
00027 struct command_table {
00028         const char *command;
00029         int (*func)(void *data, char *cmd, struct attr **in, struct attr ***out);
00030 };
00031 
00032 #define command_cast(x) (int (*)(void *, char *, struct attr **, struct attr ***))(x)
00033 
00034 /* prototypes */
00035 enum attr_type;
00036 struct attr;
00037 struct callback;
00038 struct callback_list;
00039 struct command_saved;
00040 struct command_table;
00041 struct navit;
00042 enum attr_type command_evaluate_to_attr(struct attr *attr, char *expr, int *error, struct attr *ret);
00043 void command_evaluate_to_void(struct attr *attr, char *expr, int *error);
00044 char *command_evaluate_to_string(struct attr *attr, char *expr, int *error);
00045 int command_evaluate_to_int(struct attr *attr, char *expr, int *error);
00046 int command_evaluate_to_boolean(struct attr *attr, const char *expr, int *error);
00047 void command_evaluate(struct attr *attr, const char *expr);
00048 void command_add_table_attr(struct command_table *table, int count, void *data, struct attr *attr);
00049 void command_add_table(struct callback_list *cbl, struct command_table *table, int count, void *data);
00050 void command_saved_set_cb(struct command_saved *cs, struct callback *cb);
00051 int command_saved_get_int(struct command_saved *cs);
00052 int command_saved_error(struct command_saved *cs);
00053 struct command_saved *command_saved_new(char *command, struct navit *navit, struct callback *cb);
00054 void command_saved_destroy(struct command_saved *cs);
00055 /* end of prototypes */
00056 #ifdef __cplusplus
00057 }
00058 #endif
00059 
00060  #endif /* NAVIT_COMMAND_H */