aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2023-01-24 13:19:20 +0100
committerMarkus Armbruster <armbru@redhat.com>2023-02-04 07:56:54 +0100
commit52f50b1e9f8fd410d4293a211d549ec61b902728 (patch)
treeec247a22b645c5181143d02cf33cece6f055cc40 /include
parent444ee02c5ff3b1ce794e9dc2fe2005a13ae8e4a7 (diff)
readline: Extract readline_add_completion_of() from monitor
monitor/misc.h has static add_completion_option(). It's useful elsewhere in the monitor. Since it's not monitor-specific, move it to util/readline.c renamed to readline_add_completion_of(), and put it to use. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-7-armbru@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/qemu/readline.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/qemu/readline.h b/include/qemu/readline.h
index 622aa4564f..b05e4782da 100644
--- a/include/qemu/readline.h
+++ b/include/qemu/readline.h
@@ -44,6 +44,8 @@ typedef struct ReadLineState {
} ReadLineState;
void readline_add_completion(ReadLineState *rs, const char *str);
+void readline_add_completion_of(ReadLineState *rs,
+ const char *pfx, const char *str);
void readline_set_completion_index(ReadLineState *rs, int completion_index);
const char *readline_get_history(ReadLineState *rs, unsigned int index);