]>
git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/OnigurumaUefiPort.h
3 Module to rewrite stdlib references within Oniguruma
5 (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef ONIGURUMA_UEFI_PORT_H
10 #define ONIGURUMA_UEFI_PORT_H
12 #include <Library/MemoryAllocationLib.h>
13 #include <Library/PrintLib.h>
14 #include <Library/BaseMemoryLib.h>
15 #include <Library/BaseLib.h>
16 #include <Library/DebugLib.h>
21 #define SIZEOF_LONG sizeof(long)
22 #define SIZEOF_INT sizeof(int)
25 #define malloc(n) AllocatePool(n)
26 #define calloc(n,s) AllocateZeroPool((n)*(s))
33 if (EvalOnce != NULL) { \
34 FreePool (EvalOnce); \
38 #define realloc(OldPtr,NewSize,OldSize) ReallocatePool(OldSize,NewSize,OldPtr)
39 #define xmemmove(Dest,Src,Length) CopyMem(Dest,Src,Length)
40 #define xmemcpy(Dest,Src,Length) CopyMem(Dest,Src,Length)
41 #define xmemset(Buffer,Value,Length) SetMem(Buffer,Length,Value)
43 #define va_init_list(a,b) VA_START(a,b)
44 #define va_list VA_LIST
45 #define va_arg(a,b) VA_ARG(a,b)
46 #define va_end(a) VA_END(a)
52 #define vsnprintf (int)AsciiVSPrint
53 #define _vsnprintf vsnprintf
55 #define setlocale(a,b)
58 #define MAX_STRING_SIZE 0x1000
59 #define strlen_s(String,MaxSize) AsciiStrnLenS (String, MaxSize)
60 #define strcat_s(Dest,MaxSize,Src) AsciiStrCatS (Dest, MaxSize, Src)
61 #define strncpy_s(Dest,MaxSize,Src,Length) AsciiStrnCpyS (Dest, MaxSize, Src, Length)
62 #define strcmp OnigStrCmp
64 int OnigStrCmp (char* Str1
, char* Str2
);
66 int EFIAPI
sprintf_s (char *str
, size_t sizeOfBuffer
, char const *fmt
, ...);
68 #define exit(n) ASSERT(FALSE);
70 #endif // !ONIGURUMA_UEFI_PORT_H