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