]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Include/Library/ShellLib.h
comment repairs.
[mirror_edk2.git] / ShellPkg / Include / Library / ShellLib.h
index ad3cc01f424d789d335e1272496f6725c75e79f1..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
@@ -47,7 +47,7 @@ ShellGetFileInfo (
 \r
   @param  FileInfo              The infotmation to set.\r
 \r
-  @retval EFI_SUCCESS                  The information was set.\r
+  @retval EFI_SUCCESS            The information was set.\r
   @retval EFI_UNSUPPORTED       The InformationType is not known.\r
   @retval EFI_NO_MEDIA               The device has no medium.\r
   @retval EFI_DEVICE_ERROR         The device reported an error.\r
@@ -69,7 +69,7 @@ ShellSetFileInfo (
   This function opens a file with the open mode according to the file path. The \r
   Attributes is valid only for EFI_FILE_MODE_CREATE.\r
 \r
-  @param  FilePath                 on input the device path to the file.  On output \r
+  @param  FilePath                 On input the device path to the file.  On output \r
                           the remaining device path.\r
   @param  DeviceHandle         pointer to the system device handle.\r
   @param  FileHandle             pointer to the file handle.\r
@@ -115,27 +115,27 @@ ShellOpenFileByDevicePath(
   @param  OpenMode               the mode to open the file with.\r
   @param  Attributes           the file's file attributes.\r
 \r
-  @retval EFI_SUCCESS          The information was set.\r
+  @retval EFI_SUCCESS                  The information was set.\r
   @retval EFI_INVALID_PARAMETER        One of the parameters has an invalid value.\r
-  @retval EFI_UNSUPPORTED      Could not open the file path.   \r
+  @retval EFI_UNSUPPORTED            Could not open the file path.     \r
   @retval EFI_NOT_FOUND                The specified file could not be found on the \r
                                 device or the file system could not be found \r
                                 on the device.\r
-  @retval EFI_NO_MEDIA         The device has no medium.\r
-  @retval EFI_MEDIA_CHANGED    The device has a different medium in it or the \r
+  @retval EFI_NO_MEDIA               The device has no medium.\r
+  @retval EFI_MEDIA_CHANGED        The device has a different medium in it or the \r
                                 medium is no longer supported.\r
-  @retval EFI_DEVICE_ERROR     The device reported an error.\r
+  @retval EFI_DEVICE_ERROR         The device reported an error.\r
   @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
-  @retval EFI_WRITE_PROTECTED  The file or medium is write protected.\r
-  @retval EFI_ACCESS_DENIED    The file was opened read only.\r
+  @retval EFI_WRITE_PROTECTED    The file or medium is write protected.\r
+  @retval EFI_ACCESS_DENIED        The file was opened read only.\r
   @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the \r
                                 file.\r
-  @retval EFI_VOLUME_FULL      The volume is full.\r
+  @retval EFI_VOLUME_FULL            The volume is full.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 ShellOpenFileByName(\r
-  IN CHAR16                              *FilePath,\r
+  IN CONST CHAR16                          *FilePath,\r
   OUT EFI_FILE_HANDLE           *FileHandle,\r
   IN UINT64                     OpenMode,\r
   IN UINT64                            Attributes\r
@@ -148,30 +148,30 @@ ShellOpenFileByName(
   otherwise, the Filehandle is NULL. If the directory already existed, this \r
   function opens the existing directory.\r
 \r
-  @param  DirectoryName         pointer to Directory name\r
-  @param  FileHandle                   pointer to the file handle.\r
+  @param  DirectoryName         Pointer to Directory name.\r
+  @param  FileHandle                   Pointer to the file handle.\r
 \r
   @retval EFI_SUCCESS                  The information was set.\r
   @retval EFI_INVALID_PARAMETER        One of the parameters has an invalid value.\r
-  @retval EFI_UNSUPPORTED      Could not open the file path.   \r
+  @retval EFI_UNSUPPORTED            Could not open the file path.     \r
   @retval EFI_NOT_FOUND                The specified file could not be found on the \r
                                 device or the file system could not be found \r
                                 on the device.\r
-  @retval EFI_NO_MEDIA         The device has no medium.\r
-  @retval EFI_MEDIA_CHANGED    The device has a different medium in it or the \r
+  @retval EFI_NO_MEDIA               The device has no medium.\r
+  @retval EFI_MEDIA_CHANGED        The device has a different medium in it or the \r
                                 medium is no longer supported.\r
-  @retval EFI_DEVICE_ERROR     The device reported an error.\r
+  @retval EFI_DEVICE_ERROR         The device reported an error.\r
   @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
-  @retval EFI_WRITE_PROTECTED  The file or medium is write protected.\r
-  @retval EFI_ACCESS_DENIED    The file was opened read only.\r
+  @retval EFI_WRITE_PROTECTED    The file or medium is write protected.\r
+  @retval EFI_ACCESS_DENIED        The file was opened read only.\r
   @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the \r
                                 file.\r
-  @retval EFI_VOLUME_FULL      The volume is full.\r
+  @retval EFI_VOLUME_FULL            The volume is full.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 ShellCreateDirectory(\r
-  IN CHAR16                   *DirectoryName,\r
+  IN CONST CHAR16             *DirectoryName,\r
   OUT EFI_FILE_HANDLE         *FileHandle\r
   );\r
 \r
@@ -191,18 +191,16 @@ ShellCreateDirectory(
   are no more directory entries, the read returns a zero-length buffer. \r
   EFI_FILE_INFO is the structure returned as the directory entry.\r
 \r
-  @param FileHandle             the opened file handle\r
-  \r
-  @param ReadSize               on input the size of buffer in bytes.  on return \r
+  @param FileHandle             The opened file handle.\r
+  @param ReadSize               On input the size of buffer in bytes.  On return \r
                                 the number of bytes written.\r
+  @param Buffer                 The buffer to put read data into.\r
 \r
-  @param Buffer                 the buffer to put read data into.\r
-\r
- @retval EFI_SUCCESS           Data was read.\r
- @retval EFI_NO_MEDIA          The device has no media.\r
- @retval EFI_DEVICE_ERROR      The device reported an error.\r
- @retval EFI_VOLUME_CORRUPTED  The file system structures are corrupted.\r
- @retval EFI_BUFFER_TO_SMALL   Buffer is too small. ReadSize contains required \r
+  @retval EFI_SUCCESS            Data was read.\r
+  @retval EFI_NO_MEDIA         The device has no media.\r
+  @retval EFI_DEVICE_ERROR         The device reported an error.\r
+  @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
+  @retval EFI_BUFFER_TO_SMALL    Buffer is too small. ReadSize contains required \r
                                 size.\r
 \r
 **/\r
@@ -224,28 +222,28 @@ ShellReadFile(
   The file is automatically grown to hold the data if required. Direct writes to \r
   opened directories are not supported.\r
 \r
-  @param FileHandle             The opened file for writing\r
+  @param FileHandle             The opened file for writing.\r
 \r
-  @param BufferSize             on input the number of bytes in Buffer.  On output\r
+  @param BufferSize             On input the number of bytes in Buffer.  On output\r
                                 the number of bytes written.\r
 \r
-  @param Buffer                 the buffer containing data to write is stored.\r
+  @param Buffer                 The buffer containing data to write is stored.\r
 \r
@retval EFI_SUCCESS           Data was written.\r
@retval EFI_UNSUPPORTED       Writes to an open directory are not supported.\r
@retval EFI_NO_MEDIA          The device has no media.\r
@retval EFI_DEVICE_ERROR      The device reported an error.\r
@retval EFI_VOLUME_CORRUPTED  The file system structures are corrupted.\r
@retval EFI_WRITE_PROTECTED   The device is write-protected.\r
@retval EFI_ACCESS_DENIED     The file was open for read only.\r
@retval EFI_VOLUME_FULL       The volume is full.\r
 @retval EFI_SUCCESS            Data was written.\r
 @retval EFI_UNSUPPORTED            Writes to an open directory are not supported.\r
 @retval EFI_NO_MEDIA         The device has no media.\r
 @retval EFI_DEVICE_ERROR         The device reported an error.\r
 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
 @retval EFI_WRITE_PROTECTED    The device is write-protected.\r
 @retval EFI_ACCESS_DENIED        The file was open for read only.\r
 @retval EFI_VOLUME_FULL            The volume is full.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 ShellWriteFile(\r
   IN EFI_FILE_HANDLE            FileHandle,\r
   IN OUT UINTN                  *BufferSize,\r
-  IN CONST VOID                 *Buffer\r
+  IN VOID                       *Buffer\r
   );\r
 \r
 /** \r
@@ -255,10 +253,10 @@ ShellWriteFile(
   flushed to the device, and the file is closed. In all cases the handle is \r
   closed.\r
 \r
-@param FileHandle               the file handle to close.\r
+  @param FileHandle               The file handle to close.\r
 \r
-@retval EFI_SUCCESS             the file handle was closed sucessfully.\r
-@retval INVALID_PARAMETER              One of the parameters has an invalid value.\r
+  @retval EFI_SUCCESS             The file handle was closed sucessfully.\r
+  @retval INVALID_PARAMETER            One of the parameters has an invalid value.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -273,12 +271,12 @@ ShellCloseFile (
   If the file cannot be deleted, the warning code EFI_WARN_DELETE_FAILURE is \r
   returned, but the handle is still closed.\r
 \r
-  @param FileHandle             the file handle to delete\r
+  @param FileHandle                 The file handle to delete.\r
 \r
-  @retval EFI_SUCCESS           the file was closed sucessfully\r
-  @retval EFI_WARN_DELETE_FAILURE the handle was closed, but the file was not \r
-                                deleted\r
-  @retval INVALID_PARAMETER            One of the parameters has an invalid value.\r
+  @retval EFI_SUCCESS               The file was closed sucessfully.\r
+  @retval EFI_WARN_DELETE_FAILURE   The handle was closed, but the file was not \r
+                                    deleted.\r
+  @retval INVALID_PARAMETER                One of the parameters has an invalid value.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -414,11 +412,11 @@ ShellFindNextFile(
   This function extracts the file size info from the FileHandle's EFI_FILE_INFO \r
   data.\r
 \r
-  @param FileHandle             file handle from which size is retrieved\r
-  @param Size                   pointer to size\r
+  @param FileHandle             The file handle from which size is retrieved.\r
+  @param Size                   Pointer to size.\r
 \r
-  @retval EFI_SUCCESS           operation was completed sucessfully\r
-  @retval EFI_DEVICE_ERROR      cannot access the file\r
+  @retval EFI_SUCCESS           The operation was completed sucessfully.\r
+  @retval EFI_DEVICE_ERROR      Cannot access the file.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -442,32 +440,32 @@ ShellGetExecutionBreakFlag(
   );\r
 \r
 /**\r
-  return the value of an environment variable\r
+  Return the value of an environment variable.\r
 \r
-  this function gets the value of the environment variable set by the \r
-  ShellSetEnvironmentVariable function\r
+  This function gets the value of the environment variable set by the \r
+  ShellSetEnvironmentVariable function.\r
 \r
   @param EnvKey                 The key name of the environment variable.\r
 \r
-  @retval NULL                  the named environment variable does not exist.\r
-  @return != NULL               pointer to the value of the environment variable\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
 EFIAPI\r
 ShellGetEnvironmentVariable (\r
-  IN CHAR16                     *EnvKey\r
+  IN CONST CHAR16                *EnvKey\r
   );\r
 \r
 /**\r
   set the value of an environment variable\r
 \r
-This function changes the current value of the specified environment variable. If the\r
-environment variable exists and the Value is an empty string, then the environment\r
-variable is deleted. If the environment variable exists and the Value is not an empty\r
-string, then the value of the environment variable is changed. If the environment\r
-variable does not exist and the Value is an empty string, there is no action. If the\r
-environment variable does not exist and the Value is a non-empty string, then the\r
-environment variable is created and assigned the specified value.\r
+  This function changes the current value of the specified environment variable. If the\r
+  environment variable exists and the Value is an empty string, then the environment\r
+  variable is deleted. If the environment variable exists and the Value is not an empty\r
+  string, then the value of the environment variable is changed. If the environment\r
+  variable does not exist and the Value is an empty string, there is no action. If the\r
+  environment variable does not exist and the Value is a non-empty string, then the\r
+  environment variable is created and assigned the specified value.\r
 \r
   This is not supported pre-UEFI Shell 2.0.\r
 \r
@@ -487,32 +485,32 @@ ShellSetEnvironmentVariable (
   );\r
 \r
 /**\r
-  cause the shell to parse and execute a command line.\r
+  Cause the shell to parse and execute a command line.\r
 \r
   This function creates a nested instance of the shell and executes the specified\r
-command (CommandLine) with the specified environment (Environment). Upon return,\r
-the status code returned by the specified command is placed in StatusCode.\r
-If Environment is NULL, then the current environment is used and all changes made\r
-by the commands executed will be reflected in the current environment. If the\r
-Environment is non-NULL, then the changes made will be discarded.\r
-The CommandLine is executed from the current working directory on the current\r
-device.\r
-\r
-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
-\r
-  @retval EFI_SUCCESS           the operation completed sucessfully.  Status\r
+  command (CommandLine) with the specified environment (Environment). Upon return,\r
+  the status code returned by the specified command is placed in StatusCode.\r
+  If Environment is NULL, then the current environment is used and all changes made\r
+  by the commands executed will be reflected in the current environment. If the\r
+  Environment is non-NULL, then the changes made will be discarded.\r
+  The CommandLine is executed from the current working directory on the current\r
+  device.\r
+\r
+  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
+\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
@@ -525,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
@@ -543,12 +541,12 @@ ShellGetCurrentDir (
   );\r
 \r
 /**\r
-  sets (enabled or disabled) the page break mode\r
+  Sets (enabled or disabled) the page break mode.\r
 \r
-  when page break mode is enabled the screen will stop scrolling \r
+  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
@@ -563,20 +561,19 @@ ShellSetPageBreakMode (
   file has a SHELL_FILE_ARG structure to record the file information. These \r
   structures are placed on the list ListHead. Users can get the SHELL_FILE_ARG \r
   structures from ListHead to access each file. This function supports wildcards\r
-  and will process '?' and '*' as such.  the list must be freed with a call to \r
+  and will process '?' and '*' as such.  The list must be freed with a call to \r
   ShellCloseFileMetaArg().\r
 \r
-  This function will fail if called sequentially without freeing the list in the middle.\r
+  If you are NOT appending to an existing list *ListHead must be NULL.  If \r
+  *ListHead is NULL then it must be callee freed.\r
 \r
-  @param Arg                    pointer to path string\r
-  @param OpenMode               mode to open files with\r
-  @param ListHead               head of linked list of results\r
+  @param Arg                    Pointer to path string.\r
+  @param OpenMode               Mode to open files with.\r
+  @param ListHead               Head of linked list of results.\r
 \r
-  @retval EFI_SUCCESS           the operation was sucessful and the list head \r
-                                contains the list of opened files\r
-  #retval EFI_UNSUPPORTED       a previous ShellOpenFileMetaArg must be closed first.\r
-                                *ListHead is set to NULL.\r
-  @return != EFI_SUCCESS        the operation failed\r
+  @retval EFI_SUCCESS           The operation was sucessful and the list head \r
+                                contains the list of opened files.\r
+  @retval != EFI_SUCCESS        The operation failed.\r
 \r
   @sa InternalShellConvertFileListType\r
 **/\r
@@ -589,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,10 +599,31 @@ ShellCloseFileMetaArg (
   IN OUT EFI_SHELL_FILE_INFO    **ListHead\r
   );\r
 \r
+/**\r
+  Find a file by searching the CWD and then the path.\r
+\r
+  If FileName is NULL, then ASSERT.\r
+\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
+**/\r
+CHAR16 *\r
+EFIAPI\r
+ShellFindFilePath (\r
+  IN CONST CHAR16 *FileName\r
+  );\r
+\r
 typedef enum {\r
-  TypeFlag  = 0,\r
-  TypeValue,\r
-  TypePosition,\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
@@ -624,45 +642,47 @@ extern SHELL_PARAM_ITEM EmptyParamList[];
   \r
   If no initialization is required, then return RETURN_SUCCESS.\r
   \r
-  @param CheckList              pointer to list of parameters to check\r
-  @param CheckPackage           Package of checked values\r
-  @param ProblemParam           optional pointer to pointer to unicode string for \r
+  @param CheckList              Pointer to list of parameters to check.\r
+  @param CheckPackage           Package of checked values.\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
+  @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
+  @retval EFI_NOT_FOUND         A argument required a value that was missing.  \r
+                                The invalid command line argument was returned in\r
                                 ProblemParam if provided.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
-ShellCommandLineParse (\r
+ShellCommandLineParseEx (\r
   IN CONST SHELL_PARAM_ITEM     *CheckList,\r
   OUT LIST_ENTRY                **CheckPackage,\r
   OUT CHAR16                    **ProblemParam OPTIONAL,\r
-  IN BOOLEAN                    AutoPageBreak\r
+  IN BOOLEAN                    AutoPageBreak,\r
+  IN BOOLEAN                    AlwaysAllowNumbers\r
   );\r
 \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
   Frees shell variable list that was returned from ShellCommandLineParse.\r
 \r
   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
@@ -671,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
@@ -692,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
@@ -712,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
@@ -731,6 +751,20 @@ ShellCommandLineGetRawValue (
   IN UINT32                        Position\r
   );\r
 \r
+/**\r
+  Returns the number of command line value parameters that were parsed.  \r
+  \r
+  This will not include flags.\r
+\r
+  @retval (UINTN)-1     No parsing has ocurred\r
+  @return               The number of value parameters found\r
+**/\r
+UINTN\r
+EFIAPI\r
+ShellCommandLineGetCount(\r
+  VOID\r
+  );\r
+\r
 /**\r
   This function causes the shell library to initialize itself.  If the shell library\r
   is already initialized it will de-initialize all the current protocol poitners and\r
@@ -747,6 +781,169 @@ ShellCommandLineGetRawValue (
 EFI_STATUS\r
 EFIAPI\r
 ShellInitialize (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  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 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
+\r
+  In addition to the standard %-based flags as supported by UefiLib Print() this supports \r
+  the following additional flags:\r
+    %N       -   Set output attribute to normal\r
+    %H       -   Set output attribute to highlight\r
+    %E       -   Set output attribute to error\r
+    %B       -   Set output attribute to blue color\r
+    %V       -   Set output attribute to green color\r
+\r
+  Note: The background color is controlled by the shell command cls.\r
+\r
+  @param[in] Row        the row to print at\r
+  @param[in] Col        the column to print at\r
+  @param[in] Format     the format string\r
+\r
+  @return the number of characters printed to the screen\r
+**/\r
+\r
+UINTN\r
+EFIAPI\r
+ShellPrintEx(\r
+  IN INT32                Col OPTIONAL,\r
+  IN INT32                Row OPTIONAL,\r
+  IN CONST CHAR16         *Format,\r
+  ...\r
+  );\r
+\r
+/**\r
+  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
+  \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
+\r
+  In addition to the standard %-based flags as supported by UefiLib Print() this supports \r
+  the following additional flags:\r
+    %N       -   Set output attribute to normal\r
+    %H       -   Set output attribute to highlight\r
+    %E       -   Set output attribute to error\r
+    %B       -   Set output attribute to blue color\r
+    %V       -   Set output attribute to green color\r
+\r
+  Note: The background color is controlled by the shell command cls.\r
+\r
+  @param[in] Row                the row to print at\r
+  @param[in] Col                the column to print at\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
+\r
+  @return the number of characters printed to the screen\r
+**/\r
+UINTN\r
+EFIAPI\r
+ShellPrintHiiEx(\r
+  IN INT32                Col OPTIONAL,\r
+  IN INT32                Row OPTIONAL,\r
+  IN CONST EFI_STRING_ID  HiiFormatStringId,\r
+  IN CONST EFI_HANDLE     HiiFormatHandle,\r
+  ...\r
+  );\r
+\r
+/**\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
+  @retval other           The path failed to open.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ShellIsDirectory(\r
+  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
+  @return             The unsigned integer result of the conversion.\r
+**/\r
+UINTN\r
+EFIAPI\r
+ShellStrToUintn(\r
+  IN CONST CHAR16 *String\r
+  );\r
+\r
+/**\r
+  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
+  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
+  starting at the original terminating null of Destination, and a new terminating \r
+  null is appended.\r
+\r
+  If appending D characters onto Destination will result in a overflow of the size\r
+  given in CurrentSize the string will be grown such that the copy can be performed\r
+  and CurrentSize will be updated to the new size.\r
+\r
+  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's current length (including NULL terminator) is already more then \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
+                                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
+                                all are appended.\r
+\r
+  @return                       the Destination after apending the Source.\r
+**/\r
+CHAR16* \r
+EFIAPI\r
+StrnCatGrow (\r
+  IN OUT CHAR16           **Destination,\r
+  IN OUT UINTN            *CurrentSize,\r
+  IN     CONST CHAR16     *Source,\r
+  IN     UINTN            Count\r
   );\r
 \r
-#endif // __SHELL_LIB__
\ No newline at end of file
+#endif // __SHELL_LIB__\r