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