]>
Commit | Line | Data |
---|---|---|
d1f95000 | 1 | /** @file\r |
8a7d75b0 | 2 | Unicode Collation protocol that follows the UEFI 2.0 specification.\r |
4ca9b6c4 LG |
3 | This protocol is used to allow code running in the boot services environment \r |
4 | to perform lexical comparison functions on Unicode strings for given languages.\r | |
d1f95000 | 5 | \r |
4f077902 | 6 | Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r |
af2dc6a7 | 7 | This program and the accompanying materials are licensed and made available under \r |
8 | the terms and conditions of the BSD License that accompanies this distribution. \r | |
9 | The full text of the license may be found at\r | |
10 | http://opensource.org/licenses/bsd-license.php. \r | |
11 | \r | |
12 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
13 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
d1f95000 | 14 | \r |
d1f95000 | 15 | **/\r |
16 | \r | |
17 | #ifndef __UNICODE_COLLATION_H__\r | |
18 | #define __UNICODE_COLLATION_H__\r | |
19 | \r | |
20 | #define EFI_UNICODE_COLLATION_PROTOCOL_GUID \\r | |
21 | { \\r | |
22 | 0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r | |
23 | }\r | |
24 | \r | |
d24236bf | 25 | #define EFI_UNICODE_COLLATION_PROTOCOL2_GUID \\r |
26 | { \\r | |
27 | 0xa4c751fc, 0x23ae, 0x4c3e, {0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49 } \\r | |
28 | }\r | |
29 | \r | |
a6508c05 | 30 | typedef struct _EFI_UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL;\r |
31 | \r | |
32 | \r | |
99e8ed21 | 33 | ///\r |
34 | /// Protocol GUID name defined in EFI1.1.\r | |
35 | /// \r | |
a6508c05 | 36 | #define UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL_GUID\r |
37 | \r | |
99e8ed21 | 38 | ///\r |
39 | /// Protocol defined in EFI1.1.\r | |
40 | /// \r | |
a6508c05 | 41 | typedef EFI_UNICODE_COLLATION_PROTOCOL UNICODE_COLLATION_INTERFACE;\r |
d1f95000 | 42 | \r |
99e8ed21 | 43 | ///\r |
44 | /// Protocol data structures and defines\r | |
45 | ///\r | |
d1f95000 | 46 | #define EFI_UNICODE_BYTE_ORDER_MARK (CHAR16) (0xfeff)\r |
47 | \r | |
48 | //\r | |
49 | // Protocol member functions\r | |
50 | //\r | |
51 | /**\r | |
fbf926ad | 52 | Performs a case-insensitive comparison of two Null-terminated strings.\r |
d1f95000 | 53 | \r |
fbf926ad | 54 | @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.\r |
55 | @param Str1 A pointer to a Null-terminated string.\r | |
56 | @param Str2 A pointer to a Null-terminated string.\r | |
d1f95000 | 57 | \r |
af2dc6a7 | 58 | @retval 0 Str1 is equivalent to Str2.\r |
59 | @retval >0 Str1 is lexically greater than Str2.\r | |
60 | @retval <0 Str1 is lexically less than Str2.\r | |
d1f95000 | 61 | \r |
62 | **/\r | |
63 | typedef\r | |
64 | INTN\r | |
8b13229b | 65 | (EFIAPI *EFI_UNICODE_COLLATION_STRICOLL)(\r |
d1f95000 | 66 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
67 | IN CHAR16 *Str1,\r | |
68 | IN CHAR16 *Str2\r | |
ed66e1bc | 69 | );\r |
d1f95000 | 70 | \r |
71 | /**\r | |
fbf926ad | 72 | Performs a case-insensitive comparison of a Null-terminated \r |
73 | pattern string and a Null-terminated string.\r | |
d1f95000 | 74 | \r |
fbf926ad | 75 | @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.\r |
76 | @param String A pointer to a Null-terminated string.\r | |
77 | @param Pattern A pointer to a Null-terminated pattern string.\r | |
d1f95000 | 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 | |
ed66e1bc | 89 | );\r |
d1f95000 | 90 | \r |
91 | /**\r | |
fbf926ad | 92 | Converts all the characters in a Null-terminated string to \r |
93 | lower case characters.\r | |
d1f95000 | 94 | \r |
fbf926ad | 95 | @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.\r |
96 | @param String A pointer to a Null-terminated string.\r | |
d1f95000 | 97 | \r |
d1f95000 | 98 | **/\r |
99 | typedef\r | |
100 | VOID\r | |
8b13229b | 101 | (EFIAPI *EFI_UNICODE_COLLATION_STRLWR)(\r |
d1f95000 | 102 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
103 | IN OUT CHAR16 *Str\r | |
ed66e1bc | 104 | );\r |
d1f95000 | 105 | \r |
106 | /**\r | |
fbf926ad | 107 | Converts all the characters in a Null-terminated string to upper\r |
108 | case characters.\r | |
d1f95000 | 109 | \r |
fbf926ad | 110 | @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.\r |
111 | @param String A pointer to a Null-terminated string.\r | |
d1f95000 | 112 | \r |
d1f95000 | 113 | **/\r |
114 | typedef\r | |
115 | VOID\r | |
8b13229b | 116 | (EFIAPI *EFI_UNICODE_COLLATION_STRUPR)(\r |
d1f95000 | 117 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
118 | IN OUT CHAR16 *Str\r | |
ed66e1bc | 119 | );\r |
d1f95000 | 120 | \r |
121 | /**\r | |
122 | Converts an 8.3 FAT file name in an OEM character set to a Null-terminated \r | |
fbf926ad | 123 | string.\r |
d1f95000 | 124 | \r |
fbf926ad | 125 | @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.\r |
d1f95000 | 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 | 128 | name using an 8-bit OEM character set.\r |
fbf926ad | 129 | @param String A pointer to a Null-terminated string. The string must\r |
130 | be allocated in advance to hold FatSize characters.\r | |
d1f95000 | 131 | \r |
d1f95000 | 132 | **/\r |
133 | typedef\r | |
134 | VOID\r | |
8b13229b | 135 | (EFIAPI *EFI_UNICODE_COLLATION_FATTOSTR)(\r |
d1f95000 | 136 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
137 | IN UINTN FatSize,\r | |
138 | IN CHAR8 *Fat,\r | |
139 | OUT CHAR16 *String\r | |
ed66e1bc | 140 | );\r |
d1f95000 | 141 | \r |
142 | /**\r | |
fbf926ad | 143 | Converts a Null-terminated string to legal characters in a FAT \r |
d1f95000 | 144 | filename using an OEM character set. \r |
145 | \r | |
fbf926ad | 146 | @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.\r |
147 | @param String A pointer to a Null-terminated string.\r | |
d1f95000 | 148 | @param FatSize The size of the string Fat in bytes.\r |
fbf926ad | 149 | @param Fat A pointer to a string that contains the converted version of \r |
150 | String using legal FAT characters from an OEM character set.\r | |
d1f95000 | 151 | \r |
fbf926ad | 152 | @retval TRUE One or more conversions failed and were substituted with '_'\r |
153 | @retval FALSE None of the conversions failed.\r | |
d1f95000 | 154 | \r |
155 | **/\r | |
156 | typedef\r | |
157 | BOOLEAN\r | |
8b13229b | 158 | (EFIAPI *EFI_UNICODE_COLLATION_STRTOFAT)(\r |
d1f95000 | 159 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
160 | IN CHAR16 *String,\r | |
161 | IN UINTN FatSize,\r | |
162 | OUT CHAR8 *Fat\r | |
ed66e1bc | 163 | );\r |
d1f95000 | 164 | \r |
44717a39 | 165 | ///\r |
166 | /// The EFI_UNICODE_COLLATION_PROTOCOL is used to perform case-insensitive \r | |
fbf926ad | 167 | /// comparisons of strings. \r |
44717a39 | 168 | ///\r |
d1f95000 | 169 | struct _EFI_UNICODE_COLLATION_PROTOCOL {\r |
d1f95000 | 170 | EFI_UNICODE_COLLATION_STRICOLL StriColl;\r |
171 | EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch;\r | |
172 | EFI_UNICODE_COLLATION_STRLWR StrLwr;\r | |
173 | EFI_UNICODE_COLLATION_STRUPR StrUpr;\r | |
174 | \r | |
175 | //\r | |
176 | // for supporting fat volumes\r | |
177 | //\r | |
178 | EFI_UNICODE_COLLATION_FATTOSTR FatToStr;\r | |
179 | EFI_UNICODE_COLLATION_STRTOFAT StrToFat;\r | |
258cce13 | 180 | \r |
181 | ///\r | |
e69ccf58 LG |
182 | /// A Null-terminated ASCII string array that contains one or more language codes.\r |
183 | /// When this field is used for UnicodeCollation2, it is specified in RFC 4646 format.\r | |
184 | /// When it is used for UnicodeCollation, it is specified in ISO 639-2 format.\r | |
258cce13 | 185 | ///\r |
d1f95000 | 186 | CHAR8 *SupportedLanguages;\r |
187 | };\r | |
188 | \r | |
189 | extern EFI_GUID gEfiUnicodeCollationProtocolGuid;\r | |
fd21d1aa | 190 | extern EFI_GUID gEfiUnicodeCollation2ProtocolGuid;\r |
d1f95000 | 191 | \r |
192 | #endif\r |