]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg:Refine the code comments in RegularExpressionDxe.
authorDandan Bi <dandan.bi@intel.com>
Fri, 11 Sep 2015 09:35:43 +0000 (09:35 +0000)
committerdandanbi <dandanbi@Edk2>
Fri, 11 Sep 2015 09:35:43 +0000 (09:35 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18444 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c
MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.h
MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf

index 6c62957ca380ca4916f6c02669722fdf9dbf37cc..658031675e335c98bd5f5cf98262f5284d0d9c89 100644 (file)
@@ -1,5 +1,4 @@
-/**\r
-  @file\r
+/** @file\r
 \r
   EFI_REGULAR_EXPRESSION_PROTOCOL Implementation\r
 \r
@@ -12,6 +11,7 @@
 \r
   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
   WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
 **/\r
 \r
 #include "RegularExpressionDxe.h"\r
@@ -37,8 +37,40 @@ EFI_REGULAR_EXPRESSION_PROTOCOL mProtocolInstance = {
 \r
   Same parameters as RegularExpressionMatch, except SyntaxType is required.\r
 \r
-  @retval EFI_SUCCESS       Regex compilation and match completed successfully.\r
-  @retval EFI_DEVICE_ERROR  Regex compilation failed.\r
+  @param String         A pointer to a NULL terminated string to match against the\r
+                        regular expression string specified by Pattern.\r
+\r
+  @param Pattern        A pointer to a NULL terminated string that represents the\r
+                        regular expression.\r
+  @param SyntaxType     A pointer to the EFI_REGEX_SYNTAX_TYPE that identifies the\r
+                        regular expression syntax type to use. May be NULL in which\r
+                        case the function will use its default regular expression\r
+                        syntax type.\r
+\r
+  @param Result         On return, points to TRUE if String fully matches against\r
+                        the regular expression Pattern using the regular expression\r
+                        SyntaxType. Otherwise, points to FALSE.\r
+\r
+  @param Captures       A Pointer to an array of EFI_REGEX_CAPTURE objects to receive\r
+                        the captured groups in the event of a match. The full\r
+                        sub-string match is put in Captures[0], and the results of N\r
+                        capturing groups are put in Captures[1:N]. If Captures is\r
+                        NULL, then this function doesn't allocate the memory for the\r
+                        array and does not build up the elements. It only returns the\r
+                        number of matching patterns in CapturesCount. If Captures is\r
+                        not NULL, this function returns a pointer to an array and\r
+                        builds up the elements in the array. CapturesCount is also\r
+                        updated to the number of matching patterns found. It is the\r
+                        caller's responsibility to free the memory pool in Captures\r
+                        and in each CapturePtr in the array elements.\r
+\r
+  @param CapturesCount  On output, CapturesCount is the number of matching patterns\r
+                        found in String. Zero means no matching patterns were found\r
+                        in the string.\r
+\r
+  @retval  EFI_SUCCESS       Regex compilation and match completed successfully.\r
+  @retval  EFI_DEVICE_ERROR  Regex compilation failed.\r
+\r
 **/\r
 STATIC\r
 EFI_STATUS\r
@@ -144,23 +176,23 @@ OnigurumaMatch (
   Returns information about the regular expression syntax types supported\r
   by the implementation.\r
 \r
-  This                     A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL\r
-                           instance.\r
+  @param This                      A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL\r
+                                   instance.\r
 \r
-  RegExSyntaxTypeListSize  On input, the size in bytes of RegExSyntaxTypeList.\r
-                           On output with a return code of EFI_SUCCESS, the\r
-                           size in bytes of the data returned in\r
-                           RegExSyntaxTypeList. On output with a return code\r
-                           of EFI_BUFFER_TOO_SMALL, the size of\r
-                           RegExSyntaxTypeList required to obtain the list.\r
+  @param  RegExSyntaxTypeListSize  On input, the size in bytes of RegExSyntaxTypeList.\r
+                                   On output with a return code of EFI_SUCCESS, the\r
+                                   size in bytes of the data returned in\r
+                                   RegExSyntaxTypeList. On output with a return code\r
+                                   of EFI_BUFFER_TOO_SMALL, the size of\r
+                                   RegExSyntaxTypeList required to obtain the list.\r
 \r
-  RegExSyntaxTypeList      A caller-allocated memory buffer filled by the\r
-                           driver with one EFI_REGEX_SYNTAX_TYPE element\r
-                           for each supported Regular expression syntax\r
-                           type. The list must not change across multiple\r
-                           calls to the same driver. The first syntax\r
-                           type in the list is the default type for the\r
-                           driver.\r
+  @param   RegExSyntaxTypeList     A caller-allocated memory buffer filled by the\r
+                                   driver with one EFI_REGEX_SYNTAX_TYPE element\r
+                                   for each supported Regular expression syntax\r
+                                   type. The list must not change across multiple\r
+                                   calls to the same driver. The first syntax\r
+                                   type in the list is the default type for the\r
+                                   driver.\r
 \r
   @retval EFI_SUCCESS            The regular expression syntax types list\r
                                  was returned successfully.\r
@@ -209,41 +241,41 @@ RegularExpressionGetInfo (
 /**\r
   Checks if the input string matches to the regular expression pattern.\r
 \r
-  This          A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL instance.\r
-                Type EFI_REGULAR_EXPRESSION_PROTOCOL is defined in Section\r
-                XYZ.\r
-\r
-  String        A pointer to a NULL terminated string to match against the\r
-                regular expression string specified by Pattern.\r
-\r
-  Pattern       A pointer to a NULL terminated string that represents the\r
-                regular expression.\r
-\r
-  SyntaxType    A pointer to the EFI_REGEX_SYNTAX_TYPE that identifies the\r
-                regular expression syntax type to use. May be NULL in which\r
-                case the function will use its default regular expression\r
-                syntax type.\r
-\r
-  Result        On return, points to TRUE if String fully matches against\r
-                the regular expression Pattern using the regular expression\r
-                SyntaxType. Otherwise, points to FALSE.\r
-\r
-  Captures      A Pointer to an array of EFI_REGEX_CAPTURE objects to receive\r
-                the captured groups in the event of a match. The full\r
-                sub-string match is put in Captures[0], and the results of N\r
-                capturing groups are put in Captures[1:N]. If Captures is\r
-                NULL, then this function doesn't allocate the memory for the\r
-                array and does not build up the elements. It only returns the\r
-                number of matching patterns in CapturesCount. If Captures is\r
-                not NULL, this function returns a pointer to an array and\r
-                builds up the elements in the array. CapturesCount is also\r
-                updated to the number of matching patterns found. It is the\r
-                caller's responsibility to free the memory pool in Captures\r
-                and in each CapturePtr in the array elements.\r
-\r
-  CapturesCount On output, CapturesCount is the number of matching patterns\r
-                found in String. Zero means no matching patterns were found\r
-                in the string.\r
+  @param This          A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL instance.\r
+                       Type EFI_REGULAR_EXPRESSION_PROTOCOL is defined in Section\r
+                       XYZ.\r
+\r
+  @param String        A pointer to a NULL terminated string to match against the\r
+                       regular expression string specified by Pattern.\r
+\r
+  @param Pattern       A pointer to a NULL terminated string that represents the\r
+                       regular expression.\r
+\r
+  @param SyntaxType    A pointer to the EFI_REGEX_SYNTAX_TYPE that identifies the\r
+                       regular expression syntax type to use. May be NULL in which\r
+                       case the function will use its default regular expression\r
+                       syntax type.\r
+\r
+  @param Result        On return, points to TRUE if String fully matches against\r
+                       the regular expression Pattern using the regular expression\r
+                       SyntaxType. Otherwise, points to FALSE.\r
+\r
+  @param Captures      A Pointer to an array of EFI_REGEX_CAPTURE objects to receive\r
+                       the captured groups in the event of a match. The full\r
+                       sub-string match is put in Captures[0], and the results of N\r
+                       capturing groups are put in Captures[1:N]. If Captures is\r
+                       NULL, then this function doesn't allocate the memory for the\r
+                       array and does not build up the elements. It only returns the\r
+                       number of matching patterns in CapturesCount. If Captures is\r
+                       not NULL, this function returns a pointer to an array and\r
+                       builds up the elements in the array. CapturesCount is also\r
+                       updated to the number of matching patterns found. It is the\r
+                       caller's responsibility to free the memory pool in Captures\r
+                       and in each CapturePtr in the array elements.\r
+\r
+  @param CapturesCount On output, CapturesCount is the number of matching patterns\r
+                       found in String. Zero means no matching patterns were found\r
+                       in the string.\r
 \r
   @retval EFI_SUCCESS            The regular expression string matching\r
                                  completed successfully.\r
@@ -300,6 +332,12 @@ RegularExpressionMatch (
 \r
 /**\r
   Entry point for RegularExpressionDxe.\r
+\r
+  @param ImageHandle     Image handle this driver.\r
+  @param SystemTable     Pointer to SystemTable.\r
+\r
+  @retval Status         Whether this function complete successfully.\r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
index 46734718c8e56ff8edd58daeeaa28defa80bda27..2c464aa8ff13a8a2d00d6ea8c537e0454e648144 100644 (file)
@@ -1,6 +1,4 @@
-/**\r
-  @file\r
-\r
+/** @file\r
   EFI_REGULAR_EXPRESSION_PROTOCOL Header File.\r
 \r
   Copyright (c) 2015, Hewlett Packard Enterprise Development, L.P.<BR>\r
 \r
   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
   WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
 **/\r
 \r
+#ifndef __REGULAR_EXPRESSIONDXE_H__\r
+#define __REGULAR_EXPRESSIONDXE_H__\r
+\r
 #include "Oniguruma/oniguruma.h"\r
 \r
 #include <Uefi.h>\r
 /**\r
   Checks if the input string matches to the regular expression pattern.\r
 \r
-  This          A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL instance.\r
-                Type EFI_REGULAR_EXPRESSION_PROTOCOL is defined in Section\r
-                XYZ.\r
-\r
-  String        A pointer to a NULL terminated string to match against the\r
-                regular expression string specified by Pattern.\r
-\r
-  Pattern       A pointer to a NULL terminated string that represents the\r
-                regular expression.\r
-\r
-  SyntaxType    A pointer to the EFI_REGEX_SYNTAX_TYPE that identifies the\r
-                regular expression syntax type to use. May be NULL in which\r
-                case the function will use its default regular expression\r
-                syntax type.\r
-\r
-  Result        On return, points to TRUE if String fully matches against\r
-                the regular expression Pattern using the regular expression\r
-                SyntaxType. Otherwise, points to FALSE.\r
-\r
-  Captures      A Pointer to an array of EFI_REGEX_CAPTURE objects to receive\r
-                the captured groups in the event of a match. The full\r
-                sub-string match is put in Captures[0], and the results of N\r
-                capturing groups are put in Captures[1:N]. If Captures is\r
-                NULL, then this function doesn't allocate the memory for the\r
-                array and does not build up the elements. It only returns the\r
-                number of matching patterns in CapturesCount. If Captures is\r
-                not NULL, this function returns a pointer to an array and\r
-                builds up the elements in the array. CapturesCount is also\r
-                updated to the number of matching patterns found. It is the\r
-                caller's responsibility to free the memory pool in Captures\r
-                and in each CapturePtr in the array elements.\r
-\r
-  CapturesCount On output, CapturesCount is the number of matching patterns\r
+  @param This          A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL instance.\r
+                       Type EFI_REGULAR_EXPRESSION_PROTOCOL is defined in Section\r
+                       XYZ.\r
+\r
+  @param String        A pointer to a NULL terminated string to match against the\r
+                       regular expression string specified by Pattern.\r
+\r
+  @param Pattern       A pointer to a NULL terminated string that represents the\r
+                       regular expression.\r
+\r
+  @param SyntaxType    A pointer to the EFI_REGEX_SYNTAX_TYPE that identifies the\r
+                       regular expression syntax type to use. May be NULL in which\r
+                       case the function will use its default regular expression\r
+                       syntax type.\r
+\r
+  @param Result        On return, points to TRUE if String fully matches against\r
+                       the regular expression Pattern using the regular expression\r
+                       SyntaxType. Otherwise, points to FALSE.\r
+\r
+  @param Captures      A Pointer to an array of EFI_REGEX_CAPTURE objects to receive\r
+                       the captured groups in the event of a match. The full\r
+                       sub-string match is put in Captures[0], and the results of N\r
+                       capturing groups are put in Captures[1:N]. If Captures is\r
+                       NULL, then this function doesn't allocate the memory for the\r
+                       array and does not build up the elements. It only returns the\r
+                       number of matching patterns in CapturesCount. If Captures is\r
+                       not NULL, this function returns a pointer to an array and\r
+                       builds up the elements in the array. CapturesCount is also\r
+                       updated to the number of matching patterns found. It is the\r
+                       caller's responsibility to free the memory pool in Captures\r
+                       and in each CapturePtr in the array elements.\r
+\r
+  @param CapturesCount On output, CapturesCount is the number of matching patterns\r
                 found in String. Zero means no matching patterns were found\r
                 in the string.\r
 \r
@@ -91,23 +93,23 @@ RegularExpressionMatch (
   Returns information about the regular expression syntax types supported\r
   by the implementation.\r
 \r
-  This                     A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL\r
-                           instance.\r
+  @param This                     A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL\r
+                                  instance.\r
 \r
-  RegExSyntaxTypeListSize  On input, the size in bytes of RegExSyntaxTypeList.\r
-                           On output with a return code of EFI_SUCCESS, the\r
-                           size in bytes of the data returned in\r
-                           RegExSyntaxTypeList. On output with a return code\r
-                           of EFI_BUFFER_TOO_SMALL, the size of\r
-                           RegExSyntaxTypeList required to obtain the list.\r
+  @param RegExSyntaxTypeListSize  On input, the size in bytes of RegExSyntaxTypeList.\r
+                                  On output with a return code of EFI_SUCCESS, the\r
+                                  size in bytes of the data returned in\r
+                                  RegExSyntaxTypeList. On output with a return code\r
+                                  of EFI_BUFFER_TOO_SMALL, the size of\r
+                                  RegExSyntaxTypeList required to obtain the list.\r
 \r
-  RegExSyntaxTypeList      A caller-allocated memory buffer filled by the\r
-                           driver with one EFI_REGEX_SYNTAX_TYPE element\r
-                           for each supported Regular expression syntax\r
-                           type. The list must not change across multiple\r
-                           calls to the same driver. The first syntax\r
-                           type in the list is the default type for the\r
-                           driver.\r
+  @param RegExSyntaxTypeList      A caller-allocated memory buffer filled by the\r
+                                  driver with one EFI_REGEX_SYNTAX_TYPE element\r
+                                  for each supported Regular expression syntax\r
+                                  type. The list must not change across multiple\r
+                                  calls to the same driver. The first syntax\r
+                                  type in the list is the default type for the\r
+                                  driver.\r
 \r
   @retval EFI_SUCCESS            The regular expression syntax types list\r
                                  was returned successfully.\r
@@ -127,4 +129,4 @@ RegularExpressionGetInfo (
   OUT    EFI_REGEX_SYNTAX_TYPE           *RegExSyntaxTypeList\r
   );\r
 \r
-\r
+#endif\r
index 7f1023eed056bb880dc51533ac83357dfa37c31f..36458fa81ab0bcf25eeacdf1970a89b112204d2e 100644 (file)
@@ -1,6 +1,4 @@
-##\r
-#  @file\r
-#\r
+## @file\r
 #  EFI_REGULAR_EXPRESSION_PROTOCOL Implementation\r
 #\r
 #  Copyright (c) 2015, Hewlett Packard Enterprise Development, L.P.<BR>\r
   DebugLib\r
 \r
 [Guids]\r
-  gEfiRegexSyntaxTypePosixExtendedGuid\r
-  gEfiRegexSyntaxTypePerlGuid\r
+  gEfiRegexSyntaxTypePosixExtendedGuid    ## CONSUMES  ## GUID\r
+  gEfiRegexSyntaxTypePerlGuid             ## CONSUMES  ## GUID\r
 \r
 [Protocols]\r
-  gEfiRegularExpressionProtocolGuid\r
+  gEfiRegularExpressionProtocolGuid       ## PRODUCES  \r
 \r
 [BuildOptions]\r
   # Override MSFT build option to remove /Oi and /GL\r