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