correct some coding style issues.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7112 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
gdong1
2008-12-24 02:42:57 +00:00
parent ef9273606b
commit 49a049e6d2
5 changed files with 606 additions and 621 deletions

View File

@ -11,29 +11,28 @@ http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "IfrSupportLibInternal.h"
/**
Create a SubTitle opcode independent of string creation
Create a SubTitle opcode independent of string creation.
This is used primarily by users who need to create just one particular valid op-code and the string
data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
location to pre-defined forms in HII)
@param StringToken StringToken of the subtitle
@param FormBuffer Output of subtitle as a form
@param StringToken StringToken of the subtitle
@param FormBuffer Output of subtitle as a form
@retval EFI_SUCCESS Subtitle created to be a form
@retval EFI_SUCCESS Subtitle created to be a form
**/
EFI_STATUS
CreateSubTitleOpCode (
IN STRING_REF StringToken,
IN OUT VOID *FormBuffer
IN STRING_REF StringToken,
IN OUT VOID *FormBuffer
)
{
FRAMEWORK_EFI_IFR_SUBTITLE Subtitle;
FRAMEWORK_EFI_IFR_SUBTITLE Subtitle;
Subtitle.Header.OpCode = FRAMEWORK_EFI_IFR_SUBTITLE_OP;
Subtitle.Header.Length = sizeof (FRAMEWORK_EFI_IFR_SUBTITLE);
@ -44,31 +43,32 @@ CreateSubTitleOpCode (
}
/**
Create a Text opcode independent of string creation
Create a Text opcode independent of string creation.
This is used primarily by users who need to create just one particular valid op-code and the string
data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
location to pre-defined forms in HII)
@param StringToken - First string token of the text
@param StringTokenTwo - Second string token of the text
@param StringTokenThree - Help string token of the text
@param Flags - Flag of the text
@param Key - Key of the text
@param FormBuffer - Output of text as a form
@param StringToken First string token of the text
@param StringTokenTwo Second string token of the text
@param StringTokenThree Help string token of the text
@param Flags Flag of the text
@param Key Key of the text
@param FormBuffer Output of text as a form
@retval EFI_SUCCESS - Text created to be a form
@retval EFI_SUCCESS Text created to be a form
**/
EFI_STATUS
CreateTextOpCode (
IN STRING_REF StringToken,
IN STRING_REF StringTokenTwo,
IN STRING_REF StringTokenThree,
IN UINT8 Flags,
IN UINT16 Key,
IN OUT VOID *FormBuffer
IN STRING_REF StringToken,
IN STRING_REF StringTokenTwo,
IN STRING_REF StringTokenThree,
IN UINT8 Flags,
IN UINT16 Key,
IN OUT VOID *FormBuffer
)
{
FRAMEWORK_EFI_IFR_TEXT Text;
FRAMEWORK_EFI_IFR_TEXT Text;
Text.Header.OpCode = FRAMEWORK_EFI_IFR_TEXT_OP;
Text.Header.Length = sizeof (FRAMEWORK_EFI_IFR_TEXT);
@ -85,32 +85,32 @@ CreateTextOpCode (
}
/**
Create a hyperlink opcode independent of string creation
Create a hyperlink opcode independent of string creation.
This is used primarily by users who need to create just one particular valid op-code and the string
data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
location to pre-defined forms in HII)
@param FormId - Form ID of the hyperlink
@param StringToken - Prompt string token of the hyperlink
@param StringTokenTwo - Help string token of the hyperlink
@param Flags - Flags of the hyperlink
@param Key - Key of the hyperlink
@param FormBuffer - Output of hyperlink as a form
@retval EFI_SUCCESS - Hyperlink created to be a form
--*/
@param FormId Form ID of the hyperlink
@param StringToken Prompt string token of the hyperlink
@param StringTokenTwo Help string token of the hyperlink
@param Flags Flags of the hyperlink
@param Key Key of the hyperlink
@param FormBuffer Output of hyperlink as a form
@retval EFI_SUCCESS Hyperlink created to be a form
**/
EFI_STATUS
CreateGotoOpCode (
IN UINT16 FormId,
IN STRING_REF StringToken,
IN STRING_REF StringTokenTwo,
IN UINT8 Flags,
IN UINT16 Key,
IN OUT VOID *FormBuffer
IN UINT16 FormId,
IN STRING_REF StringToken,
IN STRING_REF StringTokenTwo,
IN UINT8 Flags,
IN UINT16 Key,
IN OUT VOID *FormBuffer
)
{
FRAMEWORK_EFI_IFR_REF Hyperlink;
FRAMEWORK_EFI_IFR_REF Hyperlink;
Hyperlink.Header.OpCode = FRAMEWORK_EFI_IFR_REF_OP;
Hyperlink.Header.Length = sizeof (FRAMEWORK_EFI_IFR_REF);
@ -134,34 +134,34 @@ CreateGotoOpCode (
OptionsList is a pointer to a null-terminated list of option descriptions. Ensure that OptionsList[x].StringToken
has been filled in since this routine will not generate StringToken values.
@param QuestionId - Question ID of the one-of box
@param DataWidth - DataWidth of the one-of box
@param PromptToken - Prompt string token of the one-of box
@param HelpToken - Help string token of the one-of box
@param OptionsList - Each string in it is an option of the one-of box
@param OptionCount - Option string count
@param FormBuffer - Output of One-Of box as a form
@param QuestionId Question ID of the one-of box
@param DataWidth DataWidth of the one-of box
@param PromptToken Prompt string token of the one-of box
@param HelpToken Help string token of the one-of box
@param OptionsList Each string in it is an option of the one-of box
@param OptionCount Option string count
@param FormBuffer Output of One-Of box as a form
@retval EFI_SUCCESS - One-Of box created to be a form
@retval EFI_DEVICE_ERROR - DataWidth > 2
@retval EFI_SUCCESS One-Of box created to be a form
@retval EFI_DEVICE_ERROR DataWidth > 2
**/
EFI_STATUS
CreateOneOfOpCode (
IN UINT16 QuestionId,
IN UINT8 DataWidth,
IN STRING_REF PromptToken,
IN STRING_REF HelpToken,
IN IFR_OPTION *OptionsList,
IN UINTN OptionCount,
IN OUT VOID *FormBuffer
IN UINT16 QuestionId,
IN UINT8 DataWidth,
IN STRING_REF PromptToken,
IN STRING_REF HelpToken,
IN IFR_OPTION *OptionsList,
IN UINTN OptionCount,
IN OUT VOID *FormBuffer
)
{
UINTN Index;
FRAMEWORK_EFI_IFR_ONE_OF OneOf;
FRAMEWORK_EFI_IFR_ONE_OF_OPTION OneOfOption;
FRAMEWORK_EFI_IFR_END_ONE_OF EndOneOf;
UINT8 *LocalBuffer;
UINTN Index;
FRAMEWORK_EFI_IFR_ONE_OF OneOf;
FRAMEWORK_EFI_IFR_ONE_OF_OPTION OneOfOption;
FRAMEWORK_EFI_IFR_END_ONE_OF EndOneOf;
UINT8 *LocalBuffer;
//
// We do not create op-code storage widths for one-of in excess of 16 bits for now
@ -175,9 +175,7 @@ CreateOneOfOpCode (
OneOf.QuestionId = QuestionId;
OneOf.Width = DataWidth;
OneOf.Prompt = PromptToken;
OneOf.Help = HelpToken;
LocalBuffer = (UINT8 *) FormBuffer;
CopyMem (LocalBuffer, &OneOf, sizeof (FRAMEWORK_EFI_IFR_ONE_OF));
@ -217,41 +215,39 @@ CreateOneOfOpCode (
OptionsList is a pointer to a null-terminated list of option descriptions. Ensure that OptionsList[x].StringToken
has been filled in since this routine will not generate StringToken values.
@param QuestionId - Question ID of the ordered list
@param MaxEntries - MaxEntries of the ordered list
@param PromptToken - Prompt string token of the ordered list
@param HelpToken - Help string token of the ordered list
@param OptionsList - Each string in it is an option of the ordered list
@param OptionCount - Option string count
@param FormBuffer - Output of ordered list as a form
@param QuestionId Question ID of the ordered list
@param MaxEntries MaxEntries of the ordered list
@param PromptToken Prompt string token of the ordered list
@param HelpToken Help string token of the ordered list
@param OptionsList Each string in it is an option of the ordered list
@param OptionCount Option string count
@param FormBuffer Output of ordered list as a form
@retval EFI_SUCCESS - Ordered list created to be a form
@retval EFI_SUCCESS Ordered list created to be a form
**/
EFI_STATUS
CreateOrderedListOpCode (
IN UINT16 QuestionId,
IN UINT8 MaxEntries,
IN STRING_REF PromptToken,
IN STRING_REF HelpToken,
IN IFR_OPTION *OptionsList,
IN UINTN OptionCount,
IN OUT VOID *FormBuffer
IN UINT16 QuestionId,
IN UINT8 MaxEntries,
IN STRING_REF PromptToken,
IN STRING_REF HelpToken,
IN IFR_OPTION *OptionsList,
IN UINTN OptionCount,
IN OUT VOID *FormBuffer
)
{
UINTN Index;
FRAMEWORK_EFI_IFR_ORDERED_LIST OrderedList;
FRAMEWORK_EFI_IFR_ONE_OF_OPTION OrderedListOption;
FRAMEWORK_EFI_IFR_END_ONE_OF EndOrderedList;
UINT8 *LocalBuffer;
UINTN Index;
FRAMEWORK_EFI_IFR_ORDERED_LIST OrderedList;
FRAMEWORK_EFI_IFR_ONE_OF_OPTION OrderedListOption;
FRAMEWORK_EFI_IFR_END_ONE_OF EndOrderedList;
UINT8 *LocalBuffer;
OrderedList.Header.OpCode = FRAMEWORK_EFI_IFR_ORDERED_LIST_OP;
OrderedList.Header.Length = sizeof (FRAMEWORK_EFI_IFR_ORDERED_LIST);
OrderedList.QuestionId = QuestionId;
OrderedList.MaxEntries = MaxEntries;
OrderedList.Prompt = PromptToken;
OrderedList.Help = HelpToken;
LocalBuffer = (UINT8 *) FormBuffer;
CopyMem (LocalBuffer, &OrderedList, sizeof (FRAMEWORK_EFI_IFR_ORDERED_LIST));
@ -283,35 +279,34 @@ CreateOrderedListOpCode (
}
/**
Create a checkbox opcode independent of string creation
Create a checkbox opcode independent of string creation.
This is used primarily by users who need to create just one particular valid op-code and the string
data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
location to pre-defined forms in HII)
@param QuestionId - Question ID of the check box
@param DataWidth - DataWidth of the check box
@param PromptToken - Prompt string token of the check box
@param HelpToken - Help string token of the check box
@param Flags - Flags of the check box
@param Key - Key of the check box
@param FormBuffer - Output of the check box as a form
@param QuestionId Question ID of the check box
@param DataWidth DataWidth of the check box
@param PromptToken Prompt string token of the check box
@param HelpToken Help string token of the check box
@param Flags Flags of the check box
@param Key Key of the check box
@param FormBuffer Output of the check box as a form
@retval EFI_SUCCESS - Checkbox created to be a form
@retval EFI_DEVICE_ERROR - DataWidth > 1
@retval EFI_SUCCESS Checkbox created to be a form
@retval EFI_DEVICE_ERROR DataWidth > 1
**/
EFI_STATUS
CreateCheckBoxOpCode (
IN UINT16 QuestionId,
IN UINT8 DataWidth,
IN STRING_REF PromptToken,
IN STRING_REF HelpToken,
IN UINT8 Flags,
IN UINT16 Key,
IN OUT VOID *FormBuffer
IN UINT16 QuestionId,
IN UINT8 DataWidth,
IN STRING_REF PromptToken,
IN STRING_REF HelpToken,
IN UINT8 Flags,
IN UINT16 Key,
IN OUT VOID *FormBuffer
)
{
FRAMEWORK_EFI_IFR_CHECKBOX CheckBox;
FRAMEWORK_EFI_IFR_CHECKBOX CheckBox;
//
// We do not create op-code storage widths for checkbox in excess of 8 bits for now
@ -325,7 +320,6 @@ CreateCheckBoxOpCode (
CheckBox.QuestionId = QuestionId;
CheckBox.Width = DataWidth;
CheckBox.Prompt = PromptToken;
CheckBox.Help = HelpToken;
CheckBox.Flags = Flags;
CheckBox.Key = Key;
@ -336,44 +330,43 @@ CreateCheckBoxOpCode (
}
/**
Create a numeric opcode independent of string creation
Create a numeric opcode independent of string creation.
This is used primarily by users who need to create just one particular valid op-code and the string
data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
location to pre-defined forms in HII)
@param QuestionId - Question ID of the numeric
@param DataWidth - DataWidth of the numeric
@param PromptToken - Prompt string token of the numeric
@param HelpToken - Help string token of the numeric
@param Minimum - Minumun boundary of the numeric
@param Maximum - Maximum boundary of the numeric
@param Step - Step of the numeric
@param Default - Default value of the numeric
@param Flags - Flags of the numeric
@param Key - Key of the numeric
@param FormBuffer - Output of the numeric as a form
@param QuestionId Question ID of the numeric
@param DataWidth DataWidth of the numeric
@param PromptToken Prompt string token of the numeric
@param HelpToken Help string token of the numeric
@param Minimum Minumun boundary of the numeric
@param Maximum Maximum boundary of the numeric
@param Step Step of the numeric
@param Default Default value of the numeric
@param Flags Flags of the numeric
@param Key Key of the numeric
@param FormBuffer Output of the numeric as a form
@retval EFI_SUCCESS - The numeric created to be a form.
@retval EFI_DEVICE_ERROR - DataWidth > 2
@retval EFI_SUCCESS The numeric created to be a form.
@retval EFI_DEVICE_ERROR DataWidth > 2
**/
EFI_STATUS
CreateNumericOpCode (
IN UINT16 QuestionId,
IN UINT8 DataWidth,
IN STRING_REF PromptToken,
IN STRING_REF HelpToken,
IN UINT16 Minimum,
IN UINT16 Maximum,
IN UINT16 Step,
IN UINT16 Default,
IN UINT8 Flags,
IN UINT16 Key,
IN OUT VOID *FormBuffer
IN UINT16 QuestionId,
IN UINT8 DataWidth,
IN STRING_REF PromptToken,
IN STRING_REF HelpToken,
IN UINT16 Minimum,
IN UINT16 Maximum,
IN UINT16 Step,
IN UINT16 Default,
IN UINT8 Flags,
IN UINT16 Key,
IN OUT VOID *FormBuffer
)
{
FRAMEWORK_EFI_IFR_NUMERIC Numeric;
FRAMEWORK_EFI_IFR_NUMERIC Numeric;
//
// We do not create op-code storage widths for numerics in excess of 16 bits for now
@ -387,7 +380,6 @@ CreateNumericOpCode (
Numeric.QuestionId = QuestionId;
Numeric.Width = DataWidth;
Numeric.Prompt = PromptToken;
Numeric.Help = HelpToken;
Numeric.Minimum = Minimum;
Numeric.Maximum = Maximum;
@ -402,45 +394,43 @@ CreateNumericOpCode (
}
/**
Create a numeric opcode independent of string creation
Create a numeric opcode independent of string creation.
This is used primarily by users who need to create just one particular valid op-code and the string
data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
location to pre-defined forms in HII)
@param QuestionId Question ID of the string
@param DataWidth DataWidth of the string
@param PromptToken Prompt token of the string
@param HelpToken Help token of the string
@param MinSize Min size boundary of the string
@param MaxSize Max size boundary of the string
@param Flags Flags of the string
@param Key Key of the string
@param FormBuffer Output of the string as a form
@param QuestionId Question ID of the string
@param DataWidth DataWidth of the string
@param PromptToken Prompt token of the string
@param HelpToken Help token of the string
@param MinSize Min size boundary of the string
@param MaxSize Max size boundary of the string
@param Flags Flags of the string
@param Key Key of the string
@param FormBuffer Output of the string as a form
@retval EFI_SUCCESS String created to be a form.
@retval EFI_SUCCESS String created to be a form.
**/
EFI_STATUS
CreateStringOpCode (
IN UINT16 QuestionId,
IN UINT8 DataWidth,
IN STRING_REF PromptToken,
IN STRING_REF HelpToken,
IN UINT8 MinSize,
IN UINT8 MaxSize,
IN UINT8 Flags,
IN UINT16 Key,
IN OUT VOID *FormBuffer
IN UINT16 QuestionId,
IN UINT8 DataWidth,
IN STRING_REF PromptToken,
IN STRING_REF HelpToken,
IN UINT8 MinSize,
IN UINT8 MaxSize,
IN UINT8 Flags,
IN UINT16 Key,
IN OUT VOID *FormBuffer
)
{
FRAMEWORK_EFI_IFR_STRING String;
FRAMEWORK_EFI_IFR_STRING String;
String.Header.OpCode = FRAMEWORK_EFI_IFR_STRING_OP;
String.Header.Length = sizeof (FRAMEWORK_EFI_IFR_STRING);
String.QuestionId = QuestionId;
String.Width = DataWidth;
String.Prompt = PromptToken;
String.Help = HelpToken;
String.MinSize = MinSize;
String.MaxSize = MaxSize;
@ -455,23 +445,22 @@ CreateStringOpCode (
/**
Create a banner opcode. This is primarily used by the FrontPage implementation from BDS.
@param Title - Title of the banner
@param LineNumber - LineNumber of the banner
@param Alignment - Alignment of the banner
@param FormBuffer - Output of banner as a form
@param Title Title of the banner
@param LineNumber LineNumber of the banner
@param Alignment Alignment of the banner
@param FormBuffer Output of banner as a form
@retval EFI_SUCCESS - Banner created to be a form.
@retval EFI_SUCCESS Banner created to be a form.
**/
EFI_STATUS
CreateBannerOpCode (
IN UINT16 Title,
IN UINT16 LineNumber,
IN UINT8 Alignment,
IN OUT VOID *FormBuffer
IN UINT16 Title,
IN UINT16 LineNumber,
IN UINT8 Alignment,
IN OUT VOID *FormBuffer
)
{
FRAMEWORK_EFI_IFR_BANNER Banner;
FRAMEWORK_EFI_IFR_BANNER Banner;
Banner.Header.OpCode = FRAMEWORK_EFI_IFR_BANNER_OP;
Banner.Header.Length = sizeof (FRAMEWORK_EFI_IFR_BANNER);