summaryrefslogtreecommitdiff
path: root/MdePkg/Include
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-02-02 13:11:49 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-02-02 13:11:49 +0000
commite52c5a9fdcc1663f98e1a1090c424c1606990650 (patch)
tree6bba76e4eed7ddbccb4c1d12258d8a86db81c797 /MdePkg/Include
parent59ab6d02a98545df6b35178cce796af7ad56d0b9 (diff)
downloadedk2-platforms-e52c5a9fdcc1663f98e1a1090c424c1606990650.tar.xz
1) Cleanup HiiLib, IfrSupportLib.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4661 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Include')
-rw-r--r--MdePkg/Include/Library/HiiLib.h365
-rw-r--r--MdePkg/Include/Library/IfrSupportLib.h998
-rw-r--r--MdePkg/Include/Uefi/UefiInternalFormRepresentation.h10
3 files changed, 611 insertions, 762 deletions
diff --git a/MdePkg/Include/Library/HiiLib.h b/MdePkg/Include/Library/HiiLib.h
index dc557af31b..de6267bcf1 100644
--- a/MdePkg/Include/Library/HiiLib.h
+++ b/MdePkg/Include/Library/HiiLib.h
@@ -1,7 +1,7 @@
/** @file
Public include file for the HII Library
- Copyright (c) 2006, Intel Corporation
+ Copyright (c) 2007 - 2008, Intel Corporation
All rights reserved. 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
@@ -15,14 +15,37 @@
#ifndef __HII_LIB_H__
#define __HII_LIB_H__
-//#include <PiDxe.h>
-
//
// Limited buffer size recommended by RFC4646 (4.3. Length Considerations)
// (42 characters plus a NULL terminator)
//
#define RFC_3066_ENTRY_SIZE (42 + 1)
+#define ISO_639_2_ENTRY_SIZE 3
+
+/**
+ Assemble EFI_HII_PACKAGE_LIST according to the passed in packages.
+
+ If GuidId is NULL, then ASSERT.
+ If not enough resource to complete the operation, then ASSERT.
+
+ @param NumberOfPackages Number of packages.
+ @param GuidId Package GUID.
+ @param ... Variable argument list for packages to be assembled.
+
+ @return EFI_HII_PACKAGE_LIST_HEADER Pointer of EFI_HII_PACKAGE_LIST_HEADER. The function will ASSERT if system has
+ not enough resource to complete the operation.
+
+**/
+EFI_HII_PACKAGE_LIST_HEADER *
+EFIAPI
+HiiLibPreparePackageList (
+ IN UINTN NumberOfPackages,
+ IN CONST EFI_GUID *GuidId,
+ ...
+ )
+;
+
/**
This function allocates pool for an EFI_HII_PACKAGE_LIST structure
with additional space that is big enough to host all packages described by the variable
@@ -32,23 +55,28 @@
Then, EFI_HII_PACKAGE_LIST will be register to the default System HII Database. The
Handle to the newly registered Package List is returned throught HiiHandle.
+ If HiiHandle is NULL, then ASSERT.
+
@param NumberOfPackages The number of HII packages to register.
@param GuidId Package List GUID ID.
- @param HiiHandle The ID used to retrieve the Package List later.
+ @param EFI_HANDLE Optional. If not NULL, the DriverHandle on which an instance of DEVICE_PATH_PROTOCOL is installed.
+ This DriverHandle uniquely defines the device that the added packages are associated with.
+ @param HiiHandle On output, the HiiHandle is update with the handle which can be used to retrieve the Package
+ List later. If the functions failed to add the package to the default HII database, this value will
+ be set to NULL.
@param ... The variable argument list describing all HII Package.
- @return
- The allocated and initialized packages.
+ @return EFI_SUCCESS If the packages are successfully added to the default HII database.
+ @return EFI_OUT_OF_RESOURCE Not enough resource to complete the operation.
**/
-
EFI_STATUS
EFIAPI
-HiiLibAddPackagesToHiiDatabase (
+HiiLibAddPackages (
IN UINTN NumberOfPackages,
IN CONST EFI_GUID *GuidId,
IN EFI_HANDLE DriverHandle, OPTIONAL
- OUT EFI_HII_HANDLE *HiiHandle, OPTIONAL
+ OUT EFI_HII_HANDLE *HiiHandle,
...
)
;
@@ -63,32 +91,46 @@ HiiLibAddFontPackageToHiiDatabase (
)
;
-EFI_STATUS
+/**
+ Removes a package list from the default HII database.
+
+ If HiiHandle is NULL, then ASSERT.
+ If HiiHandle is not a valid EFI_HII_HANDLE in the default HII database, then ASSERT.
+
+ @param HiiHandle The handle that was previously registered to the data base that is requested for removal.
+ List later.
+
+ @return VOID
+
+**/
+VOID
EFIAPI
-HiiLibRemovePackagesFromHiiDatabase (
+HiiLibRemovePackages (
IN EFI_HII_HANDLE HiiHandle
)
;
/**
- This function adds the string into String Package of each language.
+ This function adds the string into String Package of each language
+ supported by the package list.
+
+ If String is NULL, then ASSERT.
+ If StringId is NULL, the ASSERT.
+ If PackageList could not be found in the default HII database, then ASSERT.
@param PackageList Handle of the package list where this string will
- be added.
+ be added.
@param StringId On return, contains the new strings id, which is
- unique within PackageList.
+ unique within PackageList.
@param String Points to the new null-terminated string.
- @retval EFI_SUCCESS The new string was added successfully.
- @retval EFI_NOT_FOUND The specified PackageList could not be found in
- database.
+ @retval EFI_SUCCESS The new string was added successfully.
@retval EFI_OUT_OF_RESOURCES Could not add the string due to lack of resources.
- @retval EFI_INVALID_PARAMETER String is NULL or StringId is NULL is NULL.
**/
EFI_STATUS
EFIAPI
-HiiLibCreateString (
+HiiLibNewString (
IN EFI_HII_HANDLE PackageList,
OUT EFI_STRING_ID *StringId,
IN CONST EFI_STRING String
@@ -96,84 +138,301 @@ HiiLibCreateString (
;
/**
- This function update the specified string in String Package of each language.
+ This function update the specified string in String Package of each language
+ supported by the package list.
+
+ If String is NULL, then ASSERT.
+ If PackageList could not be found in the default HII database, then ASSERT.
+ If StringId is not found in PackageList, then ASSERT.
@param PackageList Handle of the package list where this string will
- be added.
+ be added.
@param StringId Ths String Id to be updated.
@param String Points to the new null-terminated string.
@retval EFI_SUCCESS The new string was added successfully.
- @retval EFI_NOT_FOUND The specified PackageList could not be found in
- database.
@retval EFI_OUT_OF_RESOURCES Could not add the string due to lack of resources.
- @retval EFI_INVALID_PARAMETER String is NULL or StringId is NULL is NULL.
**/
EFI_STATUS
EFIAPI
-HiiLibUpdateString (
+HiiLibSetString (
IN EFI_HII_HANDLE PackageList,
IN EFI_STRING_ID StringId,
IN CONST EFI_STRING String
)
;
+/**
+ This function try to retrieve string from String package of current language.
+ If fails, it try to retrieve string from String package of first language it support.
+
+ If String is NULL, then ASSERT.
+ If StringSize is NULL, then ASSERT.
+ If PackageList could not be found in the default HII database, then ASSERT.
+ If StringId is not found in PackageList, then ASSERT.
+
+ @param PackageList The package list in the HII database to search for
+ the specified string.
+ @param StringId The string's id, which is unique within
+ PackageList.
+ @param String Points to the new null-terminated string.
+ @param StringSize On entry, points to the size of the buffer pointed
+ to by String, in bytes. On return, points to the
+ length of the string, in bytes.
+
+ @retval EFI_SUCCESS The string was returned successfully.
+ @retval EFI_NOT_FOUND The string specified by StringId is not available.
+ @retval EFI_BUFFER_TOO_SMALL The buffer specified by StringLength is too small
+ to hold the string.
+ @retval EFI_INVALID_PARAMETER The String or StringSize was NULL.
+**/
-//
-// Just use the UEFI prototype
-//
EFI_STATUS
EFIAPI
-HiiLibGetStringFromGuidId (
- IN EFI_GUID *ProducerGuid,
+HiiLibGetString (
+ IN EFI_HII_HANDLE PackageList,
+ IN EFI_STRING_ID StringId,
+ OUT EFI_STRING String,
+ IN OUT UINTN *StringSize
+ )
+;
+
+/**
+ Get string specified by StringId form the HiiHandle. The caller
+ is responsible to free the *String.
+
+ If String is NULL, then ASSERT.
+ If HiiHandle could not be found in the default HII database, then ASSERT.
+ If StringId is not found in PackageList, then ASSERT.
+
+ @param HiiHandle The HII handle of package list.
+ @param StringId The String ID.
+ @param String The output string.
+
+ @retval EFI_NOT_FOUND String is not found.
+ @retval EFI_SUCCESS Operation is successful.
+ @retval EFI_OUT_OF_RESOURCES There is not enought memory in the system.
+ @retval EFI_INVALID_PARAMETER The String is NULL.
+
+**/
+EFI_STATUS
+EFIAPI
+HiiLibGetStringFromHandle (
+ IN EFI_HII_HANDLE HiiHandle,
IN EFI_STRING_ID StringId,
OUT EFI_STRING *String
)
;
-//
-// This function is Implementation Specifc. HII_VENDOR_DEVICE_PATH
-// This should be moved to MdeModulepkg.
-//
+/**
+ Get the string given the StringId and String package Producer's Guid. The caller
+ is responsible to free the *String.
+
+ If PackageList with the matching ProducerGuid is not found, then ASSERT.
+ If PackageList with the matching ProducerGuid is found but no String is
+ specified by StringId is found, then ASSERT.
+
+ @param ProducerGuid The Guid of String package list.
+ @param StringId The String ID.
+ @param String The output string.
+
+ @retval EFI_SUCCESS Operation is successful.
+ @retval EFI_OUT_OF_RESOURCES There is not enought memory in the system.
+
+**/
EFI_STATUS
EFIAPI
-HiiLibCreateHiiDriverHandle (
- OUT EFI_HANDLE *DriverHandle
+HiiLibGetStringFromToken (
+ IN EFI_GUID *ProducerGuid,
+ IN EFI_STRING_ID StringId,
+ OUT EFI_STRING *String
)
;
+/**
+ Determines the handles that are currently active in the database.
+ It's the caller's responsibility to free handle buffer.
+
+ If HandleBufferLength is NULL, then ASSERT.
+ If HiiHandleBuffer is NULL, then ASSERT.
+
+ @param HiiDatabase A pointer to the EFI_HII_DATABASE_PROTOCOL
+ instance.
+ @param HandleBufferLength On input, a pointer to the length of the handle
+ buffer. On output, the length of the handle buffer
+ that is required for the handles found.
+ @param HiiHandleBuffer Pointer to an array of Hii Handles returned.
+
+ @retval EFI_SUCCESS Get an array of Hii Handles successfully.
+
+**/
EFI_STATUS
EFIAPI
-HiiLibDestroyHiiDriverHandle (
- IN EFI_HANDLE DriverHandle
+HiiLibGetHiiHandles (
+ IN OUT UINTN *HandleBufferLength,
+ OUT EFI_HII_HANDLE **HiiHandleBuffer
)
;
+/**
+ Extract Hii package list GUID for given HII handle.
+
+ If HiiHandle could not be found in the default HII database, then ASSERT.
+ If Guid is NULL, then ASSERT.
+
+ @param HiiHandle Hii handle
+ @param Guid Package list GUID
+ @retval EFI_SUCCESS Successfully extract GUID from Hii database.
+
+**/
EFI_STATUS
-HiiLibExtractClassFromHiiHandle (
+EFIAPI
+HiiLibExtractGuidFromHiiHandle (
IN EFI_HII_HANDLE Handle,
- OUT UINT16 *Class,
- OUT EFI_STRING_ID *FormSetTitle,
- OUT EFI_STRING_ID *FormSetHelp
+ OUT EFI_GUID *Guid
+ )
+;
+
+/**
+ Find HII Handle in the default HII database associated with given Device Path.
+
+ If DevicePath is NULL, then ASSERT.
+
+ @param DevicePath Device Path associated with the HII package list
+ handle.
+
+ @retval Handle HII package list Handle associated with the Device
+ Path.
+ @retval NULL Hii Package list handle is not found.
+
+**/
+EFI_HII_HANDLE
+EFIAPI
+HiiLibDevicePathToHiiHandle (
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
+ )
+;
+
+
+/**
+ Determine what is the current language setting. The space reserved for Lang
+ must be at least RFC_3066_ENTRY_SIZE bytes;
+
+ If Lang is NULL, then ASSERT.
+
+ @param Lang Pointer of system language. Lang will always be filled with
+ a valid RFC 3066 language string. If "PlatformLang" is not
+ set in the system, the default language specifed by PcdUefiVariableDefaultPlatformLang
+ is returned.
+
+ @return EFI_SUCCESS If the EFI Variable with "PlatformLang" is set and return in Lang.
+ @return EFI_NOT_FOUND If the EFI Variable with "PlatformLang" is not set, but a valid default language is return in Lang.
+
+**/
+EFI_STATUS
+EFIAPI
+HiiLibGetCurrentLanguage (
+ OUT CHAR8 *Lang
)
-/*++
+;
-Routine Description:
- Extract formset class for given HII handle.
+/**
+ Get next language from language code list (with separator ';').
-Arguments:
- HiiHandle - Hii handle
- Class - Class of the formset
- FormSetTitle - Formset title string
- FormSetHelp - Formset help string
+ If LangCode is NULL, then ASSERT.
+ If Lang is NULL, then ASSERT.
-Returns:
- EFI_SUCCESS - Successfully extract Class for specified Hii handle.
+ @param LangCode On input: point to first language in the list. On
+ output: point to next language in the list, or
+ NULL if no more language in the list.
+ @param Lang The first language in the list.
---*/
+**/
+VOID
+EFIAPI
+HiiLibGetNextLanguage (
+ IN OUT CHAR8 **LangCode,
+ OUT CHAR8 *Lang
+ )
+;
+
+/**
+ This function returns the list of supported languages, in the format specified
+ in UEFI specification Appendix M.
+
+ If HiiHandle is not a valid Handle in the default HII database, then ASSERT.
+ If not enough resource to complete the operation, then ASSERT.
+
+ @param HiiHandle The HII package list handle.
+
+ @return The supported languages.
+
+**/
+CHAR8 *
+EFIAPI
+HiiLibGetSupportedLanguages (
+ IN EFI_HII_HANDLE HiiHandle
+ )
+;
+
+/**
+ This function returns the number of supported languages on HiiHandle.
+
+ If HiiHandle is not a valid Handle in the default HII database, then ASSERT.
+ If not enough resource to complete the operation, then ASSERT.
+
+ @param HiiHandle The HII package list handle.
+
+ @return The number of supported languages.
+
+**/
+UINT16
+EFIAPI
+HiiLibGetSupportedLanguageNumber (
+ IN EFI_HII_HANDLE HiiHandle
+ )
+;
+
+/**
+ Convert language code from RFC3066 to ISO639-2.
+
+ If LanguageRfc3066 is NULL, then ASSERT.
+ If LanguageIso639 is NULL, then ASSERT.
+
+ @param LanguageRfc3066 RFC3066 language code.
+ @param LanguageIso639 ISO639-2 language code.
+
+ @retval EFI_SUCCESS Language code converted.
+ @retval EFI_NOT_FOUND Language code not found.
+
+**/
+EFI_STATUS
+EFIAPI
+ConvertRfc3066LanguageToIso639Language (
+ CHAR8 *LanguageRfc3066,
+ CHAR8 *LanguageIso639
+ )
+;
+
+/**
+ Convert language code list from RFC3066 to ISO639-2, e.g. "en-US;fr-FR" will
+ be converted to "engfra".
+
+ If SupportedLanguages is NULL, then ASSERT.
+
+ @param SupportedLanguages The RFC3066 language list.
+
+ @return The ISO639-2 language list.
+
+**/
+CHAR8 *
+EFIAPI
+Rfc3066ToIso639 (
+ CHAR8 *SupportedLanguages
+ )
;
#endif
diff --git a/MdePkg/Include/Library/IfrSupportLib.h b/MdePkg/Include/Library/IfrSupportLib.h
index 0b54a8eb9b..75c7f4785b 100644
--- a/MdePkg/Include/Library/IfrSupportLib.h
+++ b/MdePkg/Include/Library/IfrSupportLib.h
@@ -11,16 +11,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
- UefiIfrLibrary.h
+ IfrSupportLibrary.h
Abstract:
- The file contain all library function for Ifr Operations.
+ The file contain all library functions and definitions for IFR opcode creation and
+ related Form Browser utility Operations.
--*/
-#ifndef _IFRLIBRARY_H
-#define _IFRLIBRARY_H
+#ifndef _IFR_SUPPORT_LIBRARY_H
+#define _IFR_SUPPORT_LIBRARY_H
#include <Protocol/HiiFont.h>
@@ -34,8 +35,6 @@ Abstract:
#include <Guid/GlobalVariable.h>
-#define IFR_LIB_DEFAULT_STRING_SIZE 0x200
-
//
// The architectural variable "Lang" and "LangCodes" are deprecated in UEFI
// specification. While, UEFI specification also states that these deprecated
@@ -94,50 +93,62 @@ typedef struct {
} EFI_HII_UPDATE_DATA;
-//
-// Exported Library functions
-//
+/**
+ Create EFI_IFR_END_OP opcode.
+
+ If Data is NULL or Data->Data is NULL, then ASSERT.
+
+ @param Data Destination for the created opcode binary
+
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+
+**/
EFI_STATUS
+EFIAPI
CreateEndOpCode (
IN OUT EFI_HII_UPDATE_DATA *Data
)
-/*++
-
-Routine Description:
- Create EFI_IFR_END_OP opcode.
+;
-Arguments:
- Data - Destination for the created opcode binary
+/**
+ Create EFI_IFR_DEFAULT_OP opcode.
-Returns:
- EFI_SUCCESS - Opcode create success
+ @param Value Value for the default
+ @param Type Type for the default
+ @param Data Destination for the created opcode binary
---*/
-;
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+ @retval EFI_INVALID_PARAMETER The type is not valid.
+**/
EFI_STATUS
+EFIAPI
CreateDefaultOpCode (
IN EFI_IFR_TYPE_VALUE *Value,
IN UINT8 Type,
IN OUT EFI_HII_UPDATE_DATA *Data
)
-/*++
+;
-Routine Description:
- Create EFI_IFR_DEFAULT_OP opcode.
+/**
+ Create EFI_IFR_ACTION_OP opcode.
-Arguments:
- Value - Value for the default
- Type - Type for the default
- Data - Destination for the created opcode binary
+ @param QuestionId Question ID
+ @param Prompt String ID for Prompt
+ @param Help String ID for Help
+ @param QuestionFlags Flags in Question Header
+ @param QuestionConfig String ID for configuration
+ @param Data Destination for the created opcode binary
-Returns:
- EFI_SUCCESS - Opcode create success
-
---*/
-;
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+ @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
+**/
EFI_STATUS
+EFIAPI
CreateActionOpCode (
IN EFI_QUESTION_ID QuestionId,
IN EFI_STRING_ID Prompt,
@@ -146,26 +157,23 @@ CreateActionOpCode (
IN EFI_STRING_ID QuestionConfig,
IN OUT EFI_HII_UPDATE_DATA *Data
)
-/*++
-
-Routine Description:
- Create EFI_IFR_ACTION_OP opcode.
-
-Arguments:
- QuestionId - Question ID
- Prompt - String ID for Prompt
- Help - String ID for Help
- QuestionFlags - Flags in Question Header
- QuestionConfig - String ID for configuration
- Data - Destination for the created opcode binary
+;
-Returns:
- EFI_SUCCESS - Opcode create success
+/**
+ Create EFI_IFR_SUBTITLE_OP opcode.
---*/
-;
+ @param Prompt String ID for Prompt
+ @param Help String ID for Help
+ @param Flags Subtitle opcode flags
+ @param Scope Subtitle Scope bit
+ @param Data Destination for the created opcode binary
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+
+**/
EFI_STATUS
+EFIAPI
CreateSubTitleOpCode (
IN EFI_STRING_ID Prompt,
IN EFI_STRING_ID Help,
@@ -173,49 +181,47 @@ CreateSubTitleOpCode (
IN UINT8 Scope,
IN OUT EFI_HII_UPDATE_DATA *Data
)
-/*++
+;
-Routine Description:
- Create EFI_IFR_SUBTITLE_OP opcode.
+/**
+ Create EFI_IFR_TEXT_OP opcode.
-Arguments:
- Prompt - String ID for Prompt
- Help - String ID for Help
- Flags - Subtitle opcode flags
- Scope - Subtitle Scope bit
- Data - Destination for the created opcode binary
+ @param Prompt String ID for Prompt
+ @param Help String ID for Help
+ @param TextTwo String ID for text two
+ @param Data Destination for the created opcode binary
-Returns:
- EFI_SUCCESS - Opcode create success
-
---*/
-;
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+**/
EFI_STATUS
+EFIAPI
CreateTextOpCode (
IN EFI_STRING_ID Prompt,
IN EFI_STRING_ID Help,
IN EFI_STRING_ID TextTwo,
IN OUT EFI_HII_UPDATE_DATA *Data
)
-/*++
-
-Routine Description:
- Create EFI_IFR_TEXT_OP opcode.
+;
-Arguments:
- Prompt - String ID for Prompt
- Help - String ID for Help
- TextTwo - String ID for text two
- Data - Destination for the created opcode binary
+/**
+ Create EFI_IFR_REF_OP opcode.
-Returns:
- EFI_SUCCESS - Opcode create success
+ @param FormId Destination Form ID
+ @param Prompt String ID for Prompt
+ @param Help String ID for Help
+ @param QuestionFlags Flags in Question Header
+ @param QuestionId Question ID
+ @param Data Destination for the created opcode binary
---*/
-;
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+ @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
+**/
EFI_STATUS
+EFIAPI
CreateGotoOpCode (
IN EFI_FORM_ID FormId,
IN EFI_STRING_ID Prompt,
@@ -224,26 +230,22 @@ CreateGotoOpCode (
IN EFI_QUESTION_ID QuestionId,
IN OUT EFI_HII_UPDATE_DATA *Data
)
-/*++
-
-Routine Description:
- Create EFI_IFR_REF_OP opcode.
+;
-Arguments:
- FormId - Destination Form ID
- Prompt - String ID for Prompt
- Help - String ID for Help
- QuestionFlags - Flags in Question Header
- QuestionId - Question ID
- Data - Destination for the created opcode binary
+/**
+ Create EFI_IFR_ONE_OF_OPTION_OP opcode.
-Returns:
- EFI_SUCCESS - Opcode create success
+ @param QuestionId Question ID
+ @param OptionList The list of Options.
+ @param Type The data type.
+ @param Data Destination for the created opcode binary
---*/
-;
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+**/
EFI_STATUS
+EFIAPI
CreateOneOfOptionOpCode (
IN UINTN OptionCount,
IN IFR_OPTION *OptionsList,
@@ -252,7 +254,27 @@ CreateOneOfOptionOpCode (
)
;
+/**
+ Create EFI_IFR_ONE_OF_OP opcode.
+
+ @param QuestionId Question ID
+ @param VarStoreId Storage ID
+ @param VarOffset Offset in Storage
+ @param Prompt String ID for Prompt
+ @param Help String ID for Help
+ @param QuestionFlags Flags in Question Header
+ @param OneOfFlags Flags for oneof opcode
+ @param OptionsList List of options
+ @param OptionCount Number of options in option list
+ @param Data Destination for the created opcode binary
+
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+ @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
+
+**/
EFI_STATUS
+EFIAPI
CreateOneOfOpCode (
IN EFI_QUESTION_ID QuestionId,
IN EFI_VARSTORE_ID VarStoreId,
@@ -265,30 +287,31 @@ CreateOneOfOpCode (
IN UINTN OptionCount,
IN OUT EFI_HII_UPDATE_DATA *Data
)
-/*++
-
-Routine Description:
- Create EFI_IFR_ONE_OF_OP opcode.
-
-Arguments:
- QuestionId - Question ID
- VarStoreId - Storage ID
- VarOffset - Offset in Storage
- Prompt - String ID for Prompt
- Help - String ID for Help
- QuestionFlags - Flags in Question Header
- OneOfFlags - Flags for oneof opcode
- OptionsList - List of options
- OptionCount - Number of options in option list
- Data - Destination for the created opcode binary
-
-Returns:
- EFI_SUCCESS - Opcode create success
-
---*/
;
+/**
+ Create EFI_IFR_ORDERED_LIST_OP opcode.
+
+ @param QuestionId Question ID
+ @param VarStoreId Storage ID
+ @param VarOffset Offset in Storage
+ @param Prompt String ID for Prompt
+ @param Help String ID for Help
+ @param QuestionFlags Flags in Question Header
+ @param Flags Flags for ordered list opcode
+ @param DataType Type for option value
+ @param MaxContainers Maximum count for options in this ordered list
+ @param OptionsList List of options
+ @param OptionCount Number of options in option list
+ @param Data Destination for the created opcode binary
+
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+ @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
+
+**/
EFI_STATUS
+EFIAPI
CreateOrderedListOpCode (
IN EFI_QUESTION_ID QuestionId,
IN EFI_VARSTORE_ID VarStoreId,
@@ -303,32 +326,27 @@ CreateOrderedListOpCode (
IN UINTN OptionCount,
IN OUT EFI_HII_UPDATE_DATA *Data
)
-/*++
+;
-Routine Description:
- Create EFI_IFR_ORDERED_LIST_OP opcode.
+/**
+ Create EFI_IFR_CHECKBOX_OP opcode.
-Arguments:
- QuestionId - Question ID
- VarStoreId - Storage ID
- VarOffset - Offset in Storage
- Prompt - String ID for Prompt
- Help - String ID for Help
- QuestionFlags - Flags in Question Header
- Flags - Flags for ordered list opcode
- DataType - Type for option value
- MaxContainers - Maximum count for options in this ordered list
- OptionsList - List of options
- OptionCount - Number of options in option list
- Data - Destination for the created opcode binary
-
-Returns:
- EFI_SUCCESS - Opcode create success
+ @param QuestionId Question ID
+ @param VarStoreId Storage ID
+ @param VarOffset Offset in Storage
+ @param Prompt String ID for Prompt
+ @param Help String ID for Help
+ @param QuestionFlags Flags in Question Header
+ @param CheckBoxFlags Flags for checkbox opcode
+ @param Data Destination for the created opcode binary
---*/
-;
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+ @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
+**/
EFI_STATUS
+EFIAPI
CreateCheckBoxOpCode (
IN EFI_QUESTION_ID QuestionId,
IN EFI_VARSTORE_ID VarStoreId,
@@ -339,28 +357,31 @@ CreateCheckBoxOpCode (
IN UINT8 CheckBoxFlags,
IN OUT EFI_HII_UPDATE_DATA *Data
)
-/*++
-
-Routine Description:
- Create EFI_IFR_CHECKBOX_OP opcode.
-
-Arguments:
- QuestionId - Question ID
- VarStoreId - Storage ID
- VarOffset - Offset in Storage
- Prompt - String ID for Prompt
- Help - String ID for Help
- QuestionFlags - Flags in Question Header
- CheckBoxFlags - Flags for checkbox opcode
- Data - Destination for the created opcode binary
-
-Returns:
- EFI_SUCCESS - Opcode create success
-
---*/
;
+/**
+ Create EFI_IFR_NUMERIC_OP opcode.
+
+ @param QuestionId Question ID
+ @param VarStoreId Storage ID
+ @param VarOffset Offset in Storage
+ @param Prompt String ID for Prompt
+ @param Help String ID for Help
+ @param QuestionFlags Flags in Question Header
+ @param NumericFlags Flags for numeric opcode
+ @param Minimum Numeric minimum value
+ @param Maximum Numeric maximum value
+ @param Step Numeric step for edit
+ @param Default Numeric default value
+ @param Data Destination for the created opcode binary
+
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+ @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
+
+**/
EFI_STATUS
+EFIAPI
CreateNumericOpCode (
IN EFI_QUESTION_ID QuestionId,
IN EFI_VARSTORE_ID VarStoreId,
@@ -375,32 +396,29 @@ CreateNumericOpCode (
IN UINT64 Default,
IN OUT EFI_HII_UPDATE_DATA *Data
)
-/*++
-
-Routine Description:
- Create EFI_IFR_NUMERIC_OP opcode.
-
-Arguments:
- QuestionId - Question ID
- VarStoreId - Storage ID
- VarOffset - Offset in Storage
- Prompt - String ID for Prompt
- Help - String ID for Help
- QuestionFlags - Flags in Question Header
- NumericFlags - Flags for numeric opcode
- Minimum - Numeric minimum value
- Maximum - Numeric maximum value
- Step - Numeric step for edit
- Default - Numeric default value
- Data - Destination for the created opcode binary
-
-Returns:
- EFI_SUCCESS - Opcode create success
-
---*/
;
+/**
+ Create EFI_IFR_STRING_OP opcode.
+
+ @param QuestionId Question ID
+ @param VarStoreId Storage ID
+ @param VarOffset Offset in Storage
+ @param Prompt String ID for Prompt
+ @param Help String ID for Help
+ @param QuestionFlags Flags in Question Header
+ @param StringFlags Flags for string opcode
+ @param MinSize String minimum length
+ @param MaxSize String maximum length
+ @param Data Destination for the created opcode binary
+
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+ @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
+
+**/
EFI_STATUS
+EFIAPI
CreateStringOpCode (
IN EFI_QUESTION_ID QuestionId,
IN EFI_VARSTORE_ID VarStoreId,
@@ -413,188 +431,71 @@ CreateStringOpCode (
IN UINT8 MaxSize,
IN OUT EFI_HII_UPDATE_DATA *Data
)
-/*++
-
-Routine Description:
- Create EFI_IFR_STRING_OP opcode.
-
-Arguments:
- QuestionId - Question ID
- VarStoreId - Storage ID
- VarOffset - Offset in Storage
- Prompt - String ID for Prompt
- Help - String ID for Help
- QuestionFlags - Flags in Question Header
- StringFlags - Flags for string opcode
- MinSize - String minimum length
- MaxSize - String maximum length
- Data - Destination for the created opcode binary
-
-Returns:
- EFI_SUCCESS - Opcode create success
-
---*/
;
-EFI_STATUS
-CreateBannerOpCode (
- IN EFI_STRING_ID Title,
- IN UINT16 LineNumber,
- IN UINT8 Alignment,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-/*++
-
-Routine Description:
- Create GUIDed opcode for banner.
-
-Arguments:
- Title - String ID for title
- LineNumber - Line number for this banner
- Alignment - Alignment for this banner, left, center or right
- Data - Destination for the created opcode binary
-
-Returns:
- EFI_SUCCESS - Opcode create success
-
---*/
-;
-
-EFI_HII_PACKAGE_LIST_HEADER *
-PreparePackageList (
- IN UINTN NumberOfPackages,
- IN EFI_GUID *GuidId,
- ...
- )
-/*++
-
-Routine Description:
- Assemble EFI_HII_PACKAGE_LIST according to the passed in packages.
-
-Arguments:
- NumberOfPackages - Number of packages.
- GuidId - Package GUID.
-
-Returns:
- Pointer of EFI_HII_PACKAGE_LIST_HEADER.
-
---*/
-;
-
-EFI_HII_HANDLE
-DevicePathToHiiHandle (
- IN EFI_HII_DATABASE_PROTOCOL *HiiDatabase,
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-/*++
-
-Routine Description:
- Find HII Handle associated with given Device Path.
-
-Arguments:
- HiiDatabase - Point to EFI_HII_DATABASE_PROTOCOL instance.
- DevicePath - Device Path associated with the HII package list handle.
-
-Returns:
- Handle - HII package list Handle associated with the Device Path.
- NULL - Hii Package list handle is not found.
-
---*/
-;
-
-EFI_STATUS
-ExtractDefault(
- IN VOID *Buffer,
- IN UINTN *BufferSize,
- UINTN Number,
- ...
- )
-/*++
-
- Routine Description:
- Configure the buffer accrording to ConfigBody strings.
-
- Arguments:
- DefaultId - the ID of default.
- Buffer - the start address of buffer.
- BufferSize - the size of buffer.
- Number - the number of the strings.
-
- Returns:
- EFI_BUFFER_TOO_SMALL - the BufferSize is too small to operate.
- EFI_INVALID_PARAMETER - Buffer is NULL or BufferSize is 0.
- EFI_SUCCESS - Operation successful.
-
---*/
-;
-
-EFI_STATUS
-ExtractGuidFromHiiHandle (
- IN EFI_HII_HANDLE Handle,
- OUT EFI_GUID *Guid
- )
-/*++
-
-Routine Description:
- Extract Hii package list GUID for given HII handle.
-
-Arguments:
- HiiHandle - Hii handle
- Guid - Package list GUID
+/**
+ Converts binary buffer to Unicode string in reversed byte order to BufToHexString().
-Returns:
- EFI_SUCCESS - Successfully extract GUID from Hii database.
+ @param Str String for output
+ @param Buffer Binary buffer.
+ @param BufferSize Size of the buffer in bytes.
---*/
-;
+ @retval EFI_SUCCESS The function completed successfully.
+**/
EFI_STATUS
+EFIAPI
BufferToHexString (
IN OUT CHAR16 *Str,
IN UINT8 *Buffer,
IN UINTN BufferSize
)
-/*++
-
-Routine Description:
- Converts binary buffer to Unicode string in reversed byte order to BufToHexString().
+;
-Arguments:
- Str - String for output
- Buffer - Binary buffer.
- BufferSize - Size of the buffer in bytes.
+/**
+ Converts Hex String to binary buffer in reversed byte order to HexStringToBuf().
-Returns:
- EFI_SUCCESS - The function completed successfully.
+ @param Buffer Pointer to buffer that receives the data.
+ @param BufferSize Length in bytes of the buffer to hold converted
+ data. If routine return with EFI_SUCCESS,
+ containing length of converted data. If routine
+ return with EFI_BUFFER_TOO_SMALL, containg length
+ of buffer desired.
+ @param Str String to be converted from.
---*/
-;
+ @retval EFI_SUCCESS The function completed successfully.
+**/
EFI_STATUS
+EFIAPI
HexStringToBuffer (
IN OUT UINT8 *Buffer,
IN OUT UINTN *BufferSize,
IN CHAR16 *Str
)
-/*++
-
-Routine Description:
- Converts Hex String to binary buffer in reversed byte order to HexStringToBuf().
-
-Arguments:
- Buffer - Pointer to buffer that receives the data.
- BufferSize - Length in bytes of the buffer to hold converted data.
- If routine return with EFI_SUCCESS, containing length of converted data.
- If routine return with EFI_BUFFER_TOO_SMALL, containg length of buffer desired.
- Str - String to be converted from.
-
-Returns:
- EFI_SUCCESS - The function completed successfully.
-
---*/
;
+/**
+ Construct <ConfigHdr> using routing information GUID/NAME/PATH.
+
+ @param ConfigHdr Pointer to the ConfigHdr string.
+ @param StrBufferLen On input: Length in bytes of buffer to hold the
+ ConfigHdr string. Includes tailing '\0' character.
+ On output: If return EFI_SUCCESS, containing
+ length of ConfigHdr string buffer. If return
+ EFI_BUFFER_TOO_SMALL, containg length of string
+ buffer desired.
+ @param Guid Routing information: GUID.
+ @param Name Routing information: NAME.
+ @param DriverHandle Driver handle which contains the routing
+ information: PATH.
+
+ @retval EFI_SUCCESS Routine success.
+ @retval EFI_BUFFER_TOO_SMALL The ConfigHdr string buffer is too small.
+
+**/
EFI_STATUS
+EFIAPI
ConstructConfigHdr (
IN OUT CHAR16 *ConfigHdr,
IN OUT UINTN *StrBufferLen,
@@ -602,104 +503,77 @@ ConstructConfigHdr (
IN CHAR16 *Name, OPTIONAL
IN EFI_HANDLE *DriverHandle
)
-/*++
-Routine Description:
- Construct <ConfigHdr> using routing information GUID/NAME/PATH.
+;
-Arguments:
- ConfigHdr - Pointer to the ConfigHdr string.
- StrBufferLen - On input: Length in bytes of buffer to hold the ConfigHdr string. Includes tailing '\0' character.
- On output:
- If return EFI_SUCCESS, containing length of ConfigHdr string buffer.
- If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.
- Guid - Routing information: GUID.
- Name - Routing information: NAME.
- DriverHandle - Driver handle which contains the routing information: PATH.
+/**
+ Search BlockName "&OFFSET=Offset&WIDTH=Width" in a string.
-Returns:
- EFI_SUCCESS - Routine success.
- EFI_BUFFER_TOO_SMALL - The ConfigHdr string buffer is too small.
+ @param String The string to be searched in.
+ @param Offset Offset in BlockName.
+ @param Width Width in BlockName.
---*/
-;
+ @retval TRUE Block name found.
+ @retval FALSE Block name not found.
+**/
BOOLEAN
+EFIAPI
FindBlockName (
IN OUT CHAR16 *String,
UINTN Offset,
UINTN Width
)
-/*++
-
-Routine Description:
- Search BlockName "&OFFSET=Offset&WIDTH=Width" in a string.
+;
-Arguments:
- String - The string to be searched in.
- Offset - Offset in BlockName.
- Width - Width in BlockName.
+/**
+ This routine is invoked by ConfigAccess.Callback() to retrived uncommitted data from Form Browser.
-Returns:
- TRUE - Block name found.
- FALSE - Block name not found.
+ @param VariableGuid An optional field to indicate the target variable
+ GUID name to use.
+ @param VariableName An optional field to indicate the target
+ human-readable variable name.
+ @param BufferSize On input: Length in bytes of buffer to hold
+ retrived data. On output: If return
+ EFI_BUFFER_TOO_SMALL, containg length of buffer
+ desired.
+ @param Buffer Buffer to hold retrived data.
---*/
-;
+ @retval EFI_SUCCESS Routine success.
+ @retval EFI_BUFFER_TOO_SMALL The intput buffer is too small.
+**/
EFI_STATUS
+EFIAPI
GetBrowserData (
EFI_GUID *VariableGuid, OPTIONAL
CHAR16 *VariableName, OPTIONAL
UINTN *BufferSize,
UINT8 *Buffer
)
-/*++
-
-Routine Description:
- This routine is invoked by ConfigAccess.Callback() to retrived uncommitted data from Form Browser.
-
-Arguments:
- VariableGuid - An optional field to indicate the target variable GUID name to use.
- VariableName - An optional field to indicate the target human-readable variable name.
- BufferSize - On input: Length in bytes of buffer to hold retrived data.
- On output:
- If return EFI_BUFFER_TOO_SMALL, containg length of buffer desired.
- Buffer - Buffer to hold retrived data.
-
-Returns:
- EFI_SUCCESS - Routine success.
- EFI_BUFFER_TOO_SMALL - The intput buffer is too small.
-
---*/
;
-EFI_STATUS
-GetHiiHandles (
- IN OUT UINTN *HandleBufferLength,
- OUT EFI_HII_HANDLE **HiiHandleBuffer
- )
-/*++
-
-Routine Description:
- Determines the handles that are currently active in the database.
- It's the caller's responsibility to free handle buffer.
-
-Arguments:
- HiiDatabase - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
- HandleBufferLength - On input, a pointer to the length of the handle buffer. On output,
- the length of the handle buffer that is required for the handles found.
- HiiHandleBuffer - Pointer to an array of Hii Handles returned.
-
-Returns:
- EFI_SUCCESS - Get an array of Hii Handles successfully.
- EFI_INVALID_PARAMETER - Hii is NULL.
- EFI_NOT_FOUND - Database not found.
-
---*/
-;
+/**
+ This routine is invoked by ConfigAccess.Callback() to update uncommitted data of Form Browser.
+ @param VariableGuid An optional field to indicate the target variable
+ GUID name to use.
+ @param VariableName An optional field to indicate the target
+ human-readable variable name.
+ @param BufferSize Length in bytes of buffer to hold retrived data.
+ @param Buffer Buffer to hold retrived data.
+ @param RequestElement An optional field to specify which part of the
+ buffer data will be send back to Browser. If NULL,
+ the whole buffer of data will be committed to
+ Browser. <RequestElement> ::=
+ &OFFSET=<Number>&WIDTH=<Number>*
+
+ @retval EFI_SUCCESS Routine success.
+ @retval Other Updating Browser uncommitted data failed.
+
+**/
EFI_STATUS
+EFIAPI
SetBrowserData (
EFI_GUID *VariableGuid, OPTIONAL
CHAR16 *VariableName, OPTIONAL
@@ -707,325 +581,31 @@ SetBrowserData (
UINT8 *Buffer,
CHAR16 *RequestElement OPTIONAL
)
-/*++
-
-Routine Description:
- This routine is invoked by ConfigAccess.Callback() to update uncommitted data of Form Browser.
-
-Arguments:
- VariableGuid - An optional field to indicate the target variable GUID name to use.
- VariableName - An optional field to indicate the target human-readable variable name.
- BufferSize - Length in bytes of buffer to hold retrived data.
- Buffer - Buffer to hold retrived data.
- RequestElement - An optional field to specify which part of the buffer data
- will be send back to Browser. If NULL, the whole buffer of
- data will be committed to Browser.
- <RequestElement> ::= &OFFSET=<Number>&WIDTH=<Number>*
-
-Returns:
- EFI_SUCCESS - Routine success.
- Other - Updating Browser uncommitted data failed.
-
---*/
-;
-
-EFI_STATUS
-ConvertRfc3066LanguageToIso639Language (
- CHAR8 *LanguageRfc3066,
- CHAR8 *LanguageIso639
- )
-/*++
-
-Routine Description:
- Convert language code from RFC3066 to ISO639-2.
-
-Arguments:
- LanguageRfc3066 - RFC3066 language code.
- LanguageIso639 - ISO639-2 language code.
-
-Returns:
- EFI_SUCCESS - Language code converted.
- EFI_NOT_FOUND - Language code not found.
-
---*/
-;
-
-CHAR8 *
-Rfc3066ToIso639 (
- CHAR8 *SupportedLanguages
- )
-/*++
-
-Routine Description:
- Convert language code list from RFC3066 to ISO639-2, e.g. "en-US;fr-FR" will
- be converted to "engfra".
-
-Arguments:
- SupportedLanguages - The RFC3066 language list.
-
-Returns:
- The ISO639-2 language list.
-
---*/
;
-EFI_STATUS
-GetCurrentLanguage (
- OUT CHAR8 *Lang
- )
-/*++
-
-Routine Description:
- Determine what is the current language setting
-
-Arguments:
- Lang - Pointer of system language
-
-Returns:
- Status code
-
---*/
-;
-
-VOID
-GetNextLanguage (
- IN OUT CHAR8 **LangCode,
- OUT CHAR8 *Lang
- )
-/*++
-
-Routine Description:
- Get next language from language code list.
-
-Arguments:
- LangCode - The language code.
- Lang - Returned language.
-
-Returns:
- None.
-
---*/
-;
-
-CHAR8 *
-GetSupportedLanguages (
- IN EFI_HII_HANDLE HiiHandle
- )
-/*++
-
-Routine Description:
- This function returns the list of supported languages, in the format specified
- in UEFI specification Appendix M.
-
-Arguments:
- HiiHandle - The HII package list handle.
-
-Returns:
- The supported languages.
-
---*/
-;
-
-UINT16
-GetSupportedLanguageNumber (
- IN EFI_HII_HANDLE HiiHandle
- )
-/*++
-
-Routine Description:
- This function returns the number of supported languages
-
-Arguments:
- HiiHandle - The HII package list handle.
-
-Returns:
- The number of supported languages.
-
---*/
-;
-
-EFI_STATUS
-GetStringFromHandle (
- IN EFI_HII_HANDLE HiiHandle,
- IN EFI_STRING_ID StringId,
- OUT EFI_STRING *String
- )
-/*++
-
-Routine Description:
- Get string specified by StringId form the HiiHandle.
-
-Arguments:
- HiiHandle - The HII handle of package list.
- StringId - The String ID.
- String - The output string.
-
-Returns:
- EFI_NOT_FOUND - String is not found.
- EFI_SUCCESS - Operation is successful.
- EFI_OUT_OF_RESOURCES - There is not enought memory in the system.
- EFI_INVALID_PARAMETER - The String is NULL.
-
---*/
-;
-
-EFI_STATUS
-GetStringFromToken (
- IN EFI_GUID *ProducerGuid,
- IN EFI_STRING_ID StringId,
- OUT EFI_STRING *String
- )
-/*++
-
-Routine Description:
- Get the string given the StringId and String package Producer's Guid.
-
-Arguments:
- ProducerGuid - The Guid of String package list.
- StringId - The String ID.
- String - The output string.
-
-Returns:
- EFI_NOT_FOUND - String is not found.
- EFI_SUCCESS - Operation is successful.
- EFI_OUT_OF_RESOURCES - There is not enought memory in the system.
-
---*/
-;
-
-EFI_STATUS
-IfrLibNewString (
- IN EFI_HII_HANDLE PackageList,
- OUT EFI_STRING_ID *StringId,
- IN CONST EFI_STRING String
- )
-/*++
-
- Routine Description:
- This function adds the string into String Package of each language.
-
- Arguments:
- PackageList - Handle of the package list where this string will be added.
- StringId - On return, contains the new strings id, which is unique within PackageList.
- String - Points to the new null-terminated string.
-
- Returns:
- EFI_SUCCESS - The new string was added successfully.
- EFI_NOT_FOUND - The specified PackageList could not be found in database.
- EFI_OUT_OF_RESOURCES - Could not add the string due to lack of resources.
- EFI_INVALID_PARAMETER - String is NULL or StringId is NULL is NULL.
-
---*/
-;
-
-EFI_STATUS
-IfrLibGetString (
- IN EFI_HII_HANDLE PackageList,
- IN EFI_STRING_ID StringId,
- OUT EFI_STRING String,
- IN OUT UINTN *StringSize
- )
-/*++
-
- Routine Description:
- This function try to retrieve string from String package of current language.
- If fail, it try to retrieve string from String package of first language it support.
-
- Arguments:
- PackageList - The package list in the HII database to search for the specified string.
- StringId - The string's id, which is unique within PackageList.
- String - Points to the new null-terminated string.
- StringSize - On entry, points to the size of the buffer pointed to by String, in bytes. On return,
- points to the length of the string, in bytes.
-
- Returns:
- EFI_SUCCESS - The string was returned successfully.
- EFI_NOT_FOUND - The string specified by StringId is not available.
- EFI_BUFFER_TOO_SMALL - The buffer specified by StringLength is too small to hold the string.
- EFI_INVALID_PARAMETER - The String or StringSize was NULL.
-
---*/
-;
-
-EFI_STATUS
-IfrLibSetString (
- IN EFI_HII_HANDLE PackageList,
- IN EFI_STRING_ID StringId,
- IN CONST EFI_STRING String
- )
-/*++
-
- Routine Description:
- This function updates the string in String package of current language.
+/**
+ Draw a dialog and return the selected key.
- Arguments:
- PackageList - The package list containing the strings.
- StringId - The string's id, which is unique within PackageList.
- String - Points to the new null-terminated string.
+ @param NumberOfLines The number of lines for the dialog box
+ @param KeyValue The EFI_KEY value returned if HotKey is TRUE..
+ @param String Pointer to the first string in the list
+ @param ... A series of (quantity == NumberOfLines) text
+ strings which will be used to construct the dialog
+ box
- Returns:
- EFI_SUCCESS - The string was updated successfully.
- EFI_NOT_FOUND - The string specified by StringId is not in the database.
- EFI_INVALID_PARAMETER - The String was NULL.
- EFI_OUT_OF_RESOURCES - The system is out of resources to accomplish the task.
+ @retval EFI_SUCCESS Displayed dialog and received user interaction
+ @retval EFI_INVALID_PARAMETER One of the parameters was invalid.
---*/
-;
+**/
EFI_STATUS
+EFIAPI
IfrLibCreatePopUp (
IN UINTN NumberOfLines,
OUT EFI_INPUT_KEY *KeyValue,
IN CHAR16 *String,
...
)
-/*++
-
-Routine Description:
- Draw a dialog and return the selected key.
-
-Arguments:
- NumberOfLines - The number of lines for the dialog box
- KeyValue - The EFI_KEY value returned if HotKey is TRUE..
- String - Pointer to the first string in the list
- ... - A series of (quantity == NumberOfLines) text strings which
- will be used to construct the dialog box
-
-Returns:
- EFI_SUCCESS - Displayed dialog and received user interaction
- EFI_INVALID_PARAMETER - One of the parameters was invalid.
-
---*/
;
-EFI_STATUS
-IfrLibUpdateForm (
- IN EFI_HII_HANDLE Handle,
- IN EFI_GUID *FormSetGuid, OPTIONAL
- IN EFI_FORM_ID FormId,
- IN UINT16 Label,
- IN BOOLEAN Insert,
- IN EFI_HII_UPDATE_DATA *Data
- )
-/*++
-
-Routine Description:
- This function allows the caller to update a form that has
- previously been registered with the EFI HII database.
-
-Arguments:
- Handle - Hii Handle
- FormSetGuid - The formset should be updated.
- FormId - The form should be updated.
- Label - Update information starting immediately after this label in the IFR
- Insert - If TRUE and Data is not NULL, insert data after Label.
- If FALSE, replace opcodes between two labels with Data.
- Data - The adding data; If NULL, remove opcodes between two Label.
-
-Returns:
- EFI_SUCCESS - Update success.
- Other - Update fail.
-
---*/
-;
#endif
diff --git a/MdePkg/Include/Uefi/UefiInternalFormRepresentation.h b/MdePkg/Include/Uefi/UefiInternalFormRepresentation.h
index d13421d0db..dd7247fe8d 100644
--- a/MdePkg/Include/Uefi/UefiInternalFormRepresentation.h
+++ b/MdePkg/Include/Uefi/UefiInternalFormRepresentation.h
@@ -1488,4 +1488,14 @@ typedef struct {
+//
+// References to string tokens must use this macro to enable scanning for
+// token usages.
+//
+//
+// STRING_TOKEN is not defined in UEFI specification. But it is placed
+// here for the easy access by C files and VFR source files.
+//
+#define STRING_TOKEN(t) t
+
#endif