]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Include/Library/ShellLib.h
comment repairs.
[mirror_edk2.git] / ShellPkg / Include / Library / ShellLib.h
index eab8271ae9f0ee7bd27d1434acff80cd09e45897..617d90b692d1fe1ac1db376daf6edae3ad883146 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Provides interface to shell functionality for shell commands and applications.\r
 \r
-Copyright (c) 2006 - 2009, Intel Corporation\r
+Copyright (c) 2006 - 2009, Intel Corporation<BR>\r
 All rights reserved. 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
@@ -416,7 +416,7 @@ ShellFindNextFile(
   @param Size                   Pointer to size.\r
 \r
   @retval EFI_SUCCESS           The operation was completed sucessfully.\r
-  @retval EFI_DEVICE_ERROR      cannot access the file.\r
+  @retval EFI_DEVICE_ERROR      Cannot access the file.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -447,7 +447,7 @@ ShellGetExecutionBreakFlag(
 \r
   @param EnvKey                 The key name of the environment variable.\r
 \r
-  @retval NULL                  the named environment variable does not exist.\r
+  @retval NULL                  The named environment variable does not exist.\r
   @return != NULL               pointer to the value of the environment variable.\r
 **/\r
 CONST CHAR16*\r
@@ -499,18 +499,18 @@ ShellSetEnvironmentVariable (
   EnvironmentVariables and Status are only supported for UEFI Shell 2.0.\r
   Output is only supported for pre-UEFI Shell 2.0\r
 \r
-  @param ImageHandle            Parent image that is starting the operation\r
-  @param CommandLine            pointer to null terminated command line.\r
-  @param Output                 true to display debug output.  false to hide it.\r
-  @param EnvironmentVariables   optional pointer to array of environment variables\r
-                                in the form "x=y".  if NULL current set is used.\r
-  @param Status                 the status of the run command line.\r
+  @param ImageHandle            Parent image that is starting the operation.\r
+  @param CommandLine            Pointer to null terminated command line.\r
+  @param Output                 True to display debug output.  false to hide it.\r
+  @param EnvironmentVariables   Optional pointer to array of environment variables\r
+                                in the form "x=y".  If NULL current set is used.\r
+  @param Status                 The status of the run command line.\r
 \r
-  @retval EFI_SUCCESS           the operation completed sucessfully.  Status\r
+  @retval EFI_SUCCESS           The operation completed sucessfully.  Status\r
                                 contains the status code returned.\r
-  @retval EFI_INVALID_PARAMETER a parameter contains an invalid value\r
-  @retval EFI_OUT_OF_RESOURCES  out of resources\r
-  @retval EFI_UNSUPPORTED       the operation is not allowed.\r
+  @retval EFI_INVALID_PARAMETER A parameter contains an invalid value.\r
+  @retval EFI_OUT_OF_RESOURCES  Out of resources.\r
+  @retval EFI_UNSUPPORTED       The operation is not allowed.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -523,16 +523,16 @@ ShellExecute (
   );\r
 \r
 /**\r
-  Retreives the current directory path\r
+  Retreives the current directory path.\r
 \r
   If the DeviceName is NULL, it returns the current device's current directory \r
   name. If the DeviceName is not NULL, it returns the current directory name \r
   on specified drive.\r
 \r
-  @param DeviceName             the name of the drive to get directory on\r
+  @param DeviceName             The name of the file system to get directory on.\r
 \r
-  @retval NULL                  the directory does not exist\r
-  @return != NULL               the directory\r
+  @retval NULL                  The directory does not exist.\r
+  @return != NULL               The directory.\r
 **/\r
 CONST CHAR16*\r
 EFIAPI\r
@@ -546,7 +546,7 @@ ShellGetCurrentDir (
   When page break mode is enabled the screen will stop scrolling \r
   and wait for operator input before scrolling a subsequent screen.\r
 \r
-  @param CurrentState           TRUE to enable and FALSE to disable\r
+  @param CurrentState           TRUE to enable and FALSE to disable.\r
 **/\r
 VOID \r
 EFIAPI\r
@@ -573,7 +573,7 @@ ShellSetPageBreakMode (
 \r
   @retval EFI_SUCCESS           The operation was sucessful and the list head \r
                                 contains the list of opened files.\r
-  @return != EFI_SUCCESS        The operation failed.\r
+  @retval != EFI_SUCCESS        The operation failed.\r
 \r
   @sa InternalShellConvertFileListType\r
 **/\r
@@ -586,12 +586,12 @@ ShellOpenFileMetaArg (
   );\r
 \r
 /**\r
-  Free the linked list returned from ShellOpenFileMetaArg\r
+  Free the linked list returned from ShellOpenFileMetaArg.\r
 \r
-  @param ListHead               the pointer to free\r
+  @param ListHead               The pointer to free.\r
 \r
-  @retval EFI_SUCCESS           the operation was sucessful\r
-  @retval EFI_INVALID_PARAMETER A parameter was invalid\r
+  @retval EFI_SUCCESS           The operation was sucessful.\r
+  @retval EFI_INVALID_PARAMETER A parameter was invalid.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -602,14 +602,14 @@ ShellCloseFileMetaArg (
 /**\r
   Find a file by searching the CWD and then the path.\r
 \r
-  if FileName is NULL then ASSERT.\r
+  If FileName is NULL, then ASSERT.\r
 \r
-  if the return value is not NULL then the memory must be caller freed.\r
+  If the return value is not NULL then the memory must be caller freed.\r
 \r
   @param FileName               Filename string.\r
 \r
-  @retval NULL                  the file was not found\r
-  @return !NULL                 the path to the file.\r
+  @retval NULL                  The file was not found.\r
+  @return !NULL                 The path to the file.\r
 **/\r
 CHAR16 *\r
 EFIAPI\r
@@ -618,12 +618,12 @@ ShellFindFilePath (
   );\r
 \r
 typedef enum {\r
-  TypeFlag  = 0,    /// a flag that is present or not present only. (IE "-a")\r
-  TypeValue,        /// a flag that has some data following it with a space (IE "-a 1")\r
-  TypePosition,     /// some data that did not follow a parameter (IE "filename.txt")\r
-  TypeStart,        /// a flag that has variable value appended to the end (IE "-ad", "-afd", "-adf", etc...\r
-  TypeDoubleValue,  /// a flag that has 2 space seperated value data following it. (IE "-a 1 2")\r
-  TypeMaxValue,     /// a flag followed by all the command line data before the next flag.\r
+  TypeFlag  = 0,    ///< a flag that is present or not present only (IE "-a").\r
+  TypeValue,        ///< a flag that has some data following it with a space (IE "-a 1").\r
+  TypePosition,     ///< some data that did not follow a parameter (IE "filename.txt").\r
+  TypeStart,        ///< a flag that has variable value appended to the end (IE "-ad", "-afd", "-adf", etc...).\r
+  TypeDoubleValue,  ///< a flag that has 2 space seperated value data following it (IE "-a 1 2").\r
+  TypeMaxValue,     ///< a flag followed by all the command line data before the next flag.\r
   TypeMax,\r
 } ParamType;\r
 \r
@@ -644,21 +644,21 @@ extern SHELL_PARAM_ITEM EmptyParamList[];
   \r
   @param CheckList              Pointer to list of parameters to check.\r
   @param CheckPackage           Package of checked values.\r
-  @param ProblemParam           Pptional pointer to pointer to unicode string for \r
+  @param ProblemParam           Optional pointer to pointer to unicode string for \r
                                 the paramater that caused failure.\r
   @param AutoPageBreak          Will automatically set PageBreakEnabled.\r
 \r
   @retval EFI_SUCCESS           The operation completed sucessfully.\r
-  @retval EFI_OUT_OF_RESOURCES  A memory allocation failed\r
-  @retval EFI_INVALID_PARAMETER A parameter was invalid\r
-  @retval EFI_VOLUME_CORRUPTED  the command line was corrupt.  an argument was \r
-                                duplicated.  the duplicated command line argument \r
+  @retval EFI_OUT_OF_RESOURCES  A memory allocation failed.\r
+  @retval EFI_INVALID_PARAMETER A parameter was invalid.\r
+  @retval EFI_VOLUME_CORRUPTED  The command line was corrupt.  an argument was \r
+                                duplicated.  The duplicated command line argument \r
                                 was returned in ProblemParam if provided.\r
-  @retval EFI_DEVICE_ERROR      The commands contained 2 opposing arguments.  one\r
+  @retval EFI_DEVICE_ERROR      The commands contained 2 opposing arguments.  One\r
                                 of the command line arguments was returned in \r
                                 ProblemParam if provided.\r
   @retval EFI_NOT_FOUND         A argument required a value that was missing.  \r
-                                the invalid command line argument was returned in\r
+                                The invalid command line argument was returned in\r
                                 ProblemParam if provided.\r
 **/\r
 EFI_STATUS\r
@@ -671,7 +671,7 @@ ShellCommandLineParseEx (
   IN BOOLEAN                    AlwaysAllowNumbers\r
   );\r
 \r
-// make it easy to upgrade from older versions of the shell library.\r
+/// make it easy to upgrade from older versions of the shell library.\r
 #define ShellCommandLineParse(CheckList,CheckPackage,ProblemParam,AutoPageBreak) ShellCommandLineParseEx(CheckList,CheckPackage,ProblemParam,AutoPageBreak,FALSE)\r
 \r
 /**\r
@@ -680,11 +680,9 @@ ShellCommandLineParseEx (
   This function will free all the memory that was used for the CheckPackage\r
   list of postprocessed shell arguments.\r
 \r
-  this function has no return value.\r
+  If CheckPackage is NULL, then return.\r
 \r
-  if CheckPackage is NULL, then return\r
-\r
-  @param CheckPackage           the list to de-allocate\r
+  @param CheckPackage           The list to de-allocate.\r
   **/\r
 VOID\r
 EFIAPI\r
@@ -693,18 +691,18 @@ ShellCommandLineFreeVarList (
   );\r
 \r
 /**\r
-  Checks for presence of a flag parameter\r
+  Checks for presence of a flag parameter.\r
 \r
   flag arguments are in the form of "-<Key>" or "/<Key>", but do not have a value following the key\r
 \r
   if CheckPackage is NULL then return FALSE.\r
-  if KeyString is NULL then ASSERT()\r
+  if KeyString is NULL then ASSERT().\r
   \r
-  @param CheckPackage           The package of parsed command line arguments\r
-  @param KeyString              the Key of the command line argument to check for\r
+  @param CheckPackage           The package of parsed command line arguments.\r
+  @param KeyString              The Key of the command line argument to check for.\r
 \r
-  @retval TRUE                  the flag is on the command line\r
-  @retval FALSE                 the flag is not on the command line\r
+  @retval TRUE                  The flag is on the command line.\r
+  @retval FALSE                 The flag is not on the command line.\r
   **/\r
 BOOLEAN\r
 EFIAPI\r
@@ -714,17 +712,17 @@ ShellCommandLineGetFlag (
   );\r
 \r
 /**\r
-  returns value from command line argument\r
+  Returns value from command line argument.\r
 \r
-  value parameters are in the form of "-<Key> value" or "/<Key> value"\r
+  Value parameters are in the form of "-<Key> value" or "/<Key> value"\r
   \r
-  if CheckPackage is NULL, then return NULL;\r
+  If CheckPackage is NULL, then return NULL.\r
 \r
-  @param CheckPackage           The package of parsed command line arguments\r
-  @param KeyString              the Key of the command line argument to check for\r
+  @param CheckPackage           The package of parsed command line arguments.\r
+  @param KeyString              The Key of the command line argument to check for.\r
 \r
-  @retval NULL                  the flag is not on the command line\r
-  @return !=NULL                pointer to unicode string of the value\r
+  @retval NULL                  The flag is not on the command line.\r
+  @retval !=NULL                Pointer to unicode string of the value.\r
   **/\r
 CONST CHAR16*\r
 EFIAPI\r
@@ -734,17 +732,17 @@ ShellCommandLineGetValue (
   );\r
 \r
 /**\r
-  returns raw value from command line argument\r
+  Returns raw value from command line argument.\r
 \r
-  raw value parameters are in the form of "value" in a specific position in the list\r
+  Raw value parameters are in the form of "value" in a specific position in the list.\r
   \r
-  if CheckPackage is NULL, then return NULL;\r
+  If CheckPackage is NULL, then return NULL;\r
 \r
-  @param CheckPackage           The package of parsed command line arguments\r
-  @param Position               the position of the value \r
+  @param CheckPackage           The package of parsed command line arguments.\r
+  @param Position               The position of the value.\r
 \r
-  @retval NULL                  the flag is not on the command line\r
-  @return !=NULL                pointer to unicode string of the value\r
+  @retval NULL                  The flag is not on the command line.\r
+  @retval !=NULL                Pointer to unicode string of the value.\r
   **/\r
 CONST CHAR16*\r
 EFIAPI\r
@@ -754,12 +752,12 @@ ShellCommandLineGetRawValue (
   );\r
 \r
 /**\r
-  returns the number of command line value parameters that were parsed.  \r
+  Returns the number of command line value parameters that were parsed.  \r
   \r
-  this will not include flags.\r
+  This will not include flags.\r
 \r
   @retval (UINTN)-1     No parsing has ocurred\r
-  @return other         The number of value parameters found\r
+  @return               The number of value parameters found\r
 **/\r
 UINTN\r
 EFIAPI\r
@@ -790,13 +788,13 @@ ShellInitialize (
   Print at a specific location on the screen.\r
 \r
   This function will move the cursor to a given screen location, print the specified string, \r
-  and return the cursor to the original locaiton.  \r
+  and return the cursor to the original location.  \r
   \r
   If -1 is specified for either the Row or Col the current screen location for BOTH \r
   will be used and the cursor's position will not be moved back to an original location.\r
 \r
-  if either Row or Col is out of range for the current console, then ASSERT\r
-  if Format is NULL, then ASSERT\r
+  If either Row or Col is out of range for the current console, then ASSERT.\r
+  If Format is NULL, then ASSERT.\r
 \r
   In addition to the standard %-based flags as supported by UefiLib Print() this supports \r
   the following additional flags:\r
@@ -864,13 +862,13 @@ ShellPrintHiiEx(
   );\r
 \r
 /**\r
-  Function to determine if a given filename represents a file or a directory.\r
+  Function to determine if a given filename represents a directory.\r
 \r
   @param[in] DirName      Path to directory to test.\r
 \r
-  @retval EFI_SUCCESS     The Path represents a directory\r
-  @retval EFI_NOT_FOUND   The Path does not represent a directory\r
-  @return other           The path failed to open\r
+  @retval EFI_SUCCESS     The Path represents a directory.\r
+  @retval EFI_NOT_FOUND   The Path does not represent a directory.\r
+  @retval other           The path failed to open.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -878,13 +876,28 @@ ShellIsDirectory(
   IN CONST CHAR16 *DirName\r
   );\r
 \r
+/**\r
+  Function to determine if a given filename represents a file.\r
+\r
+  @param[in] Name         Path to file to test.\r
+\r
+  @retval EFI_SUCCESS     The Path represents a file.\r
+  @retval EFI_NOT_FOUND   The Path does not represent a file.\r
+  @retval other           The path failed to open.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ShellIsFile(\r
+  IN CONST CHAR16 *Name\r
+  );\r
+\r
 /**\r
   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
 \r
-  @retval all         the number\r
+  @return             The unsigned integer result of the conversion.\r
 **/\r
 UINTN\r
 EFIAPI\r
@@ -896,7 +909,7 @@ ShellStrToUintn(
   Safely append with automatic string resizing given length of Destination and \r
   desired length of copy from Source.\r
 \r
-  append the first D characters of Source to the end of Destination, where D is \r
+  Append the first D characters of Source to the end of Destination, where D is \r
   the lesser of Count and the StrLen() of Source. If appending those D characters \r
   will fit within Destination (whose Size is given as CurrentSize) and \r
   still leave room for a null terminator, then those characters are appended, \r
@@ -910,19 +923,19 @@ ShellStrToUintn(
   If Source is NULL, there is nothing to append, just return the current buffer in \r
   Destination.\r
 \r
-  if Destination is NULL, then ASSERT()\r
+  if Destination is NULL, then ASSERT().\r
   if Destination's current length (including NULL terminator) is already more then \r
-  CurrentSize, then ASSERT()\r
+  CurrentSize, then ASSERT().\r
 \r
-  @param[in,out] Destination   The String to append onto\r
-  @param[in,out] CurrentSize   on call the number of bytes in Destination.  On \r
+  @param[in,out] Destination    The String to append onto.\r
+  @param[in,out] CurrentSize    On call the number of bytes in Destination.  On \r
                                 return possibly the new size (still in bytes).  if NULL\r
                                 then allocate whatever is needed.\r
-  @param[in]      Source        The String to append from\r
-  @param[in]      Count         Maximum number of characters to append.  if 0 then \r
+  @param[in]     Source         The String to append from.\r
+  @param[in]     Count          Maximum number of characters to append.  If 0 then \r
                                 all are appended.\r
 \r
-  @return Destination           return the resultant string.\r
+  @return                       the Destination after apending the Source.\r
 **/\r
 CHAR16* \r
 EFIAPI\r