mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-23 02:01:55 +00:00
8322ecde12
Restructure client/ subdir. Add two different flavors of client. The full featured birdc client code is in client/birdc/. The new light client birtcl is in client/birdcl/. Common sources of both clients are directly in client/. Rework on-line auto-completion in client/command.c to conditionally turn off ncurses-specific code. Add lightweight client without libreadline and ncurses dependencies - birdcl. The birdcl lacks support of history, on-line auto-completion and there are different implementations of "more" functionality and help on '?' press. New client operates in canonical terminal mode (apart from "more" display) and therefore all commands have to be executed by a return key including help commands (called by '?' character in the end of the line). Apart from these limitations the interaction style should be the same as for the full client - birdc. Build of birdcl is always on (independent on --enable-client parameter).
36 lines
764 B
C
36 lines
764 B
C
/*
|
|
* BIRD Client
|
|
*
|
|
* (c) 1999--2000 Martin Mares <mj@ucw.cz>
|
|
*
|
|
* Can be freely distributed and used under the terms of the GNU GPL.
|
|
*/
|
|
|
|
/* client.c callbacks */
|
|
|
|
void cleanup(void);
|
|
void input_start_list(void);
|
|
void input_stop_list(void);
|
|
void server_got_reply(char *x);
|
|
|
|
/* commands.c */
|
|
|
|
void cmd_build_tree(void);
|
|
void cmd_help(char *cmd, int len);
|
|
int cmd_complete(char *cmd, int len, char *buf, int again);
|
|
char *cmd_expand(char *cmd);
|
|
|
|
/* client_common.c */
|
|
|
|
#define STATE_PROMPT 0
|
|
#define STATE_CMD_SERVER 1
|
|
#define STATE_CMD_USER 2
|
|
|
|
#define SERVER_READ_BUF_LEN 4096
|
|
|
|
int handle_internal_command(char *cmd);
|
|
void submit_server_command(char *cmd);
|
|
void server_connect(void);
|
|
void server_read(void);
|
|
void server_send(char *cmd);
|