TianoCore EDK2 master
Loading...
Searching...
No Matches
OnigurumaUefiPort.h
Go to the documentation of this file.
1
12#ifndef ONIGURUMA_UEFI_PORT_H
13#define ONIGURUMA_UEFI_PORT_H
14
16#include <Library/PrintLib.h>
18#include <Library/BaseLib.h>
19#include <Library/DebugLib.h>
20
21#define ONIG_NO_STANDARD_C_HEADERS
22#define ONIG_NO_PRINT
23#define P_(args) args
24
25#define INT_MAX 0x7FFFFFFF
26#define LONG_MAX 0x7FFFFFFF
27#define UINT_MAX 0xFFFFFFFF
28#define ULONG_MAX 0xFFFFFFFF
29
30#define SIZEOF_LONG 4
31#define SIZEOF_LONG_LONG 8
32typedef UINTN size_t;
33typedef UINT32 uint32_t;
34typedef INTN intptr_t;
35
36#ifndef offsetof
37#define offsetof OFFSET_OF
38#endif
39
40#if defined (MDE_CPU_IA32) || defined (MDE_CPU_ARM) || defined (MDE_CPU_EBC)
41#define SIZEOF_VOIDP 4
42#else
43#define SIZEOF_VOIDP 8
44#endif
45
46#define calloc(n, s) AllocateZeroPool((n)*(s))
47#define xmemmove(Dest, Src, Length) CopyMem(Dest,Src,Length)
48#define xmemcpy(Dest, Src, Length) CopyMem(Dest,Src,Length)
49#define xmemset(Buffer, Value, Length) SetMem(Buffer,Length,Value)
50
51#define va_init_list(a, b) VA_START(a,b)
52#define va_list VA_LIST
53#define va_arg(a, b) VA_ARG(a,b)
54#define va_end(a) VA_END(a)
55#define va_start VA_START
56
57#define FILE VOID
58#define stdout NULL
59#define fprintf(...)
60#define fputs(a, b)
61#define vsnprintf (int)AsciiVSPrint
62#define _vsnprintf vsnprintf
63#define xsnprintf sprintf_s
64#define xvsnprintf vsnprintf
65#define alloca malloc
66
67#define setlocale(a, b)
68#define LC_ALL 0
69
70#define UCHAR_MAX 255
71#define MAX_STRING_SIZE 0x1000
72#define strlen_s(String, MaxSize) AsciiStrnLenS (String, MaxSize)
73#define xstrncpy(Dest, Src, MaxSize) strcat_s(Dest,MaxSize,Src)
74#define xstrcat(Dest, Src, MaxSize) strcat(Dest,Src,MaxSize)
75#define strcat(Dest, Src, MaxSize) strcat_s(Dest,MaxSize,Src)
76#define strcat_s(Dest, MaxSize, Src) AsciiStrCatS (Dest, MaxSize, Src)
77#define strncpy_s(Dest, MaxSize, Src, Length) AsciiStrnCpyS (Dest, MaxSize, Src, Length)
78#define strcmp OnigStrCmp
79
80int
81OnigStrCmp (
82 const char *Str1,
83 const char *Str2
84 );
85
86int EFIAPI
87sprintf_s (
88 char *str,
89 size_t sizeOfBuffer,
90 char const *fmt,
91 ...
92 );
93
94int
95strlen (
96 const char *str
97 );
98
99void *
100malloc (
101 size_t size
102 );
103
104void *
105realloc (
106 void *ptr,
107 size_t size
108 );
109
110#if !defined (MDE_CPU_ARM)
111void *
112memcpy (
113 void *dest,
114 const void *src,
115 unsigned int count
116 );
117
118#endif
119
120void *
121memset (
122 void *dest,
123 int ch,
124 unsigned int count
125 );
126
127void
128free (
129 void *ptr
130 );
131
132#define exit(n) ASSERT(FALSE);
133
134#endif // !ONIGURUMA_UEFI_PORT_H
UINT64 UINTN
INT64 INTN