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