2 Head file for Unicode Collation Protocol (English)
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _UNICODE_COLLATION_ENG_H_
10 #define _UNICODE_COLLATION_ENG_H_
14 #include <Protocol/UnicodeCollation.h>
16 #include <Library/DebugLib.h>
17 #include <Library/UefiDriverEntryPoint.h>
18 #include <Library/UefiBootServicesTableLib.h>
19 #include <Library/PcdLib.h>
22 // Bit mask to indicate the validity of character in FAT file name.
24 #define CHAR_FAT_VALID 0x01
27 // Maximum FAT table size.
29 #define MAP_TABLE_SIZE 0x100
32 // Macro to map character a to upper case.
34 #define TO_UPPER(a) (CHAR16) ((a) <= 0xFF ? mEngUpperMap[a] : (a))
37 // Macro to map character a to lower case.
39 #define TO_LOWER(a) (CHAR16) ((a) <= 0xFF ? mEngLowerMap[a] : (a))
46 Performs a case-insensitive comparison of two Null-terminated strings.
48 @param This Protocol instance pointer.
49 @param Str1 A pointer to a Null-terminated string.
50 @param Str2 A pointer to a Null-terminated string.
52 @retval 0 Str1 is equivalent to Str2
53 @retval > 0 Str1 is lexically greater than Str2
54 @retval < 0 Str1 is lexically less than Str2
60 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
66 Performs a case-insensitive comparison of a Null-terminated
67 pattern string and a Null-terminated string.
69 @param This Protocol instance pointer.
70 @param String A pointer to a Null-terminated string.
71 @param Pattern A pointer to a Null-terminated pattern string.
73 @retval TRUE Pattern was found in String.
74 @retval FALSE Pattern was not found in String.
80 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
86 Converts all the characters in a Null-terminated string to
87 lower case characters.
89 @param This Protocol instance pointer.
90 @param Str A pointer to a Null-terminated string.
96 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
101 Converts all the characters in a Null-terminated string to upper
104 @param This Protocol instance pointer.
105 @param Str A pointer to a Null-terminated string.
111 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
116 Converts an 8.3 FAT file name in an OEM character set to a Null-terminated string.
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 8-bit OEM character set.
122 @param String A pointer to a Null-terminated string. The string must
123 be preallocated to hold FatSize characters.
129 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
136 Converts a Null-terminated string to legal characters in a FAT
137 filename using an OEM character set.
139 @param This Protocol instance pointer.
140 @param String A pointer to a Null-terminated string. The string must
141 be preallocated to hold FatSize characters.
142 @param FatSize The size of the string Fat in bytes.
143 @param Fat A pointer to a Null-terminated string that contains an 8.3 file
144 name using an OEM character set.
146 @retval TRUE Fat is a Long File Name
147 @retval FALSE Fat is an 8.3 file name
153 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
160 The user Entry Point for English module.
162 This function initializes unicode character mapping and then installs Unicode
163 Collation & Unicode Collation 2 Protocols based on the feature flags.
165 @param ImageHandle The firmware allocated handle for the EFI image.
166 @param SystemTable A pointer to the EFI System Table.
168 @retval EFI_SUCCESS The entry point is executed successfully.
169 @retval other Some error occurs when executing this entry point.
174 InitializeUnicodeCollationEng (
175 IN EFI_HANDLE ImageHandle
,
176 IN EFI_SYSTEM_TABLE
*SystemTable