]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Protocol/UnicodeCollation.h
Update comments for Protocol definitions to match UEFI spec.
[mirror_edk2.git] / MdePkg / Include / Protocol / UnicodeCollation.h
... / ...
CommitLineData
1/** @file\r
2 Unicode Collation protocol that follows the UEFI 2.0 specification.\r
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
5\r
6 Copyright (c) 2006 - 2008, Intel Corporation \r
7 All rights reserved. This program and the accompanying materials \r
8 are licensed and made available under the terms and conditions of the BSD License \r
9 which accompanies this distribution. 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
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
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
30typedef struct _EFI_UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL;\r
31\r
32\r
33///\r
34/// Protocol GUID name defined in EFI1.1.\r
35/// \r
36#define UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL_GUID\r
37\r
38///\r
39/// Protocol defined in EFI1.1.\r
40/// \r
41typedef EFI_UNICODE_COLLATION_PROTOCOL UNICODE_COLLATION_INTERFACE;\r
42\r
43///\r
44/// Protocol data structures and defines\r
45///\r
46#define EFI_UNICODE_BYTE_ORDER_MARK (CHAR16) (0xfeff)\r
47\r
48//\r
49// Protocol member functions\r
50//\r
51/**\r
52 Performs a case-insensitive comparison of two Null-terminated Unicode \r
53 strings.\r
54\r
55 @param This Protocol instance pointer.\r
56 @param Str1 A pointer to a Null-terminated Unicode string.\r
57 @param Str2 A pointer to a Null-terminated Unicode string.\r
58\r
59 @retval 0 Str1 is equivalent to Str2\r
60 @retval >_0 Str1 is lexically greater than Str2\r
61 @retval <_0 Str1 is lexically less than Str2\r
62\r
63**/\r
64typedef\r
65INTN\r
66(EFIAPI *EFI_UNICODE_COLLATION_STRICOLL)(\r
67 IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r
68 IN CHAR16 *Str1,\r
69 IN CHAR16 *Str2\r
70 );\r
71\r
72/**\r
73 Performs a case-insensitive comparison of a Null-terminated Unicode \r
74 pattern string and a Null-terminated Unicode string.\r
75\r
76 @param This Protocol instance pointer.\r
77 @param String A pointer to a Null-terminated Unicode string.\r
78 @param Pattern A pointer to a Null-terminated Unicode pattern string.\r
79\r
80 @retval TRUE Pattern was found in String.\r
81 @retval FALSE Pattern was not found in String.\r
82\r
83**/\r
84typedef\r
85BOOLEAN\r
86(EFIAPI *EFI_UNICODE_COLLATION_METAIMATCH)(\r
87 IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r
88 IN CHAR16 *String,\r
89 IN CHAR16 *Pattern\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**/\r
100typedef\r
101VOID\r
102(EFIAPI *EFI_UNICODE_COLLATION_STRLWR)(\r
103 IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r
104 IN OUT CHAR16 *Str\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**/\r
115typedef\r
116VOID\r
117(EFIAPI *EFI_UNICODE_COLLATION_STRUPR)(\r
118 IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r
119 IN OUT CHAR16 *Str\r
120 );\r
121\r
122/**\r
123 Converts an 8.3 FAT file name in an OEM character set to a Null-terminated \r
124 Unicode string.\r
125\r
126 @param This Protocol instance pointer.\r
127 @param FatSize The size of the string Fat in bytes.\r
128 @param Fat A pointer to a Null-terminated string that contains an 8.3 file\r
129 name using an OEM character set.\r
130 @param String A pointer to a Null-terminated Unicode string. The string must\r
131 be preallocated to hold FatSize Unicode characters.\r
132\r
133**/\r
134typedef\r
135VOID\r
136(EFIAPI *EFI_UNICODE_COLLATION_FATTOSTR)(\r
137 IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r
138 IN UINTN FatSize,\r
139 IN CHAR8 *Fat,\r
140 OUT CHAR16 *String\r
141 );\r
142\r
143/**\r
144 Converts a Null-terminated Unicode string to legal characters in a FAT \r
145 filename using an OEM character set. \r
146\r
147 @param This Protocol instance pointer.\r
148 @param String A pointer to a Null-terminated Unicode string. The string must\r
149 be preallocated to hold FatSize Unicode characters.\r
150 @param FatSize The size of the string Fat in bytes.\r
151 @param Fat A pointer to a Null-terminated string that contains an 8.3 file\r
152 name using an OEM character set.\r
153\r
154 @retval TRUE Fat is a Long File Name\r
155 @retval FALSE Fat is an 8.3 file name\r
156\r
157**/\r
158typedef\r
159BOOLEAN\r
160(EFIAPI *EFI_UNICODE_COLLATION_STRTOFAT)(\r
161 IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r
162 IN CHAR16 *String,\r
163 IN UINTN FatSize,\r
164 OUT CHAR8 *Fat\r
165 );\r
166\r
167///\r
168/// The EFI_UNICODE_COLLATION_PROTOCOL is used to perform case-insensitive \r
169/// comparisons of Unicode strings. \r
170///\r
171struct _EFI_UNICODE_COLLATION_PROTOCOL {\r
172 EFI_UNICODE_COLLATION_STRICOLL StriColl;\r
173 EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch;\r
174 EFI_UNICODE_COLLATION_STRLWR StrLwr;\r
175 EFI_UNICODE_COLLATION_STRUPR StrUpr;\r
176\r
177 //\r
178 // for supporting fat volumes\r
179 //\r
180 EFI_UNICODE_COLLATION_FATTOSTR FatToStr;\r
181 EFI_UNICODE_COLLATION_STRTOFAT StrToFat;\r
182 \r
183 ///\r
184 /// A Null-terminated ASCII string array that contains one or more \r
185 /// language codes. This array is specified in RFC 4646 format.\r
186 ///\r
187 CHAR8 *SupportedLanguages;\r
188};\r
189\r
190extern EFI_GUID gEfiUnicodeCollationProtocolGuid;\r
191extern EFI_GUID gEfiUnicodeCollation2ProtocolGuid;\r
192\r
193#endif\r