diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2013-11-14 11:54:15 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2014-01-22 12:07:17 +0100 |
commit | 0150cd81cf608b93778a067189829f354fe27e4b (patch) | |
tree | b37e2c71249f04c0a1053d58f940d0b120bc4a23 /include/monitor | |
parent | c60bf3391bf4cb79b7adc6650094e21671ddaabd (diff) | |
download | qemu-0150cd81cf608b93778a067189829f354fe27e4b.zip qemu-0150cd81cf608b93778a067189829f354fe27e4b.tar.gz qemu-0150cd81cf608b93778a067189829f354fe27e4b.tar.bz2 |
readline: move readline to a generic location
Now that the monitor and readline are decoupled, readline.h no longer
belongs in include/monitor/. Put the header into include/qemu/.
Move the source file into util/ so it can be linked as part of
libqemuutil.a.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/monitor')
-rw-r--r-- | include/monitor/monitor.h | 2 | ||||
-rw-r--r-- | include/monitor/readline.h | 62 |
2 files changed, 1 insertions, 63 deletions
diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index 22d8b8f..7e5f752 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -5,7 +5,7 @@ #include "qapi/qmp/qerror.h" #include "qapi/qmp/qdict.h" #include "block/block.h" -#include "monitor/readline.h" +#include "qemu/readline.h" extern Monitor *cur_mon; extern Monitor *default_mon; diff --git a/include/monitor/readline.h b/include/monitor/readline.h deleted file mode 100644 index a89fe4a..0000000 --- a/include/monitor/readline.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef READLINE_H -#define READLINE_H - -#define READLINE_CMD_BUF_SIZE 4095 -#define READLINE_MAX_CMDS 64 -#define READLINE_MAX_COMPLETIONS 256 - -typedef void ReadLinePrintfFunc(void *opaque, const char *fmt, ...); -typedef void ReadLineFlushFunc(void *opaque); -typedef void ReadLineFunc(void *opaque, const char *str, - void *readline_opaque); -typedef void ReadLineCompletionFunc(void *opaque, - const char *cmdline); - -typedef struct ReadLineState { - char cmd_buf[READLINE_CMD_BUF_SIZE + 1]; - int cmd_buf_index; - int cmd_buf_size; - - char last_cmd_buf[READLINE_CMD_BUF_SIZE + 1]; - int last_cmd_buf_index; - int last_cmd_buf_size; - - int esc_state; - int esc_param; - - char *history[READLINE_MAX_CMDS]; - int hist_entry; - - ReadLineCompletionFunc *completion_finder; - char *completions[READLINE_MAX_COMPLETIONS]; - int nb_completions; - int completion_index; - - ReadLineFunc *readline_func; - void *readline_opaque; - int read_password; - char prompt[256]; - - ReadLinePrintfFunc *printf_func; - ReadLineFlushFunc *flush_func; - void *opaque; -} ReadLineState; - -void readline_add_completion(ReadLineState *rs, const char *str); -void readline_set_completion_index(ReadLineState *rs, int completion_index); - -const char *readline_get_history(ReadLineState *rs, unsigned int index); - -void readline_handle_byte(ReadLineState *rs, int ch); - -void readline_start(ReadLineState *rs, const char *prompt, int read_password, - ReadLineFunc *readline_func, void *readline_opaque); -void readline_restart(ReadLineState *rs); -void readline_show_prompt(ReadLineState *rs); - -ReadLineState *readline_init(ReadLinePrintfFunc *printf_func, - ReadLineFlushFunc *flush_func, - void *opaque, - ReadLineCompletionFunc *completion_finder); - -#endif /* !READLINE_H */ |