2 Head file for Unicode Collation Protocol (English)
4 Copyright (c) 2006 - 2008, Intel Corporation. <BR>
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
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.
15 #ifndef _UNICODE_COLLATION_ENG_H_
16 #define _UNICODE_COLLATION_ENG_H_
22 #include <Protocol/UnicodeCollation.h>
24 #include <Library/DebugLib.h>
25 #include <Library/UefiDriverEntryPoint.h>
26 #include <Library/UefiBootServicesTableLib.h>
27 #include <Library/PcdLib.h>
30 // Bit mask to indicate the validity of character in FAT file name.
32 #define CHAR_FAT_VALID 0x01
35 // Maximum FAT table size.
37 #define MAP_TABLE_SIZE 0x100
40 // Macro to map character a to upper case.
42 #define TO_UPPER(a) (CHAR16) ((a) <= 0xFF ? mEngUpperMap[a] : (a))
45 // Macro to map character a to lower case.
47 #define TO_LOWER(a) (CHAR16) ((a) <= 0xFF ? mEngLowerMap[a] : (a))
53 Performs a case-insensitive comparison of two Null-terminated Unicode
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.
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
68 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
74 Performs a case-insensitive comparison of a Null-terminated Unicode
75 pattern string and a Null-terminated Unicode string.
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.
81 @retval TRUE Pattern was found in String.
82 @retval FALSE Pattern was not found in String.
88 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
94 Converts all the Unicode characters in a Null-terminated Unicode string to
95 lower case Unicode characters.
97 @param This Protocol instance pointer.
98 @param Str A pointer to a Null-terminated Unicode string.
104 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
109 Converts all the Unicode characters in a Null-terminated Unicode string to upper
110 case Unicode characters.
112 @param This Protocol instance pointer.
113 @param Str A pointer to a Null-terminated Unicode string.
119 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
124 Converts an 8.3 FAT file name in an OEM character set to a Null-terminated
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.
138 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
145 Converts a Null-terminated Unicode string to legal characters in a FAT
146 filename using an OEM character set.
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.
155 @retval TRUE Fat is a Long File Name
156 @retval FALSE Fat is an 8.3 file name
162 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
169 The user Entry Point for English module.
171 This function initializes unicode character mapping and then installs Unicode
172 Collation & Unicode Collation 2 Protocols based on the feature flags.
174 @param ImageHandle The firmware allocated handle for the EFI image.
175 @param SystemTable A pointer to the EFI System Table.
177 @retval EFI_SUCCESS The entry point is executed successfully.
178 @retval other Some error occurs when executing this entry point.
183 InitializeUnicodeCollationEng (
184 IN EFI_HANDLE ImageHandle
,
185 IN EFI_SYSTEM_TABLE
*SystemTable