]>
git.proxmox.com Git - mirror_qemu.git/blob - cmd.h
2 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #include "qemu-common.h"
22 #define CMD_FLAG_GLOBAL ((int)0x80000000) /* don't iterate "args" */
24 extern BlockDriverState
*qemuio_bs
;
26 typedef int (*cfunc_t
)(BlockDriverState
*bs
, int argc
, char **argv
);
27 typedef void (*helpfunc_t
)(void);
29 typedef struct cmdinfo
{
42 extern cmdinfo_t
*cmdtab
;
48 typedef int (*checkfunc_t
)(BlockDriverState
*bs
, const cmdinfo_t
*ci
);
50 void add_command(const cmdinfo_t
*ci
);
51 void add_user_command(char *optarg
);
52 void add_check_command(checkfunc_t cf
);
54 const cmdinfo_t
*find_command(const char *cmd
);
56 void command_loop(void);
57 int command_usage(const cmdinfo_t
*ci
);
58 int command(const cmdinfo_t
*ci
, int argc
, char **argv
);
61 char **breakline(char *input
, int *count
);
62 char *fetchline(void);
64 void cvtstr(double value
, char *str
, size_t sz
);
66 struct timeval
tsub(struct timeval t1
, struct timeval t2
);
67 double tdiv(double value
, struct timeval tv
);
71 TERSE_FIXED_TIME
= 0x1,
72 VERBOSE_FIXED_TIME
= 0x2
75 void timestr(struct timeval
*tv
, char *str
, size_t sz
, int flags
);
77 extern char *progname
;
79 bool qemuio_command(const char *cmd
);
81 #endif /* __COMMAND_H__ */