]>
Commit | Line | Data |
---|---|---|
03284334 | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2008, Intel Corporation\r | |
4 | All rights reserved. This program and the accompanying materials\r | |
5 | are licensed and made available under the terms and conditions of the BSD License\r | |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | UnicodeCollation2.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Unicode Collation2 protocol that follows the UEFI 2.0 specification.\r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
22 | #ifndef _UNICODE_COLLATION2_H_\r | |
23 | #define _UNICODE_COLLATION2_H_\r | |
24 | \r | |
25 | #define EFI_UNICODE_COLLATION2_PROTOCOL_GUID \\r | |
26 | { \\r | |
27 | 0xa4c751fc, 0x23ae, 0x4c3e, {0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49} \\r | |
28 | }\r | |
29 | \r | |
30 | EFI_FORWARD_DECLARATION (EFI_UNICODE_COLLATION2_PROTOCOL);\r | |
31 | \r | |
32 | //\r | |
33 | // Protocol data structures and defines\r | |
34 | //\r | |
35 | #define EFI_UNICODE_BYTE_ORDER_MARK ((CHAR16)(0xfeff))\r | |
36 | #define EFI_UNICODE_BYTE_ORDER_MARK_REVERSE ((CHAR16)(0xfffe))\r | |
37 | \r | |
38 | //\r | |
39 | // Protocol member functions\r | |
40 | //\r | |
41 | typedef\r | |
42 | INTN\r | |
43 | (EFIAPI *EFI_UNICODE_COLLATION2_STRICOLL) (\r | |
44 | IN EFI_UNICODE_COLLATION2_PROTOCOL * This,\r | |
45 | IN CHAR16 *Str1,\r | |
46 | IN CHAR16 *Str2\r | |
47 | )\r | |
48 | /*++\r | |
49 | \r | |
50 | Routine Description:\r | |
51 | Performs a case-insensitive comparison of two Null-terminated Unicode\r | |
52 | strings.\r | |
53 | \r | |
54 | Arguments:\r | |
55 | This - Protocol instance pointer.\r | |
56 | Str1 - A pointer to a Null-terminated Unicode string.\r | |
57 | Str2 - A pointer to a Null-terminated Unicode string.\r | |
58 | \r | |
59 | Returns:\r | |
60 | 0 - Str1 is equivalent to Str2\r | |
61 | > 0 - Str1 is lexically greater than Str2\r | |
62 | < 0 - Str1 is lexically less than Str2\r | |
63 | \r | |
64 | --*/\r | |
65 | ;\r | |
66 | \r | |
67 | typedef\r | |
68 | BOOLEAN\r | |
69 | (EFIAPI *EFI_UNICODE_COLLATION2_METAIMATCH) (\r | |
70 | IN EFI_UNICODE_COLLATION2_PROTOCOL * This,\r | |
71 | IN CHAR16 *String,\r | |
72 | IN CHAR16 *Pattern\r | |
73 | )\r | |
74 | /*++\r | |
75 | \r | |
76 | Routine Description:\r | |
77 | Performs a case-insensitive comparison of a Null-terminated Unicode\r | |
78 | pattern string and a Null-terminated Unicode string.\r | |
79 | \r | |
80 | Arguments:\r | |
81 | This - Protocol instance pointer.\r | |
82 | String - A pointer to a Null-terminated Unicode string.\r | |
83 | Pattern - A pointer to a Null-terminated Unicode pattern string.\r | |
84 | \r | |
85 | Returns:\r | |
86 | TRUE - Pattern was found in String.\r | |
87 | FALSE - Pattern was not found in String.\r | |
88 | \r | |
89 | --*/\r | |
90 | ;\r | |
91 | \r | |
92 | typedef\r | |
93 | VOID\r | |
94 | (EFIAPI *EFI_UNICODE_COLLATION2_STRLWR) (\r | |
95 | IN EFI_UNICODE_COLLATION2_PROTOCOL * This,\r | |
96 | IN OUT CHAR16 *Str\r | |
97 | )\r | |
98 | /*++\r | |
99 | \r | |
100 | Routine Description:\r | |
101 | Converts all the Unicode characters in a Null-terminated Unicode string to\r | |
102 | lower case Unicode characters.\r | |
103 | \r | |
104 | Arguments:\r | |
105 | This - Protocol instance pointer.\r | |
106 | String - A pointer to a Null-terminated Unicode string.\r | |
107 | \r | |
108 | Returns:\r | |
109 | NONE\r | |
110 | \r | |
111 | --*/\r | |
112 | ;\r | |
113 | \r | |
114 | typedef\r | |
115 | VOID\r | |
116 | (EFIAPI *EFI_UNICODE_COLLATION2_STRUPR) (\r | |
117 | IN EFI_UNICODE_COLLATION2_PROTOCOL * This,\r | |
118 | IN OUT CHAR16 *Str\r | |
119 | )\r | |
120 | /*++\r | |
121 | \r | |
122 | Routine Description:\r | |
123 | Converts all the Unicode characters in a Null-terminated Unicode string to upper\r | |
124 | case Unicode characters.\r | |
125 | \r | |
126 | Arguments:\r | |
127 | This - Protocol instance pointer.\r | |
128 | String - A pointer to a Null-terminated Unicode string.\r | |
129 | \r | |
130 | Returns:\r | |
131 | NONE\r | |
132 | \r | |
133 | --*/\r | |
134 | ;\r | |
135 | \r | |
136 | typedef\r | |
137 | VOID\r | |
138 | (EFIAPI *EFI_UNICODE_COLLATION2_FATTOSTR) (\r | |
139 | IN EFI_UNICODE_COLLATION2_PROTOCOL * This,\r | |
140 | IN UINTN FatSize,\r | |
141 | IN CHAR8 *Fat,\r | |
142 | OUT CHAR16 *String\r | |
143 | )\r | |
144 | /*++\r | |
145 | \r | |
146 | Routine Description:\r | |
147 | Converts an 8.3 FAT file name in an OEM character set to a Null-terminated\r | |
148 | Unicode string.\r | |
149 | \r | |
150 | Arguments:\r | |
151 | This - Protocol instance pointer.\r | |
152 | FatSize - The size of the string Fat in bytes.\r | |
153 | Fat - A pointer to a Null-terminated string that contains an 8.3 file\r | |
154 | name using an OEM character set.\r | |
155 | String - A pointer to a Null-terminated Unicode string. The string must\r | |
156 | be preallocated to hold FatSize Unicode characters.\r | |
157 | Returns:\r | |
158 | NONE\r | |
159 | \r | |
160 | --*/\r | |
161 | ;\r | |
162 | \r | |
163 | typedef\r | |
164 | BOOLEAN\r | |
165 | (EFIAPI *EFI_UNICODE_COLLATION2_STRTOFAT) (\r | |
166 | IN EFI_UNICODE_COLLATION2_PROTOCOL * This,\r | |
167 | IN CHAR16 *String,\r | |
168 | IN UINTN FatSize,\r | |
169 | OUT CHAR8 *Fat\r | |
170 | )\r | |
171 | /*++\r | |
172 | \r | |
173 | Routine Description:\r | |
174 | Converts a Null-terminated Unicode string to legal characters in a FAT\r | |
175 | filename using an OEM character set.\r | |
176 | \r | |
177 | Arguments:\r | |
178 | This - Protocol instance pointer.\r | |
179 | String - A pointer to a Null-terminated Unicode string. The string must\r | |
180 | be preallocated to hold FatSize Unicode characters.\r | |
181 | FatSize - The size of the string Fat in bytes.\r | |
182 | Fat - A pointer to a Null-terminated string that contains an 8.3 file\r | |
183 | name using an OEM character set.\r | |
184 | Returns:\r | |
185 | TRUE - Fat is a Long File Name\r | |
186 | FALSE - Fat is an 8.3 file name\r | |
187 | \r | |
188 | --*/\r | |
189 | ;\r | |
190 | \r | |
191 | typedef struct _EFI_UNICODE_COLLATION2_PROTOCOL {\r | |
192 | //\r | |
193 | // general\r | |
194 | //\r | |
195 | EFI_UNICODE_COLLATION2_STRICOLL StriColl;\r | |
196 | EFI_UNICODE_COLLATION2_METAIMATCH MetaiMatch;\r | |
197 | EFI_UNICODE_COLLATION2_STRLWR StrLwr;\r | |
198 | EFI_UNICODE_COLLATION2_STRUPR StrUpr;\r | |
199 | \r | |
200 | //\r | |
201 | // for supporting fat volumes\r | |
202 | //\r | |
203 | EFI_UNICODE_COLLATION2_FATTOSTR FatToStr;\r | |
204 | EFI_UNICODE_COLLATION2_STRTOFAT StrToFat;\r | |
205 | \r | |
206 | CHAR8 *SupportedLanguages;\r | |
207 | } EFI_UNICODE_COLLATION2_PROTOCOL;\r | |
208 | \r | |
209 | extern EFI_GUID gEfiUnicodeCollation2ProtocolGuid;\r | |
210 | \r | |
211 | #endif\r |