]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h
Update the copyright notice format
[mirror_edk2.git] / MdeModulePkg / Universal / Disk / UnicodeCollation / EnglishDxe / UnicodeCollationEng.h
1 /** @file
2 Head file for Unicode Collation Protocol (English)
3
4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
5 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_ENG_H_
16 #define _UNICODE_COLLATION_ENG_H_
17
18
19
20 #include <Uefi.h>
21
22 #include <Protocol/UnicodeCollation.h>
23
24 #include <Library/DebugLib.h>
25 #include <Library/UefiDriverEntryPoint.h>
26 #include <Library/UefiBootServicesTableLib.h>
27 #include <Library/PcdLib.h>
28
29 //
30 // Bit mask to indicate the validity of character in FAT file name.
31 //
32 #define CHAR_FAT_VALID 0x01
33
34 //
35 // Maximum FAT table size.
36 //
37 #define MAP_TABLE_SIZE 0x100
38
39 //
40 // Macro to map character a to upper case.
41 //
42 #define TO_UPPER(a) (CHAR16) ((a) <= 0xFF ? mEngUpperMap[a] : (a))
43
44 //
45 // Macro to map character a to lower case.
46 //
47 #define TO_LOWER(a) (CHAR16) ((a) <= 0xFF ? mEngLowerMap[a] : (a))
48
49 //
50 // Prototypes
51 //
52 /**
53 Performs a case-insensitive comparison of two Null-terminated Unicode
54 strings.
55
56 @param This Protocol instance pointer.
57 @param Str1 A pointer to a Null-terminated Unicode string.
58 @param Str2 A pointer to a Null-terminated Unicode string.
59
60 @retval 0 Str1 is equivalent to Str2
61 @retval > 0 Str1 is lexically greater than Str2
62 @retval < 0 Str1 is lexically less than Str2
63
64 **/
65 INTN
66 EFIAPI
67 EngStriColl (
68 IN EFI_UNICODE_COLLATION_PROTOCOL *This,
69 IN CHAR16 *Str1,
70 IN CHAR16 *Str2
71 );
72
73 /**
74 Performs a case-insensitive comparison of a Null-terminated Unicode
75 pattern string and a Null-terminated Unicode string.
76
77 @param This Protocol instance pointer.
78 @param String A pointer to a Null-terminated Unicode string.
79 @param Pattern A pointer to a Null-terminated Unicode pattern string.
80
81 @retval TRUE Pattern was found in String.
82 @retval FALSE Pattern was not found in String.
83
84 **/
85 BOOLEAN
86 EFIAPI
87 EngMetaiMatch (
88 IN EFI_UNICODE_COLLATION_PROTOCOL *This,
89 IN CHAR16 *String,
90 IN CHAR16 *Pattern
91 );
92
93 /**
94 Converts all the Unicode characters in a Null-terminated Unicode string to
95 lower case Unicode characters.
96
97 @param This Protocol instance pointer.
98 @param Str A pointer to a Null-terminated Unicode string.
99
100 **/
101 VOID
102 EFIAPI
103 EngStrLwr (
104 IN EFI_UNICODE_COLLATION_PROTOCOL *This,
105 IN OUT CHAR16 *Str
106 );
107
108 /**
109 Converts all the Unicode characters in a Null-terminated Unicode string to upper
110 case Unicode characters.
111
112 @param This Protocol instance pointer.
113 @param Str A pointer to a Null-terminated Unicode string.
114
115 **/
116 VOID
117 EFIAPI
118 EngStrUpr (
119 IN EFI_UNICODE_COLLATION_PROTOCOL *This,
120 IN OUT CHAR16 *Str
121 );
122
123 /**
124 Converts an 8.3 FAT file name in an OEM character set to a Null-terminated
125 Unicode string.
126
127 @param This Protocol instance pointer.
128 @param FatSize The size of the string Fat in bytes.
129 @param Fat A pointer to a Null-terminated string that contains an 8.3 file
130 name using an OEM character set.
131 @param String A pointer to a Null-terminated Unicode string. The string must
132 be preallocated to hold FatSize Unicode characters.
133
134 **/
135 VOID
136 EFIAPI
137 EngFatToStr (
138 IN EFI_UNICODE_COLLATION_PROTOCOL *This,
139 IN UINTN FatSize,
140 IN CHAR8 *Fat,
141 OUT CHAR16 *String
142 );
143
144 /**
145 Converts a Null-terminated Unicode string to legal characters in a FAT
146 filename using an OEM character set.
147
148 @param This Protocol instance pointer.
149 @param String A pointer to a Null-terminated Unicode string. The string must
150 be preallocated to hold FatSize Unicode characters.
151 @param FatSize The size of the string Fat in bytes.
152 @param Fat A pointer to a Null-terminated string that contains an 8.3 file
153 name using an OEM character set.
154
155 @retval TRUE Fat is a Long File Name
156 @retval FALSE Fat is an 8.3 file name
157
158 **/
159 BOOLEAN
160 EFIAPI
161 EngStrToFat (
162 IN EFI_UNICODE_COLLATION_PROTOCOL *This,
163 IN CHAR16 *String,
164 IN UINTN FatSize,
165 OUT CHAR8 *Fat
166 );
167
168 /**
169 The user Entry Point for English module.
170
171 This function initializes unicode character mapping and then installs Unicode
172 Collation & Unicode Collation 2 Protocols based on the feature flags.
173
174 @param ImageHandle The firmware allocated handle for the EFI image.
175 @param SystemTable A pointer to the EFI System Table.
176
177 @retval EFI_SUCCESS The entry point is executed successfully.
178 @retval other Some error occurs when executing this entry point.
179
180 **/
181 EFI_STATUS
182 EFIAPI
183 InitializeUnicodeCollationEng (
184 IN EFI_HANDLE ImageHandle,
185 IN EFI_SYSTEM_TABLE *SystemTable
186 );
187
188 #endif
189