server/src/kernel/command.h

47 lines
1.4 KiB
C
Raw Normal View History

/*
2010-08-08 10:06:34 +02:00
+-------------------+ Christian Schlittchen <corwin@amber.kn-bremen.de>
| | Enno Rehling <enno@eressea.de>
| Eressea PBEM host | Katja Zedel <katze@felidae.kn-bremen.de>
| (c) 1998 - 2003 | Henning Peters <faroul@beyond.kn-bremen.de>
| | Ingo Wilken <Ingo.Wilken@informatik.uni-oldenburg.de>
+-------------------+ Stefan Reich <reich@halbling.de>
This program may not be used, modified or distributed
2010-08-08 10:06:34 +02:00
without prior permission by the authors of Eressea.
2010-08-08 10:06:34 +02:00
*/
#ifndef H_UTIL_COMMAND_H
#define H_UTIL_COMMAND_H
#ifdef __cplusplus
extern "C" {
#endif
struct locale;
struct order;
struct unit;
struct tnode;
struct command;
2010-08-08 10:06:34 +02:00
typedef struct syntaxtree {
const struct locale *lang;
struct tnode *root;
struct syntaxtree *next;
struct command *cmds;
} syntaxtree;
2010-08-08 10:06:34 +02:00
typedef void(*parser) (const void *nodes, struct unit * u, struct order *);
2016-09-07 15:43:04 +02:00
void add_command(struct tnode **troot,
const char *str, parser fun);
void do_command(const struct tnode *troot, struct unit *u, struct order *);
2010-08-08 10:06:34 +02:00
struct syntaxtree *stree_create(void);
void stree_add(struct syntaxtree *, const char *str, parser fun);
void stree_free(struct syntaxtree *);
void *stree_find(const struct syntaxtree *stree,
const struct locale *lang);
2010-08-08 10:06:34 +02:00
#ifdef __cplusplus
}
#endif
#endif