]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrOnTheFly.c
Fix coding style issue.
[mirror_edk2.git] / IntelFrameworkPkg / Library / FrameworkIfrSupportLib / IfrOnTheFly.c
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