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