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