]> git.proxmox.com Git - mirror_edk2.git/commitdiff
FileHandleLib - use standard unicode file tag.
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 25 Mar 2011 21:03:58 +0000 (21:03 +0000)
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 25 Mar 2011 21:03:58 +0000 (21:03 +0000)
ShellCEntryLib - add #define protection.
ShellCommandLib - add optional sorting of command list.
ShellLib - add string-to-number with EFI_STATUS return value for verification.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11429 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Include/Library/FileHandleLib.h
ShellPkg/Include/Library/ShellCEntryLib.h
ShellPkg/Include/Library/ShellCommandLib.h
ShellPkg/Include/Library/ShellLib.h

index 1c191ad64a27b2e73aa8d34737e0bc65148c97ec..b4c2e7ddee294f789d808365d6e115c60d73d429 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Provides interface to EFI_FILE_HANDLE functionality.\r
 \r
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2011, 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
@@ -19,9 +19,7 @@
 \r
 /// The tag for use in identifying UNICODE files.\r
 /// If the file is UNICODE, the first 16 bits of the file will equal this value.\r
-enum {\r
-  UnicodeFileTag = 0xFEFF\r
-};\r
+extern CONST UINT16 gUnicodeFileTag;\r
 \r
 /**\r
   This function retrieves information about the file for the handle\r
index f839372b39c82842f40d920052915a1744333534..79136a6894d98a09bdcac3d60c32724c5c05ab09 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Provides application point extension for "C" style main funciton.\r
 \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2011, 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
@@ -12,6 +12,9 @@
 \r
 **/\r
 \r
+#if !defined (_SHELL_C_ENTRY_LIB_)\r
+#define _SHELL_C_ENTRY_LIB_\r
+\r
 /**\r
   UEFI application entry point which has an interface similar to a\r
   standard C main function.\r
@@ -32,3 +35,6 @@ ShellAppMain (
   IN UINTN Argc,\r
   IN CHAR16 **Argv\r
   );\r
+\r
+#endif\r
+\r
index af16c85ef36316fa0ee7cdba8217a941f17ef64a..6edd36676be8d60f0a6bb8b14900c844600b0829 100644 (file)
@@ -4,7 +4,7 @@
   This library is for use ONLY by shell commands linked into the shell application.\r
   This library will not funciton if it is used for UEFI Shell 2.0 Applications.\r
 \r
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2011, 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
@@ -211,12 +211,14 @@ typedef struct {
   via the LIST_ENTRY structure.  Enumerate through it using the BaseLib linked\r
   list functions.  Do not modify the values.\r
 \r
+  @param[in] Sort       TRUE to alphabetically sort the values first.  FALSE otherwise.\r
+\r
   @return A linked list of all available shell commands.\r
 **/\r
 CONST COMMAND_LIST*\r
 EFIAPI\r
 ShellCommandGetCommandList (\r
-  VOID\r
+  IN CONST BOOLEAN Sort\r
   );\r
 \r
 typedef struct {\r
@@ -501,7 +503,7 @@ ShellCommandConsistMappingUnInitialize (
   This must be called after ShellCommandConsistMappingInitialize() and \r
   before ShellCommandConsistMappingUnInitialize() is called.\r
 \r
-  @param[in] DeviecPath   The pointer to the dev path for the device.\r
+  @param[in] DevicePath   The pointer to the dev path for the device.\r
   @param[in] Table        The Table of mapping information.\r
 \r
   @retval NULL            A consistent mapped name could not be created.\r
index 7a5d96157bd7a8e050eb6e0cc45b51326356eb41..6061262221c127e882ac6c101785db28a81f2b76 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Provides interface to shell functionality for shell commands and applications.\r
 \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2011, 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
@@ -988,9 +988,13 @@ ShellIsFileInPath(
   Function to determine whether a string is decimal or hex representation of a number\r
   and return the number converted from the string.\r
 \r
-  @param[in] String   String representation of a number\r
+  Note: this function cannot be used when (UINTN)(-1), (0xFFFFFFFF) may be a valid \r
+  result.  Use ShellConvertStringToUint64 instead.\r
+\r
+  @param[in] String   String representation of a number.\r
 \r
   @return             The unsigned integer result of the conversion.\r
+  @retval (UINTN)(-1) An error occured.\r
 **/\r
 UINTN\r
 EFIAPI\r
@@ -1183,11 +1187,11 @@ ShellPromptForResponse (
   This function is the same as ShellPromptForResponse, except that the prompt is\r
   automatically pulled from HII.\r
 \r
-  @param Type     What type of question is asked.  This is used to filter the input\r
+  @param[in] Type What type of question is asked.  This is used to filter the input\r
                   to prevent invalid answers to question.\r
   @param[in] HiiFormatStringId  The format string Id for getting from Hii.\r
   @param[in] HiiFormatHandle    The format string Handle for getting from Hii.\r
-  @param Response               The pointer to Response, which will be populated upon return.\r
+  @param[out] Response          The pointer to Response, which will be populated upon return.\r
 \r
   @retval EFI_SUCCESS The operation was sucessful.\r
   @return other       The operation failed.\r
@@ -1206,7 +1210,7 @@ ShellPromptForResponseHii (
 /**\r
   Function to determin if an entire string is a valid number.\r
 \r
-  If Hex it must be preceeded with a 0x or has ForceHex, set TRUE.\r
+  If Hex it must be preceeded with a 0x, 0X, or has ForceHex set TRUE.\r
 \r
   @param[in] String       The string to evaluate.\r
   @param[in] ForceHex     TRUE - always assume hex.\r
@@ -1223,6 +1227,30 @@ ShellIsHexOrDecimalNumber (
   IN CONST BOOLEAN  StopAtSpace\r
   );\r
 \r
+/**\r
+  Function to verify and convert a string to its numerical 64 bit representation.\r
+\r
+  If Hex it must be preceeded with a 0x, 0X, or has ForceHex set TRUE.\r
+\r
+  @param[in] String       The string to evaluate.\r
+  @param[out] Value       Upon a successful return the value of the conversion.\r
+  @param[in] ForceHex     TRUE - always assume hex.\r
+  @param[in] StopAtSpace  TRUE to halt upon finding a space, FALSE to \r
+                          process the entire String.\r
+  \r
+  @retval EFI_SUCCESS             The conversion was successful.\r
+  @retval EFI_INVALID_PARAMETER   String contained an invalid character.\r
+  @retval EFI_NOT_FOUND           String was a number, but Value was NULL.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ShellConvertStringToUint64(\r
+  IN CONST CHAR16   *String,\r
+     OUT   UINT64   *Value,\r
+  IN CONST BOOLEAN  ForceHex,\r
+  IN CONST BOOLEAN  StopAtSpace\r
+  );\r
+\r
 /**\r
   Function to determine if a given filename exists.\r
 \r