]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdeModulePkg / Universal / Disk / UnicodeCollation / EnglishDxe / UnicodeCollationEng.h
CommitLineData
f42be642 1/** @file\r
2 Head file for Unicode Collation Protocol (English)\r
adbcbf8f 3\r
d1102dba 4Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9d510e61 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
adbcbf8f 6\r
f42be642 7**/\r
adbcbf8f 8\r
ea7cb08c 9#ifndef _UNICODE_COLLATION_ENG_H_\r
10#define _UNICODE_COLLATION_ENG_H_\r
adbcbf8f 11\r
adbcbf8f 12#include <Uefi.h>\r
13\r
adbcbf8f 14#include <Protocol/UnicodeCollation.h>\r
ed7748fe 15\r
adbcbf8f 16#include <Library/DebugLib.h>\r
17#include <Library/UefiDriverEntryPoint.h>\r
18#include <Library/UefiBootServicesTableLib.h>\r
2d9a7522 19#include <Library/PcdLib.h>\r
adbcbf8f 20\r
21//\r
48557c65 22// Bit mask to indicate the validity of character in FAT file name.\r
adbcbf8f 23//\r
24#define CHAR_FAT_VALID 0x01\r
25\r
48557c65 26//\r
27// Maximum FAT table size.\r
28//\r
29#define MAP_TABLE_SIZE 0x100\r
30\r
31//\r
32// Macro to map character a to upper case.\r
33//\r
1436aea4 34#define TO_UPPER(a) (CHAR16) ((a) <= 0xFF ? mEngUpperMap[a] : (a))\r
48557c65 35\r
36//\r
37// Macro to map character a to lower case.\r
38//\r
1436aea4 39#define TO_LOWER(a) (CHAR16) ((a) <= 0xFF ? mEngLowerMap[a] : (a))\r
adbcbf8f 40\r
41//\r
42// Prototypes\r
43//\r
1436aea4 44\r
61e33430 45/**\r
4f077902 46 Performs a case-insensitive comparison of two Null-terminated strings.\r
61e33430 47\r
48 @param This Protocol instance pointer.\r
4f077902
SZ
49 @param Str1 A pointer to a Null-terminated string.\r
50 @param Str2 A pointer to a Null-terminated string.\r
61e33430 51\r
52 @retval 0 Str1 is equivalent to Str2\r
53 @retval > 0 Str1 is lexically greater than Str2\r
54 @retval < 0 Str1 is lexically less than Str2\r
55\r
56**/\r
adbcbf8f 57INTN\r
58EFIAPI\r
59EngStriColl (\r
1436aea4
MK
60 IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r
61 IN CHAR16 *Str1,\r
62 IN CHAR16 *Str2\r
ea7cb08c 63 );\r
adbcbf8f 64\r
61e33430 65/**\r
4f077902
SZ
66 Performs a case-insensitive comparison of a Null-terminated\r
67 pattern string and a Null-terminated string.\r
61e33430 68\r
69 @param This Protocol instance pointer.\r
4f077902
SZ
70 @param String A pointer to a Null-terminated string.\r
71 @param Pattern A pointer to a Null-terminated pattern string.\r
61e33430 72\r
73 @retval TRUE Pattern was found in String.\r
74 @retval FALSE Pattern was not found in String.\r
75\r
76**/\r
adbcbf8f 77BOOLEAN\r
78EFIAPI\r
79EngMetaiMatch (\r
1436aea4
MK
80 IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r
81 IN CHAR16 *String,\r
82 IN CHAR16 *Pattern\r
ea7cb08c 83 );\r
adbcbf8f 84\r
61e33430 85/**\r
d1102dba 86 Converts all the characters in a Null-terminated string to\r
4f077902 87 lower case characters.\r
61e33430 88\r
89 @param This Protocol instance pointer.\r
4f077902 90 @param Str A pointer to a Null-terminated string.\r
61e33430 91\r
92**/\r
adbcbf8f 93VOID\r
94EFIAPI\r
95EngStrLwr (\r
1436aea4
MK
96 IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r
97 IN OUT CHAR16 *Str\r
ea7cb08c 98 );\r
adbcbf8f 99\r
61e33430 100/**\r
4f077902
SZ
101 Converts all the characters in a Null-terminated string to upper\r
102 case characters.\r
61e33430 103\r
104 @param This Protocol instance pointer.\r
4f077902 105 @param Str A pointer to a Null-terminated string.\r
61e33430 106\r
107**/\r
adbcbf8f 108VOID\r
109EFIAPI\r
110EngStrUpr (\r
1436aea4
MK
111 IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r
112 IN OUT CHAR16 *Str\r
ea7cb08c 113 );\r
adbcbf8f 114\r
61e33430 115/**\r
4f077902 116 Converts an 8.3 FAT file name in an OEM character set to a Null-terminated string.\r
61e33430 117\r
118 @param This Protocol instance pointer.\r
119 @param FatSize The size of the string Fat in bytes.\r
120 @param Fat A pointer to a Null-terminated string that contains an 8.3 file\r
4f077902
SZ
121 name using an 8-bit OEM character set.\r
122 @param String A pointer to a Null-terminated string. The string must\r
123 be preallocated to hold FatSize characters.\r
61e33430 124\r
125**/\r
adbcbf8f 126VOID\r
127EFIAPI\r
128EngFatToStr (\r
1436aea4
MK
129 IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r
130 IN UINTN FatSize,\r
131 IN CHAR8 *Fat,\r
132 OUT CHAR16 *String\r
ea7cb08c 133 );\r
adbcbf8f 134\r
61e33430 135/**\r
d1102dba
LG
136 Converts a Null-terminated string to legal characters in a FAT\r
137 filename using an OEM character set.\r
61e33430 138\r
139 @param This Protocol instance pointer.\r
4f077902
SZ
140 @param String A pointer to a Null-terminated string. The string must\r
141 be preallocated to hold FatSize characters.\r
61e33430 142 @param FatSize The size of the string Fat in bytes.\r
143 @param Fat A pointer to a Null-terminated string that contains an 8.3 file\r
144 name using an OEM character set.\r
145\r
146 @retval TRUE Fat is a Long File Name\r
147 @retval FALSE Fat is an 8.3 file name\r
148\r
149**/\r
adbcbf8f 150BOOLEAN\r
151EFIAPI\r
152EngStrToFat (\r
1436aea4
MK
153 IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r
154 IN CHAR16 *String,\r
155 IN UINTN FatSize,\r
156 OUT CHAR8 *Fat\r
ea7cb08c 157 );\r
adbcbf8f 158\r
61e33430 159/**\r
160 The user Entry Point for English module.\r
d1102dba 161\r
61e33430 162 This function initializes unicode character mapping and then installs Unicode\r
d1102dba 163 Collation & Unicode Collation 2 Protocols based on the feature flags.\r
61e33430 164\r
d1102dba 165 @param ImageHandle The firmware allocated handle for the EFI image.\r
61e33430 166 @param SystemTable A pointer to the EFI System Table.\r
d1102dba 167\r
61e33430 168 @retval EFI_SUCCESS The entry point is executed successfully.\r
169 @retval other Some error occurs when executing this entry point.\r
170\r
171**/\r
adbcbf8f 172EFI_STATUS\r
173EFIAPI\r
174InitializeUnicodeCollationEng (\r
1436aea4
MK
175 IN EFI_HANDLE ImageHandle,\r
176 IN EFI_SYSTEM_TABLE *SystemTable\r
ea7cb08c 177 );\r
adbcbf8f 178\r
179#endif\r