]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h
MdeModulePkg: Removing ipf which is no longer supported from edk2.
[mirror_edk2.git] / MdeModulePkg / Universal / Disk / UnicodeCollation / EnglishDxe / UnicodeCollationEng.h
index 668652871aafb382fb7e5da4399d3cf576e96e7b..ddce2f69d375a68466e6353f4790187c7dc1d23e 100644 (file)
@@ -1,7 +1,8 @@
-/*++\r
+/** @file\r
+  Head file for Unicode Collation Protocol (English)\r
 \r
-Copyright (c) 2006, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -9,26 +10,15 @@ http://opensource.org/licenses/bsd-license.php
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
-Module Name:\r
-\r
-  UnicodeCollationEng.h\r
-\r
-Abstract:\r
-\r
-  Head file for Unicode Collation Protocol (English)\r
+**/\r
 \r
-Revision History\r
-\r
---*/\r
-\r
-#ifndef _UNICODE_COLLATION_ENG_H\r
-#define _UNICODE_COLLATION_ENG_H\r
+#ifndef _UNICODE_COLLATION_ENG_H_\r
+#define _UNICODE_COLLATION_ENG_H_\r
 \r
 \r
 \r
 #include <Uefi.h>\r
 \r
-\r
 #include <Protocol/UnicodeCollation.h>\r
 \r
 #include <Library/DebugLib.h>\r
@@ -37,76 +27,161 @@ Revision History
 #include <Library/PcdLib.h>\r
 \r
 //\r
-// Defines\r
+// Bit mask to indicate the validity of character in FAT file name.\r
 //\r
 #define CHAR_FAT_VALID  0x01\r
 \r
-#define ToUpper(a)      (CHAR16) (a <= 0xFF ? mEngUpperMap[a] : a)\r
-#define ToLower(a)      (CHAR16) (a <= 0xFF ? mEngLowerMap[a] : a)\r
+//\r
+// Maximum FAT table size.\r
+//\r
+#define MAP_TABLE_SIZE  0x100\r
+\r
+//\r
+// Macro to map character a to upper case.\r
+//\r
+#define TO_UPPER(a)      (CHAR16) ((a) <= 0xFF ? mEngUpperMap[a] : (a))\r
+\r
+//\r
+// Macro to map character a to lower case.\r
+//\r
+#define TO_LOWER(a)      (CHAR16) ((a) <= 0xFF ? mEngLowerMap[a] : (a))\r
 \r
 //\r
 // Prototypes\r
 //\r
+/**\r
+  Performs a case-insensitive comparison of two Null-terminated strings.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Str1 A pointer to a Null-terminated string.\r
+  @param  Str2 A pointer to a Null-terminated string.\r
+\r
+  @retval 0   Str1 is equivalent to Str2\r
+  @retval > 0 Str1 is lexically greater than Str2\r
+  @retval < 0 Str1 is lexically less than Str2\r
+\r
+**/\r
 INTN\r
 EFIAPI\r
 EngStriColl (\r
-  IN EFI_UNICODE_COLLATION_PROTOCOL           *This,\r
-  IN CHAR16                                   *s1,\r
-  IN CHAR16                                   *s2\r
-  )\r
-;\r
+  IN EFI_UNICODE_COLLATION_PROTOCOL   *This,\r
+  IN CHAR16                           *Str1,\r
+  IN CHAR16                           *Str2\r
+  );\r
+\r
+/**\r
+  Performs a case-insensitive comparison of a Null-terminated\r
+  pattern string and a Null-terminated string.\r
+\r
+  @param  This    Protocol instance pointer.\r
+  @param  String  A pointer to a Null-terminated string.\r
+  @param  Pattern A pointer to a Null-terminated pattern string.\r
+\r
+  @retval TRUE    Pattern was found in String.\r
+  @retval FALSE   Pattern was not found in String.\r
 \r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 EngMetaiMatch (\r
-  IN EFI_UNICODE_COLLATION_PROTOCOL          *This,\r
-  IN CHAR16                                  *String,\r
-  IN CHAR16                                  *Pattern\r
-  )\r
-;\r
+  IN EFI_UNICODE_COLLATION_PROTOCOL   *This,\r
+  IN CHAR16                           *String,\r
+  IN CHAR16                           *Pattern\r
+  );\r
 \r
+/**\r
+  Converts all the characters in a Null-terminated string to\r
+  lower case characters.\r
+\r
+  @param  This   Protocol instance pointer.\r
+  @param  Str    A pointer to a Null-terminated string.\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 EngStrLwr (\r
-  IN EFI_UNICODE_COLLATION_PROTOCOL          *This,\r
-  IN OUT CHAR16                              *Str\r
-  )\r
-;\r
+  IN EFI_UNICODE_COLLATION_PROTOCOL   *This,\r
+  IN OUT CHAR16                       *Str\r
+  );\r
+\r
+/**\r
+  Converts all the characters in a Null-terminated string to upper\r
+  case characters.\r
+\r
+  @param  This   Protocol instance pointer.\r
+  @param  Str    A pointer to a Null-terminated string.\r
 \r
+**/\r
 VOID\r
 EFIAPI\r
 EngStrUpr (\r
-  IN EFI_UNICODE_COLLATION_PROTOCOL          *This,\r
-  IN OUT CHAR16                              *Str\r
-  )\r
-;\r
+  IN EFI_UNICODE_COLLATION_PROTOCOL   *This,\r
+  IN OUT CHAR16                       *Str\r
+  );\r
 \r
+/**\r
+  Converts an 8.3 FAT file name in an OEM character set to a Null-terminated string.\r
+\r
+  @param  This    Protocol instance pointer.\r
+  @param  FatSize The size of the string Fat in bytes.\r
+  @param  Fat     A pointer to a Null-terminated string that contains an 8.3 file\r
+                  name using an 8-bit OEM character set.\r
+  @param  String  A pointer to a Null-terminated string. The string must\r
+                  be preallocated to hold FatSize characters.\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 EngFatToStr (\r
-  IN EFI_UNICODE_COLLATION_PROTOCOL          *This,\r
-  IN UINTN                                   FatSize,\r
-  IN CHAR8                                   *Fat,\r
-  OUT CHAR16                                 *String\r
-  )\r
-;\r
-\r
+  IN EFI_UNICODE_COLLATION_PROTOCOL   *This,\r
+  IN UINTN                            FatSize,\r
+  IN CHAR8                            *Fat,\r
+  OUT CHAR16                          *String\r
+  );\r
+\r
+/**\r
+  Converts a Null-terminated string to legal characters in a FAT\r
+  filename using an OEM character set.\r
+\r
+  @param  This    Protocol instance pointer.\r
+  @param  String  A pointer to a Null-terminated string. The string must\r
+                  be preallocated to hold FatSize characters.\r
+  @param  FatSize The size of the string Fat in bytes.\r
+  @param  Fat     A pointer to a Null-terminated string that contains an 8.3 file\r
+                  name using an OEM character set.\r
+\r
+  @retval TRUE    Fat is a Long File Name\r
+  @retval FALSE   Fat is an 8.3 file name\r
+\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 EngStrToFat (\r
-  IN EFI_UNICODE_COLLATION_PROTOCOL          *This,\r
-  IN CHAR16                                  *String,\r
-  IN UINTN                                   FatSize,\r
-  OUT CHAR8                                  *Fat\r
-  )\r
-;\r
+  IN EFI_UNICODE_COLLATION_PROTOCOL   *This,\r
+  IN CHAR16                           *String,\r
+  IN UINTN                            FatSize,\r
+  OUT CHAR8                           *Fat\r
+  );\r
+\r
+/**\r
+  The user Entry Point for English module.\r
 \r
+  This function initializes unicode character mapping and then installs Unicode\r
+  Collation & Unicode Collation 2 Protocols based on the feature flags.\r
+\r
+  @param  ImageHandle    The firmware allocated handle for the EFI image.\r
+  @param  SystemTable    A pointer to the EFI System Table.\r
+\r
+  @retval EFI_SUCCESS    The entry point is executed successfully.\r
+  @retval other          Some error occurs when executing this entry point.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 InitializeUnicodeCollationEng (\r
   IN EFI_HANDLE       ImageHandle,\r
   IN EFI_SYSTEM_TABLE *SystemTable\r
-  )\r
-;\r
+  );\r
 \r
 #endif\r
+\r