]> git.proxmox.com Git - grub2.git/blob - include/grub/parttool.h
Import grub2_2.02+dfsg1.orig.tar.xz
[grub2.git] / include / grub / parttool.h
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2009 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_PARTTOOL_HEADER
20 #define GRUB_PARTTOOL_HEADER 1
21
22 struct grub_parttool_argdesc
23 {
24 const char *name;
25 const char *desc;
26 enum {GRUB_PARTTOOL_ARG_END, GRUB_PARTTOOL_ARG_BOOL, GRUB_PARTTOOL_ARG_VAL}
27 type;
28 };
29
30 struct grub_parttool_args
31 {
32 int set;
33 union
34 {
35 int bool;
36 char *str;
37 };
38 };
39
40 typedef grub_err_t (*grub_parttool_function_t) (const grub_device_t dev,
41 const struct grub_parttool_args *args);
42
43 struct grub_parttool
44 {
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;
51 };
52
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);
57
58 #endif /* ! GRUB_PARTTOOL_HEADER*/