]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/OnigurumaUefiPort.h
MdeModulePkg: Regular expression protocol
[mirror_edk2.git] / MdeModulePkg / Universal / RegularExpressionDxe / Oniguruma / OnigurumaUefiPort.h
CommitLineData
14b0e578
CS
1/** @file\r
2 \r
3 Module to rewrite stdlib references within Oniguruma\r
4\r
5 Copyright (c) 2014-2015, Hewlett-Packard Development Company, L.P.<BR>\r
6\r
7 This program and the accompanying materials are licensed and made available\r
8 under the terms and conditions of the BSD License that accompanies this\r
9 distribution. The full text of the license may be found at\r
10 http://opensource.org/licenses/bsd-license.php.\r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
13 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14**/\r
15#ifndef ONIGURUMA_UEFI_PORT_H\r
16#define ONIGURUMA_UEFI_PORT_H\r
17\r
18#include <Library/MemoryAllocationLib.h>\r
19#include <Library/PrintLib.h>\r
20#include <Library/BaseMemoryLib.h>\r
21#include <Library/BaseLib.h>\r
22#include <Library/DebugLib.h>\r
23\r
24#undef _WIN32\r
25#define P_(args) args\r
26\r
27#define SIZEOF_LONG sizeof(long)\r
28#define SIZEOF_INT sizeof(int)\r
29typedef UINTN size_t;\r
30\r
31#define malloc(n) AllocatePool(n)\r
32#define calloc(n,s) AllocateZeroPool((n)*(s))\r
33#define free(p) FreePool(p)\r
34#define realloc(OldPtr,NewSize,OldSize) ReallocatePool(OldSize,NewSize,OldPtr)\r
35#define xmemmove(Dest,Src,Length) CopyMem(Dest,Src,Length)\r
36#define xmemcpy(Dest,Src,Length) CopyMem(Dest,Src,Length)\r
37#define xmemset(Buffer,Value,Length) SetMem(Buffer,Length,Value)\r
38\r
39#define va_init_list(a,b) VA_START(a,b)\r
40#define va_list VA_LIST\r
41#define va_arg(a,b) VA_ARG(a,b)\r
42#define va_end(a) VA_END(a)\r
43\r
44#define FILE VOID\r
45#define stdout NULL\r
46#define fprintf(...)\r
47#define fputs(a,b)\r
48#define vsnprintf (int)AsciiVSPrint\r
49#define _vsnprintf vsnprintf\r
50\r
51#define setlocale(a,b)\r
52#define LC_ALL 0\r
53\r
54#define MAX_STRING_SIZE 0x1000\r
55#define strlen_s(String,MaxSize) AsciiStrnLenS (String, MaxSize)\r
56#define strcat_s(Dest,MaxSize,Src) AsciiStrCatS (Dest, MaxSize, Src)\r
57#define strncpy_s(Dest,MaxSize,Src,Length) AsciiStrnCpyS (Dest, MaxSize, Src, Length)\r
58#define strcmp OnigStrCmp\r
59\r
60int OnigStrCmp (char* Str1, char* Str2);\r
61\r
62int sprintf (char *str, char const *fmt, ...);\r
63\r
64#define exit(n) ASSERT(FALSE);\r
65\r
66#endif // !ONIGURUMA_UEFI_PORT_H\r