2 * Commandline option parsing functions
4 * Copyright (c) 2003-2008 Fabrice Bellard
5 * Copyright (c) 2009 Kevin Wolf <kwolf@redhat.com>
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26 #ifndef QEMU_OPTIONS_H
27 #define QEMU_OPTIONS_H
29 enum QEMUOptionParType
{
36 typedef struct QEMUOptionParameter
{
38 enum QEMUOptionParType type
;
44 } QEMUOptionParameter
;
47 const char *get_opt_name(char *buf
, int buf_size
, const char *p
, char delim
);
48 const char *get_opt_value(char *buf
, int buf_size
, const char *p
);
52 * The following functions take a parameter list as input. This is a pointer to
53 * the first element of a QEMUOptionParameter array which is terminated by an
54 * entry with entry->name == NULL.
57 QEMUOptionParameter
*get_option_parameter(QEMUOptionParameter
*list
,
59 int set_option_parameter(QEMUOptionParameter
*list
, const char *name
,
61 int set_option_parameter_int(QEMUOptionParameter
*list
, const char *name
,
63 QEMUOptionParameter
*parse_option_parameters(const char *param
,
64 QEMUOptionParameter
*list
, QEMUOptionParameter
*dest
);
65 void free_option_parameters(QEMUOptionParameter
*list
);
66 void print_option_parameters(QEMUOptionParameter
*list
);
67 void print_option_help(QEMUOptionParameter
*list
);