]>
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 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))
33 #define free(p) FreePool(p)
34 #define realloc(OldPtr,NewSize,OldSize) ReallocatePool(OldSize,NewSize,OldPtr)
35 #define xmemmove(Dest,Src,Length) CopyMem(Dest,Src,Length)
36 #define xmemcpy(Dest,Src,Length) CopyMem(Dest,Src,Length)
37 #define xmemset(Buffer,Value,Length) SetMem(Buffer,Length,Value)
39 #define va_init_list(a,b) VA_START(a,b)
40 #define va_list VA_LIST
41 #define va_arg(a,b) VA_ARG(a,b)
42 #define va_end(a) VA_END(a)
48 #define vsnprintf (int)AsciiVSPrint
49 #define _vsnprintf vsnprintf
51 #define setlocale(a,b)
54 #define MAX_STRING_SIZE 0x1000
55 #define strlen_s(String,MaxSize) AsciiStrnLenS (String, MaxSize)
56 #define strcat_s(Dest,MaxSize,Src) AsciiStrCatS (Dest, MaxSize, Src)
57 #define strncpy_s(Dest,MaxSize,Src,Length) AsciiStrnCpyS (Dest, MaxSize, Src, Length)
58 #define strcmp OnigStrCmp
60 int OnigStrCmp (char* Str1
, char* Str2
);
62 int sprintf (char *str
, char const *fmt
, ...);
64 #define exit(n) ASSERT(FALSE);
66 #endif // !ONIGURUMA_UEFI_PORT_H