summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/RegularExpressionDxe
diff options
context:
space:
mode:
authorkx <kx@radix.pro>2024-06-04 06:43:08 +0300
committerkx <kx@radix.pro>2024-06-04 06:43:08 +0300
commit7e2ccccace24636f29ddc210b94606abd4c7e42b (patch)
tree545d43ea12671048956cafeb12303e84d601e571 /MdeModulePkg/Universal/RegularExpressionDxe
parent27b044605cd5f6b33a3d231576003850b3fe305b (diff)
downloadedk2-trunk.tar.xz
Renormalized end-of-lines from master@27b044605cd5f6b33a3d231576003850b3fe305btrunk
Diffstat (limited to 'MdeModulePkg/Universal/RegularExpressionDxe')
-rw-r--r--MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c310
-rw-r--r--MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h268
-rw-r--r--MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c764
-rw-r--r--MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.h250
-rw-r--r--MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf260
-rw-r--r--MdeModulePkg/Universal/RegularExpressionDxe/config.h18
-rw-r--r--MdeModulePkg/Universal/RegularExpressionDxe/stdarg.h18
-rw-r--r--MdeModulePkg/Universal/RegularExpressionDxe/stddef.h18
-rw-r--r--MdeModulePkg/Universal/RegularExpressionDxe/stdio.h18
-rw-r--r--MdeModulePkg/Universal/RegularExpressionDxe/stdlib.h18
-rw-r--r--MdeModulePkg/Universal/RegularExpressionDxe/string.h18
11 files changed, 980 insertions, 980 deletions
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
index 0d8984dde0..9c477d98ae 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
@@ -1,155 +1,155 @@
-/** @file
-
- Module to rewrite stdlib references within Oniguruma
-
- (C) Copyright 2014-2021 Hewlett Packard Enterprise Development LP<BR>
- Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
- Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-#include "OnigurumaUefiPort.h"
-
-#define ONIGMEM_HEAD_SIGNATURE SIGNATURE_32('o','m','h','d')
-
-typedef struct {
- UINT32 Signature;
- UINTN Size;
-} ONIGMEM_HEAD;
-
-#define ONIGMEM_OVERHEAD sizeof(ONIGMEM_HEAD)
-
-int EFIAPI
-sprintf_s (
- char *str,
- size_t sizeOfBuffer,
- char const *fmt,
- ...
- )
-{
- VA_LIST Marker;
- int NumberOfPrinted;
-
- VA_START (Marker, fmt);
- NumberOfPrinted = (int)AsciiVSPrint (str, sizeOfBuffer, fmt, Marker);
- VA_END (Marker);
-
- return NumberOfPrinted;
-}
-
-int
-OnigStrCmp (
- const char *Str1,
- const char *Str2
- )
-{
- return (int)AsciiStrCmp (Str1, Str2);
-}
-
-int
-strlen (
- const char *str
- )
-{
- return strlen_s (str, MAX_STRING_SIZE);
-}
-
-void *
-malloc (
- size_t size
- )
-{
- ONIGMEM_HEAD *PoolHdr;
- UINTN NewSize;
- VOID *Data;
-
- NewSize = (UINTN)(size) + ONIGMEM_OVERHEAD;
-
- Data = AllocatePool (NewSize);
- if (Data != NULL) {
- PoolHdr = (ONIGMEM_HEAD *)Data;
- PoolHdr->Signature = ONIGMEM_HEAD_SIGNATURE;
- PoolHdr->Size = size;
-
- return (VOID *)(PoolHdr + 1);
- }
-
- return NULL;
-}
-
-void *
-realloc (
- void *ptr,
- size_t size
- )
-{
- ONIGMEM_HEAD *OldPoolHdr;
- ONIGMEM_HEAD *NewPoolHdr;
- UINTN OldSize;
- UINTN NewSize;
- VOID *Data;
-
- NewSize = (UINTN)size + ONIGMEM_OVERHEAD;
- Data = AllocatePool (NewSize);
- if (Data != NULL) {
- NewPoolHdr = (ONIGMEM_HEAD *)Data;
- NewPoolHdr->Signature = ONIGMEM_HEAD_SIGNATURE;
- NewPoolHdr->Size = size;
- if (ptr != NULL) {
- OldPoolHdr = (ONIGMEM_HEAD *)ptr - 1;
- ASSERT (OldPoolHdr->Signature == ONIGMEM_HEAD_SIGNATURE);
- OldSize = OldPoolHdr->Size;
-
- CopyMem ((VOID *)(NewPoolHdr + 1), ptr, MIN (OldSize, size));
- FreePool ((VOID *)OldPoolHdr);
- }
-
- return (VOID *)(NewPoolHdr + 1);
- }
-
- return NULL;
-}
-
-#if !defined (MDE_CPU_ARM)
-void *
-memcpy (
- void *dest,
- const void *src,
- unsigned int count
- )
-{
- return CopyMem (dest, src, (UINTN)count);
-}
-
-#endif
-
-void *
-memset (
- void *dest,
- int ch,
- unsigned int count
- )
-{
- return SetMem (dest, (UINTN)count, (UINT8)ch);
-}
-
-void
-free (
- void *ptr
- )
-{
- VOID *EvalOnce;
- ONIGMEM_HEAD *PoolHdr;
-
- EvalOnce = ptr;
- if (EvalOnce == NULL) {
- return;
- }
-
- PoolHdr = (ONIGMEM_HEAD *)EvalOnce - 1;
- if (PoolHdr->Signature == ONIGMEM_HEAD_SIGNATURE) {
- FreePool (PoolHdr);
- } else {
- FreePool (EvalOnce);
- }
-}
+/** @file
+
+ Module to rewrite stdlib references within Oniguruma
+
+ (C) Copyright 2014-2021 Hewlett Packard Enterprise Development LP<BR>
+ Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+#include "OnigurumaUefiPort.h"
+
+#define ONIGMEM_HEAD_SIGNATURE SIGNATURE_32('o','m','h','d')
+
+typedef struct {
+ UINT32 Signature;
+ UINTN Size;
+} ONIGMEM_HEAD;
+
+#define ONIGMEM_OVERHEAD sizeof(ONIGMEM_HEAD)
+
+int EFIAPI
+sprintf_s (
+ char *str,
+ size_t sizeOfBuffer,
+ char const *fmt,
+ ...
+ )
+{
+ VA_LIST Marker;
+ int NumberOfPrinted;
+
+ VA_START (Marker, fmt);
+ NumberOfPrinted = (int)AsciiVSPrint (str, sizeOfBuffer, fmt, Marker);
+ VA_END (Marker);
+
+ return NumberOfPrinted;
+}
+
+int
+OnigStrCmp (
+ const char *Str1,
+ const char *Str2
+ )
+{
+ return (int)AsciiStrCmp (Str1, Str2);
+}
+
+int
+strlen (
+ const char *str
+ )
+{
+ return strlen_s (str, MAX_STRING_SIZE);
+}
+
+void *
+malloc (
+ size_t size
+ )
+{
+ ONIGMEM_HEAD *PoolHdr;
+ UINTN NewSize;
+ VOID *Data;
+
+ NewSize = (UINTN)(size) + ONIGMEM_OVERHEAD;
+
+ Data = AllocatePool (NewSize);
+ if (Data != NULL) {
+ PoolHdr = (ONIGMEM_HEAD *)Data;
+ PoolHdr->Signature = ONIGMEM_HEAD_SIGNATURE;
+ PoolHdr->Size = size;
+
+ return (VOID *)(PoolHdr + 1);
+ }
+
+ return NULL;
+}
+
+void *
+realloc (
+ void *ptr,
+ size_t size
+ )
+{
+ ONIGMEM_HEAD *OldPoolHdr;
+ ONIGMEM_HEAD *NewPoolHdr;
+ UINTN OldSize;
+ UINTN NewSize;
+ VOID *Data;
+
+ NewSize = (UINTN)size + ONIGMEM_OVERHEAD;
+ Data = AllocatePool (NewSize);
+ if (Data != NULL) {
+ NewPoolHdr = (ONIGMEM_HEAD *)Data;
+ NewPoolHdr->Signature = ONIGMEM_HEAD_SIGNATURE;
+ NewPoolHdr->Size = size;
+ if (ptr != NULL) {
+ OldPoolHdr = (ONIGMEM_HEAD *)ptr - 1;
+ ASSERT (OldPoolHdr->Signature == ONIGMEM_HEAD_SIGNATURE);
+ OldSize = OldPoolHdr->Size;
+
+ CopyMem ((VOID *)(NewPoolHdr + 1), ptr, MIN (OldSize, size));
+ FreePool ((VOID *)OldPoolHdr);
+ }
+
+ return (VOID *)(NewPoolHdr + 1);
+ }
+
+ return NULL;
+}
+
+#if !defined (MDE_CPU_ARM)
+void *
+memcpy (
+ void *dest,
+ const void *src,
+ unsigned int count
+ )
+{
+ return CopyMem (dest, src, (UINTN)count);
+}
+
+#endif
+
+void *
+memset (
+ void *dest,
+ int ch,
+ unsigned int count
+ )
+{
+ return SetMem (dest, (UINTN)count, (UINT8)ch);
+}
+
+void
+free (
+ void *ptr
+ )
+{
+ VOID *EvalOnce;
+ ONIGMEM_HEAD *PoolHdr;
+
+ EvalOnce = ptr;
+ if (EvalOnce == NULL) {
+ return;
+ }
+
+ PoolHdr = (ONIGMEM_HEAD *)EvalOnce - 1;
+ if (PoolHdr->Signature == ONIGMEM_HEAD_SIGNATURE) {
+ FreePool (PoolHdr);
+ } else {
+ FreePool (EvalOnce);
+ }
+}
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
index 8931f8ec50..1875f82e0d 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
@@ -1,134 +1,134 @@
-/** @file
-
- Module to rewrite stdlib references within Oniguruma
-
- (C) Copyright 2014-2021 Hewlett Packard Enterprise Development LP<BR>
- Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
- Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#ifndef ONIGURUMA_UEFI_PORT_H
-#define ONIGURUMA_UEFI_PORT_H
-
-#include <Library/MemoryAllocationLib.h>
-#include <Library/PrintLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/BaseLib.h>
-#include <Library/DebugLib.h>
-
-#define ONIG_NO_STANDARD_C_HEADERS
-#define ONIG_NO_PRINT
-#define P_(args) args
-
-#define INT_MAX 0x7FFFFFFF
-#define LONG_MAX 0x7FFFFFFF
-#define UINT_MAX 0xFFFFFFFF
-#define ULONG_MAX 0xFFFFFFFF
-
-#define SIZEOF_LONG 4
-#define SIZEOF_LONG_LONG 8
-typedef UINTN size_t;
-typedef UINT32 uint32_t;
-typedef INTN intptr_t;
-
-#ifndef offsetof
-#define offsetof OFFSET_OF
-#endif
-
-#if defined (MDE_CPU_IA32) || defined (MDE_CPU_ARM) || defined (MDE_CPU_EBC)
-#define SIZEOF_VOIDP 4
-#else
-#define SIZEOF_VOIDP 8
-#endif
-
-#define calloc(n, s) AllocateZeroPool((n)*(s))
-#define xmemmove(Dest, Src, Length) CopyMem(Dest,Src,Length)
-#define xmemcpy(Dest, Src, Length) CopyMem(Dest,Src,Length)
-#define xmemset(Buffer, Value, Length) SetMem(Buffer,Length,Value)
-
-#define va_init_list(a, b) VA_START(a,b)
-#define va_list VA_LIST
-#define va_arg(a, b) VA_ARG(a,b)
-#define va_end(a) VA_END(a)
-#define va_start VA_START
-
-#define FILE VOID
-#define stdout NULL
-#define fprintf(...)
-#define fputs(a, b)
-#define vsnprintf (int)AsciiVSPrint
-#define _vsnprintf vsnprintf
-#define xsnprintf sprintf_s
-#define xvsnprintf vsnprintf
-#define alloca malloc
-
-#define setlocale(a, b)
-#define LC_ALL 0
-
-#define UCHAR_MAX 255
-#define MAX_STRING_SIZE 0x1000
-#define strlen_s(String, MaxSize) AsciiStrnLenS (String, MaxSize)
-#define xstrncpy(Dest, Src, MaxSize) strcat_s(Dest,MaxSize,Src)
-#define xstrcat(Dest, Src, MaxSize) strcat(Dest,Src,MaxSize)
-#define strcat(Dest, Src, MaxSize) strcat_s(Dest,MaxSize,Src)
-#define strcat_s(Dest, MaxSize, Src) AsciiStrCatS (Dest, MaxSize, Src)
-#define strncpy_s(Dest, MaxSize, Src, Length) AsciiStrnCpyS (Dest, MaxSize, Src, Length)
-#define strcmp OnigStrCmp
-
-int
-OnigStrCmp (
- const char *Str1,
- const char *Str2
- );
-
-int EFIAPI
-sprintf_s (
- char *str,
- size_t sizeOfBuffer,
- char const *fmt,
- ...
- );
-
-int
-strlen (
- const char *str
- );
-
-void *
-malloc (
- size_t size
- );
-
-void *
-realloc (
- void *ptr,
- size_t size
- );
-
-#if !defined (MDE_CPU_ARM)
-void *
-memcpy (
- void *dest,
- const void *src,
- unsigned int count
- );
-
-#endif
-
-void *
-memset (
- void *dest,
- int ch,
- unsigned int count
- );
-
-void
-free (
- void *ptr
- );
-
-#define exit(n) ASSERT(FALSE);
-
-#endif // !ONIGURUMA_UEFI_PORT_H
+/** @file
+
+ Module to rewrite stdlib references within Oniguruma
+
+ (C) Copyright 2014-2021 Hewlett Packard Enterprise Development LP<BR>
+ Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef ONIGURUMA_UEFI_PORT_H
+#define ONIGURUMA_UEFI_PORT_H
+
+#include <Library/MemoryAllocationLib.h>
+#include <Library/PrintLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/BaseLib.h>
+#include <Library/DebugLib.h>
+
+#define ONIG_NO_STANDARD_C_HEADERS
+#define ONIG_NO_PRINT
+#define P_(args) args
+
+#define INT_MAX 0x7FFFFFFF
+#define LONG_MAX 0x7FFFFFFF
+#define UINT_MAX 0xFFFFFFFF
+#define ULONG_MAX 0xFFFFFFFF
+
+#define SIZEOF_LONG 4
+#define SIZEOF_LONG_LONG 8
+typedef UINTN size_t;
+typedef UINT32 uint32_t;
+typedef INTN intptr_t;
+
+#ifndef offsetof
+#define offsetof OFFSET_OF
+#endif
+
+#if defined (MDE_CPU_IA32) || defined (MDE_CPU_ARM) || defined (MDE_CPU_EBC)
+#define SIZEOF_VOIDP 4
+#else
+#define SIZEOF_VOIDP 8
+#endif
+
+#define calloc(n, s) AllocateZeroPool((n)*(s))
+#define xmemmove(Dest, Src, Length) CopyMem(Dest,Src,Length)
+#define xmemcpy(Dest, Src, Length) CopyMem(Dest,Src,Length)
+#define xmemset(Buffer, Value, Length) SetMem(Buffer,Length,Value)
+
+#define va_init_list(a, b) VA_START(a,b)
+#define va_list VA_LIST
+#define va_arg(a, b) VA_ARG(a,b)
+#define va_end(a) VA_END(a)
+#define va_start VA_START
+
+#define FILE VOID
+#define stdout NULL
+#define fprintf(...)
+#define fputs(a, b)
+#define vsnprintf (int)AsciiVSPrint
+#define _vsnprintf vsnprintf
+#define xsnprintf sprintf_s
+#define xvsnprintf vsnprintf
+#define alloca malloc
+
+#define setlocale(a, b)
+#define LC_ALL 0
+
+#define UCHAR_MAX 255
+#define MAX_STRING_SIZE 0x1000
+#define strlen_s(String, MaxSize) AsciiStrnLenS (String, MaxSize)
+#define xstrncpy(Dest, Src, MaxSize) strcat_s(Dest,MaxSize,Src)
+#define xstrcat(Dest, Src, MaxSize) strcat(Dest,Src,MaxSize)
+#define strcat(Dest, Src, MaxSize) strcat_s(Dest,MaxSize,Src)
+#define strcat_s(Dest, MaxSize, Src) AsciiStrCatS (Dest, MaxSize, Src)
+#define strncpy_s(Dest, MaxSize, Src, Length) AsciiStrnCpyS (Dest, MaxSize, Src, Length)
+#define strcmp OnigStrCmp
+
+int
+OnigStrCmp (
+ const char *Str1,
+ const char *Str2
+ );
+
+int EFIAPI
+sprintf_s (
+ char *str,
+ size_t sizeOfBuffer,
+ char const *fmt,
+ ...
+ );
+
+int
+strlen (
+ const char *str
+ );
+
+void *
+malloc (
+ size_t size
+ );
+
+void *
+realloc (
+ void *ptr,
+ size_t size
+ );
+
+#if !defined (MDE_CPU_ARM)
+void *
+memcpy (
+ void *dest,
+ const void *src,
+ unsigned int count
+ );
+
+#endif
+
+void *
+memset (
+ void *dest,
+ int ch,
+ unsigned int count
+ );
+
+void
+free (
+ void *ptr
+ );
+
+#define exit(n) ASSERT(FALSE);
+
+#endif // !ONIGURUMA_UEFI_PORT_H
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c
index 326a6e6884..fff4fa78ca 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c
@@ -1,382 +1,382 @@
-/** @file
-
- EFI_REGULAR_EXPRESSION_PROTOCOL Implementation
-
- (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include "RegularExpressionDxe.h"
-
-STATIC
-EFI_REGEX_SYNTAX_TYPE *CONST mSupportedSyntaxes[] = {
- &gEfiRegexSyntaxTypePosixExtendedGuid,
- &gEfiRegexSyntaxTypePerlGuid
-};
-
-STATIC
-EFI_REGULAR_EXPRESSION_PROTOCOL mProtocolInstance = {
- RegularExpressionMatch,
- RegularExpressionGetInfo
-};
-
-#define CHAR16_ENCODING ONIG_ENCODING_UTF16_LE
-
-/**
- Call the Oniguruma regex match API.
-
- Same parameters as RegularExpressionMatch, except SyntaxType is required.
-
- @param String A pointer to a NULL terminated string to match against the
- regular expression string specified by Pattern.
-
- @param Pattern A pointer to a NULL terminated string that represents the
- regular expression.
- @param SyntaxType A pointer to the EFI_REGEX_SYNTAX_TYPE that identifies the
- regular expression syntax type to use. May be NULL in which
- case the function will use its default regular expression
- syntax type.
-
- @param Result On return, points to TRUE if String fully matches against
- the regular expression Pattern using the regular expression
- SyntaxType. Otherwise, points to FALSE.
-
- @param Captures A Pointer to an array of EFI_REGEX_CAPTURE objects to receive
- the captured groups in the event of a match. The full
- sub-string match is put in Captures[0], and the results of N
- capturing groups are put in Captures[1:N]. If Captures is
- NULL, then this function doesn't allocate the memory for the
- array and does not build up the elements. It only returns the
- number of matching patterns in CapturesCount. If Captures is
- not NULL, this function returns a pointer to an array and
- builds up the elements in the array. CapturesCount is also
- updated to the number of matching patterns found. It is the
- caller's responsibility to free the memory pool in Captures
- and in each CapturePtr in the array elements.
-
- @param CapturesCount On output, CapturesCount is the number of matching patterns
- found in String. Zero means no matching patterns were found
- in the string.
-
- @retval EFI_SUCCESS Regex compilation and match completed successfully.
- @retval EFI_DEVICE_ERROR Regex compilation failed.
-
-**/
-STATIC
-EFI_STATUS
-OnigurumaMatch (
- IN CHAR16 *String,
- IN CHAR16 *Pattern,
- IN EFI_REGEX_SYNTAX_TYPE *SyntaxType,
- OUT BOOLEAN *Result,
- OUT EFI_REGEX_CAPTURE **Captures OPTIONAL,
- OUT UINTN *CapturesCount
- )
-{
- regex_t *OnigRegex;
- OnigSyntaxType *OnigSyntax;
- OnigRegion *Region;
- INT32 OnigResult;
- OnigErrorInfo ErrorInfo;
- OnigUChar ErrorMessage[ONIG_MAX_ERROR_MESSAGE_LEN];
- UINT32 Index;
- OnigUChar *Start;
- EFI_STATUS Status;
-
- Status = EFI_SUCCESS;
-
- //
- // Detemine the internal syntax type
- //
- OnigSyntax = ONIG_SYNTAX_DEFAULT;
- if (CompareGuid (SyntaxType, &gEfiRegexSyntaxTypePosixExtendedGuid)) {
- OnigSyntax = ONIG_SYNTAX_POSIX_EXTENDED;
- } else if (CompareGuid (SyntaxType, &gEfiRegexSyntaxTypePerlGuid)) {
- OnigSyntax = ONIG_SYNTAX_PERL;
- } else {
- DEBUG ((DEBUG_ERROR, "Unsupported regex syntax - using default\n"));
- return EFI_UNSUPPORTED;
- }
-
- //
- // Compile pattern
- //
- Start = (OnigUChar *)Pattern;
- OnigResult = onig_new (
- &OnigRegex,
- Start,
- Start + onigenc_str_bytelen_null (CHAR16_ENCODING, Start),
- ONIG_OPTION_DEFAULT,
- CHAR16_ENCODING,
- OnigSyntax,
- &ErrorInfo
- );
-
- if (OnigResult != ONIG_NORMAL) {
- onig_error_code_to_str (ErrorMessage, OnigResult, &ErrorInfo);
- DEBUG ((DEBUG_ERROR, "Regex compilation failed: %a\n", ErrorMessage));
- return EFI_DEVICE_ERROR;
- }
-
- //
- // Try to match
- //
- Start = (OnigUChar *)String;
- Region = onig_region_new ();
- if (Region == NULL) {
- onig_free (OnigRegex);
- return EFI_OUT_OF_RESOURCES;
- }
-
- OnigResult = onig_search (
- OnigRegex,
- Start,
- Start + onigenc_str_bytelen_null (CHAR16_ENCODING, Start),
- Start,
- Start + onigenc_str_bytelen_null (CHAR16_ENCODING, Start),
- Region,
- ONIG_OPTION_NONE
- );
-
- if (OnigResult >= 0) {
- *Result = TRUE;
- } else {
- *Result = FALSE;
- if (OnigResult != ONIG_MISMATCH) {
- onig_error_code_to_str (ErrorMessage, OnigResult);
- DEBUG ((DEBUG_ERROR, "Regex match failed: %a\n", ErrorMessage));
- onig_region_free (Region, 1);
- onig_free (OnigRegex);
- return EFI_DEVICE_ERROR;
- }
- }
-
- //
- // If successful, copy out the region (capture) information
- //
- if (*Result && (Captures != NULL)) {
- *CapturesCount = Region->num_regs;
- *Captures = AllocateZeroPool (*CapturesCount * sizeof (**Captures));
- if (*Captures != NULL) {
- for (Index = 0; Index < *CapturesCount; ++Index) {
- //
- // Region beg/end values represent bytes, not characters
- //
- (*Captures)[Index].Length = (Region->end[Index] - Region->beg[Index]) / sizeof (CHAR16);
- (*Captures)[Index].CapturePtr = AllocateCopyPool (
- ((*Captures)[Index].Length) * sizeof (CHAR16),
- (CHAR16 *)((UINTN)String + Region->beg[Index])
- );
- if ((*Captures)[Index].CapturePtr == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- break;
- }
- }
-
- if (EFI_ERROR (Status)) {
- for (Index = 0; Index < *CapturesCount; ++Index) {
- if ((*Captures)[Index].CapturePtr != NULL) {
- FreePool ((CHAR16 *)(*Captures)[Index].CapturePtr);
- }
- }
-
- FreePool (*Captures);
- }
- }
- }
-
- onig_region_free (Region, 1);
- onig_free (OnigRegex);
-
- return Status;
-}
-
-/**
- Returns information about the regular expression syntax types supported
- by the implementation.
-
- @param This A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL
- instance.
-
- @param RegExSyntaxTypeListSize On input, the size in bytes of RegExSyntaxTypeList.
- On output with a return code of EFI_SUCCESS, the
- size in bytes of the data returned in
- RegExSyntaxTypeList. On output with a return code
- of EFI_BUFFER_TOO_SMALL, the size of
- RegExSyntaxTypeList required to obtain the list.
-
- @param RegExSyntaxTypeList A caller-allocated memory buffer filled by the
- driver with one EFI_REGEX_SYNTAX_TYPE element
- for each supported Regular expression syntax
- type. The list must not change across multiple
- calls to the same driver. The first syntax
- type in the list is the default type for the
- driver.
-
- @retval EFI_SUCCESS The regular expression syntax types list
- was returned successfully.
- @retval EFI_UNSUPPORTED The service is not supported by this driver.
- @retval EFI_DEVICE_ERROR The list of syntax types could not be
- retrieved due to a hardware or firmware error.
- @retval EFI_BUFFER_TOO_SMALL The buffer RegExSyntaxTypeList is too small
- to hold the result.
- @retval EFI_INVALID_PARAMETER RegExSyntaxTypeListSize is NULL
-
-**/
-EFI_STATUS
-EFIAPI
-RegularExpressionGetInfo (
- IN EFI_REGULAR_EXPRESSION_PROTOCOL *This,
- IN OUT UINTN *RegExSyntaxTypeListSize,
- OUT EFI_REGEX_SYNTAX_TYPE *RegExSyntaxTypeList
- )
-{
- UINTN SyntaxSize;
- UINTN Index;
-
- if ((This == NULL) || (RegExSyntaxTypeListSize == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- if ((*RegExSyntaxTypeListSize != 0) && (RegExSyntaxTypeList == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- SyntaxSize = ARRAY_SIZE (mSupportedSyntaxes) * sizeof (**mSupportedSyntaxes);
-
- if (*RegExSyntaxTypeListSize < SyntaxSize) {
- *RegExSyntaxTypeListSize = SyntaxSize;
- return EFI_BUFFER_TOO_SMALL;
- }
-
- for (Index = 0; Index < ARRAY_SIZE (mSupportedSyntaxes); ++Index) {
- CopyMem (&RegExSyntaxTypeList[Index], mSupportedSyntaxes[Index], sizeof (**mSupportedSyntaxes));
- }
-
- *RegExSyntaxTypeListSize = SyntaxSize;
-
- return EFI_SUCCESS;
-}
-
-/**
- Checks if the input string matches to the regular expression pattern.
-
- @param This A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL instance.
- Type EFI_REGULAR_EXPRESSION_PROTOCOL is defined in Section
- XYZ.
-
- @param String A pointer to a NULL terminated string to match against the
- regular expression string specified by Pattern.
-
- @param Pattern A pointer to a NULL terminated string that represents the
- regular expression.
-
- @param SyntaxType A pointer to the EFI_REGEX_SYNTAX_TYPE that identifies the
- regular expression syntax type to use. May be NULL in which
- case the function will use its default regular expression
- syntax type.
-
- @param Result On return, points to TRUE if String fully matches against
- the regular expression Pattern using the regular expression
- SyntaxType. Otherwise, points to FALSE.
-
- @param Captures A Pointer to an array of EFI_REGEX_CAPTURE objects to receive
- the captured groups in the event of a match. The full
- sub-string match is put in Captures[0], and the results of N
- capturing groups are put in Captures[1:N]. If Captures is
- NULL, then this function doesn't allocate the memory for the
- array and does not build up the elements. It only returns the
- number of matching patterns in CapturesCount. If Captures is
- not NULL, this function returns a pointer to an array and
- builds up the elements in the array. CapturesCount is also
- updated to the number of matching patterns found. It is the
- caller's responsibility to free the memory pool in Captures
- and in each CapturePtr in the array elements.
-
- @param CapturesCount On output, CapturesCount is the number of matching patterns
- found in String. Zero means no matching patterns were found
- in the string.
-
- @retval EFI_SUCCESS The regular expression string matching
- completed successfully.
- @retval EFI_UNSUPPORTED The regular expression syntax specified by
- SyntaxType is not supported by this driver.
- @retval EFI_DEVICE_ERROR The regular expression string matching
- failed due to a hardware or firmware error.
- @retval EFI_INVALID_PARAMETER String, Pattern, Result, or CapturesCountis
- NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-RegularExpressionMatch (
- IN EFI_REGULAR_EXPRESSION_PROTOCOL *This,
- IN CHAR16 *String,
- IN CHAR16 *Pattern,
- IN EFI_REGEX_SYNTAX_TYPE *SyntaxType OPTIONAL,
- OUT BOOLEAN *Result,
- OUT EFI_REGEX_CAPTURE **Captures OPTIONAL,
- OUT UINTN *CapturesCount
- )
-{
- EFI_STATUS Status;
- UINT32 Index;
- BOOLEAN Supported;
-
- if ((This == NULL) || (String == NULL) || (Pattern == NULL) || (Result == NULL) || (CapturesCount == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Figure out which syntax to use
- //
- if (SyntaxType == NULL) {
- SyntaxType = mSupportedSyntaxes[0];
- } else {
- Supported = FALSE;
- for (Index = 0; Index < ARRAY_SIZE (mSupportedSyntaxes); ++Index) {
- if (CompareGuid (SyntaxType, mSupportedSyntaxes[Index])) {
- Supported = TRUE;
- break;
- }
- }
-
- if (!Supported) {
- return EFI_UNSUPPORTED;
- }
- }
-
- Status = OnigurumaMatch (String, Pattern, SyntaxType, Result, Captures, CapturesCount);
-
- return Status;
-}
-
-/**
- Entry point for RegularExpressionDxe.
-
- @param ImageHandle Image handle this driver.
- @param SystemTable Pointer to SystemTable.
-
- @retval Status Whether this function complete successfully.
-
-**/
-EFI_STATUS
-EFIAPI
-RegularExpressionDxeEntry (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
- Status = gBS->InstallMultipleProtocolInterfaces (
- &ImageHandle,
- &gEfiRegularExpressionProtocolGuid,
- &mProtocolInstance,
- NULL
- );
-
- return Status;
-}
+/** @file
+
+ EFI_REGULAR_EXPRESSION_PROTOCOL Implementation
+
+ (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include "RegularExpressionDxe.h"
+
+STATIC
+EFI_REGEX_SYNTAX_TYPE *CONST mSupportedSyntaxes[] = {
+ &gEfiRegexSyntaxTypePosixExtendedGuid,
+ &gEfiRegexSyntaxTypePerlGuid
+};
+
+STATIC
+EFI_REGULAR_EXPRESSION_PROTOCOL mProtocolInstance = {
+ RegularExpressionMatch,
+ RegularExpressionGetInfo
+};
+
+#define CHAR16_ENCODING ONIG_ENCODING_UTF16_LE
+
+/**
+ Call the Oniguruma regex match API.
+
+ Same parameters as RegularExpressionMatch, except SyntaxType is required.
+
+ @param String A pointer to a NULL terminated string to match against the
+ regular expression string specified by Pattern.
+
+ @param Pattern A pointer to a NULL terminated string that represents the
+ regular expression.
+ @param SyntaxType A pointer to the EFI_REGEX_SYNTAX_TYPE that identifies the
+ regular expression syntax type to use. May be NULL in which
+ case the function will use its default regular expression
+ syntax type.
+
+ @param Result On return, points to TRUE if String fully matches against
+ the regular expression Pattern using the regular expression
+ SyntaxType. Otherwise, points to FALSE.
+
+ @param Captures A Pointer to an array of EFI_REGEX_CAPTURE objects to receive
+ the captured groups in the event of a match. The full
+ sub-string match is put in Captures[0], and the results of N
+ capturing groups are put in Captures[1:N]. If Captures is
+ NULL, then this function doesn't allocate the memory for the
+ array and does not build up the elements. It only returns the
+ number of matching patterns in CapturesCount. If Captures is
+ not NULL, this function returns a pointer to an array and
+ builds up the elements in the array. CapturesCount is also
+ updated to the number of matching patterns found. It is the
+ caller's responsibility to free the memory pool in Captures
+ and in each CapturePtr in the array elements.
+
+ @param CapturesCount On output, CapturesCount is the number of matching patterns
+ found in String. Zero means no matching patterns were found
+ in the string.
+
+ @retval EFI_SUCCESS Regex compilation and match completed successfully.
+ @retval EFI_DEVICE_ERROR Regex compilation failed.
+
+**/
+STATIC
+EFI_STATUS
+OnigurumaMatch (
+ IN CHAR16 *String,
+ IN CHAR16 *Pattern,
+ IN EFI_REGEX_SYNTAX_TYPE *SyntaxType,
+ OUT BOOLEAN *Result,
+ OUT EFI_REGEX_CAPTURE **Captures OPTIONAL,
+ OUT UINTN *CapturesCount
+ )
+{
+ regex_t *OnigRegex;
+ OnigSyntaxType *OnigSyntax;
+ OnigRegion *Region;
+ INT32 OnigResult;
+ OnigErrorInfo ErrorInfo;
+ OnigUChar ErrorMessage[ONIG_MAX_ERROR_MESSAGE_LEN];
+ UINT32 Index;
+ OnigUChar *Start;
+ EFI_STATUS Status;
+
+ Status = EFI_SUCCESS;
+
+ //
+ // Detemine the internal syntax type
+ //
+ OnigSyntax = ONIG_SYNTAX_DEFAULT;
+ if (CompareGuid (SyntaxType, &gEfiRegexSyntaxTypePosixExtendedGuid)) {
+ OnigSyntax = ONIG_SYNTAX_POSIX_EXTENDED;
+ } else if (CompareGuid (SyntaxType, &gEfiRegexSyntaxTypePerlGuid)) {
+ OnigSyntax = ONIG_SYNTAX_PERL;
+ } else {
+ DEBUG ((DEBUG_ERROR, "Unsupported regex syntax - using default\n"));
+ return EFI_UNSUPPORTED;
+ }
+
+ //
+ // Compile pattern
+ //
+ Start = (OnigUChar *)Pattern;
+ OnigResult = onig_new (
+ &OnigRegex,
+ Start,
+ Start + onigenc_str_bytelen_null (CHAR16_ENCODING, Start),
+ ONIG_OPTION_DEFAULT,
+ CHAR16_ENCODING,
+ OnigSyntax,
+ &ErrorInfo
+ );
+
+ if (OnigResult != ONIG_NORMAL) {
+ onig_error_code_to_str (ErrorMessage, OnigResult, &ErrorInfo);
+ DEBUG ((DEBUG_ERROR, "Regex compilation failed: %a\n", ErrorMessage));
+ return EFI_DEVICE_ERROR;
+ }
+
+ //
+ // Try to match
+ //
+ Start = (OnigUChar *)String;
+ Region = onig_region_new ();
+ if (Region == NULL) {
+ onig_free (OnigRegex);
+ return EFI_OUT_OF_RESOURCES;
+ }
+
+ OnigResult = onig_search (
+ OnigRegex,
+ Start,
+ Start + onigenc_str_bytelen_null (CHAR16_ENCODING, Start),
+ Start,
+ Start + onigenc_str_bytelen_null (CHAR16_ENCODING, Start),
+ Region,
+ ONIG_OPTION_NONE
+ );
+
+ if (OnigResult >= 0) {
+ *Result = TRUE;
+ } else {
+ *Result = FALSE;
+ if (OnigResult != ONIG_MISMATCH) {
+ onig_error_code_to_str (ErrorMessage, OnigResult);
+ DEBUG ((DEBUG_ERROR, "Regex match failed: %a\n", ErrorMessage));
+ onig_region_free (Region, 1);
+ onig_free (OnigRegex);
+ return EFI_DEVICE_ERROR;
+ }
+ }
+
+ //
+ // If successful, copy out the region (capture) information
+ //
+ if (*Result && (Captures != NULL)) {
+ *CapturesCount = Region->num_regs;
+ *Captures = AllocateZeroPool (*CapturesCount * sizeof (**Captures));
+ if (*Captures != NULL) {
+ for (Index = 0; Index < *CapturesCount; ++Index) {
+ //
+ // Region beg/end values represent bytes, not characters
+ //
+ (*Captures)[Index].Length = (Region->end[Index] - Region->beg[Index]) / sizeof (CHAR16);
+ (*Captures)[Index].CapturePtr = AllocateCopyPool (
+ ((*Captures)[Index].Length) * sizeof (CHAR16),
+ (CHAR16 *)((UINTN)String + Region->beg[Index])
+ );
+ if ((*Captures)[Index].CapturePtr == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
+ break;
+ }
+ }
+
+ if (EFI_ERROR (Status)) {
+ for (Index = 0; Index < *CapturesCount; ++Index) {
+ if ((*Captures)[Index].CapturePtr != NULL) {
+ FreePool ((CHAR16 *)(*Captures)[Index].CapturePtr);
+ }
+ }
+
+ FreePool (*Captures);
+ }
+ }
+ }
+
+ onig_region_free (Region, 1);
+ onig_free (OnigRegex);
+
+ return Status;
+}
+
+/**
+ Returns information about the regular expression syntax types supported
+ by the implementation.
+
+ @param This A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL
+ instance.
+
+ @param RegExSyntaxTypeListSize On input, the size in bytes of RegExSyntaxTypeList.
+ On output with a return code of EFI_SUCCESS, the
+ size in bytes of the data returned in
+ RegExSyntaxTypeList. On output with a return code
+ of EFI_BUFFER_TOO_SMALL, the size of
+ RegExSyntaxTypeList required to obtain the list.
+
+ @param RegExSyntaxTypeList A caller-allocated memory buffer filled by the
+ driver with one EFI_REGEX_SYNTAX_TYPE element
+ for each supported Regular expression syntax
+ type. The list must not change across multiple
+ calls to the same driver. The first syntax
+ type in the list is the default type for the
+ driver.
+
+ @retval EFI_SUCCESS The regular expression syntax types list
+ was returned successfully.
+ @retval EFI_UNSUPPORTED The service is not supported by this driver.
+ @retval EFI_DEVICE_ERROR The list of syntax types could not be
+ retrieved due to a hardware or firmware error.
+ @retval EFI_BUFFER_TOO_SMALL The buffer RegExSyntaxTypeList is too small
+ to hold the result.
+ @retval EFI_INVALID_PARAMETER RegExSyntaxTypeListSize is NULL
+
+**/
+EFI_STATUS
+EFIAPI
+RegularExpressionGetInfo (
+ IN EFI_REGULAR_EXPRESSION_PROTOCOL *This,
+ IN OUT UINTN *RegExSyntaxTypeListSize,
+ OUT EFI_REGEX_SYNTAX_TYPE *RegExSyntaxTypeList
+ )
+{
+ UINTN SyntaxSize;
+ UINTN Index;
+
+ if ((This == NULL) || (RegExSyntaxTypeListSize == NULL)) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ if ((*RegExSyntaxTypeListSize != 0) && (RegExSyntaxTypeList == NULL)) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ SyntaxSize = ARRAY_SIZE (mSupportedSyntaxes) * sizeof (**mSupportedSyntaxes);
+
+ if (*RegExSyntaxTypeListSize < SyntaxSize) {
+ *RegExSyntaxTypeListSize = SyntaxSize;
+ return EFI_BUFFER_TOO_SMALL;
+ }
+
+ for (Index = 0; Index < ARRAY_SIZE (mSupportedSyntaxes); ++Index) {
+ CopyMem (&RegExSyntaxTypeList[Index], mSupportedSyntaxes[Index], sizeof (**mSupportedSyntaxes));
+ }
+
+ *RegExSyntaxTypeListSize = SyntaxSize;
+
+ return EFI_SUCCESS;
+}
+
+/**
+ Checks if the input string matches to the regular expression pattern.
+
+ @param This A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL instance.
+ Type EFI_REGULAR_EXPRESSION_PROTOCOL is defined in Section
+ XYZ.
+
+ @param String A pointer to a NULL terminated string to match against the
+ regular expression string specified by Pattern.
+
+ @param Pattern A pointer to a NULL terminated string that represents the
+ regular expression.
+
+ @param SyntaxType A pointer to the EFI_REGEX_SYNTAX_TYPE that identifies the
+ regular expression syntax type to use. May be NULL in which
+ case the function will use its default regular expression
+ syntax type.
+
+ @param Result On return, points to TRUE if String fully matches against
+ the regular expression Pattern using the regular expression
+ SyntaxType. Otherwise, points to FALSE.
+
+ @param Captures A Pointer to an array of EFI_REGEX_CAPTURE objects to receive
+ the captured groups in the event of a match. The full
+ sub-string match is put in Captures[0], and the results of N
+ capturing groups are put in Captures[1:N]. If Captures is
+ NULL, then this function doesn't allocate the memory for the
+ array and does not build up the elements. It only returns the
+ number of matching patterns in CapturesCount. If Captures is
+ not NULL, this function returns a pointer to an array and
+ builds up the elements in the array. CapturesCount is also
+ updated to the number of matching patterns found. It is the
+ caller's responsibility to free the memory pool in Captures
+ and in each CapturePtr in the array elements.
+
+ @param CapturesCount On output, CapturesCount is the number of matching patterns
+ found in String. Zero means no matching patterns were found
+ in the string.
+
+ @retval EFI_SUCCESS The regular expression string matching
+ completed successfully.
+ @retval EFI_UNSUPPORTED The regular expression syntax specified by
+ SyntaxType is not supported by this driver.
+ @retval EFI_DEVICE_ERROR The regular expression string matching
+ failed due to a hardware or firmware error.
+ @retval EFI_INVALID_PARAMETER String, Pattern, Result, or CapturesCountis
+ NULL.
+
+**/
+EFI_STATUS
+EFIAPI
+RegularExpressionMatch (
+ IN EFI_REGULAR_EXPRESSION_PROTOCOL *This,
+ IN CHAR16 *String,
+ IN CHAR16 *Pattern,
+ IN EFI_REGEX_SYNTAX_TYPE *SyntaxType OPTIONAL,
+ OUT BOOLEAN *Result,
+ OUT EFI_REGEX_CAPTURE **Captures OPTIONAL,
+ OUT UINTN *CapturesCount
+ )
+{
+ EFI_STATUS Status;
+ UINT32 Index;
+ BOOLEAN Supported;
+
+ if ((This == NULL) || (String == NULL) || (Pattern == NULL) || (Result == NULL) || (CapturesCount == NULL)) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ //
+ // Figure out which syntax to use
+ //
+ if (SyntaxType == NULL) {
+ SyntaxType = mSupportedSyntaxes[0];
+ } else {
+ Supported = FALSE;
+ for (Index = 0; Index < ARRAY_SIZE (mSupportedSyntaxes); ++Index) {
+ if (CompareGuid (SyntaxType, mSupportedSyntaxes[Index])) {
+ Supported = TRUE;
+ break;
+ }
+ }
+
+ if (!Supported) {
+ return EFI_UNSUPPORTED;
+ }
+ }
+
+ Status = OnigurumaMatch (String, Pattern, SyntaxType, Result, Captures, CapturesCount);
+
+ return Status;
+}
+
+/**
+ Entry point for RegularExpressionDxe.
+
+ @param ImageHandle Image handle this driver.
+ @param SystemTable Pointer to SystemTable.
+
+ @retval Status Whether this function complete successfully.
+
+**/
+EFI_STATUS
+EFIAPI
+RegularExpressionDxeEntry (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ EFI_STATUS Status;
+
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &ImageHandle,
+ &gEfiRegularExpressionProtocolGuid,
+ &mProtocolInstance,
+ NULL
+ );
+
+ return Status;
+}
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.h b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.h
index 1a6961a671..72354127fc 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.h
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.h
@@ -1,125 +1,125 @@
-/** @file
- EFI_REGULAR_EXPRESSION_PROTOCOL Header File.
-
- (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
- Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __REGULAR_EXPRESSIONDXE_H__
-#define __REGULAR_EXPRESSIONDXE_H__
-
-#include "oniguruma/src/oniguruma.h"
-
-#include <Uefi.h>
-#include <Protocol/RegularExpressionProtocol.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/DebugLib.h>
-#include <Library/BaseLib.h>
-
-/**
- Checks if the input string matches to the regular expression pattern.
-
- @param This A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL instance.
- Type EFI_REGULAR_EXPRESSION_PROTOCOL is defined in Section
- XYZ.
-
- @param String A pointer to a NULL terminated string to match against the
- regular expression string specified by Pattern.
-
- @param Pattern A pointer to a NULL terminated string that represents the
- regular expression.
-
- @param SyntaxType A pointer to the EFI_REGEX_SYNTAX_TYPE that identifies the
- regular expression syntax type to use. May be NULL in which
- case the function will use its default regular expression
- syntax type.
-
- @param Result On return, points to TRUE if String fully matches against
- the regular expression Pattern using the regular expression
- SyntaxType. Otherwise, points to FALSE.
-
- @param Captures A Pointer to an array of EFI_REGEX_CAPTURE objects to receive
- the captured groups in the event of a match. The full
- sub-string match is put in Captures[0], and the results of N
- capturing groups are put in Captures[1:N]. If Captures is
- NULL, then this function doesn't allocate the memory for the
- array and does not build up the elements. It only returns the
- number of matching patterns in CapturesCount. If Captures is
- not NULL, this function returns a pointer to an array and
- builds up the elements in the array. CapturesCount is also
- updated to the number of matching patterns found. It is the
- caller's responsibility to free the memory pool in Captures
- and in each CapturePtr in the array elements.
-
- @param CapturesCount On output, CapturesCount is the number of matching patterns
- found in String. Zero means no matching patterns were found
- in the string.
-
- @retval EFI_SUCCESS The regular expression string matching
- completed successfully.
- @retval EFI_UNSUPPORTED The regular expression syntax specified by
- SyntaxType is not supported by this driver.
- @retval EFI_DEVICE_ERROR The regular expression string matching
- failed due to a hardware or firmware error.
- @retval EFI_INVALID_PARAMETER String, Pattern, Result, or CapturesCountis
- NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-RegularExpressionMatch (
- IN EFI_REGULAR_EXPRESSION_PROTOCOL *This,
- IN CHAR16 *String,
- IN CHAR16 *Pattern,
- IN EFI_REGEX_SYNTAX_TYPE *SyntaxType OPTIONAL,
- OUT BOOLEAN *Result,
- OUT EFI_REGEX_CAPTURE **Captures OPTIONAL,
- OUT UINTN *CapturesCount
- );
-
-/**
- Returns information about the regular expression syntax types supported
- by the implementation.
-
- @param This A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL
- instance.
-
- @param RegExSyntaxTypeListSize On input, the size in bytes of RegExSyntaxTypeList.
- On output with a return code of EFI_SUCCESS, the
- size in bytes of the data returned in
- RegExSyntaxTypeList. On output with a return code
- of EFI_BUFFER_TOO_SMALL, the size of
- RegExSyntaxTypeList required to obtain the list.
-
- @param RegExSyntaxTypeList A caller-allocated memory buffer filled by the
- driver with one EFI_REGEX_SYNTAX_TYPE element
- for each supported Regular expression syntax
- type. The list must not change across multiple
- calls to the same driver. The first syntax
- type in the list is the default type for the
- driver.
-
- @retval EFI_SUCCESS The regular expression syntax types list
- was returned successfully.
- @retval EFI_UNSUPPORTED The service is not supported by this driver.
- @retval EFI_DEVICE_ERROR The list of syntax types could not be
- retrieved due to a hardware or firmware error.
- @retval EFI_BUFFER_TOO_SMALL The buffer RegExSyntaxTypeList is too small
- to hold the result.
- @retval EFI_INVALID_PARAMETER RegExSyntaxTypeListSize is NULL
-
-**/
-EFI_STATUS
-EFIAPI
-RegularExpressionGetInfo (
- IN EFI_REGULAR_EXPRESSION_PROTOCOL *This,
- IN OUT UINTN *RegExSyntaxTypeListSize,
- OUT EFI_REGEX_SYNTAX_TYPE *RegExSyntaxTypeList
- );
-
-#endif
+/** @file
+ EFI_REGULAR_EXPRESSION_PROTOCOL Header File.
+
+ (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
+ Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef __REGULAR_EXPRESSIONDXE_H__
+#define __REGULAR_EXPRESSIONDXE_H__
+
+#include "oniguruma/src/oniguruma.h"
+
+#include <Uefi.h>
+#include <Protocol/RegularExpressionProtocol.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/DebugLib.h>
+#include <Library/BaseLib.h>
+
+/**
+ Checks if the input string matches to the regular expression pattern.
+
+ @param This A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL instance.
+ Type EFI_REGULAR_EXPRESSION_PROTOCOL is defined in Section
+ XYZ.
+
+ @param String A pointer to a NULL terminated string to match against the
+ regular expression string specified by Pattern.
+
+ @param Pattern A pointer to a NULL terminated string that represents the
+ regular expression.
+
+ @param SyntaxType A pointer to the EFI_REGEX_SYNTAX_TYPE that identifies the
+ regular expression syntax type to use. May be NULL in which
+ case the function will use its default regular expression
+ syntax type.
+
+ @param Result On return, points to TRUE if String fully matches against
+ the regular expression Pattern using the regular expression
+ SyntaxType. Otherwise, points to FALSE.
+
+ @param Captures A Pointer to an array of EFI_REGEX_CAPTURE objects to receive
+ the captured groups in the event of a match. The full
+ sub-string match is put in Captures[0], and the results of N
+ capturing groups are put in Captures[1:N]. If Captures is
+ NULL, then this function doesn't allocate the memory for the
+ array and does not build up the elements. It only returns the
+ number of matching patterns in CapturesCount. If Captures is
+ not NULL, this function returns a pointer to an array and
+ builds up the elements in the array. CapturesCount is also
+ updated to the number of matching patterns found. It is the
+ caller's responsibility to free the memory pool in Captures
+ and in each CapturePtr in the array elements.
+
+ @param CapturesCount On output, CapturesCount is the number of matching patterns
+ found in String. Zero means no matching patterns were found
+ in the string.
+
+ @retval EFI_SUCCESS The regular expression string matching
+ completed successfully.
+ @retval EFI_UNSUPPORTED The regular expression syntax specified by
+ SyntaxType is not supported by this driver.
+ @retval EFI_DEVICE_ERROR The regular expression string matching
+ failed due to a hardware or firmware error.
+ @retval EFI_INVALID_PARAMETER String, Pattern, Result, or CapturesCountis
+ NULL.
+
+**/
+EFI_STATUS
+EFIAPI
+RegularExpressionMatch (
+ IN EFI_REGULAR_EXPRESSION_PROTOCOL *This,
+ IN CHAR16 *String,
+ IN CHAR16 *Pattern,
+ IN EFI_REGEX_SYNTAX_TYPE *SyntaxType OPTIONAL,
+ OUT BOOLEAN *Result,
+ OUT EFI_REGEX_CAPTURE **Captures OPTIONAL,
+ OUT UINTN *CapturesCount
+ );
+
+/**
+ Returns information about the regular expression syntax types supported
+ by the implementation.
+
+ @param This A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL
+ instance.
+
+ @param RegExSyntaxTypeListSize On input, the size in bytes of RegExSyntaxTypeList.
+ On output with a return code of EFI_SUCCESS, the
+ size in bytes of the data returned in
+ RegExSyntaxTypeList. On output with a return code
+ of EFI_BUFFER_TOO_SMALL, the size of
+ RegExSyntaxTypeList required to obtain the list.
+
+ @param RegExSyntaxTypeList A caller-allocated memory buffer filled by the
+ driver with one EFI_REGEX_SYNTAX_TYPE element
+ for each supported Regular expression syntax
+ type. The list must not change across multiple
+ calls to the same driver. The first syntax
+ type in the list is the default type for the
+ driver.
+
+ @retval EFI_SUCCESS The regular expression syntax types list
+ was returned successfully.
+ @retval EFI_UNSUPPORTED The service is not supported by this driver.
+ @retval EFI_DEVICE_ERROR The list of syntax types could not be
+ retrieved due to a hardware or firmware error.
+ @retval EFI_BUFFER_TOO_SMALL The buffer RegExSyntaxTypeList is too small
+ to hold the result.
+ @retval EFI_INVALID_PARAMETER RegExSyntaxTypeListSize is NULL
+
+**/
+EFI_STATUS
+EFIAPI
+RegularExpressionGetInfo (
+ IN EFI_REGULAR_EXPRESSION_PROTOCOL *This,
+ IN OUT UINTN *RegExSyntaxTypeListSize,
+ OUT EFI_REGEX_SYNTAX_TYPE *RegExSyntaxTypeList
+ );
+
+#endif
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
index 0092531a67..d58cd5881a 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
@@ -1,130 +1,130 @@
-## @file
-# EFI_REGULAR_EXPRESSION_PROTOCOL Implementation
-#
-# Copyright (c) 2018-2020, Intel Corporation. All rights reserved.<BR>
-# (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-##
-
-[Defines]
- INF_VERSION = 0x00010018
- BASE_NAME = RegularExpressionDxe
- FILE_GUID = 3E197E9C-D8DC-42D3-89CE-B04FA9833756
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- ENTRY_POINT = RegularExpressionDxeEntry
-
-[Sources]
- RegularExpressionDxe.c
- RegularExpressionDxe.h
- OnigurumaUefiPort.h
- OnigurumaUefiPort.c
-
-# Wrapper header files start #
- stdio.h
- stdarg.h
- stddef.h
- stdlib.h
- string.h
- config.h
-# Wrapper header files end #
-
-# Upstream Oniguruma code
- oniguruma/src/onig_init.c
- oniguruma/src/oniguruma.h
- oniguruma/src/regcomp.c
- oniguruma/src/regenc.c
- oniguruma/src/regenc.h
- oniguruma/src/regerror.c
- oniguruma/src/regexec.c
- oniguruma/src/oniggnu.h
- oniguruma/src/reggnu.c
- oniguruma/src/regint.h
- oniguruma/src/regparse.c
- oniguruma/src/regparse.h
- oniguruma/src/regposerr.c
- oniguruma/src/onigposix.h
- oniguruma/src/regposix.c
- oniguruma/src/regsyntax.c
- oniguruma/src/regtrav.c
- oniguruma/src/regversion.c
- oniguruma/src/st.c
- oniguruma/src/st.h
-
-# Supported Character Encodings
- oniguruma/src/ascii.c
- oniguruma/src/unicode.c
- oniguruma/src/unicode_fold1_key.c
- oniguruma/src/unicode_fold2_key.c
- oniguruma/src/unicode_fold3_key.c
- oniguruma/src/unicode_unfold_key.c
- oniguruma/src/utf16_le.c
- oniguruma/src/utf8.c
- oniguruma/src/utf16_be.c
- oniguruma/src/euc_jp.c
- oniguruma/src/sjis.c
- oniguruma/src/sjis_prop.c
- oniguruma/src/euc_jp_prop.c
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
-
-[LibraryClasses]
- UefiBootServicesTableLib
- UefiDriverEntryPoint
- MemoryAllocationLib
- BaseMemoryLib
- DebugLib
- PrintLib
-
-[Guids]
- gEfiRegexSyntaxTypePosixExtendedGuid ## CONSUMES ## GUID
- gEfiRegexSyntaxTypePerlGuid ## CONSUMES ## GUID
-
-[Protocols]
- gEfiRegularExpressionProtocolGuid ## PRODUCES
-
-[BuildOptions]
- # Enable STDARG for variable arguments
- *_*_*_CC_FLAGS = -DHAVE_STDARG_H -U_WIN32 -DONIG_VARIADIC_FUNC_ATTR=EFIAPI
-
- # Override MSFT build option to remove /Oi and /GL
- MSFT:*_*_*_CC_FLAGS = /GL-
- INTEL:*_*_*_CC_FLAGS = /Oi-
-
- # Oniguruma: potentially uninitialized local variable used
- MSFT:*_*_*_CC_FLAGS = /wd4701 /wd4703
-
- # Oniguruma: intrinsic function not declared
- MSFT:*_*_*_CC_FLAGS = /wd4164
-
- # Oniguruma: old style declaration in st.c
- MSFT:*_*_*_CC_FLAGS = /wd4131
- GCC:*_*_*_CC_FLAGS = -Wno-deprecated-non-prototype
-
- # Oniguruma: 'type cast' : truncation from 'OnigUChar *' to 'unsigned int'
- MSFT:*_*_*_CC_FLAGS = /wd4305 /wd4306
-
- # Oniguruma: nameless union declared in regparse.h
- MSFT:*_*_*_CC_FLAGS = /wd4201
-
- # Oniguruma: 'type cast' : "int" to "OnigUChar", function pointer to "void *"
- MSFT:*_*_*_CC_FLAGS = /wd4244 /wd4054
-
- # Oniguruma: previous local declaration
- MSFT:*_*_*_CC_FLAGS = /wd4456
-
- # Oniguruma: signed and unsigned mismatch/cast
- MSFT:*_*_*_CC_FLAGS = /wd4018 /wd4245 /wd4389 /wd4090
-
- # Oniguruma: tag_end in parse_callout_of_name
- GCC:*_*_*_CC_FLAGS = -Wno-error=maybe-uninitialized
-
- # Oniguruma: implicit conversion from 'UINTN' (aka 'unsigned long long') to 'long'
- GCC:*_CLANGPDB_*_CC_FLAGS = -Wno-error=constant-conversion
-
- # Not add -Wno-error=maybe-uninitialized option for XCODE
- # XCODE doesn't know this option
- XCODE:*_*_*_CC_FLAGS =
+## @file
+# EFI_REGULAR_EXPRESSION_PROTOCOL Implementation
+#
+# Copyright (c) 2018-2020, Intel Corporation. All rights reserved.<BR>
+# (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+[Defines]
+ INF_VERSION = 0x00010018
+ BASE_NAME = RegularExpressionDxe
+ FILE_GUID = 3E197E9C-D8DC-42D3-89CE-B04FA9833756
+ MODULE_TYPE = UEFI_DRIVER
+ VERSION_STRING = 1.0
+ ENTRY_POINT = RegularExpressionDxeEntry
+
+[Sources]
+ RegularExpressionDxe.c
+ RegularExpressionDxe.h
+ OnigurumaUefiPort.h
+ OnigurumaUefiPort.c
+
+# Wrapper header files start #
+ stdio.h
+ stdarg.h
+ stddef.h
+ stdlib.h
+ string.h
+ config.h
+# Wrapper header files end #
+
+# Upstream Oniguruma code
+ oniguruma/src/onig_init.c
+ oniguruma/src/oniguruma.h
+ oniguruma/src/regcomp.c
+ oniguruma/src/regenc.c
+ oniguruma/src/regenc.h
+ oniguruma/src/regerror.c
+ oniguruma/src/regexec.c
+ oniguruma/src/oniggnu.h
+ oniguruma/src/reggnu.c
+ oniguruma/src/regint.h
+ oniguruma/src/regparse.c
+ oniguruma/src/regparse.h
+ oniguruma/src/regposerr.c
+ oniguruma/src/onigposix.h
+ oniguruma/src/regposix.c
+ oniguruma/src/regsyntax.c
+ oniguruma/src/regtrav.c
+ oniguruma/src/regversion.c
+ oniguruma/src/st.c
+ oniguruma/src/st.h
+
+# Supported Character Encodings
+ oniguruma/src/ascii.c
+ oniguruma/src/unicode.c
+ oniguruma/src/unicode_fold1_key.c
+ oniguruma/src/unicode_fold2_key.c
+ oniguruma/src/unicode_fold3_key.c
+ oniguruma/src/unicode_unfold_key.c
+ oniguruma/src/utf16_le.c
+ oniguruma/src/utf8.c
+ oniguruma/src/utf16_be.c
+ oniguruma/src/euc_jp.c
+ oniguruma/src/sjis.c
+ oniguruma/src/sjis_prop.c
+ oniguruma/src/euc_jp_prop.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+ UefiBootServicesTableLib
+ UefiDriverEntryPoint
+ MemoryAllocationLib
+ BaseMemoryLib
+ DebugLib
+ PrintLib
+
+[Guids]
+ gEfiRegexSyntaxTypePosixExtendedGuid ## CONSUMES ## GUID
+ gEfiRegexSyntaxTypePerlGuid ## CONSUMES ## GUID
+
+[Protocols]
+ gEfiRegularExpressionProtocolGuid ## PRODUCES
+
+[BuildOptions]
+ # Enable STDARG for variable arguments
+ *_*_*_CC_FLAGS = -DHAVE_STDARG_H -U_WIN32 -DONIG_VARIADIC_FUNC_ATTR=EFIAPI
+
+ # Override MSFT build option to remove /Oi and /GL
+ MSFT:*_*_*_CC_FLAGS = /GL-
+ INTEL:*_*_*_CC_FLAGS = /Oi-
+
+ # Oniguruma: potentially uninitialized local variable used
+ MSFT:*_*_*_CC_FLAGS = /wd4701 /wd4703
+
+ # Oniguruma: intrinsic function not declared
+ MSFT:*_*_*_CC_FLAGS = /wd4164
+
+ # Oniguruma: old style declaration in st.c
+ MSFT:*_*_*_CC_FLAGS = /wd4131
+ GCC:*_*_*_CC_FLAGS = -Wno-deprecated-non-prototype
+
+ # Oniguruma: 'type cast' : truncation from 'OnigUChar *' to 'unsigned int'
+ MSFT:*_*_*_CC_FLAGS = /wd4305 /wd4306
+
+ # Oniguruma: nameless union declared in regparse.h
+ MSFT:*_*_*_CC_FLAGS = /wd4201
+
+ # Oniguruma: 'type cast' : "int" to "OnigUChar", function pointer to "void *"
+ MSFT:*_*_*_CC_FLAGS = /wd4244 /wd4054
+
+ # Oniguruma: previous local declaration
+ MSFT:*_*_*_CC_FLAGS = /wd4456
+
+ # Oniguruma: signed and unsigned mismatch/cast
+ MSFT:*_*_*_CC_FLAGS = /wd4018 /wd4245 /wd4389 /wd4090
+
+ # Oniguruma: tag_end in parse_callout_of_name
+ GCC:*_*_*_CC_FLAGS = -Wno-error=maybe-uninitialized
+
+ # Oniguruma: implicit conversion from 'UINTN' (aka 'unsigned long long') to 'long'
+ GCC:*_CLANGPDB_*_CC_FLAGS = -Wno-error=constant-conversion
+
+ # Not add -Wno-error=maybe-uninitialized option for XCODE
+ # XCODE doesn't know this option
+ XCODE:*_*_*_CC_FLAGS =
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/config.h b/MdeModulePkg/Universal/RegularExpressionDxe/config.h
index 820040066c..130f70d078 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/config.h
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/config.h
@@ -1,9 +1,9 @@
-/** @file
- Include file to support building the third-party oniguruma.
-
-Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include <OnigurumaUefiPort.h>
+/** @file
+ Include file to support building the third-party oniguruma.
+
+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <OnigurumaUefiPort.h>
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/stdarg.h b/MdeModulePkg/Universal/RegularExpressionDxe/stdarg.h
index 820040066c..130f70d078 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/stdarg.h
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/stdarg.h
@@ -1,9 +1,9 @@
-/** @file
- Include file to support building the third-party oniguruma.
-
-Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include <OnigurumaUefiPort.h>
+/** @file
+ Include file to support building the third-party oniguruma.
+
+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <OnigurumaUefiPort.h>
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/stddef.h b/MdeModulePkg/Universal/RegularExpressionDxe/stddef.h
index 820040066c..130f70d078 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/stddef.h
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/stddef.h
@@ -1,9 +1,9 @@
-/** @file
- Include file to support building the third-party oniguruma.
-
-Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include <OnigurumaUefiPort.h>
+/** @file
+ Include file to support building the third-party oniguruma.
+
+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <OnigurumaUefiPort.h>
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/stdio.h b/MdeModulePkg/Universal/RegularExpressionDxe/stdio.h
index 820040066c..130f70d078 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/stdio.h
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/stdio.h
@@ -1,9 +1,9 @@
-/** @file
- Include file to support building the third-party oniguruma.
-
-Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include <OnigurumaUefiPort.h>
+/** @file
+ Include file to support building the third-party oniguruma.
+
+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <OnigurumaUefiPort.h>
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/stdlib.h b/MdeModulePkg/Universal/RegularExpressionDxe/stdlib.h
index 820040066c..130f70d078 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/stdlib.h
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/stdlib.h
@@ -1,9 +1,9 @@
-/** @file
- Include file to support building the third-party oniguruma.
-
-Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include <OnigurumaUefiPort.h>
+/** @file
+ Include file to support building the third-party oniguruma.
+
+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <OnigurumaUefiPort.h>
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/string.h b/MdeModulePkg/Universal/RegularExpressionDxe/string.h
index 820040066c..130f70d078 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/string.h
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/string.h
@@ -1,9 +1,9 @@
-/** @file
- Include file to support building the third-party oniguruma.
-
-Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include <OnigurumaUefiPort.h>
+/** @file
+ Include file to support building the third-party oniguruma.
+
+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <OnigurumaUefiPort.h>