]>
Commit | Line | Data |
---|---|---|
d1f95000 | 1 | /** @file\r |
8a7d75b0 | 2 | Unicode Collation protocol that follows the UEFI 2.0 specification.\r |
d1f95000 | 3 | \r |
4 | Copyright (c) 2006, Intel Corporation \r | |
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 | |
d1f95000 | 13 | **/\r |
14 | \r | |
15 | #ifndef __UNICODE_COLLATION_H__\r | |
16 | #define __UNICODE_COLLATION_H__\r | |
17 | \r | |
18 | #define EFI_UNICODE_COLLATION_PROTOCOL_GUID \\r | |
19 | { \\r | |
20 | 0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r | |
21 | }\r | |
22 | \r | |
d24236bf | 23 | #define EFI_UNICODE_COLLATION_PROTOCOL2_GUID \\r |
24 | { \\r | |
25 | 0xa4c751fc, 0x23ae, 0x4c3e, {0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49 } \\r | |
26 | }\r | |
27 | \r | |
a6508c05 | 28 | typedef struct _EFI_UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL;\r |
29 | \r | |
30 | \r | |
31 | //\r | |
32 | // Protocol GUID name defined in EFI1.1.\r | |
33 | // \r | |
34 | #define UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL_GUID\r | |
35 | \r | |
36 | //\r | |
37 | // Protocol defined in EFI1.1.\r | |
38 | // \r | |
39 | typedef EFI_UNICODE_COLLATION_PROTOCOL UNICODE_COLLATION_INTERFACE;\r | |
d1f95000 | 40 | \r |
41 | //\r | |
42 | // Protocol data structures and defines\r | |
43 | //\r | |
44 | #define EFI_UNICODE_BYTE_ORDER_MARK (CHAR16) (0xfeff)\r | |
45 | \r | |
46 | //\r | |
47 | // Protocol member functions\r | |
48 | //\r | |
49 | /**\r | |
50 | Performs a case-insensitive comparison of two Null-terminated Unicode \r | |
51 | strings.\r | |
52 | \r | |
53 | @param This Protocol instance pointer.\r | |
54 | @param Str1 A pointer to a Null-terminated Unicode string.\r | |
55 | @param Str2 A pointer to a Null-terminated Unicode string.\r | |
56 | \r | |
57 | @retval 0 Str1 is equivalent to Str2\r | |
58 | @retval >_0 Str1 is lexically greater than Str2\r | |
59 | @retval <_0 Str1 is lexically less than Str2\r | |
60 | \r | |
61 | **/\r | |
62 | typedef\r | |
63 | INTN\r | |
8b13229b | 64 | (EFIAPI *EFI_UNICODE_COLLATION_STRICOLL)(\r |
d1f95000 | 65 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
66 | IN CHAR16 *Str1,\r | |
67 | IN CHAR16 *Str2\r | |
68 | )\r | |
69 | ;\r | |
70 | \r | |
71 | /**\r | |
72 | Performs a case-insensitive comparison of a Null-terminated Unicode \r | |
73 | pattern string and a Null-terminated Unicode string.\r | |
74 | \r | |
75 | @param This Protocol instance pointer.\r | |
76 | @param String A pointer to a Null-terminated Unicode string.\r | |
77 | @param Pattern A pointer to a Null-terminated Unicode pattern string.\r | |
78 | \r | |
79 | @retval TRUE Pattern was found in String.\r | |
80 | @retval FALSE Pattern was not found in String.\r | |
81 | \r | |
82 | **/\r | |
83 | typedef\r | |
84 | BOOLEAN\r | |
8b13229b | 85 | (EFIAPI *EFI_UNICODE_COLLATION_METAIMATCH)(\r |
d1f95000 | 86 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
87 | IN CHAR16 *String,\r | |
88 | IN CHAR16 *Pattern\r | |
89 | )\r | |
90 | ;\r | |
91 | \r | |
92 | /**\r | |
93 | Converts all the Unicode characters in a Null-terminated Unicode string to \r | |
94 | lower case Unicode characters.\r | |
95 | \r | |
96 | @param This Protocol instance pointer.\r | |
97 | @param String A pointer to a Null-terminated Unicode string.\r | |
98 | \r | |
99 | NONE\r | |
100 | \r | |
101 | **/\r | |
102 | typedef\r | |
103 | VOID\r | |
8b13229b | 104 | (EFIAPI *EFI_UNICODE_COLLATION_STRLWR)(\r |
d1f95000 | 105 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
106 | IN OUT CHAR16 *Str\r | |
107 | )\r | |
108 | ;\r | |
109 | \r | |
110 | /**\r | |
111 | Converts all the Unicode characters in a Null-terminated Unicode string to upper\r | |
112 | case Unicode characters.\r | |
113 | \r | |
114 | @param This Protocol instance pointer.\r | |
115 | @param String A pointer to a Null-terminated Unicode string.\r | |
116 | \r | |
117 | NONE\r | |
118 | \r | |
119 | **/\r | |
120 | typedef\r | |
121 | VOID\r | |
8b13229b | 122 | (EFIAPI *EFI_UNICODE_COLLATION_STRUPR)(\r |
d1f95000 | 123 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
124 | IN OUT CHAR16 *Str\r | |
125 | )\r | |
126 | ;\r | |
127 | \r | |
128 | /**\r | |
129 | Converts an 8.3 FAT file name in an OEM character set to a Null-terminated \r | |
130 | Unicode string.\r | |
131 | \r | |
132 | @param This Protocol instance pointer.\r | |
133 | @param FatSize The size of the string Fat in bytes.\r | |
134 | @param Fat A pointer to a Null-terminated string that contains an 8.3 file\r | |
135 | name using an OEM character set.\r | |
136 | @param String A pointer to a Null-terminated Unicode string. The string must\r | |
137 | be preallocated to hold FatSize Unicode characters.\r | |
138 | \r | |
139 | NONE\r | |
140 | \r | |
141 | **/\r | |
142 | typedef\r | |
143 | VOID\r | |
8b13229b | 144 | (EFIAPI *EFI_UNICODE_COLLATION_FATTOSTR)(\r |
d1f95000 | 145 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
146 | IN UINTN FatSize,\r | |
147 | IN CHAR8 *Fat,\r | |
148 | OUT CHAR16 *String\r | |
149 | )\r | |
150 | ;\r | |
151 | \r | |
152 | /**\r | |
153 | Converts a Null-terminated Unicode string to legal characters in a FAT \r | |
154 | filename using an OEM character set. \r | |
155 | \r | |
156 | @param This Protocol instance pointer.\r | |
157 | @param String A pointer to a Null-terminated Unicode string. The string must\r | |
158 | be preallocated to hold FatSize Unicode characters.\r | |
159 | @param FatSize The size of the string Fat in bytes.\r | |
160 | @param Fat A pointer to a Null-terminated string that contains an 8.3 file\r | |
161 | name using an OEM character set.\r | |
162 | \r | |
163 | @retval TRUE Fat is a Long File Name\r | |
164 | @retval FALSE Fat is an 8.3 file name\r | |
165 | \r | |
166 | **/\r | |
167 | typedef\r | |
168 | BOOLEAN\r | |
8b13229b | 169 | (EFIAPI *EFI_UNICODE_COLLATION_STRTOFAT)(\r |
d1f95000 | 170 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
171 | IN CHAR16 *String,\r | |
172 | IN UINTN FatSize,\r | |
173 | OUT CHAR8 *Fat\r | |
174 | )\r | |
175 | ;\r | |
176 | \r | |
177 | struct _EFI_UNICODE_COLLATION_PROTOCOL {\r | |
178 | //\r | |
179 | // general\r | |
180 | //\r | |
181 | EFI_UNICODE_COLLATION_STRICOLL StriColl;\r | |
182 | EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch;\r | |
183 | EFI_UNICODE_COLLATION_STRLWR StrLwr;\r | |
184 | EFI_UNICODE_COLLATION_STRUPR StrUpr;\r | |
185 | \r | |
186 | //\r | |
187 | // for supporting fat volumes\r | |
188 | //\r | |
189 | EFI_UNICODE_COLLATION_FATTOSTR FatToStr;\r | |
190 | EFI_UNICODE_COLLATION_STRTOFAT StrToFat;\r | |
191 | \r | |
192 | CHAR8 *SupportedLanguages;\r | |
193 | };\r | |
194 | \r | |
195 | extern EFI_GUID gEfiUnicodeCollationProtocolGuid;\r | |
fd21d1aa | 196 | extern EFI_GUID gEfiUnicodeCollation2ProtocolGuid;\r |
d1f95000 | 197 | \r |
198 | #endif\r |