2009-11-02 Samuel Thibault <samuel.thibault@ens-lyon.org>
[grub2/jjazz.git] / include / grub / parttool.h
blob8291e1161472b5eafd6105fed9393e839b355c81
1 /*
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_PARTTOOL_HEADER
20 #define GRUB_PARTTOOL_HEADER 1
22 struct grub_parttool_argdesc
24 char *name;
25 char *desc;
26 enum {GRUB_PARTTOOL_ARG_END, GRUB_PARTTOOL_ARG_BOOL, GRUB_PARTTOOL_ARG_VAL}
27 type;
30 struct grub_parttool_args
32 int set;
33 union
35 int bool;
36 char *str;
40 typedef grub_err_t (*grub_parttool_function_t) (const grub_device_t dev,
41 const struct grub_parttool_args *args);
43 struct grub_parttool
45 struct grub_parttool *next;
46 char *name;
47 int handle;
48 int nargs;
49 struct grub_parttool_argdesc *args;
50 grub_parttool_function_t func;
53 int grub_parttool_register(const char *part_name,
54 const grub_parttool_function_t func,
55 const struct grub_parttool_argdesc *args);
56 void grub_parttool_unregister (int handle);
58 #endif /* ! GRUB_PARTTOOL_HEADER*/