]> git.proxmox.com Git - qemu.git/blobdiff - cmd.h
qemu-io: Move functions for registering and running commands
[qemu.git] / cmd.h
diff --git a/cmd.h b/cmd.h
index 4dcfe885a4bf1d9a9aab1c2d8bc2d14d26632505..0d01a33e978fc2f518782e8a00729a61edca2de3 100644 (file)
--- a/cmd.h
+++ b/cmd.h
 #ifndef __COMMAND_H__
 #define __COMMAND_H__
 
+#include "qemu-common.h"
+
 #define CMD_FLAG_GLOBAL        ((int)0x80000000)       /* don't iterate "args" */
 
-typedef int (*cfunc_t)(int argc, char **argv);
+extern BlockDriverState *qemuio_bs;
+
+typedef int (*cfunc_t)(BlockDriverState *bs, int argc, char **argv);
 typedef void (*helpfunc_t)(void);
 
 typedef struct cmdinfo {
@@ -35,27 +39,16 @@ typedef struct cmdinfo {
        helpfunc_t      help;
 } cmdinfo_t;
 
-extern cmdinfo_t       *cmdtab;
-extern int             ncmds;
-
-void help_init(void);
-void quit_init(void);
+typedef int (*checkfunc_t)(BlockDriverState *bs, const cmdinfo_t *ci);
 
-typedef int (*checkfunc_t)(const cmdinfo_t *ci);
-
-void add_command(const cmdinfo_t *ci);
+void qemuio_add_command(const cmdinfo_t *ci);
 void add_user_command(char *optarg);
 void add_check_command(checkfunc_t cf);
 
-const cmdinfo_t *find_command(const char *cmd);
-
 void command_loop(void);
-int command_usage(const cmdinfo_t *ci);
-int command(const cmdinfo_t *ci, int argc, char **argv);
+int qemuio_command_usage(const cmdinfo_t *ci);
 
 /* from input.h */
-char **breakline(char *input, int *count);
-void doneline(char *input, char **vec);
 char *fetchline(void);
 
 void cvtstr(double value, char *str, size_t sz);
@@ -73,4 +66,6 @@ void timestr(struct timeval *tv, char *str, size_t sz, int flags);
 
 extern char *progname;
 
+bool qemuio_command(const char *cmd);
+
 #endif /* __COMMAND_H__ */