]>
git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/OnigurumaUefiPort.h
d24ac1d880b04c19462bce20e41edd4d71993c58
3 Module to rewrite stdlib references within Oniguruma
5 (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP<BR>
7 This program and the accompanying materials are licensed and made available
8 under the terms and conditions of the BSD License that accompanies this
9 distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php.
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
13 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef ONIGURUMA_UEFI_PORT_H
16 #define ONIGURUMA_UEFI_PORT_H
18 #include <Library/MemoryAllocationLib.h>
19 #include <Library/PrintLib.h>
20 #include <Library/BaseMemoryLib.h>
21 #include <Library/BaseLib.h>
22 #include <Library/DebugLib.h>
27 #define SIZEOF_LONG sizeof(long)
28 #define SIZEOF_INT sizeof(int)
31 #define malloc(n) AllocatePool(n)
32 #define calloc(n,s) AllocateZeroPool((n)*(s))
39 if (EvalOnce != NULL) { \
40 FreePool (EvalOnce); \
44 #define realloc(OldPtr,NewSize,OldSize) ReallocatePool(OldSize,NewSize,OldPtr)
45 #define xmemmove(Dest,Src,Length) CopyMem(Dest,Src,Length)
46 #define xmemcpy(Dest,Src,Length) CopyMem(Dest,Src,Length)
47 #define xmemset(Buffer,Value,Length) SetMem(Buffer,Length,Value)
49 #define va_init_list(a,b) VA_START(a,b)
50 #define va_list VA_LIST
51 #define va_arg(a,b) VA_ARG(a,b)
52 #define va_end(a) VA_END(a)
58 #define vsnprintf (int)AsciiVSPrint
59 #define _vsnprintf vsnprintf
61 #define setlocale(a,b)
64 #define MAX_STRING_SIZE 0x1000
65 #define strlen_s(String,MaxSize) AsciiStrnLenS (String, MaxSize)
66 #define strcat_s(Dest,MaxSize,Src) AsciiStrCatS (Dest, MaxSize, Src)
67 #define strncpy_s(Dest,MaxSize,Src,Length) AsciiStrnCpyS (Dest, MaxSize, Src, Length)
68 #define strcmp OnigStrCmp
70 int OnigStrCmp (char* Str1
, char* Str2
);
72 int EFIAPI
sprintf_s (char *str
, size_t sizeOfBuffer
, char const *fmt
, ...);
74 #define exit(n) ASSERT(FALSE);
76 #endif // !ONIGURUMA_UEFI_PORT_H