2010-08-08 10:06:34 +02:00
|
|
|
#ifndef H_UTIL_COMMAND_H
|
|
|
|
#define H_UTIL_COMMAND_H
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
struct locale;
|
|
|
|
struct order;
|
|
|
|
struct unit;
|
2016-09-06 22:04:25 +02:00
|
|
|
struct tnode;
|
2016-09-07 17:39:54 +02:00
|
|
|
struct command;
|
2010-08-08 10:06:34 +02:00
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
typedef struct syntaxtree {
|
|
|
|
const struct locale *lang;
|
2016-09-06 22:04:25 +02:00
|
|
|
struct tnode *root;
|
2015-01-30 20:37:14 +01:00
|
|
|
struct syntaxtree *next;
|
2016-09-07 17:39:54 +02:00
|
|
|
struct command *cmds;
|
2015-01-30 20:37:14 +01:00
|
|
|
} syntaxtree;
|
2010-08-08 10:06:34 +02:00
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
typedef void(*parser) (const void *nodes, struct unit * u, struct order *);
|
2016-09-06 22:21:06 +02:00
|
|
|
void do_command(const struct tnode *troot, struct unit *u, struct order *);
|
2010-08-08 10:06:34 +02:00
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
struct syntaxtree *stree_create(void);
|
2016-09-07 17:39:54 +02:00
|
|
|
void stree_add(struct syntaxtree *, const char *str, parser fun);
|
2016-04-08 19:45:27 +02:00
|
|
|
void stree_free(struct syntaxtree *);
|
2015-01-30 20:37:14 +01:00
|
|
|
void *stree_find(const struct syntaxtree *stree,
|
|
|
|
const struct locale *lang);
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|