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