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