2006-04-29 Marco Gerards <marco@gnu.org>

* commands/configfile.c (grub_cmd_configfile): Execute the
	configfile within its own context.

	* include/grub/env.h (grub_env_context_open): New prototype.
	(grub_env_context_close): Likewise.

	* kern/env.c (grub_env): Removed.
	(grub_env_sorted): Likewise.
	(grub_env_context): New variable.
	(grub_env_var_context): Likewise.
	(grub_env_find): Search both the active context and the global
	context.
	(grub_env_context_open): New function.
	(grub_env_context_close): Likewise.
	(grub_env_insert): Likewise.
	(grub_env_remove): Likewise.
	(grub_env_export): Likewise.
	(grub_env_set): Changed to use helper functions to avoid code
	duplication.
	(grub_env_iterate): Rewritten so both the current context and the
	global context are being used.

	* normal/command.c (export_command): New function.
	(grub_command_init): Register the `export' function.
This commit is contained in:
marco_g 2006-04-29 20:29:42 +00:00
parent 7b455f4dd3
commit eaef05533f
5 changed files with 216 additions and 47 deletions

View file

@ -1,6 +1,6 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2003,2005 Free Software Foundation, Inc.
* Copyright (C) 2003,2005,2006 Free Software Foundation, Inc.
*
* GRUB is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -50,5 +50,7 @@ void EXPORT_FUNC(grub_env_iterate) (int (* func) (struct grub_env_var *var));
grub_err_t EXPORT_FUNC(grub_register_variable_hook) (const char *var,
grub_env_read_hook_t read_hook,
grub_env_write_hook_t write_hook);
grub_err_t EXPORT_FUNC(grub_env_context_open) (void);
grub_err_t EXPORT_FUNC(grub_env_context_close) (void);
#endif /* ! GRUB_ENV_HEADER */