TianoCore EDK2 master
Loading...
Searching...
No Matches
SetVar.c File Reference

Go to the source code of this file.

Data Structures

union  HEX_NUMBER
 

Enumerations

enum  DATA_TYPE {
  DataTypeHexNumber = 0 , DataTypeHexArray = 1 , DataTypeAscii = 2 , DataTypeUnicode = 3 ,
  DataTypeDevicePath = 4 , DataTypeUnKnow = 5
}
 

Functions

BOOLEAN IsStringOfHexNibbles (IN CONST CHAR16 *String)
 
DATA_TYPE TestDataType (IN CONST CHAR16 *Data)
 
EFI_STATUS ParseParameterData (IN CONST CHAR16 *Data, OUT VOID *Buffer, IN OUT UINTN *BufferSize)
 
EFI_STATUS GetVariableDataFromParameter (IN CONST LIST_ENTRY *Package, OUT UINT8 **Buffer, OUT UINTN *BufferSize)
 
SHELL_STATUS EFIAPI ShellCommandRunSetVar (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC CONST SHELL_PARAM_ITEM ParamList []
 

Detailed Description

Main file for SetVar shell Debug1 function.

(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file SetVar.c.

Enumeration Type Documentation

◆ DATA_TYPE

enum DATA_TYPE

Definition at line 20 of file SetVar.c.

Function Documentation

◆ GetVariableDataFromParameter()

EFI_STATUS GetVariableDataFromParameter ( IN CONST LIST_ENTRY Package,
OUT UINT8 **  Buffer,
OUT UINTN BufferSize 
)

Function to get each data from parameters.

Parameters
[in]PackageThe package of checked values.
[out]BufferA pointer to a buffer to hold the return data.
[out]BufferSizeIndicates the size of data in bytes return in Buffer.
Return values
EFI_INVALID_PARAMETERBuffer or BufferSize is NULL.
EFI_OUT_OF_RESOURCESA memory allcation failed.
EFI_SUCCESSGet each parameter data was successful.

Definition at line 265 of file SetVar.c.

◆ IsStringOfHexNibbles()

BOOLEAN IsStringOfHexNibbles ( IN CONST CHAR16 *  String)

Check if the input is a (potentially empty) string of hexadecimal nibbles.

Parameters
[in]StringThe CHAR16 string to check.
Return values
FALSEA character has been found in String for which ShellIsHexaDecimalDigitCharacter() returned FALSE.
TRUEOtherwise. (Note that this covers the case when String is empty.)

Definition at line 48 of file SetVar.c.

◆ ParseParameterData()

EFI_STATUS ParseParameterData ( IN CONST CHAR16 *  Data,
OUT VOID *  Buffer,
IN OUT UINTN BufferSize 
)

Function to parse the Data by the type of Data, and save in the Buffer.

Parameters
[in]DataA pointer to a buffer to be parsed.
[out]BufferA pointer to a buffer to hold the return data.
[in,out]BufferSizeOn input, indicates the size of Buffer in bytes. On output,indicates the size of data return in Buffer. Or the size in bytes of the buffer needed to obtain.
Return values
EFI_INVALID_PARAMETERThe Buffer or BufferSize is NULL.
EFI_BUFFER_TOO_SMALLThe Buffer is too small to hold the data.
EFI_OUT_OF_RESOURCESA memory allcation failed.
EFI_SUCCESSThe Data parsed successful and save in the Buffer.

Definition at line 117 of file SetVar.c.

◆ ShellCommandRunSetVar()

SHELL_STATUS EFIAPI ShellCommandRunSetVar ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Function for 'setvar' command.

Parameters
[in]ImageHandleHandle to the Image (NULL if Internal).
[in]SystemTablePointer to the System Table (NULL if Internal).

Definition at line 352 of file SetVar.c.

◆ TestDataType()

DATA_TYPE TestDataType ( IN CONST CHAR16 *  Data)

Function to check the TYPE of Data.

Parameters
[in]DataThe Data to be check.
Return values
DATA_TYPEThe TYPE of Data.

Definition at line 71 of file SetVar.c.

Variable Documentation

◆ ParamList

Initial value:
= {
{ L"-guid", TypeValue },
{ L"-bs", TypeFlag },
{ L"-rt", TypeFlag },
{ L"-nv", TypeFlag },
{ NULL, TypeMax }
}
#define NULL
Definition: Base.h:319
@ TypeValue
A flag that has some data following it with a space (IE "-a 1").
Definition: ShellLib.h:700
@ TypeFlag
A flag that is present or not present only (IE "-a").
Definition: ShellLib.h:699

Definition at line 12 of file SetVar.c.