57 lines
1.8 KiB
C
57 lines
1.8 KiB
C
/*
|
|
* VAS_EBOOT -- GRand Unified Bootloader
|
|
* Copyright (C) 2008,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_ENVBLK_HEADER
|
|
#define VAS_EBOOT_ENVBLK_HEADER 1
|
|
|
|
#define VAS_EBOOT_ENVBLK_SIGNATURE "# VAS_EBOOT Environment Block\n"
|
|
#define VAS_EBOOT_ENVBLK_DEFCFG "VasEBootenv"
|
|
|
|
#ifndef ASM_FILE
|
|
|
|
struct VasEBoot_envblk
|
|
{
|
|
char *buf;
|
|
VasEBoot_size_t size;
|
|
};
|
|
typedef struct VasEBoot_envblk *VasEBoot_envblk_t;
|
|
|
|
VasEBoot_envblk_t VasEBoot_envblk_open (char *buf, VasEBoot_size_t size);
|
|
int VasEBoot_envblk_set (VasEBoot_envblk_t envblk, const char *name, const char *value);
|
|
void VasEBoot_envblk_delete (VasEBoot_envblk_t envblk, const char *name);
|
|
void VasEBoot_envblk_iterate (VasEBoot_envblk_t envblk,
|
|
void *hook_data,
|
|
int hook (const char *name, const char *value, void *hook_data));
|
|
void VasEBoot_envblk_close (VasEBoot_envblk_t envblk);
|
|
|
|
static inline char *
|
|
VasEBoot_envblk_buffer (const VasEBoot_envblk_t envblk)
|
|
{
|
|
return envblk->buf;
|
|
}
|
|
|
|
static inline VasEBoot_size_t
|
|
VasEBoot_envblk_size (const VasEBoot_envblk_t envblk)
|
|
{
|
|
return envblk->size;
|
|
}
|
|
|
|
#endif /* ! ASM_FILE */
|
|
|
|
#endif /* ! VAS_EBOOT_ENVBLK_HEADER */
|