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