/* env.c - Environment variables */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/env_private.h>
struct menu_pointer
{
};
void
grub_env_unset_menu (void)
{
}
grub_env_get_menu (void)
{
return current_menu->menu;
}
void
{
}
static grub_err_t
{
int i;
if (! context)
return grub_errno;
if (! menu)
return grub_errno;
current_menu = menu;
/* Copy exported variables. */
for (i = 0; i < HASHSZ; i++)
{
{
{
return grub_errno;
}
}
}
return GRUB_ERR_NONE;
}
grub_env_context_open (void)
{
return grub_env_new_context (0);
}
int grub_extractor_level = 0;
{
return grub_env_new_context (source);
}
grub_env_context_close (void)
{
int i;
if (! grub_current_context->prev)
return grub_error (GRUB_ERR_BAD_ARGUMENT,
"cannot close the initial context");
/* Free the variables associated with this context. */
for (i = 0; i < HASHSZ; i++)
{
struct grub_env_var *p, *q;
for (p = grub_current_context->vars[i]; p; p = q)
{
q = p->next;
grub_free (p);
}
}
/* Restore the previous context. */
current_menu = menu;
return GRUB_ERR_NONE;
}
{
if (source)
{
menu = grub_env_get_menu ();
}
err = grub_env_context_close ();
{
menu2 = grub_env_get_menu ();
while (*last)
}
return err;
}
static grub_err_t
{
int i;
if (argc < 1)
return grub_error (GRUB_ERR_BAD_ARGUMENT,
"no environment variable specified");
for (i = 0; i < argc; i++)
grub_env_export (args[i]);
return 0;
}
void
grub_context_init (void)
{
N_("ENVVAR [ENVVAR] ..."),
N_("Export variables."));
}
void
grub_context_fini (void)
{
}