1999-10-29 09:44:44 +00:00
|
|
|
/*
|
|
|
|
* BIRD Client
|
|
|
|
*
|
2000-01-19 15:07:00 +00:00
|
|
|
* (c) 1999--2000 Martin Mares <mj@ucw.cz>
|
1999-10-29 09:44:44 +00:00
|
|
|
*
|
|
|
|
* Can be freely distributed and used under the terms of the GNU GPL.
|
|
|
|
*/
|
2000-02-15 12:18:37 +00:00
|
|
|
|
2016-04-15 09:41:08 +00:00
|
|
|
#ifndef _BIRD_CLIENT_H_
|
|
|
|
#define _BIRD_CLIENT_H_
|
2000-02-15 12:18:37 +00:00
|
|
|
|
2013-04-23 00:42:35 +00:00
|
|
|
extern int init, busy, interactive;
|
|
|
|
extern int term_lns, term_cls;
|
|
|
|
|
|
|
|
/* birdc.c / birdcl.c */
|
|
|
|
|
2000-02-17 23:37:16 +00:00
|
|
|
void input_start_list(void);
|
|
|
|
void input_stop_list(void);
|
2013-04-23 00:42:35 +00:00
|
|
|
|
|
|
|
void input_init(void);
|
|
|
|
void input_notify(int prompt);
|
|
|
|
void input_read(void);
|
|
|
|
|
|
|
|
void more_begin(void);
|
|
|
|
void more_end(void);
|
|
|
|
|
|
|
|
void cleanup(void);
|
2000-02-17 22:00:13 +00:00
|
|
|
|
|
|
|
/* commands.c */
|
|
|
|
|
|
|
|
void cmd_build_tree(void);
|
|
|
|
void cmd_help(char *cmd, int len);
|
2000-02-17 23:37:16 +00:00
|
|
|
int cmd_complete(char *cmd, int len, char *buf, int again);
|
2000-02-27 22:00:19 +00:00
|
|
|
char *cmd_expand(char *cmd);
|
2013-01-23 16:14:53 +00:00
|
|
|
|
2013-04-23 00:42:35 +00:00
|
|
|
/* client.c */
|
2013-01-23 16:14:53 +00:00
|
|
|
|
2016-04-15 09:41:08 +00:00
|
|
|
/* Client Symbol Flags: Types */
|
|
|
|
#define CLI_SF_CONSTANT (1 << 0)
|
|
|
|
#define CLI_SF_VARIABLE (1 << 1)
|
|
|
|
#define CLI_SF_FILTER (1 << 2)
|
|
|
|
#define CLI_SF_FUNCTION (1 << 3)
|
|
|
|
#define CLI_SF_PROTOCOL (1 << 4)
|
|
|
|
#define CLI_SF_TABLE (1 << 5)
|
|
|
|
#define CLI_SF_TEMPLATE (1 << 6)
|
|
|
|
#define CLI_SF_INTERFACE (1 << 7)
|
|
|
|
|
|
|
|
#define CLI_SF_OPTIONAL (1 << 8) /* This node is optional not mandatory */
|
|
|
|
#define CLI_SF_PARAMETER (1 << 9) /* A parameter/word will follow after this node */
|
|
|
|
|
|
|
|
/* Client Symbol Flags: Keywords */
|
|
|
|
#define CLI_SF_KW_ALL (1 << 10)
|
|
|
|
#define CLI_SF_KW_OFF (1 << 11)
|
|
|
|
|
|
|
|
|
|
|
|
struct cli_symbol
|
|
|
|
{
|
|
|
|
node n;
|
|
|
|
const char *name;
|
|
|
|
uint len;
|
|
|
|
u32 flags; /* CLI_SF_* */
|
|
|
|
};
|
|
|
|
|
2013-04-23 00:42:35 +00:00
|
|
|
void submit_command(char *cmd_raw);
|
2016-05-12 19:29:04 +00:00
|
|
|
|
|
|
|
/* die() with system error messages */
|
|
|
|
#define DIE(x, y...) die(x ": %s", ##y, strerror(errno))
|
2016-04-15 09:41:08 +00:00
|
|
|
|
|
|
|
void retrieve_symbols(void);
|
|
|
|
void add_keywords_to_symbols(void);
|
|
|
|
list *cli_get_symbol_list(void);
|
|
|
|
uint cli_get_symbol_maxlen(void);
|
|
|
|
void simple_input_read(void);
|
|
|
|
|
|
|
|
#endif
|