Upgraded GRUB2 to 2.00 release.
[AROS.git] / arch / all-pc / boot / grub2-aros / include / grub / lib / arg.h
blobf81af85eee118067ec2c4877950dc165c87747fe
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2003,2005,2007 Free Software Foundation, Inc.
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.
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.
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/>.
19 #ifndef GRUB_ARG_HEADER
20 #define GRUB_ARG_HEADER 1
22 #include <grub/symbol.h>
23 #include <grub/err.h>
24 #include <grub/types.h>
26 enum grub_arg_type
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
37 typedef enum grub_arg_type grub_arg_type_t;
39 /* Flags for the option field op grub_arg_option. */
40 #define GRUB_ARG_OPTION_OPTIONAL (1 << 1)
41 /* Flags for an option that can appear multiple times. */
42 #define GRUB_ARG_OPTION_REPEATABLE (1 << 2)
44 enum grub_key_type
46 GRUB_KEY_ARG = -1,
47 GRUB_KEY_END = -2
49 typedef enum grub_key_type grub_arg_key_type_t;
51 struct grub_arg_option
53 const char *longarg;
54 int shortarg;
55 int flags;
56 const char *doc;
57 const char *arg;
58 grub_arg_type_t type;
61 struct grub_arg_list
63 int set;
64 union {
65 char *arg;
66 char **args;
70 struct grub_extcmd;
72 int grub_arg_parse (struct grub_extcmd *cmd, int argc, char **argv,
73 struct grub_arg_list *usr, char ***args, int *argnum);
75 void EXPORT_FUNC(grub_arg_show_help) (struct grub_extcmd *cmd);
76 struct grub_arg_list* grub_arg_list_alloc (struct grub_extcmd *cmd,
77 int argc, char *argv[]);
79 #endif /* ! GRUB_ARG_HEADER */