aliguori | e3aff4f | 2009-04-05 19:14:04 +0000 | [diff] [blame] | 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 |
Blue Swirl | 8167ee8 | 2009-07-16 20:47:01 +0000 | [diff] [blame] | 15 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
aliguori | e3aff4f | 2009-04-05 19:14:04 +0000 | [diff] [blame] | 16 | */ |
Kevin Wolf | 3d21994 | 2013-06-05 14:19:39 +0200 | [diff] [blame] | 17 | |
| 18 | #ifndef QEMU_IO_H |
| 19 | #define QEMU_IO_H |
aliguori | e3aff4f | 2009-04-05 19:14:04 +0000 | [diff] [blame] | 20 | |
Kevin Wolf | 734c3b8 | 2013-06-05 14:19:30 +0200 | [diff] [blame] | 21 | #include "qemu-common.h" |
| 22 | |
Kevin Wolf | 3d21994 | 2013-06-05 14:19:39 +0200 | [diff] [blame] | 23 | #define CMD_FLAG_GLOBAL ((int)0x80000000) /* don't iterate "args" */ |
Kevin Wolf | 734c3b8 | 2013-06-05 14:19:30 +0200 | [diff] [blame] | 24 | |
| 25 | typedef int (*cfunc_t)(BlockDriverState *bs, int argc, char **argv); |
aliguori | e3aff4f | 2009-04-05 19:14:04 +0000 | [diff] [blame] | 26 | typedef void (*helpfunc_t)(void); |
| 27 | |
| 28 | typedef struct cmdinfo { |
Kevin Wolf | 3d21994 | 2013-06-05 14:19:39 +0200 | [diff] [blame] | 29 | const char* name; |
| 30 | const char* altname; |
| 31 | cfunc_t cfunc; |
| 32 | int argmin; |
| 33 | int argmax; |
| 34 | int canpush; |
| 35 | int flags; |
| 36 | const char *args; |
| 37 | const char *oneline; |
| 38 | helpfunc_t help; |
aliguori | e3aff4f | 2009-04-05 19:14:04 +0000 | [diff] [blame] | 39 | } cmdinfo_t; |
| 40 | |
Kevin Wolf | 3d21994 | 2013-06-05 14:19:39 +0200 | [diff] [blame] | 41 | bool qemuio_command(BlockDriverState *bs, const char *cmd); |
aliguori | e3aff4f | 2009-04-05 19:14:04 +0000 | [diff] [blame] | 42 | |
Kevin Wolf | 3d21994 | 2013-06-05 14:19:39 +0200 | [diff] [blame] | 43 | void qemuio_add_command(const cmdinfo_t *ci); |
Kevin Wolf | c2cdf5c | 2013-06-05 14:19:36 +0200 | [diff] [blame] | 44 | int qemuio_command_usage(const cmdinfo_t *ci); |
aliguori | e3aff4f | 2009-04-05 19:14:04 +0000 | [diff] [blame] | 45 | |
Kevin Wolf | 3d21994 | 2013-06-05 14:19:39 +0200 | [diff] [blame] | 46 | #endif /* QEMU_IO_H */ |