ShellEnvVar.h revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
/** @file
function definitions for shell environment functions.
the following includes are required:
//#include <Guid/ShellVariableGuid.h>
//#include <Library/UefiRuntimeServicesTableLib.h>
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
typedef struct {
} ENV_VAR_LIST;
/**
Reports whether an environment variable is Volatile or Non-Volatile
This will use the Runtime Services call GetVariable to to search for the variable.
@param EnvVarName The name of the environment variable in question
@retval TRUE This environment variable is Volatile
@retval FALSE This environment variable is NON-Volatile
**/
);
/**
Delete a Non-Violatile environment variable.
This will use the Runtime Services call SetVariable to remove a non-violatile variable.
@param EnvVarName The name of the environment variable in question
@retval EFI_SUCCESS The variable was deleted sucessfully
@retval other An error ocurred
@sa SetVariable
**/
#define SHELL_DELETE_ENVIRONMENT_VARIABLE(EnvVarName) \
0, \
0, \
NULL))
/**
Set a Non-Violatile environment variable.
This will use the Runtime Services call SetVariable to set a non-violatile variable.
@param EnvVarName The name of the environment variable in question
@param BufferSize UINTN size of Buffer
@param Buffer Pointer to value to set variable to
@retval EFI_SUCCESS The variable was changed sucessfully
@retval other An error ocurred
@sa SetVariable
**/
BufferSize, \
/**
Get an environment variable.
This will use the Runtime Services call GetVariable to get a variable.
@param EnvVarName The name of the environment variable in question
@param BufferSize Pointer to the UINTN size of Buffer
@param Buffer Pointer buffer to get variable value into
@retval EFI_SUCCESS The variable's value was retrieved sucessfully
@retval other An error ocurred
@sa SetVariable
**/
0, \
BufferSize, \
Buffer))
/**
Get an environment variable.
This will use the Runtime Services call GetVariable to get a variable.
@param EnvVarName The name of the environment variable in question
@param Atts Pointer to the UINT32 for attributes (or NULL)
@param BufferSize Pointer to the UINTN size of Buffer
@param Buffer Pointer buffer to get variable value into
@retval EFI_SUCCESS The variable's value was retrieved sucessfully
@retval other An error ocurred
@sa SetVariable
**/
Atts, \
BufferSize, \
Buffer))
/**
Set a Violatile environment variable.
This will use the Runtime Services call SetVariable to set a violatile variable.
@param EnvVarName The name of the environment variable in question
@param BufferSize UINTN size of Buffer
@param Buffer Pointer to value to set variable to
@retval EFI_SUCCESS The variable was changed sucessfully
@retval other An error ocurred
@sa SetVariable
**/
BufferSize, \
/**
Creates a list of all Shell-Guid-based environment variables.
@param[in, out] List The pointer to pointer to LIST_ENTRY object for
storing this list.
@retval EFI_SUCCESS the list was created sucessfully.
**/
);
/**
Sets a list of all Shell-Guid-based environment variables. this will
also eliminate all pre-existing shell environment variables (even if they
are not on the list).
This function will also deallocate the memory from List.
@param[in] List The pointer to LIST_ENTRY from
GetShellEnvVarList().
@retval EFI_SUCCESS The list was Set sucessfully.
**/
);
/**
sets all Shell-Guid-based environment variables. this will
also eliminate all pre-existing shell environment variables (even if they
are not on the list).
@param[in] Environment Points to a NULL-terminated array of environment
variables with the format 'x=y', where x is the
environment variable name and y is the value.
@retval EFI_SUCCESS The command executed successfully.
@retval EFI_INVALID_PARAMETER The parameter is invalid.
@retval EFI_OUT_OF_RESOURCES Out of resources.
@sa SetEnvironmentVariableList
**/
);
/**
free function for ENV_VAR_LIST objects.
@param[in] List The pointer to pointer to list.
**/
);
#endif //_SHELL_ENVIRONMENT_VARIABLE_HEADER_