2 Head file for Unicode Collation Protocol (English)
4 Copyright (c) 2006 - 2018, 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
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 strings.
55 @param This Protocol instance pointer.
56 @param Str1 A pointer to a Null-terminated string.
57 @param Str2 A pointer to a Null-terminated string.
59 @retval 0 Str1 is equivalent to Str2
60 @retval > 0 Str1 is lexically greater than Str2
61 @retval < 0 Str1 is lexically less than Str2
67 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
73 Performs a case-insensitive comparison of a Null-terminated
74 pattern string and a Null-terminated string.
76 @param This Protocol instance pointer.
77 @param String A pointer to a Null-terminated string.
78 @param Pattern A pointer to a Null-terminated pattern string.
80 @retval TRUE Pattern was found in String.
81 @retval FALSE Pattern was not found in String.
87 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
93 Converts all the characters in a Null-terminated string to
94 lower case characters.
96 @param This Protocol instance pointer.
97 @param Str A pointer to a Null-terminated string.
103 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
108 Converts all the characters in a Null-terminated string to upper
111 @param This Protocol instance pointer.
112 @param Str A pointer to a Null-terminated string.
118 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
123 Converts an 8.3 FAT file name in an OEM character set to a Null-terminated string.
125 @param This Protocol instance pointer.
126 @param FatSize The size of the string Fat in bytes.
127 @param Fat A pointer to a Null-terminated string that contains an 8.3 file
128 name using an 8-bit OEM character set.
129 @param String A pointer to a Null-terminated string. The string must
130 be preallocated to hold FatSize characters.
136 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
143 Converts a Null-terminated string to legal characters in a FAT
144 filename using an OEM character set.
146 @param This Protocol instance pointer.
147 @param String A pointer to a Null-terminated string. The string must
148 be preallocated to hold FatSize characters.
149 @param FatSize The size of the string Fat in bytes.
150 @param Fat A pointer to a Null-terminated string that contains an 8.3 file
151 name using an OEM character set.
153 @retval TRUE Fat is a Long File Name
154 @retval FALSE Fat is an 8.3 file name
160 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
167 The user Entry Point for English module.
169 This function initializes unicode character mapping and then installs Unicode
170 Collation & Unicode Collation 2 Protocols based on the feature flags.
172 @param ImageHandle The firmware allocated handle for the EFI image.
173 @param SystemTable A pointer to the EFI System Table.
175 @retval EFI_SUCCESS The entry point is executed successfully.
176 @retval other Some error occurs when executing this entry point.
181 InitializeUnicodeCollationEng (
182 IN EFI_HANDLE ImageHandle
,
183 IN EFI_SYSTEM_TABLE
*SystemTable