Upgraded GRUB2 to 2.00 release.
[AROS.git] / arch / all-pc / boot / grub2-aros / include / grub / env.h
blobef425826578dc4485a45258e8bd441171467ea1d
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2003,2005,2006,2007,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_ENV_HEADER
20 #define GRUB_ENV_HEADER 1
22 #include <grub/symbol.h>
23 #include <grub/err.h>
24 #include <grub/types.h>
25 #include <grub/menu.h>
27 struct grub_env_var;
29 typedef const char *(*grub_env_read_hook_t) (struct grub_env_var *var,
30 const char *val);
31 typedef char *(*grub_env_write_hook_t) (struct grub_env_var *var,
32 const char *val);
34 struct grub_env_var
36 char *name;
37 char *value;
38 grub_env_read_hook_t read_hook;
39 grub_env_write_hook_t write_hook;
40 struct grub_env_var *next;
41 struct grub_env_var **prevp;
42 int global;
45 grub_err_t EXPORT_FUNC(grub_env_set) (const char *name, const char *val);
46 const char *EXPORT_FUNC(grub_env_get) (const char *name);
47 void EXPORT_FUNC(grub_env_unset) (const char *name);
48 void EXPORT_FUNC(grub_env_iterate) (int (*func) (struct grub_env_var *var));
49 grub_err_t EXPORT_FUNC(grub_register_variable_hook) (const char *name,
50 grub_env_read_hook_t read_hook,
51 grub_env_write_hook_t write_hook);
53 grub_err_t grub_env_context_open (void);
54 grub_err_t grub_env_context_close (void);
55 grub_err_t EXPORT_FUNC(grub_env_export) (const char *name);
57 void grub_env_unset_menu (void);
58 grub_menu_t grub_env_get_menu (void);
59 void grub_env_set_menu (grub_menu_t nmenu);
61 grub_err_t
62 grub_env_extractor_open (int source);
64 grub_err_t
65 grub_env_extractor_close (int source);
68 #endif /* ! GRUB_ENV_HEADER */