]> git.proxmox.com Git - qemu.git/blame - cmd.h
qemu-io: Remove unused args_command
[qemu.git] / cmd.h
CommitLineData
e3aff4f6
AL
1/*
2 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
4 *
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.
8 *
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.
13 *
14 * You should have received a copy of the GNU General Public License
8167ee88 15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
e3aff4f6
AL
16 */
17#ifndef __COMMAND_H__
18#define __COMMAND_H__
19
20#define CMD_FLAG_GLOBAL ((int)0x80000000) /* don't iterate "args" */
21
22typedef int (*cfunc_t)(int argc, char **argv);
23typedef void (*helpfunc_t)(void);
24
25typedef struct cmdinfo {
26 const char *name;
27 const char *altname;
28 cfunc_t cfunc;
29 int argmin;
30 int argmax;
31 int canpush;
32 int flags;
33 const char *args;
34 const char *oneline;
35 helpfunc_t help;
36} cmdinfo_t;
37
38extern cmdinfo_t *cmdtab;
39extern int ncmds;
40
64b85a8f
BS
41void help_init(void);
42void quit_init(void);
e3aff4f6 43
e3aff4f6
AL
44typedef int (*checkfunc_t)(const cmdinfo_t *ci);
45
64b85a8f
BS
46void add_command(const cmdinfo_t *ci);
47void add_user_command(char *optarg);
64b85a8f 48void add_check_command(checkfunc_t cf);
e3aff4f6 49
64b85a8f 50const cmdinfo_t *find_command(const char *cmd);
e3aff4f6 51
64b85a8f
BS
52void command_loop(void);
53int command_usage(const cmdinfo_t *ci);
54int command(const cmdinfo_t *ci, int argc, char **argv);
e3aff4f6
AL
55
56/* from input.h */
64b85a8f
BS
57char **breakline(char *input, int *count);
58void doneline(char *input, char **vec);
59char *fetchline(void);
e3aff4f6 60
64b85a8f
BS
61long long cvtnum(char *s);
62void cvtstr(double value, char *str, size_t sz);
e3aff4f6 63
64b85a8f
BS
64struct timeval tsub(struct timeval t1, struct timeval t2);
65double tdiv(double value, struct timeval tv);
e3aff4f6
AL
66
67enum {
68 DEFAULT_TIME = 0x0,
69 TERSE_FIXED_TIME = 0x1,
70 VERBOSE_FIXED_TIME = 0x2
71};
72
64b85a8f 73void timestr(struct timeval *tv, char *str, size_t sz, int flags);
e3aff4f6 74
856ae5c3
BS
75extern char *progname;
76
e3aff4f6 77#endif /* __COMMAND_H__ */