]> git.proxmox.com Git - grub2.git/blob - include/grub/arg.h
2007-07-22 Yoshinori K. Okuji <okuji@enbug.org>
[grub2.git] / include / grub / arg.h
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2003,2005,2007 Free Software Foundation, Inc.
4 *
5 * GRUB is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * GRUB is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #ifndef GRUB_ARG_HEADER
20 #define GRUB_ARG_HEADER 1
21
22 #include <grub/symbol.h>
23 #include <grub/err.h>
24 #include <grub/types.h>
25
26 enum grub_arg_type
27 {
28 ARG_TYPE_NONE,
29 ARG_TYPE_STRING,
30 ARG_TYPE_INT,
31 ARG_TYPE_DEVICE,
32 ARG_TYPE_FILE,
33 ARG_TYPE_DIR,
34 ARG_TYPE_PATHNAME
35 };
36
37 typedef enum grub_arg_type grub_arg_type_t;
38
39 /* Flags for the option field op grub_arg_option. */
40 #define GRUB_ARG_OPTION_OPTIONAL (1 << 1)
41
42 enum grub_key_type
43 {
44 GRUB_KEY_ARG = -1,
45 GRUB_KEY_END = -2
46 };
47 typedef enum grub_key_type grub_arg_key_type_t;
48
49 struct grub_arg_option
50 {
51 const char *longarg;
52 int shortarg;
53 int flags;
54 char *doc;
55 char *arg;
56 grub_arg_type_t type;
57 };
58
59 struct grub_arg_list
60 {
61 int set;
62 char *arg;
63 };
64
65 #endif /* ! GRUB_ARG_HEADER */