]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix coding style issue.
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 9 Apr 2008 07:15:51 +0000 (07:15 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 9 Apr 2008 07:15:51 +0000 (07:15 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5029 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrCommon.c
IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrOnTheFly.c
IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrOpCodeCreation.c
IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrVariable.c

index fb8b905e12399cf6369656f3f920a8e580d6fab4..567eb56a4d3373bd1cf10196d6a5584d290b209a 100644 (file)
@@ -17,25 +17,21 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 //\r
 #include "IfrSupportLibInternal.h"\r
 \r
+/**\r
+  Determine what is the current language setting\r
+  The setting is stored in language variable in flash. This routine\r
+  will get setting by accesssing that variable. If failed to access\r
+  language variable, then use default setting that 'eng' as current\r
+  language setting.\r
+  \r
+  @param Lang Pointer of system language\r
+  \r
+  @return whether sucess to get setting from variable\r
+**/\r
 EFI_STATUS\r
 GetCurrentLanguage (\r
   OUT     CHAR16              *Lang\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Determine what is the current language setting\r
-\r
-Arguments:\r
-\r
-  Lang      - Pointer of system language\r
-\r
-Returns:\r
-\r
-  Status code\r
-\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
   UINTN       Size;\r
@@ -75,7 +71,17 @@ Returns:
   return Status;\r
 }\r
 \r
-\r
+/**\r
+  Add a string to the incoming buffer and return the token and offset data\r
+  \r
+  @param StringBuffer      The incoming buffer\r
+  @param Language          Currrent language\r
+  @param String            The string to be added\r
+  @param StringToken       The index where the string placed  \r
+  \r
+  @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
+  @retval EFI_SUCCESS          String successfully added to the incoming buffer\r
+**/\r
 EFI_STATUS\r
 AddString (\r
   IN      VOID                *StringBuffer,\r
@@ -83,29 +89,6 @@ AddString (
   IN      CHAR16              *String,\r
   IN OUT  STRING_REF          *StringToken\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Add a string to the incoming buffer and return the token and offset data\r
-\r
-Arguments:\r
-\r
-  StringBuffer      - The incoming buffer\r
-\r
-  Language          - Currrent language\r
-\r
-  String            - The string to be added\r
-\r
-  StringToken       - The index where the string placed\r
-\r
-Returns:\r
-\r
-  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
-\r
-  EFI_SUCCESS             - String successfully added to the incoming buffer\r
-\r
---*/\r
 {\r
   EFI_HII_STRING_PACK *StringPack;\r
   EFI_HII_STRING_PACK *StringPackBuffer;\r
@@ -298,31 +281,20 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-\r
+/**\r
+  Add op-code data to the FormBuffer\r
+  \r
+  @param FormBuffer      Form buffer to be inserted to\r
+  @param OpCodeData      Op-code data to be inserted  \r
+  \r
+  @retval EFI_OUT_OF_RESOURCES    No enough buffer to allocate\r
+  @retval EFI_SUCCESS             Op-code data successfully inserted  \r
+**/\r
 EFI_STATUS\r
 AddOpCode (\r
   IN      VOID                *FormBuffer,\r
   IN OUT  VOID                *OpCodeData\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Add op-code data to the FormBuffer\r
-\r
-Arguments:\r
-\r
-  FormBuffer      - Form buffer to be inserted to\r
-\r
-  OpCodeData      - Op-code data to be inserted\r
-\r
-Returns:\r
-\r
-  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
-\r
-  EFI_SUCCESS             - Op-code data successfully inserted\r
-\r
---*/\r
 {\r
   EFI_HII_PACK_HEADER *NewBuffer;\r
   UINT8               *Source;\r
@@ -415,26 +387,18 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Get the HII protocol interface\r
+  \r
+  @param Hii     HII protocol interface\r
+  \r
+  @return the statue of locating HII protocol\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 GetHiiInterface (\r
   OUT     EFI_HII_PROTOCOL    **Hii\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Get the HII protocol interface\r
-\r
-Arguments:\r
-\r
-  Hii     - HII protocol interface\r
-\r
-Returns:\r
-\r
-  Status code\r
-\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
 \r
@@ -450,7 +414,19 @@ Returns:
   return Status;;\r
 }\r
 \r
-\r
+/**\r
+  Extract information pertaining to the HiiHandle\r
+  \r
+  @param HiiHandle       Hii handle\r
+  @param ImageLength     For input, length of DefaultImage;\r
+                         For output, length of actually required\r
+  @param DefaultImage    Image buffer prepared by caller\r
+  @param Guid            Guid information about the form \r
+  \r
+  @retval EFI_OUT_OF_RESOURCES    No enough buffer to allocate\r
+  @retval EFI_BUFFER_TOO_SMALL    DefualtImage has no enough ImageLength\r
+  @retval EFI_SUCCESS             Successfully extract data from Hii database.\r
+**/\r
 EFI_STATUS\r
 ExtractDataFromHiiHandle (\r
   IN      FRAMEWORK_EFI_HII_HANDLE       HiiHandle,\r
@@ -458,33 +434,6 @@ ExtractDataFromHiiHandle (
   OUT     UINT8               *DefaultImage,\r
   OUT     EFI_GUID            *Guid\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Extract information pertaining to the HiiHandle\r
-\r
-Arguments:\r
-\r
-  HiiHandle       - Hii handle\r
-\r
-  ImageLength     - For input, length of DefaultImage;\r
-                    For output, length of actually required\r
-\r
-  DefaultImage    - Image buffer prepared by caller\r
-\r
-  Guid            - Guid information about the form\r
-\r
-Returns:\r
-\r
-  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
-\r
-  EFI_BUFFER_TOO_SMALL    - DefualtImage has no enough ImageLength\r
-\r
-  EFI_SUCCESS             - Successfully extract data from Hii database.\r
-\r
-\r
---*/\r
 {\r
   EFI_STATUS        Status;\r
   EFI_HII_PROTOCOL  *Hii;\r
@@ -630,28 +579,22 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Finds HII handle for given pack GUID previously registered with the HII.\r
+  \r
+  @param HiiProtocol pointer to pointer to HII protocol interface.\r
+                     If NULL, the interface will be found but not returned.\r
+                     If it points to NULL, the interface will be found and\r
+                     written back to the pointer that is pointed to.\r
+  @param Guid        The GUID of the pack that registered with the HII.\r
 \r
+  @return  Handle to the HII pack previously registered by the memory driver.\r
+**/\r
 FRAMEWORK_EFI_HII_HANDLE \r
 FindHiiHandle (\r
   IN OUT EFI_HII_PROTOCOL    **HiiProtocol, OPTIONAL\r
   IN     EFI_GUID            *Guid\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Finds HII handle for given pack GUID previously registered with the HII.\r
-\r
-Arguments:\r
-  HiiProtocol - pointer to pointer to HII protocol interface.\r
-                If NULL, the interface will be found but not returned.\r
-                If it points to NULL, the interface will be found and\r
-                written back to the pointer that is pointed to.\r
-  Guid        - The GUID of the pack that registered with the HII.\r
-\r
-Returns:\r
-  Handle to the HII pack previously registered by the memory driver.\r
-\r
---*/\r
 {\r
   EFI_STATUS        Status;\r
 \r
@@ -746,34 +689,24 @@ lbl_exit:
   return HiiHandle;\r
 }\r
 \r
+/**\r
+  Validate that the data associated with the HiiHandle in NVRAM is within\r
+  the reasonable parameters for that FormSet.  Values for strings and passwords\r
+  are not verified due to their not having the equivalent of valid range settings.\r
+\r
+  @param HiiHandle    Handle of the HII database entry to query\r
 \r
+  @param Results      If return Status is EFI_SUCCESS, Results provides valid data\r
+                      TRUE  = NVRAM Data is within parameters\r
+                      FALSE = NVRAM Data is NOT within parameters\r
+  @retval EFI_OUT_OF_RESOURCES      No enough buffer to allocate\r
+  @retval EFI_SUCCESS               Data successfully validated\r
+**/\r
 EFI_STATUS\r
 ValidateDataFromHiiHandle (\r
   IN      FRAMEWORK_EFI_HII_HANDLE       HiiHandle,\r
   OUT     BOOLEAN             *Results\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Validate that the data associated with the HiiHandle in NVRAM is within\r
-  the reasonable parameters for that FormSet.  Values for strings and passwords\r
-  are not verified due to their not having the equivalent of valid range settings.\r
-\r
-Arguments:\r
-\r
-  HiiHandle -   Handle of the HII database entry to query\r
-\r
-  Results -     If return Status is EFI_SUCCESS, Results provides valid data\r
-                TRUE  = NVRAM Data is within parameters\r
-                FALSE = NVRAM Data is NOT within parameters\r
-\r
-Returns:\r
-\r
-  EFI_OUT_OF_RESOURCES      - No enough buffer to allocate\r
-\r
-  EFI_SUCCESS               - Data successfully validated\r
---*/\r
 {\r
   EFI_STATUS        Status;\r
   EFI_HII_PROTOCOL  *Hii;\r
index db4f52f73b89ea52e53ccd3d49ffa1acba3fe08c..7772b499255b71635661a65fd78fa32781b54a85 100644 (file)
@@ -1,4 +1,6 @@
 /** @file\r
+  Library Routines to create IFR on-the-fly\r
+  \r
 Copyright (c) 2006, Intel Corporation                                                         \r
 All rights reserved. This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
@@ -8,15 +10,6 @@ http://opensource.org/licenses/bsd-license.php
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
 \r
-Module Name:\r
-  IfrOnTheFly.c\r
-\r
-Abstract:\r
-\r
-  Library Routines to create IFR on-the-fly\r
-\r
-Revision History:\r
-\r
 **/\r
 \r
 //\r
@@ -24,6 +17,22 @@ Revision History:
 //\r
 #include "IfrSupportLibInternal.h"\r
 \r
+/**\r
+  Create a formset\r
+  \r
+  The form package is a collection of forms that are intended to describe the pages that will be\r
+  displayed to the user.\r
+  \r
+  @param FormSetTitle         Title of formset\r
+  @param Guid                 Guid of formset\r
+  @param Class                Class of formset\r
+  @param SubClass             Sub class of formset\r
+  @param FormBuffer           Pointer of the formset created\r
+  @param StringBuffer         Pointer of FormSetTitile string created\r
+  \r
+  @retval EFI_OUT_OF_RESOURCES     No enough buffer to allocate\r
+  @retval EFI_SUCCESS              Formset successfully created  \r
+**/\r
 EFI_STATUS\r
 CreateFormSet (\r
   IN      CHAR16              *FormSetTitle,\r
@@ -33,33 +42,6 @@ CreateFormSet (
   IN OUT  VOID                **FormBuffer,\r
   IN OUT  VOID                **StringBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a formset\r
-  \r
-Arguments:\r
-  \r
-  FormSetTitle        - Title of formset\r
-  \r
-  Guid                - Guid of formset\r
-  \r
-  Class               - Class of formset\r
-  \r
-  SubClass            - Sub class of formset\r
-  \r
-  FormBuffer          - Pointer of the formset created\r
-  \r
-  StringBuffer        - Pointer of FormSetTitile string created\r
-  \r
-Returns: \r
-\r
-  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
-  \r
-  EFI_SUCCESS             - Formset successfully created\r
-\r
---*/\r
 {\r
   EFI_STATUS            Status;\r
   EFI_HII_IFR_PACK      IfrPack;\r
@@ -139,7 +121,19 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-\r
+/**\r
+  Create a form\r
+  A form is the encapsulation of what amounts to a browser page. The header defines a FormId,\r
+  which is referenced by the form package, among others. It also defines a FormTitle, which is a\r
+  string to be used as the title for the form\r
+  \r
+  @param FormTitle        Title of the form\r
+  @param FormId           Id of the form\r
+  @param FormBuffer       Pointer of the form created\r
+  @param StringBuffer     Pointer of FormTitil string created\r
+  \r
+  @retval EFI_SUCCESS     Form successfully created\r
+**/\r
 EFI_STATUS\r
 CreateForm (\r
   IN      CHAR16              *FormTitle,\r
@@ -147,27 +141,6 @@ CreateForm (
   IN OUT  VOID                *FormBuffer,\r
   IN OUT  VOID                *StringBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a form\r
-  \r
-Arguments:\r
-  \r
-  FormTitle       - Title of the form\r
-  \r
-  FormId          - Id of the form\r
-  \r
-  FormBuffer          - Pointer of the form created\r
-  \r
-  StringBuffer        - Pointer of FormTitil string created\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Form successfully created\r
-\r
---*/\r
 {\r
   EFI_STATUS        Status;\r
   FRAMEWORK_EFI_IFR_FORM      Form;\r
@@ -202,39 +175,27 @@ Returns:
 \r
   Status                = AddOpCode (FormBuffer, &EndForm);\r
 \r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
-\r
+/**\r
+  Create a SubTitle\r
+  \r
+  Subtitle strings are intended to be used by authors to separate sections of questions into semantic\r
+  groups.\r
+  \r
+  @param SubTitle         Sub title to be created\r
+  @param FormBuffer       Where this subtitle to add to\r
+  @param StringBuffer     String buffer created for subtitle\r
+  \r
+  @retval EFI_SUCCESS      Subtitle successfully created\r
+**/\r
 EFI_STATUS\r
 CreateSubTitle (\r
   IN      CHAR16              *SubTitle,\r
   IN OUT  VOID                *FormBuffer,\r
   IN OUT  VOID                *StringBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a SubTitle\r
-  \r
-Arguments:\r
-  \r
-  SubTitle        - Sub title to be created\r
-  \r
-  FormBuffer      - Where this subtitle to add to\r
-  \r
-  StringBuffer    - String buffer created for subtitle\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Subtitle successfully created\r
-\r
---*/\r
 {\r
   EFI_STATUS        Status;\r
   FRAMEWORK_EFI_IFR_SUBTITLE  Subtitle;\r
@@ -258,14 +219,24 @@ Returns:
 \r
   Status                  = AddOpCode (FormBuffer, &Subtitle);\r
 \r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
-\r
+/**\r
+  Create a line of text\r
+  Unlike HTML, text is simply another tag. \r
+  This tag type enables IFR to be more easily localized.\r
+  \r
+  @param String          - First string of the text\r
+  @param String2         - Second string of the text\r
+  @param String3         - Help string of the text\r
+  @param Flags           - Flag of the text\r
+  @param Key             - Key of the text\r
+  @param FormBuffer      - The form where this text adds to\r
+  @param StringBuffer    - String buffer created for String, String2 and String3\r
+  \r
+  @retval EFI_SUCCESS     - Text successfully created\r
+**/\r
 EFI_STATUS\r
 CreateText (\r
   IN      CHAR16              *String,\r
@@ -276,33 +247,6 @@ CreateText (
   IN OUT  VOID                *FormBuffer,\r
   IN OUT  VOID                *StringBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a line of text\r
-  \r
-Arguments:\r
-  \r
-  String          - First string of the text\r
-  \r
-  String2         - Second string of the text\r
-  \r
-  String3         - Help string of the text\r
-  \r
-  Flags           - Flag of the text\r
-  \r
-  Key             - Key of the text\r
-  \r
-  FormBuffer      - The form where this text adds to\r
-  \r
-  StringBuffer    - String buffer created for String, String2 and String3\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Text successfully created\r
-\r
---*/\r
 {\r
   EFI_STATUS    Status;\r
   FRAMEWORK_EFI_IFR_TEXT  Text;\r
@@ -354,14 +298,19 @@ Returns:
 \r
   Status    = AddOpCode (FormBuffer, &Text);\r
 \r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
-\r
+/**\r
+  Create a hyperlink\r
+  \r
+  @param FormId         Form ID of the hyperlink\r
+  @param Prompt         Prompt of the hyperlink\r
+  @param FormBuffer     The form where this hyperlink adds to\r
+  @param StringBuffer   String buffer created for Prompt\r
+  \r
+  @retval EFI_SUCCESS   Hyperlink successfully created  \r
+**/\r
 EFI_STATUS\r
 CreateGoto (\r
   IN      UINT16              FormId,\r
@@ -369,27 +318,6 @@ CreateGoto (
   IN OUT  VOID                *FormBuffer,\r
   IN OUT  VOID                *StringBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a hyperlink\r
-  \r
-Arguments:\r
-  \r
-  FormId        - Form ID of the hyperlink\r
-  \r
-  Prompt        - Prompt of the hyperlink\r
-  \r
-  FormBuffer    - The form where this hyperlink adds to\r
-  \r
-  StringBuffer  - String buffer created for Prompt\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Hyperlink successfully created\r
-\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
   FRAMEWORK_EFI_IFR_REF Hyperlink;\r
@@ -414,14 +342,25 @@ Returns:
 \r
   Status                  = AddOpCode (FormBuffer, &Hyperlink);\r
 \r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
+/**\r
+  Create a one-of question with a set of options to choose from.  The\r
+  OptionsList is a pointer to a null-terminated list of option descriptions.\r
 \r
+  @param QuestionId      - Question ID of the one-of box\r
+  @param DataWidth       - DataWidth of the one-of box\r
+  @param Prompt          - Prompt of the one-of box\r
+  @param Help            - Help of the one-of box\r
+  @param OptionsList     - Each string in it is an option of the one-of box\r
+  @param OptionCount     - Option string count\r
+  @param FormBuffer      - The form where this one-of box adds to\r
+  @param StringBuffer    - String buffer created for Prompt, Help and Option strings\r
+  \r
+  @retval EFI_DEVICE_ERROR    - DataWidth > 2\r
+  @retval EFI_SUCCESS         - One-Of box successfully created.\r
+**/\r
 EFI_STATUS\r
 CreateOneOf (\r
   IN      UINT16              QuestionId,\r
@@ -433,38 +372,6 @@ CreateOneOf (
   IN OUT  VOID                *FormBuffer,\r
   IN OUT  VOID                *StringBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a one-of question with a set of options to choose from.  The\r
-  OptionsList is a pointer to a null-terminated list of option descriptions.\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the one-of box\r
-  \r
-  DataWidth       - DataWidth of the one-of box\r
-  \r
-  Prompt          - Prompt of the one-of box\r
-  \r
-  Help            - Help of the one-of box\r
-  \r
-  OptionsList     - Each string in it is an option of the one-of box\r
-  \r
-  OptionCount     - Option string count\r
-  \r
-  FormBuffer      - The form where this one-of box adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt, Help and Option strings\r
-  \r
-Returns: \r
-\r
-  EFI_DEVICE_ERROR    - DataWidth > 2\r
-\r
-  EFI_SUCCESS         - One-Of box successfully created.\r
-\r
---*/\r
 {\r
   EFI_STATUS            Status;\r
   UINTN                 Index;\r
@@ -551,6 +458,21 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Create a one-of question with a set of options to choose from.  The\r
+  OptionsList is a pointer to a null-terminated list of option descriptions.\r
+  \r
+  @param QuestionId      - Question ID of the ordered list\r
+  @param MaxEntries      - MaxEntries of the ordered list\r
+  @param Prompt          - Prompt of the ordered list\r
+  @param Help            - Help of the ordered list\r
+  @param OptionsList     - Each string in it is an option of the ordered list\r
+  @param OptionCount     - Option string count\r
+  @param FormBuffer      - The form where this ordered list adds to\r
+  @param StringBuffer    - String buffer created for Prompt, Help and Option strings\r
+  \r
+  @retval EFI_SUCCESS     - Ordered list successfully created.\r
+**/\r
 EFI_STATUS\r
 CreateOrderedList (\r
   IN      UINT16              QuestionId,\r
@@ -562,36 +484,6 @@ CreateOrderedList (
   IN OUT  VOID                *FormBuffer,\r
   IN OUT  VOID                *StringBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a one-of question with a set of options to choose from.  The\r
-  OptionsList is a pointer to a null-terminated list of option descriptions.\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the ordered list\r
-  \r
-  MaxEntries      - MaxEntries of the ordered list\r
-  \r
-  Prompt          - Prompt of the ordered list\r
-  \r
-  Help            - Help of the ordered list\r
-  \r
-  OptionsList     - Each string in it is an option of the ordered list\r
-  \r
-  OptionCount     - Option string count\r
-  \r
-  FormBuffer      - The form where this ordered list adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt, Help and Option strings\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Ordered list successfully created.\r
-\r
---*/\r
 {\r
   EFI_STATUS            Status;\r
   UINTN                 Index;\r
@@ -664,14 +556,23 @@ Returns:
 \r
   Status                        = AddOpCode (FormBuffer, &EndOrderedList);\r
 \r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
-\r
+/**\r
+  Create a checkbox\r
+  \r
+  @param QuestionId       Question ID of the check box\r
+  @param DataWidth        DataWidth of the check box\r
+  @param Prompt           Prompt of the check box\r
+  @param Help             Help of the check box  \r
+  @param Flags            Flags of the check box\r
+  @param FormBuffer       The form where this check box adds to\r
+  @param StringBuffer     String buffer created for Prompt and Help.\r
+  \r
+  @retval  EFI_DEVICE_ERROR    DataWidth > 1\r
+  @retval EFI_SUCCESS          Check box successfully created\r
+**/\r
 EFI_STATUS\r
 CreateCheckBox (\r
   IN      UINT16              QuestionId,\r
@@ -682,35 +583,6 @@ CreateCheckBox (
   IN OUT  VOID                *FormBuffer,\r
   IN OUT  VOID                *StringBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a checkbox\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the check box\r
-  \r
-  DataWidth       - DataWidth of the check box\r
-  \r
-  Prompt          - Prompt of the check box\r
-  \r
-  Help            - Help of the check box\r
-  \r
-  Flags           - Flags of the check box\r
-  \r
-  FormBuffer      - The form where this check box adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt and Help.\r
-  \r
-Returns: \r
-\r
-  EFI_DEVICE_ERROR    - DataWidth > 1\r
-\r
-  EFI_SUCCESS         - Check box successfully created\r
-\r
---*/\r
 {\r
   EFI_STATUS        Status;\r
   FRAMEWORK_EFI_IFR_CHECKBOX  CheckBox;\r
@@ -757,15 +629,29 @@ Returns:
   CheckBox.Flags  = (UINT8) (Flags | FRAMEWORK_EFI_IFR_FLAG_CREATED);\r
 \r
   Status          = AddOpCode (FormBuffer, &CheckBox);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
+  \r
+  return Status;\r
 }\r
 \r
-\r
+/**\r
+  Create a numeric\r
+  \r
+  @param QuestionId       Question ID of the numeric\r
+  @param DataWidth        DataWidth of the numeric\r
+  @param Prompt           Prompt of the numeric\r
+  @param Help             Help of the numeric\r
+  @param Minimum          Minumun boundary of the numeric\r
+  @param Maximum          Maximum boundary of the numeric\r
+  @param Step             Step of the numeric\r
+  @param Default          Default value\r
+  @param Flags            Flags of the numeric\r
+  @param Key              Key of the numeric\r
+  @param FormBuffer       The form where this numeric adds to\r
+  @param StringBuffer     String buffer created for Prompt and Help.\r
+\r
+  @retval EFI_DEVICE_ERROR       DataWidth > 2\r
+  @retval EFI_SUCCESS            Numeric is successfully created  \r
+**/\r
 EFI_STATUS\r
 CreateNumeric (\r
   IN      UINT16              QuestionId,\r
@@ -781,45 +667,6 @@ CreateNumeric (
   IN OUT  VOID                *FormBuffer,\r
   IN OUT  VOID                *StringBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a numeric\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the numeric\r
-  \r
-  DataWidth       - DataWidth of the numeric\r
-  \r
-  Prompt          - Prompt of the numeric\r
-  \r
-  Help            - Help of the numeric\r
-  \r
-  Minimum         - Minumun boundary of the numeric\r
-  \r
-  Maximum         - Maximum boundary of the numeric\r
-  \r
-  Step            - Step of the numeric\r
-  \r
-  Default         - Default value\r
-  \r
-  Flags           - Flags of the numeric\r
-  \r
-  Key             - Key of the numeric\r
-  \r
-  FormBuffer      - The form where this numeric adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt and Help.\r
-  \r
-Returns: \r
-\r
-  EFI_DEVICE_ERROR      - DataWidth > 2\r
-  \r
-  EFI_SUCCESS           - Numeric is successfully created\r
-\r
---*/\r
 {\r
   EFI_STATUS      Status;\r
   FRAMEWORK_EFI_IFR_NUMERIC Numeric;\r
@@ -872,14 +719,24 @@ Returns:
 \r
   Status          = AddOpCode (FormBuffer, &Numeric);\r
 \r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
-\r
+/**\r
+  Create a string\r
+  \r
+  @param QuestionId      - Question ID of the string\r
+  @param DataWidth       - DataWidth of the string\r
+  @param Prompt          - Prompt of the string\r
+  @param Help            - Help of the string\r
+  @param MinSize         - Min size boundary of the string\r
+  @param MaxSize         - Max size boundary of the string\r
+  @param Flags           - Flags of the string\r
+  @param Key             - Key of the string\r
+  @param FormBuffer      - The form where this string adds to\r
+  @param StringBuffer    - String buffer created for Prompt and Help.\r
+  @retval EFI_SUCCESS     - String successfully created.  \r
+**/\r
 EFI_STATUS\r
 CreateString (\r
   IN      UINT16              QuestionId,\r
@@ -893,39 +750,6 @@ CreateString (
   IN OUT  VOID                *FormBuffer,\r
   IN OUT  VOID                *StringBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a string\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the string\r
-  \r
-  DataWidth       - DataWidth of the string\r
-  \r
-  Prompt          - Prompt of the string\r
-  \r
-  Help            - Help of the string\r
-  \r
-  MinSize         - Min size boundary of the string\r
-  \r
-  MaxSize         - Max size boundary of the string\r
-    \r
-  Flags           - Flags of the string\r
-  \r
-  Key             - Key of the string\r
-  \r
-  FormBuffer      - The form where this string adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt and Help.\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - String successfully created.\r
-\r
---*/\r
 {\r
   EFI_STATUS      Status;\r
   FRAMEWORK_EFI_IFR_STRING  String;\r
@@ -969,9 +793,6 @@ Returns:
 \r
   Status          = AddOpCode (FormBuffer, &String);\r
 \r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
+\r
index 305532083b0f84d7cda4410de01ee917a2dd75f8..cbb5cfa07cc9213bdd79527a74b036575412cf1c 100644 (file)
@@ -1,4 +1,7 @@
 /** @file\r
+  Library Routines to create IFR independent of string data - assume tokens already exist\r
+  Primarily to be used for exporting op-codes at a label in pre-defined forms.\r
+\r
 Copyright (c) 2006, Intel Corporation                                                         \r
 All rights reserved. This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
@@ -8,15 +11,6 @@ http://opensource.org/licenses/bsd-license.php
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
 \r
-Module Name:\r
-  IfrOpCodeCreation.c\r
-\r
-Abstract:\r
-\r
-  Library Routines to create IFR independent of string data - assume tokens already exist\r
-  Primarily to be used for exporting op-codes at a label in pre-defined forms.\r
-\r
-Revision History:\r
 \r
 **/\r
 \r
@@ -25,31 +19,22 @@ Revision History:
 //\r
 #include "IfrSupportLibInternal.h"\r
 \r
-EFI_STATUS\r
-CreateSubTitleOpCode (\r
-  IN      STRING_REF          StringToken,\r
-  IN OUT  VOID                *FormBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Create a SubTitle opcode independent of string creation\r
   This is used primarily by users who need to create just one particular valid op-code and the string\r
   data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
   location to pre-defined forms in HII)\r
   \r
-Arguments:\r
+  @param StringToken      StringToken of the subtitle\r
+  @param FormBuffer       Output of subtitle as a form\r
   \r
-  StringToken     - StringToken of the subtitle\r
-  \r
-  FormBuffer      - Output of subtitle as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Subtitle created to be a form\r
-\r
---*/\r
+  @retval EFI_SUCCESS     Subtitle created to be a form\r
+**/\r
+EFI_STATUS\r
+CreateSubTitleOpCode (\r
+  IN      STRING_REF          StringToken,\r
+  IN OUT  VOID                *FormBuffer\r
+  )\r
 {\r
   FRAMEWORK_EFI_IFR_SUBTITLE  Subtitle;\r
 \r
@@ -61,7 +46,21 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Create a Text opcode independent of string creation\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+\r
+  @param StringToken               - First string token of the text\r
+  @param StringTokenTwo            - Second string token of the text\r
+  @param StringTokenThree          - Help string token of the text\r
+  @param Flags                     - Flag of the text\r
+  @param Key                       - Key of the text\r
+  @param FormBuffer                - Output of text as a form\r
 \r
+  @retval EFI_SUCCESS       - Text created to be a form\r
+**/\r
 EFI_STATUS\r
 CreateTextOpCode (\r
   IN      STRING_REF          StringToken,\r
@@ -71,34 +70,6 @@ CreateTextOpCode (
   IN      UINT16              Key,\r
   IN OUT  VOID                *FormBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a Text opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
-Arguments:\r
-  \r
-  StringToken               - First string token of the text\r
-  \r
-  StringTokenTwo            - Second string token of the text\r
-  \r
-  StringTokenThree          - Help string token of the text\r
-  \r
-  Flags                     - Flag of the text\r
-  \r
-  Key                       - Key of the text\r
-  \r
-  FormBuffer                - Output of text as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS       - Text created to be a form\r
-\r
---*/\r
 {\r
   FRAMEWORK_EFI_IFR_TEXT  Text;\r
 \r
@@ -116,7 +87,21 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Create a hyperlink opcode independent of string creation\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+  \r
 \r
+  @param FormId          - Form ID of the hyperlink\r
+  @param StringToken     - Prompt string token of the hyperlink\r
+  @param StringTokenTwo  - Help string token of the hyperlink\r
+  @param Flags           - Flags of the hyperlink\r
+  @param Key             - Key of the hyperlink\r
+  @param FormBuffer      - Output of hyperlink as a form\r
+  @retval EFI_SUCCESS   - Hyperlink created to be a form\r
+--*/\r
 EFI_STATUS\r
 CreateGotoOpCode (\r
   IN      UINT16              FormId,\r
@@ -126,34 +111,7 @@ CreateGotoOpCode (
   IN      UINT16              Key,\r
   IN OUT  VOID                *FormBuffer\r
   )\r
-/*++\r
 \r
-Routine Description:\r
-\r
-  Create a hyperlink opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
-Arguments:\r
-  \r
-  FormId          - Form ID of the hyperlink\r
-  \r
-  StringToken     - Prompt string token of the hyperlink\r
-  \r
-  StringTokenTwo  - Help string token of the hyperlink\r
-  \r
-  Flags           - Flags of the hyperlink\r
-  \r
-  Key             - Key of the hyperlink\r
-  \r
-  FormBuffer      - Output of hyperlink as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS   - Hyperlink created to be a form\r
-\r
---*/\r
 {\r
   FRAMEWORK_EFI_IFR_REF Hyperlink;\r
 \r
@@ -170,7 +128,27 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Create a one-of opcode with a set of option op-codes to choose from independent of string creation.\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+\r
+  OptionsList is a pointer to a null-terminated list of option descriptions.  Ensure that OptionsList[x].StringToken\r
+  has been filled in since this routine will not generate StringToken values.\r
+  \r
+  @param QuestionId      - Question ID of the one-of box\r
+  @param DataWidth       - DataWidth of the one-of box\r
+  @param PromptToken     - Prompt string token of the one-of box\r
+  @param HelpToken       - Help string token of the one-of box\r
+  @param OptionsList     - Each string in it is an option of the one-of box\r
+  @param OptionCount     - Option string count\r
+  @param FormBuffer      - Output of One-Of box as a form\r
+  \r
 \r
+  @retval EFI_SUCCESS         - One-Of box created to be a form\r
+  @retval EFI_DEVICE_ERROR    - DataWidth > 2\r
+**/\r
 EFI_STATUS\r
 CreateOneOfOpCode (\r
   IN      UINT16              QuestionId,\r
@@ -181,41 +159,6 @@ CreateOneOfOpCode (
   IN      UINTN               OptionCount,\r
   IN OUT  VOID                *FormBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a one-of opcode with a set of option op-codes to choose from independent of string creation.\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-\r
-  OptionsList is a pointer to a null-terminated list of option descriptions.  Ensure that OptionsList[x].StringToken\r
-  has been filled in since this routine will not generate StringToken values.\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the one-of box\r
-  \r
-  DataWidth       - DataWidth of the one-of box\r
-  \r
-  PromptToken     - Prompt string token of the one-of box\r
-  \r
-  HelpToken       - Help string token of the one-of box\r
-  \r
-  OptionsList     - Each string in it is an option of the one-of box\r
-  \r
-  OptionCount     - Option string count\r
-  \r
-  FormBuffer      - Output of One-Of box as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS         - One-Of box created to be a form\r
-  \r
-  EFI_DEVICE_ERROR    - DataWidth > 2\r
-\r
---*/\r
 {\r
   UINTN                 Index;\r
   FRAMEWORK_EFI_IFR_ONE_OF        OneOf;\r
@@ -268,6 +211,25 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Create a ordered list opcode with a set of option op-codes to choose from independent of string creation.\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+\r
+  OptionsList is a pointer to a null-terminated list of option descriptions.  Ensure that OptionsList[x].StringToken\r
+  has been filled in since this routine will not generate StringToken values.\r
+  \r
+  @param QuestionId      - Question ID of the ordered list\r
+  @param MaxEntries      - MaxEntries of the ordered list\r
+  @param PromptToken     - Prompt string token of the ordered list\r
+  @param HelpToken       - Help string token of the ordered list\r
+  @param OptionsList     - Each string in it is an option of the ordered list\r
+  @param OptionCount     - Option string count\r
+  @param FormBuffer      - Output of ordered list as a form\r
+  \r
+  @retval EFI_SUCCESS     - Ordered list created to be a form\r
+**/\r
 EFI_STATUS\r
 CreateOrderedListOpCode (\r
   IN      UINT16              QuestionId,\r
@@ -278,39 +240,6 @@ CreateOrderedListOpCode (
   IN      UINTN               OptionCount,\r
   IN OUT  VOID                *FormBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a ordered list opcode with a set of option op-codes to choose from independent of string creation.\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-\r
-  OptionsList is a pointer to a null-terminated list of option descriptions.  Ensure that OptionsList[x].StringToken\r
-  has been filled in since this routine will not generate StringToken values.\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the ordered list\r
-  \r
-  MaxEntries      - MaxEntries of the ordered list\r
-  \r
-  PromptToken     - Prompt string token of the ordered list\r
-  \r
-  HelpToken       - Help string token of the ordered list\r
-  \r
-  OptionsList     - Each string in it is an option of the ordered list\r
-  \r
-  OptionCount     - Option string count\r
-  \r
-  FormBuffer      - Output of ordered list as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Ordered list created to be a form\r
-\r
---*/\r
 {\r
   UINTN                 Index;\r
   FRAMEWORK_EFI_IFR_ORDERED_LIST  OrderedList;\r
@@ -356,6 +285,23 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Create a checkbox opcode independent of string creation\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+\r
+  @param QuestionId      - Question ID of the check box\r
+  @param DataWidth       - DataWidth of the check box\r
+  @param PromptToken     - Prompt string token of the check box\r
+  @param HelpToken       - Help string token of the check box\r
+  @param Flags           - Flags of the check box\r
+  @param Key             - Key of the check box\r
+  @param FormBuffer      - Output of the check box as a form\r
+\r
+  @retval EFI_SUCCESS       - Checkbox created to be a form\r
+  @retval EFI_DEVICE_ERROR  - DataWidth > 1\r
+**/\r
 EFI_STATUS\r
 CreateCheckBoxOpCode (\r
   IN      UINT16              QuestionId,\r
@@ -366,38 +312,7 @@ CreateCheckBoxOpCode (
   IN      UINT16              Key,\r
   IN OUT  VOID                *FormBuffer\r
   )\r
-/*++\r
 \r
-Routine Description:\r
-\r
-  Create a checkbox opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the check box\r
-  \r
-  DataWidth       - DataWidth of the check box\r
-  \r
-  PromptToken     - Prompt string token of the check box\r
-  \r
-  HelpToken       - Help string token of the check box\r
-  \r
-  Flags           - Flags of the check box\r
-  \r
-  Key             - Key of the check box\r
-  \r
-  FormBuffer      - Output of the check box as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS       - Checkbox created to be a form\r
-  \r
-  EFI_DEVICE_ERROR  - DataWidth > 1\r
-\r
---*/\r
 {\r
   FRAMEWORK_EFI_IFR_CHECKBOX  CheckBox;\r
 \r
@@ -423,7 +338,28 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-\r
+/**\r
+  Create a numeric opcode independent of string creation\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+  \r
+  @param QuestionId      - Question ID of the numeric\r
+  @param DataWidth       - DataWidth of the numeric\r
+  @param PromptToken     - Prompt string token of the numeric\r
+  @param HelpToken       - Help string token of the numeric\r
+  @param Minimum         - Minumun boundary of the numeric\r
+  @param Maximum         - Maximum boundary of the numeric\r
+  @param Step            - Step of the numeric\r
+  @param Default         - Default value of the numeric\r
+  @param Flags           - Flags of the numeric\r
+  @param Key             - Key of the numeric\r
+  @param FormBuffer      - Output of the numeric as a form\r
\r
+\r
+  @retval EFI_SUCCESS       - The numeric created to be a form.\r
+  @retval EFI_DEVICE_ERROR  - DataWidth > 2\r
+**/\r
 EFI_STATUS\r
 CreateNumericOpCode (\r
   IN      UINT16              QuestionId,\r
@@ -438,46 +374,7 @@ CreateNumericOpCode (
   IN      UINT16              Key,\r
   IN OUT  VOID                *FormBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a numeric opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the numeric\r
-  \r
-  DataWidth       - DataWidth of the numeric\r
-  \r
-  PromptToken     - Prompt string token of the numeric\r
-  \r
-  HelpToken       - Help string token of the numeric\r
-  \r
-  Minimum         - Minumun boundary of the numeric\r
-  \r
-  Maximum         - Maximum boundary of the numeric\r
-  \r
-  Step            - Step of the numeric\r
-  \r
-  Default         - Default value of the numeric\r
-  \r
-  Flags           - Flags of the numeric\r
-  \r
-  Key             - Key of the numeric\r
-  \r
-  FormBuffer      - Output of the numeric as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS       - The numeric created to be a form.\r
-  \r
-  EFI_DEVICE_ERROR  - DataWidth > 2\r
 \r
---*/\r
 {\r
   FRAMEWORK_EFI_IFR_NUMERIC Numeric;\r
 \r
@@ -507,7 +404,24 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-\r
+/**\r
+  Create a numeric opcode independent of string creation\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+  \r
+  @param QuestionId       Question ID of the string\r
+  @param DataWidth        DataWidth of the string\r
+  @param PromptToken      Prompt token of the string\r
+  @param HelpToken        Help token of the string\r
+  @param MinSize          Min size boundary of the string\r
+  @param MaxSize          Max size boundary of the string\r
+  @param Flags            Flags of the string\r
+  @param Key              Key of the string\r
+  @param FormBuffer       Output of the string as a form\r
+  \r
+  @retval EFI_SUCCESS     String created to be a form.\r
+**/\r
 EFI_STATUS\r
 CreateStringOpCode (\r
   IN      UINT16              QuestionId,\r
@@ -520,40 +434,7 @@ CreateStringOpCode (
   IN      UINT16              Key,\r
   IN OUT  VOID                *FormBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
 \r
-  Create a numeric opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the string\r
-  \r
-  DataWidth       - DataWidth of the string\r
-  \r
-  PromptToken     - Prompt token of the string\r
-  \r
-  HelpToken       - Help token of the string\r
-  \r
-  MinSize         - Min size boundary of the string\r
-  \r
-  MaxSize         - Max size boundary of the string\r
-    \r
-  Flags           - Flags of the string\r
-  \r
-  Key             - Key of the string\r
-  \r
-  FormBuffer      - Output of the string as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS       - String created to be a form.\r
-\r
---*/\r
 {\r
   FRAMEWORK_EFI_IFR_STRING  String;\r
 \r
@@ -574,7 +455,16 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Create a banner opcode.  This is primarily used by the FrontPage implementation from BDS.\r
+  \r
+  @param Title       - Title of the banner\r
+  @param LineNumber  - LineNumber of the banner\r
+  @param Alignment   - Alignment of the banner\r
+  @param FormBuffer  - Output of banner as a form\r
 \r
+  @retval EFI_SUCCESS     - Banner created to be a form.\r
+**/\r
 EFI_STATUS\r
 CreateBannerOpCode (\r
   IN      UINT16              Title,\r
@@ -582,27 +472,7 @@ CreateBannerOpCode (
   IN      UINT8               Alignment,\r
   IN OUT  VOID                *FormBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a banner opcode.  This is primarily used by the FrontPage implementation from BDS.\r
-  \r
-Arguments:\r
-  \r
-  Title       - Title of the banner\r
-  \r
-  LineNumber  - LineNumber of the banner\r
-  \r
-  Alignment   - Alignment of the banner\r
-  \r
-  FormBuffer  - Output of banner as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Banner created to be a form.\r
 \r
---*/\r
 {\r
   FRAMEWORK_EFI_IFR_BANNER  Banner;\r
 \r
@@ -616,3 +486,5 @@ Returns:
 \r
   return EFI_SUCCESS;\r
 }\r
+\r
+\r
index c48c497bdd23533a8b8d91e56ce117397b6ac2b3..8c662b60647518abaac7a762089569d664795a65 100644 (file)
@@ -1,5 +1,6 @@
 /** @file\r
-\r
+  Variable/Map manipulations routines\r
+  \r
 Copyright (c) 2006, Intel Corporation                                                         \r
 All rights reserved. This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
@@ -9,12 +10,6 @@ http://opensource.org/licenses/bsd-license.php
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
 \r
-Module Name:\r
-  IfrVariable.c\r
-\r
-Abstract:\r
-  Variable/Map manipulations routines\r
-\r
 **/\r
 \r
 //\r
@@ -22,6 +17,15 @@ Abstract:
 //\r
 #include "IfrSupportLibInternal.h"\r
 \r
+/**\r
+  Extracts a variable form a Pack.\r
+\r
+  @param Pack - List of variables\r
+  @param Name - Name of the variable/map\r
+  @param Guid - GUID of the variable/map\r
+  @param Var  - Pointer to the variable/map\r
+  @param Size - Size of the variable/map in bytes\r
+**/\r
 VOID\r
 EfiLibHiiVariablePackGetMap (\r
   IN    EFI_HII_VARIABLE_PACK       *Pack,  \r
@@ -31,25 +35,7 @@ EfiLibHiiVariablePackGetMap (
   OUT   VOID                        **Var,   OPTIONAL\r
   OUT   UINTN                       *Size    OPTIONAL\r
   )\r
-/*++\r
 \r
-Routine Description:\r
-\r
-  Extracts a variable form a Pack.\r
-\r
-Arguments:\r
-\r
-  Pack - List of variables\r
-  Name - Name of the variable/map\r
-  Guid - GUID of the variable/map\r
-  Var  - Pointer to the variable/map\r
-  Size - Size of the variable/map in bytes\r
-\r
-Returns: \r
-\r
-  VOID\r
-  \r
---*/\r
 {\r
   if (NULL != Name) {\r
     *Name = (VOID *) (Pack + 1);\r
@@ -73,28 +59,17 @@ Returns:
   }\r
 }\r
 \r
+/**\r
+  Finds a count of the variables/maps in the List.\r
+\r
+  @param List - List of variables\r
 \r
+  @return The number of map count.\r
+**/\r
 UINTN\r
 EfiLibHiiVariablePackListGetMapCnt (\r
   IN    EFI_HII_VARIABLE_PACK_LIST   *List\r
   )\r
-  \r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Finds a count of the variables/maps in the List.\r
-\r
-Arguments:\r
-\r
-  List - List of variables\r
-\r
-Returns: \r
-\r
-  UINTN - The number of map count.\r
-\r
---*/\r
-\r
 {\r
   UINTN   Cnt = 0;\r
   while (NULL != List) {\r
@@ -104,29 +79,20 @@ Returns:
   return Cnt;\r
 }\r
 \r
+/**\r
+  Will iterate all variable/maps as appearing \r
+  in List and for each, it will call the Callback.\r
+\r
+  @param List     - List of variables\r
+  @param Callback - Routine to be called for each iterated variable.\r
 \r
+**/\r
 VOID\r
 EfiLibHiiVariablePackListForEachVar (\r
   IN    EFI_HII_VARIABLE_PACK_LIST               *List,\r
   IN    EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK  *Callback\r
   )\r
-/*++\r
-\r
-Routine Description:\r
 \r
-  Will iterate all variable/maps as appearing \r
-  in List and for each, it will call the Callback.\r
-\r
-Arguments:\r
-\r
-  List     - List of variables\r
-  Callback - Routine to be called for each iterated variable.\r
-\r
-Returns: \r
-\r
-  VOID\r
-  \r
---*/\r
 \r
 {\r
   CHAR16    *MapName;\r
@@ -145,7 +111,20 @@ Returns:
   }\r
 }\r
 \r
+/**\r
+  Finds a variable form List given \r
+  the order number as appears in the List.\r
+\r
+  @param Idx  - The index of the variable/map to retrieve\r
+  @param List - List of variables\r
+  @param Name - Name of the variable/map\r
+  @param Guid - GUID of the variable/map\r
+  @param Var  - Pointer to the variable/map\r
+  @param Size - Size of the variable/map in bytes\r
 \r
+  @param EFI_SUCCESS   - Variable is found, OUT parameters are valid\r
+  @param EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
+**/\r
 EFI_STATUS\r
 EfiLibHiiVariablePackListGetMapByIdx (\r
   IN    UINTN                       Idx,  \r
@@ -157,28 +136,7 @@ EfiLibHiiVariablePackListGetMapByIdx (
   OUT   UINTN                       *Size\r
   )\r
 \r
-/*++\r
 \r
-Routine Description:\r
-\r
-  Finds a variable form List given \r
-  the order number as appears in the List.\r
-\r
-Arguments:\r
-\r
-  Idx  - The index of the variable/map to retrieve\r
-  List - List of variables\r
-  Name - Name of the variable/map\r
-  Guid - GUID of the variable/map\r
-  Var  - Pointer to the variable/map\r
-  Size - Size of the variable/map in bytes\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS   - Variable is found, OUT parameters are valid\r
-  EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
-\r
---*/\r
 {\r
   CHAR16     *MapName;\r
   EFI_GUID   *MapGuid;\r
@@ -214,7 +172,21 @@ Returns:
   return EFI_NOT_FOUND; \r
 }\r
 \r
+/**\r
+  Finds a variable form List given the \r
+  order number as appears in the List.\r
+\r
+  @param Id   - The ID of the variable/map to retrieve\r
+  @param List - List of variables\r
+  @param Name - Name of the variable/map\r
+  @param Guid - GUID of the variable/map\r
+  @param Var  - Pointer to the variable/map\r
+  @param Size - Size of the variable/map in bytes\r
 \r
+  @retval EFI_SUCCESS   - Variable is found, OUT parameters are valid\r
+  @retval EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
+\r
+**/\r
 EFI_STATUS\r
 EfiLibHiiVariablePackListGetMapById (\r
   IN    UINT16                        Id,  \r
@@ -224,30 +196,6 @@ EfiLibHiiVariablePackListGetMapById (
   OUT   VOID                          **Var,\r
   OUT   UINTN                         *Size\r
   )\r
-  \r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Finds a variable form List given the \r
-  order number as appears in the List.\r
-\r
-Arguments:\r
-\r
-  Id   - The ID of the variable/map to retrieve\r
-  List - List of variables\r
-  Name - Name of the variable/map\r
-  Guid - GUID of the variable/map\r
-  Var  - Pointer to the variable/map\r
-  Size - Size of the variable/map in bytes\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS   - Variable is found, OUT parameters are valid\r
-  EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
-\r
---*/\r
-\r
 { \r
   CHAR16    *MapName;\r
   EFI_GUID  *MapGuid;\r
@@ -279,7 +227,18 @@ Returns:
   return EFI_NOT_FOUND; \r
 }\r
 \r
+/**\r
+  Finds a variable form EFI_HII_VARIABLE_PACK_LIST given name and GUID.\r
 \r
+  @param List - List of variables\r
+  @param Name - Name of the variable/map to be found\r
+  @param Guid - GUID of the variable/map to be found\r
+  @param Var  - Pointer to the variable/map found\r
+  @param Size - Size of the variable/map in bytes found\r
+\r
+  @retval EFI_SUCCESS   - variable is found, OUT parameters are valid\r
+  @retval EFI_NOT_FOUND - variable is not found, OUT parameters are not valid\r
+**/\r
 EFI_STATUS\r
 EfiLibHiiVariablePackListGetMap (\r
   IN    EFI_HII_VARIABLE_PACK_LIST   *List,\r
@@ -289,28 +248,6 @@ EfiLibHiiVariablePackListGetMap (
   OUT   VOID                         **Var, \r
   OUT   UINTN                        *Size\r
   )\r
-\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Finds a variable form EFI_HII_VARIABLE_PACK_LIST given name and GUID.\r
-\r
-Arguments:\r
-\r
-  List - List of variables\r
-  Name - Name of the variable/map to be found\r
-  Guid - GUID of the variable/map to be found\r
-  Var  - Pointer to the variable/map found\r
-  Size - Size of the variable/map in bytes found\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS   - variable is found, OUT parameters are valid\r
-  EFI_NOT_FOUND - variable is not found, OUT parameters are not valid\r
-\r
---*/\r
-\r
 { \r
   VOID      *Map;\r
   UINTN     MapSize;\r
@@ -334,6 +271,21 @@ Returns:
   return EFI_NOT_FOUND;\r
 }\r
 \r
+/**\r
+  Finds out if a variable of specific Name/Guid/Size exists in NV. \r
+  If it does, it will retrieve it into the Var. \r
+\r
+  @param Name  Parameters of the variable to retrieve. Must match exactly.\r
+  @param Guid  Parameters of the variable to retrieve. Must match exactly.\r
+  @param Size  Parameters of the variable to retrieve. Must match exactly.\r
+  @param Var   Variable will be retrieved into buffer pointed by this pointer.\r
+               If pointing to NULL, the buffer will be allocated. Caller is responsible for releasing the buffer.\r
+\r
+  @retval EFI_SUCCESS    - The variable of exact Name/Guid/Size parameters was retrieved and written to Var.\r
+  @retval EFI_NOT_FOUND  - The variable of this Name/Guid was not found in the NV.\r
+  @retval EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
+\r
+**/\r
 EFI_STATUS\r
 EfiLibHiiVariableRetrieveFromNv (\r
   IN  CHAR16                 *Name,\r
@@ -341,22 +293,7 @@ EfiLibHiiVariableRetrieveFromNv (
   IN  UINTN                   Size,\r
   OUT VOID                  **Var\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Finds out if a variable of specific Name/Guid/Size exists in NV. \r
-  If it does, it will retrieve it into the Var. \r
 \r
-Arguments:\r
-  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
-  Var              - Variable will be retrieved into buffer pointed by this pointer.\r
-                     If pointing to NULL, the buffer will be allocated. Caller is responsible for releasing the buffer.\r
-Returns:\r
-  EFI_SUCCESS    - The variable of exact Name/Guid/Size parameters was retrieved and written to Var.\r
-  EFI_NOT_FOUND  - The variable of this Name/Guid was not found in the NV.\r
-  EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
-\r
---*/\r
 {\r
   EFI_STATUS                  Status;\r
   UINTN                       SizeNv;\r
@@ -394,8 +331,23 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Overrrides the variable with NV data if found.\r
+  But it only does it if the Name ends with specified Suffix.\r
+  For example, if Suffix="MyOverride" and the Name="XyzSetupMyOverride",\r
+  the Suffix matches the end of Name, so the variable will be loaded from NV\r
+  provided the variable exists and the GUID and Size matches.\r
 \r
+  @param Suffix             Suffix the Name should end with.\r
+  @param Name, Guid, Size   Parameters of the variable to retrieve. Must match exactly.\r
+  @param Var                Variable will be retrieved into this buffer.\r
+                            Caller is responsible for providing storage of exactly Size size in bytes.\r
 \r
+  @retval EFI_SUCCESS           - The variable was overriden with NV variable of same Name/Guid/Size.\r
+  @retval EFI_INVALID_PARAMETER - The name of the variable does not end with <Suffix>.\r
+  @retval EFI_NOT_FOUND         - The variable of this Name/Guid was not found in the NV.\r
+  @retval EFI_LOAD_ERROR        - The variable in the NV was of different size, or NV API returned error.\r
+**/\r
 EFI_STATUS\r
 EfiLibHiiVariableOverrideIfSuffix (\r
   IN  CHAR16                 *Suffix,\r
@@ -404,27 +356,6 @@ EfiLibHiiVariableOverrideIfSuffix (
   IN  UINTN                   Size,\r
   OUT VOID                   *Var\r
   )  \r
-/*++\r
-\r
-Routine Description:\r
-  Overrrides the variable with NV data if found.\r
-  But it only does it if the Name ends with specified Suffix.\r
-  For example, if Suffix="MyOverride" and the Name="XyzSetupMyOverride",\r
-  the Suffix matches the end of Name, so the variable will be loaded from NV\r
-  provided the variable exists and the GUID and Size matches.\r
-\r
-Arguments:\r
-  Suffix           - Suffix the Name should end with.\r
-  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
-  Var              - Variable will be retrieved into this buffer.\r
-                     Caller is responsible for providing storage of exactly Size size in bytes.\r
-Returns:\r
-  EFI_SUCCESS           - The variable was overriden with NV variable of same Name/Guid/Size.\r
-  EFI_INVALID_PARAMETER - The name of the variable does not end with <Suffix>.\r
-  EFI_NOT_FOUND         - The variable of this Name/Guid was not found in the NV.\r
-  EFI_LOAD_ERROR        - The variable in the NV was of different size, or NV API returned error.\r
-\r
---*/\r
 {\r
   UINTN         StrLength;\r
   UINTN         StrLenSuffix;\r
@@ -440,35 +371,32 @@ Returns:
   return EfiLibHiiVariableRetrieveFromNv (Name, Guid, Size, &Var);\r
 }\r
 \r
-EFI_STATUS\r
-EfiLibHiiVariableOverrideBySuffix (\r
-  IN  CHAR16                 *Suffix,\r
-  IN  CHAR16                 *Name,\r
-  IN  EFI_GUID               *Guid,\r
-  IN  UINTN                   Size,\r
-  OUT VOID                   *Var\r
-  ) \r
-/*++\r
-\r
-Routine Description:\r
+/**\r
   Overrrides the variable with NV data if found.\r
   But it only does it if the NV contains the same variable with Name is appended with Suffix.  \r
   For example, if Suffix="MyOverride" and the Name="XyzSetup",\r
   the Suffix will be appended to the end of Name, and the variable with Name="XyzSetupMyOverride"\r
   will be loaded from NV provided the variable exists and the GUID and Size matches.\r
 \r
-Arguments:\r
-  Suffix           - Suffix the variable will be appended with.\r
-  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
-  Var              - Variable will be retrieved into this buffer.\r
-                     Caller is responsible for providing storage of exactly Size size in bytes.\r
+  @param Suffix            Suffix the variable will be appended with.\r
+  @param Name, Guid, Size  Parameters of the variable to retrieve. Must match exactly.\r
+  @param Var               Variable will be retrieved into this buffer.\r
+                           Caller is responsible for providing storage of exactly Size size in bytes.\r
 \r
-Returns:\r
-  EFI_SUCCESS    - The variable was overriden with NV variable of same Name/Guid/Size.\r
-  EFI_NOT_FOUND  - The variable of this Name/Guid was not found in the NV.\r
-  EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
+  @retval EFI_SUCCESS    - The variable was overriden with NV variable of same Name/Guid/Size.\r
+  @retval EFI_NOT_FOUND  - The variable of this Name/Guid was not found in the NV.\r
+  @retval EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
 \r
 --*/\r
+EFI_STATUS\r
+EfiLibHiiVariableOverrideBySuffix (\r
+  IN  CHAR16                 *Suffix,\r
+  IN  CHAR16                 *Name,\r
+  IN  EFI_GUID               *Guid,\r
+  IN  UINTN                   Size,\r
+  OUT VOID                   *Var\r
+  ) \r
+\r
 {\r
   EFI_STATUS    Status;\r
   CHAR16       *NameSuffixed;\r