]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Include/Protocol/EfiShell.h
Refine comments and two code style.
[mirror_edk2.git] / ShellPkg / Include / Protocol / EfiShell.h
index fd9064fe68f750e82abc649d707fb18dfd585222..d36c1f6b17da2347c834bb1b53663e7d491e868b 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   EFI Shell protocol as defined in the UEFI Shell 2.0 specification including errata.\r
 \r
-  Copyright (c) 2006 - 2010, Intel Corporation.  All rights reserved.<BR>\r
+  Copyright (c) 2006 - 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
@@ -15,7 +15,7 @@
 #ifndef __EFI_SHELL_PROTOCOL__\r
 #define __EFI_SHELL_PROTOCOL__\r
 \r
-#include <Protocol/SimpleFileSystem.h>\r
+#include <ShellBase.h>\r
 #include <Guid/FileInfo.h>\r
 \r
 #define EFI_SHELL_PROTOCOL_GUID \\r
 // replaced EFI_LIST_ENTRY with LIST_ENTRY for simplicity.\r
 // they are identical outside of the name.\r
 typedef struct {\r
-  LIST_ENTRY      Link;       ///< Linked list members.\r
-  EFI_STATUS      Status;     ///< Status of opening the file.  Valid only if Handle != NULL.\r
-  CONST CHAR16    *FullName;  ///< Fully qualified filename.\r
-  CONST CHAR16    *FileName;  ///< name of this file.\r
-  EFI_FILE_HANDLE Handle;     ///< Handle for interacting with the opened file or NULL if closed.\r
-  EFI_FILE_INFO   *Info;      ///< Pointer to the FileInfo struct for this file or NULL.\r
+  LIST_ENTRY        Link;       ///< Linked list members.\r
+  EFI_STATUS        Status;     ///< Status of opening the file.  Valid only if Handle != NULL.\r
+  CONST CHAR16      *FullName;  ///< Fully qualified filename.\r
+  CONST CHAR16      *FileName;  ///< name of this file.\r
+  SHELL_FILE_HANDLE Handle;     ///< Handle for interacting with the opened file or NULL if closed.\r
+  EFI_FILE_INFO     *Info;      ///< Pointer to the FileInfo struct for this file or NULL.\r
 } EFI_SHELL_FILE_INFO;\r
 \r
 /**\r
@@ -61,7 +61,7 @@ BOOLEAN
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_CLOSE_FILE)(\r
-  IN EFI_FILE_HANDLE FileHandle\r
+  IN SHELL_FILE_HANDLE FileHandle\r
   );\r
 \r
 /**\r
@@ -79,9 +79,9 @@ EFI_STATUS
   already exists and is non-volatile then EFI_INVALID_PARAMETER is returned.\r
 \r
   @param[in] FileName           Pointer to NULL-terminated file path.\r
-  @param[in] FileAttribs        The new file's attrbiutes.  the different attributes are\r
+  @param[in] FileAttribs        The new file's attrbiutes.  The different attributes are\r
                                 described in EFI_FILE_PROTOCOL.Open().\r
-  @param[out] FileHandle        On return, points to the created file handle or directory's handle\r
+  @param[out] FileHandle        On return, points to the created file handle or directory's handle.\r
 \r
   @retval EFI_SUCCESS           The file was opened.  FileHandle points to the new file's handle.\r
   @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
@@ -103,9 +103,9 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_CREATE_FILE)(\r
-  IN CONST CHAR16 *FileName,\r
-  IN UINT64 FileAttribs,\r
-  OUT EFI_FILE_HANDLE *FileHandle\r
+  IN CONST CHAR16               *FileName,\r
+  IN UINT64                     FileAttribs,\r
+  OUT SHELL_FILE_HANDLE         *FileHandle\r
   );\r
 \r
 /**\r
@@ -123,7 +123,7 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_DELETE_FILE)(\r
-  IN EFI_FILE_HANDLE FileHandle\r
+  IN SHELL_FILE_HANDLE FileHandle\r
   );\r
 \r
 /**\r
@@ -194,10 +194,10 @@ VOID
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_EXECUTE) (\r
-  IN EFI_HANDLE *ParentImageHandle,\r
-  IN CHAR16 *CommandLine OPTIONAL,\r
-  IN CHAR16 **Environment OPTIONAL,\r
-  OUT EFI_STATUS *StatusCode OPTIONAL\r
+  IN EFI_HANDLE                 *ParentImageHandle,\r
+  IN CHAR16                     *CommandLine OPTIONAL,\r
+  IN CHAR16                     **Environment OPTIONAL,\r
+  OUT EFI_STATUS                *StatusCode OPTIONAL\r
   );\r
 \r
 /**\r
@@ -224,8 +224,8 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_FIND_FILES)(\r
-  IN CONST CHAR16 *FilePattern,\r
-  OUT EFI_SHELL_FILE_INFO **FileList\r
+  IN CONST CHAR16               *FilePattern,\r
+  OUT EFI_SHELL_FILE_INFO       **FileList\r
   );\r
 \r
 /**\r
@@ -243,8 +243,8 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_FIND_FILES_IN_DIR)(\r
-IN EFI_FILE_HANDLE FileDirHandle,\r
-OUT EFI_SHELL_FILE_INFO **FileList\r
+IN SHELL_FILE_HANDLE            FileDirHandle,\r
+OUT EFI_SHELL_FILE_INFO         **FileList\r
 );\r
 \r
 /**\r
@@ -265,7 +265,7 @@ OUT EFI_SHELL_FILE_INFO **FileList
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_FLUSH_FILE)(\r
-  IN EFI_FILE_HANDLE FileHandle\r
+  IN SHELL_FILE_HANDLE FileHandle\r
   );\r
 \r
 /**\r
@@ -341,11 +341,11 @@ typedef UINT32 EFI_SHELL_DEVICE_NAME_FLAGS;
 **/\r
 typedef\r
 EFI_STATUS\r
-(*EFI_SHELL_GET_DEVICE_NAME) (\r
-  IN EFI_HANDLE DeviceHandle,\r
-  IN EFI_SHELL_DEVICE_NAME_FLAGS Flags,\r
-  IN CHAR8 *Language,\r
-  OUT CHAR16 **BestDeviceName\r
+(EFIAPI *EFI_SHELL_GET_DEVICE_NAME) (\r
+  IN EFI_HANDLE                   DeviceHandle,\r
+  IN EFI_SHELL_DEVICE_NAME_FLAGS  Flags,\r
+  IN CHAR8                        *Language,\r
+  OUT CHAR16                      **BestDeviceName\r
   );\r
 \r
 /**\r
@@ -427,7 +427,7 @@ CONST CHAR16 *
 typedef\r
 EFI_FILE_INFO *\r
 (EFIAPI *EFI_SHELL_GET_FILE_INFO)(\r
-  IN EFI_FILE_HANDLE FileHandle\r
+  IN SHELL_FILE_HANDLE FileHandle\r
   );\r
 \r
 /**\r
@@ -464,7 +464,7 @@ CHAR16 *
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_GET_FILE_POSITION)(\r
-  IN EFI_FILE_HANDLE FileHandle,\r
+  IN SHELL_FILE_HANDLE FileHandle,\r
   OUT UINT64 *Position\r
   );\r
 \r
@@ -482,7 +482,7 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_GET_FILE_SIZE)(\r
-  IN EFI_FILE_HANDLE FileHandle,\r
+  IN SHELL_FILE_HANDLE FileHandle,\r
   OUT UINT64 *Size\r
   );\r
 \r
@@ -531,9 +531,9 @@ EFI_STATUS
   If there are multiple map names they will be semi-colon seperated in the\r
   NULL-terminated string.\r
 \r
-  @param[in,out] DevicePath     On entry, points to a device path pointer. On\r
-                                exit, updates the pointer to point to the\r
-                                portion of the device path after the mapping.\r
+  @param[in, out] DevicePath     On entry, points to a device path pointer. On\r
+                                 exit, updates the pointer to point to the\r
+                                 portion of the device path after the mapping.\r
 \r
   @retval NULL                  No mapping was found.\r
   @retval !=NULL                Pointer to NULL-terminated mapping. The buffer\r
@@ -629,7 +629,7 @@ typedef
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_OPEN_FILE_BY_NAME) (\r
   IN CONST CHAR16 *FileName,\r
-  OUT EFI_FILE_HANDLE *FileHandle,\r
+  OUT SHELL_FILE_HANDLE *FileHandle,\r
   IN UINT64 OpenMode\r
   );\r
 \r
@@ -640,10 +640,10 @@ EFI_STATUS
   according to the rules specified in UEFI Shell 2.0 spec section 3.7.1. Each\r
   matching file has an EFI_SHELL_FILE_INFO structure created in a linked list.\r
 \r
-  @param[in] Path               A pointer to the path string.\r
-  @param[in] OpenMode           Specifies the mode used to open each file, EFI_FILE_MODE_READ or\r
-                                EFI_FILE_MODE_WRITE.\r
-  @param[in,out] FileList       Points to the start of a list of files opened.\r
+  @param[in] Path                A pointer to the path string.\r
+  @param[in] OpenMode            Specifies the mode used to open each file, EFI_FILE_MODE_READ or\r
+                                 EFI_FILE_MODE_WRITE.\r
+  @param[in, out] FileList       Points to the start of a list of files opened.\r
 \r
   @retval EFI_SUCCESS           Create the file list successfully.\r
   @return                       Can't create the file list.\r
@@ -676,7 +676,7 @@ typedef
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_OPEN_ROOT)(\r
   IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
-  OUT EFI_FILE_HANDLE *FileHandle\r
+  OUT SHELL_FILE_HANDLE *FileHandle\r
   );\r
 \r
 /**\r
@@ -698,7 +698,7 @@ typedef
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_OPEN_ROOT_BY_HANDLE)(\r
   IN EFI_HANDLE DeviceHandle,\r
-  OUT EFI_FILE_HANDLE *FileHandle\r
+  OUT SHELL_FILE_HANDLE *FileHandle\r
   );\r
 \r
 /**\r
@@ -710,9 +710,9 @@ EFI_STATUS
   current position is increased by the number of bytes returned.\r
   If FileHandle is a directory, then an error is returned.\r
 \r
-  @param[in] FileHandle         The opened file handle for read.\r
-  @param[in] ReadSize           On input, the size of Buffer, in bytes. On output, the amount of data read.\r
-  @param[in,out] Buffer         The buffer in which data is read.\r
+  @param[in] FileHandle          The opened file handle for read.\r
+  @param[in] ReadSize            On input, the size of Buffer, in bytes. On output, the amount of data read.\r
+  @param[in, out] Buffer         The buffer in which data is read.\r
 \r
   @retval EFI_SUCCESS           Data was read.\r
   @retval EFI_NO_MEDIA          The device has no media.\r
@@ -723,7 +723,7 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_READ_FILE) (\r
-  IN EFI_FILE_HANDLE FileHandle,\r
+  IN SHELL_FILE_HANDLE FileHandle,\r
   IN OUT UINTN *ReadSize,\r
   IN OUT VOID *Buffer\r
   );\r
@@ -873,7 +873,7 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_SET_FILE_INFO)(\r
-  IN EFI_FILE_HANDLE FileHandle,\r
+  IN SHELL_FILE_HANDLE FileHandle,\r
   IN CONST EFI_FILE_INFO *FileInfo\r
   );\r
 \r
@@ -895,7 +895,7 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_SET_FILE_POSITION)(\r
-  IN EFI_FILE_HANDLE FileHandle,\r
+  IN SHELL_FILE_HANDLE FileHandle,\r
   IN UINT64 Position\r
   );\r
 \r
@@ -929,9 +929,9 @@ EFI_STATUS
 \r
   Direct writes to opened directories are not supported.\r
 \r
-  @param[in] FileHandle             The opened file handle for writing.\r
-  @param[in,out] BufferSize         On input, size of Buffer.\r
-  @param[in] Buffer                 The buffer in which data to write.\r
+  @param[in] FileHandle              The opened file handle for writing.\r
+  @param[in, out] BufferSize         On input, size of Buffer.\r
+  @param[in] Buffer                  The buffer in which data to write.\r
 \r
   @retval EFI_SUCCESS               Data was written.\r
   @retval EFI_UNSUPPORTED           Writes to open directory are not supported.\r
@@ -945,7 +945,7 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_WRITE_FILE)(\r
-  IN EFI_FILE_HANDLE            FileHandle,\r
+  IN SHELL_FILE_HANDLE          FileHandle,\r
   IN OUT UINTN                  *BufferSize,\r
   IN VOID                       *Buffer\r
   );\r