#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 {
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);
extern char *progname;
+bool qemuio_command(const char *cmd);
+
#endif /* __COMMAND_H__ */