From db3b92b40e17f4bf9393eea4a10f79d5165aeead Mon Sep 17 00:00:00 2001 From: Cecil Sheng Date: Tue, 8 Sep 2015 06:49:47 +0000 Subject: MdeModulePkg: Regular expression protocol Add driver to produce EFI_REGULAR_EXPRESSION_PROTOCOL. Based on Oniguruma v5.9.6 (BSD 2-clause license), which provides full Unicode support, and POSIX ERE and Perl regex syntaxes. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cecil Sheng Reviewed-by: Eric Dong git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18411 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Oniguruma/OnigurumaUefiPort.c | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/OnigurumaUefiPort.c (limited to 'MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/OnigurumaUefiPort.c') diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/OnigurumaUefiPort.c b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/OnigurumaUefiPort.c new file mode 100644 index 0000000000..98822f3648 --- /dev/null +++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/OnigurumaUefiPort.c @@ -0,0 +1,32 @@ +/** @file + + Module to rewrite stdlib references within Oniguruma + + Copyright (c) 2014-2015, Hewlett-Packard Development Company, L.P.
+ + This program and the accompanying materials are licensed and made available + under the terms and conditions of the BSD License that accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT + WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +**/ +#include "OnigurumaUefiPort.h" + +int sprintf(char *str, char const *fmt, ...) +{ + VA_LIST Marker; + int NumberOfPrinted; + + VA_START (Marker, fmt); + NumberOfPrinted = (int)AsciiVSPrint (str, 1000000, fmt, Marker); + VA_END (Marker); + + return NumberOfPrinted; +} + +int OnigStrCmp (char* Str1, char* Str2) +{ + return (int)AsciiStrCmp (Str1, Str2); +} -- cgit v1.2.3