2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2009 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_EXTCMD_HEADER
20 #define GRUB_EXTCMD_HEADER 1
22 #include <grub/lib/arg.h>
23 #include <grub/command.h>
27 typedef grub_err_t (*grub_extcmd_func_t
) (struct grub_extcmd
*cmd
,
28 int argc
, char **args
);
30 /* The argcmd description. */
35 grub_extcmd_func_t func
;
37 /* The argument parser optionlist. */
38 const struct grub_arg_option
*options
;
42 struct grub_arg_list
*state
;
44 typedef struct grub_extcmd
*grub_extcmd_t
;
46 grub_extcmd_t
grub_register_extcmd (const char *name
,
47 grub_extcmd_func_t func
,
50 const char *description
,
51 const struct grub_arg_option
*parser
);
53 void grub_unregister_extcmd (grub_extcmd_t cmd
);
55 #endif /* ! GRUB_EXTCMD_HEADER */