TianoCore EDK2 master
|
#include "Shell.h"
Go to the source code of this file.
Macros | |
#define | INIT_NAME_BUFFER_SIZE 128 |
#define | INIT_DATA_BUFFER_SIZE 1024 |
Functions | |
EFI_STATUS | IsVolatileEnv (IN CONST CHAR16 *EnvVarName, OUT BOOLEAN *Volatile) |
VOID | FreeEnvironmentVariableList (IN LIST_ENTRY *List) |
EFI_STATUS | GetEnvironmentVariableList (IN OUT LIST_ENTRY *ListHead) |
EFI_STATUS | SetEnvironmentVariableList (IN LIST_ENTRY *ListHead) |
EFI_STATUS | SetEnvironmentVariables (IN CONST CHAR16 **Environment) |
EFI_STATUS | ShellFindEnvVarInList (IN CONST CHAR16 *Key, OUT CHAR16 **Value, OUT UINTN *ValueSize, OUT UINT32 *Atts OPTIONAL) |
EFI_STATUS | ShellAddEnvVarToList (IN CONST CHAR16 *Key, IN CONST CHAR16 *Value, IN UINTN ValueSize, IN UINT32 Atts) |
EFI_STATUS | ShellRemvoeEnvVarFromList (IN CONST CHAR16 *Key) |
EFI_STATUS | ShellInitEnvVarList (VOID) |
VOID | ShellFreeEnvVarList (VOID) |
Variables | |
ENV_VAR_LIST | gShellEnvVarList |
function declarations for shell environment functions.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file ShellEnvVar.c.
#define INIT_DATA_BUFFER_SIZE 1024 |
Definition at line 12 of file ShellEnvVar.c.
#define INIT_NAME_BUFFER_SIZE 128 |
Definition at line 11 of file ShellEnvVar.c.
VOID FreeEnvironmentVariableList | ( | IN LIST_ENTRY * | List | ) |
free function for ENV_VAR_LIST objects.
[in] | List | The pointer to pointer to list. |
Definition at line 95 of file ShellEnvVar.c.
EFI_STATUS GetEnvironmentVariableList | ( | IN OUT LIST_ENTRY * | ListHead | ) |
Creates a list of all Shell-Guid-based environment variables.
[in,out] | ListHead | The pointer to pointer to LIST ENTRY object for storing this list. |
EFI_SUCCESS | the list was created successfully. |
Definition at line 134 of file ShellEnvVar.c.
EFI_STATUS IsVolatileEnv | ( | IN CONST CHAR16 * | EnvVarName, |
OUT BOOLEAN * | Volatile | ||
) |
Reports whether an environment variable is Volatile or Non-Volatile.
EnvVarName | The name of the environment variable in question |
Volatile | Return TRUE if the environment variable is volatile |
EFI_SUCCESS | The volatile attribute is returned successfully |
others | Some errors happened. |
Definition at line 29 of file ShellEnvVar.c.
EFI_STATUS SetEnvironmentVariableList | ( | IN LIST_ENTRY * | ListHead | ) |
Sets a list of all Shell-Guid-based environment variables. this will also eliminate all existing shell environment variables (even if they are not on the list).
This function will also deallocate the memory from List.
[in] | ListHead | The pointer to LIST_ENTRY from GetShellEnvVarList(). |
EFI_SUCCESS | the list was Set successfully. |
Definition at line 254 of file ShellEnvVar.c.
EFI_STATUS SetEnvironmentVariables | ( | IN CONST CHAR16 ** | Environment | ) |
sets a list of all Shell-Guid-based environment variables.
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. |
EFI_SUCCESS | The command executed successfully. |
EFI_INVALID_PARAMETER | The parameter is invalid. |
EFI_OUT_OF_RESOURCES | Out of resources. |
Definition at line 322 of file ShellEnvVar.c.
EFI_STATUS ShellAddEnvVarToList | ( | IN CONST CHAR16 * | Key, |
IN CONST CHAR16 * | Value, | ||
IN UINTN | ValueSize, | ||
IN UINT32 | Atts | ||
) |
Add an environment variable into gShellEnvVarList.
Key | The name of the environment variable. |
Value | The value of environment variable. |
ValueSize | The size in bytes of the environment variable including the tailing CHAR_NULL |
Atts | The attributes of the variable. |
EFI_SUCCESS | The environment variable was added to list successfully. |
others | Some errors happened. |
Definition at line 472 of file ShellEnvVar.c.
EFI_STATUS ShellFindEnvVarInList | ( | IN CONST CHAR16 * | Key, |
OUT CHAR16 ** | Value, | ||
OUT UINTN * | ValueSize, | ||
OUT UINT32 *Atts | OPTIONAL | ||
) |
Find an environment variable in the gShellEnvVarList.
Key | The name of the environment variable. |
Value | The value of the environment variable, the buffer shoule be freed by the caller. |
ValueSize | The size in bytes of the environment variable including the tailing CHAR_NELL. |
Atts | The attributes of the variable. |
EFI_SUCCESS | The command executed successfully. |
EFI_NOT_FOUND | The environment variable is not found in gShellEnvVarList. |
Definition at line 426 of file ShellEnvVar.c.
VOID ShellFreeEnvVarList | ( | VOID | ) |
Destructe the gShellEnvVarList.
Definition at line 593 of file ShellEnvVar.c.
EFI_STATUS ShellInitEnvVarList | ( | VOID | ) |
Initialize the gShellEnvVarList and cache all Shell-Guid-based environment variables.
Definition at line 576 of file ShellEnvVar.c.
EFI_STATUS ShellRemvoeEnvVarFromList | ( | IN CONST CHAR16 * | Key | ) |
Remove a specified environment variable in gShellEnvVarList.
Key | The name of the environment variable. |
EFI_SUCCESS | The command executed successfully. |
EFI_NOT_FOUND | The environment variable is not found in gShellEnvVarList. |
Definition at line 543 of file ShellEnvVar.c.
ENV_VAR_LIST gShellEnvVarList |
Definition at line 17 of file ShellEnvVar.c.