74 lines
2.5 KiB
C
74 lines
2.5 KiB
C
/*
|
|
* VAS_EBOOT -- GRand Unified Bootloader
|
|
* Copyright (C) 2003,2005,2006,2007,2009 Free Software Foundation, Inc.
|
|
*
|
|
* VAS_EBOOT is free software: you can redistribute it and/or modify
|
|
* 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.
|
|
*
|
|
* VAS_EBOOT 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 VAS_EBOOT. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef VAS_EBOOT_ENV_HEADER
|
|
#define VAS_EBOOT_ENV_HEADER 1
|
|
|
|
#include <VasEBoot/symbol.h>
|
|
#include <VasEBoot/err.h>
|
|
#include <VasEBoot/types.h>
|
|
#include <VasEBoot/menu.h>
|
|
|
|
struct VasEBoot_env_var;
|
|
|
|
typedef const char *(*VasEBoot_env_read_hook_t) (struct VasEBoot_env_var *var,
|
|
const char *val);
|
|
typedef char *(*VasEBoot_env_write_hook_t) (struct VasEBoot_env_var *var,
|
|
const char *val);
|
|
|
|
struct VasEBoot_env_var
|
|
{
|
|
char *name;
|
|
char *value;
|
|
VasEBoot_env_read_hook_t read_hook;
|
|
VasEBoot_env_write_hook_t write_hook;
|
|
struct VasEBoot_env_var *next;
|
|
struct VasEBoot_env_var **prevp;
|
|
struct VasEBoot_env_var *sorted_next;
|
|
int global;
|
|
};
|
|
|
|
VasEBoot_err_t EXPORT_FUNC(VasEBoot_env_set) (const char *name, const char *val);
|
|
const char *EXPORT_FUNC(VasEBoot_env_get) (const char *name);
|
|
bool EXPORT_FUNC(VasEBoot_env_get_bool) (const char *name, bool if_unset);
|
|
void EXPORT_FUNC(VasEBoot_env_unset) (const char *name);
|
|
struct VasEBoot_env_var *EXPORT_FUNC(VasEBoot_env_update_get_sorted) (void);
|
|
|
|
#define FOR_SORTED_ENV(var) for (var = VasEBoot_env_update_get_sorted (); var; var = var->sorted_next)
|
|
|
|
VasEBoot_err_t EXPORT_FUNC(VasEBoot_register_variable_hook) (const char *name,
|
|
VasEBoot_env_read_hook_t read_hook,
|
|
VasEBoot_env_write_hook_t write_hook);
|
|
|
|
VasEBoot_err_t VasEBoot_env_context_open (void);
|
|
VasEBoot_err_t VasEBoot_env_context_close (void);
|
|
VasEBoot_err_t EXPORT_FUNC(VasEBoot_env_export) (const char *name);
|
|
|
|
void VasEBoot_env_unset_menu (void);
|
|
VasEBoot_menu_t VasEBoot_env_get_menu (void);
|
|
void VasEBoot_env_set_menu (VasEBoot_menu_t nmenu);
|
|
|
|
VasEBoot_err_t
|
|
VasEBoot_env_extractor_open (int source);
|
|
|
|
VasEBoot_err_t
|
|
VasEBoot_env_extractor_close (int source);
|
|
|
|
|
|
#endif /* ! VAS_EBOOT_ENV_HEADER */
|