]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Include/Library/HandleParsingLib.h
MdeModulePkg/Variable: Initialize local variable "RtPtrTrack"
[mirror_edk2.git] / ShellPkg / Include / Library / HandleParsingLib.h
index 8c0b81d12c34a9c46bb9ed486565044f2ae8b40d..ea16b855b60074c028f6c459044e5e99ab415b4c 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
   Provides interface to advanced shell functionality for parsing both handle and protocol database.\r
 \r
-  Copyright (c) 2010, 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
-\r
-  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
+  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
 \r
 #include <Uefi.h>\r
 \r
+/**\r
+  Function to add a new GUID/Name mapping.\r
+\r
+  This cannot overwrite an existing mapping.\r
+\r
+  @param[in] Guid       The Guid\r
+  @param[in] TheName    The Guid's name\r
+  @param[in] Lang       RFC4646 language code list or NULL\r
+\r
+  @retval EFI_SUCCESS           The operation was sucessful\r
+  @retval EFI_ACCESS_DENIED     There was a duplicate\r
+  @retval EFI_OUT_OF_RESOURCES  A memory allocation failed\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+AddNewGuidNameMapping(\r
+  IN CONST EFI_GUID *Guid,\r
+  IN CONST CHAR16   *TheName,\r
+  IN CONST CHAR8    *Lang OPTIONAL\r
+  );\r
+\r
 /**\r
   Function to get the name of a protocol or struct from it's GUID.\r
 \r
@@ -38,9 +53,11 @@ GetStringNameFromGuid(
 /**\r
   Function to get the Guid for a protocol or struct based on it's string name.\r
 \r
+  Do not free or modify the returned GUID.\r
+\r
   @param[in] Name           The pointer to the string name.\r
   @param[in] Lang           The pointer to the language code (string).\r
-  @param[in] Guid           The pointer to the pointer to the Guid.\r
+  @param[out] Guid          The pointer to the pointer to the Guid.\r
 \r
   @retval EFI_SUCCESS       The operation was successful.\r
 **/\r
@@ -49,7 +66,7 @@ EFIAPI
 GetGuidFromStringName(\r
   IN CONST CHAR16 *Name,\r
   IN CONST CHAR8  *Lang OPTIONAL,\r
-  IN EFI_GUID     **Guid\r
+  OUT EFI_GUID    **Guid\r
   );\r
 \r
 /**\r
@@ -95,6 +112,27 @@ GetStringNameFromHandle(
   IN CONST CHAR8      *Language\r
   );\r
 \r
+/**\r
+  Get best support language for this driver.\r
+\r
+  First base on the user input language  to search, second base on the current\r
+  platform used language to search, third get the first language from the\r
+  support language list. The caller need to free the buffer of the best language.\r
+\r
+  @param[in] SupportedLanguages      The support languages for this driver.\r
+  @param[in] InputLanguage           The user input language.\r
+  @param[in] Iso639Language          Whether get language for ISO639.\r
+\r
+  @return                            The best support language for this driver.\r
+**/\r
+CHAR8 *\r
+EFIAPI\r
+GetBestLanguageForDriver (\r
+  IN CONST CHAR8  *SupportedLanguages,\r
+  IN CONST CHAR8  *InputLanguage,\r
+  IN BOOLEAN      Iso639Language\r
+  );\r
+\r
 #define HR_UNKNOWN                     0\r
 #define HR_IMAGE_HANDLE                BIT1\r
 #define HR_DRIVER_BINDING_HANDLE       BIT2 // has driver binding\r
@@ -262,7 +300,7 @@ ParseHandleDatabaseForChildDevices(
   Gets handles for any child controllers of the passed in controller.\r
 \r
   @param[in] ControllerHandle       The handle of the "parent controller".\r
-  @param[in] MatchingHandleCount    The pointer to the number of handles in\r
+  @param[out] MatchingHandleCount   The pointer to the number of handles in\r
                                     MatchingHandleBuffer on return.\r
   @param[out] MatchingHandleBuffer  The buffer containing handles on a successful\r
                                     return.\r
@@ -273,7 +311,7 @@ EFI_STATUS
 EFIAPI\r
 ParseHandleDatabaseForChildControllers(\r
   IN CONST EFI_HANDLE       ControllerHandle,\r
-  IN UINTN                  *MatchingHandleCount,\r
+  OUT UINTN                 *MatchingHandleCount,\r
   OUT EFI_HANDLE            **MatchingHandleBuffer OPTIONAL\r
   );\r
 \r
@@ -313,6 +351,8 @@ ConvertHandleIndexToHandle(
 /**\r
   Function to get all handles that support a given protocol or all handles.\r
 \r
+  The caller is responsible to free this memory.\r
+\r
   @param[in] ProtocolGuid The guid of the protocol to get handles for.  If NULL\r
                           then the function will return all handles.\r
 \r
@@ -328,6 +368,8 @@ GetHandleListByProtocol (
 /**\r
   Function to get all handles that support some protocols.\r
 \r
+  The caller is responsible to free this memory.\r
+\r
   @param[in] ProtocolGuids  A NULL terminated list of protocol GUIDs.\r
 \r
   @retval NULL              A memory allocation failed.\r
@@ -340,4 +382,23 @@ GetHandleListByProtocolList (
   IN CONST EFI_GUID **ProtocolGuids\r
   );\r
 \r
+\r
+/**\r
+  Return all supported GUIDs.\r
+\r
+  @param[out]      Guids  The buffer to return all supported GUIDs.\r
+  @param[in, out]  Count  On input, the count of GUIDs the buffer can hold,\r
+                         On output, the count of GUIDs to return.\r
+\r
+  @retval EFI_INVALID_PARAMETER Count is NULL.\r
+  @retval EFI_BUFFER_TOO_SMALL  Buffer is not enough to hold all GUIDs.\r
+  @retval EFI_SUCCESS           GUIDs are returned successfully.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetAllMappingGuids (\r
+  OUT EFI_GUID *Guids,\r
+  IN OUT UINTN *Count\r
+  );\r
+\r
 #endif // __HANDLE_PARSING_LIB__\r