]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/Include/Library/EfiFileLib.h
EmbeddedPkg: Fix various typos
[mirror_edk2.git] / EmbeddedPkg / Include / Library / EfiFileLib.h
index d50a2f367935493ce44954ade9d1aee4b7f92d7c..0544b6e2006d51f7a022a395aa2c96787d9096a9 100644 (file)
@@ -1,24 +1,18 @@
 /** @file\r
-  Library functions that perform file IO. Memory buffer, file system, and \r
-  fimrware volume operations are supproted. \r
+  Library functions that perform file IO. Memory buffer, file system, and\r
+  firmware volume operations are supported.\r
 \r
   Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
   Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
 \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
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
   Basic support for opening files on different device types. The device string\r
   is in the form of DevType:Path. Current DevType is required as there is no\r
   current mounted device concept of current working directory concept implement\r
   by this library.\r
 \r
-  Device names are case insensative and only check the leading characters for \r
+  Device names are case insensitive and only check the leading characters for\r
   unique matches. Thus the following are all the same:\r
     LoadFile0:\r
     l0:\r
@@ -30,9 +24,9 @@
   l1:          - EFI LoadFile device one.\r
   B0:          - EFI BlockIo zero.\r
   fs3:         - EFI Simple File System device 3\r
-  Fv2:         - EFI Firmware VOlume device 2\r
+  Fv2:         - EFI Firmware Volume device 2\r
   1.2.3.4:name - TFTP IP and file name\r
-  \r
+\r
 **/\r
 \r
 #ifndef __EFI_FILE_LIB_H__\r
@@ -50,7 +44,7 @@
 \r
 #define MAX_PATHNAME    0x200\r
 \r
-/// Type of the file that has been opened \r
+/// Type of the file that has been opened\r
 typedef enum {\r
   EfiOpenLoadFile,\r
   EfiOpenMemoryBuffer,\r
@@ -64,11 +58,11 @@ typedef enum {
 \r
 /// Public information about the open file\r
 typedef struct {\r
-  UINTN                         Version;          // Common information        \r
+  UINTN                         Version;          // Common information\r
   EFI_OPEN_FILE_TYPE            Type;\r
   EFI_DEVICE_PATH_PROTOCOL      *DevicePath;\r
   EFI_STATUS                    LastError;\r
-  EFI_HANDLE                    EfiHandle;        \r
+  EFI_HANDLE                    EfiHandle;\r
   CHAR8                         *DeviceName;\r
   CHAR8                         *FileName;\r
 \r
@@ -76,33 +70,34 @@ typedef struct {
   UINT64                        MaxPosition;\r
 \r
   UINTN                         BaseOffset;       // Base offset for hexdump command\r
\r
+\r
   UINTN                         Size;             // Valid for all types other than l#:\r
   UINT8                         *Buffer;          // Information valid for A#:\r
 \r
-  EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;              // Information valid for Fv#: \r
-  EFI_GUID                      FvNameGuid;       \r
-  EFI_SECTION_TYPE              FvSectionType;    \r
-  EFI_FV_FILETYPE               FvType;           \r
-  EFI_FV_FILE_ATTRIBUTES        FvAttributes;     \r
+  EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;              // Information valid for Fv#:\r
+  EFI_GUID                      FvNameGuid;\r
+  EFI_SECTION_TYPE              FvSectionType;\r
+  EFI_FV_FILETYPE               FvType;\r
+  EFI_FV_FILE_ATTRIBUTES        FvAttributes;\r
 \r
-  EFI_PHYSICAL_ADDRESS          FvStart;          \r
-  UINTN                         FvSize;      \r
+  EFI_PHYSICAL_ADDRESS          FvStart;\r
+  UINTN                         FvSize;\r
   UINTN                         FvHeaderSize;\r
 \r
   EFI_FILE                      *FsFileHandle;    // Information valid for Fs#:\r
   EFI_FILE_SYSTEM_INFO          *FsInfo;\r
   EFI_FILE_INFO                 *FsFileInfo;\r
-  EFI_BLOCK_IO_MEDIA            FsBlockIoMedia;   // Information valid for Fs#: or B#:\r
+  EFI_BLOCK_IO_MEDIA            *FsBlockIoMedia;  // Information valid for Fs#: or B#:\r
+  EFI_BLOCK_IO_PROTOCOL         *FsBlockIo;       // Information valid for Fs#: or B#:\r
 \r
   UINTN                         DiskOffset;       // Information valid for B#:\r
 \r
   EFI_LOAD_FILE_PROTOCOL        *LoadFile;        // Information valid for l#:\r
-  \r
+\r
   EFI_IP_ADDRESS                ServerIp;         // Information valid for t:\r
   BOOLEAN                       IsDirty;\r
   BOOLEAN                       IsBufferValid;\r
-                           \r
+\r
 } EFI_OPEN_FILE;\r
 \r
 \r
@@ -116,17 +111,17 @@ typedef enum {
 \r
 \r
 /**\r
-  Open a device named by PathName. The PathName includes a device name and \r
-  path seperated by a :. See file header for more details on the PathName \r
+  Open a device named by PathName. The PathName includes a device name and\r
+  path separated by a :. See file header for more details on the PathName\r
   syntax. There is no checking to prevent a file from being opened more than\r
-  one type. \r
+  one type.\r
 \r
   SectionType is only used to open an FV. Each file in an FV contains multiple\r
-  secitons and only the SectionType section is opened. \r
+  sections and only the SectionType section is opened.\r
 \r
   For any file that is opened with EfiOpen() must be closed with EfiClose().\r
 \r
-  @param  PathName    Path to parse to open \r
+  @param  PathName    Path to parse to open\r
   @param  OpenMode    Same as EFI_FILE.Open()\r
   @param  SectionType Section in FV to open.\r
 \r
@@ -181,9 +176,9 @@ EfiClose (
 \r
 \r
 /**\r
-  Return the size of the file represented by Stream. Also return the current \r
+  Return the size of the file represented by Stream. Also return the current\r
   Seek position. Opening a file will enable a valid file size to be returned.\r
-  LoadFile is an exception as a load file size is set to zero. \r
+  LoadFile is an exception as a load file size is set to zero.\r
 \r
   @param  Stream    Open File Handle\r
 \r
@@ -198,22 +193,22 @@ EfiTell (
 \r
 \r
 /**\r
-  Seek to the Offset locaiton in the file. LoadFile and FV device types do\r
-  not support EfiSeek(). It is not possible to grow the file size using \r
+  Seek to the Offset location in the file. LoadFile and FV device types do\r
+  not support EfiSeek(). It is not possible to grow the file size using\r
   EfiSeek().\r
-  \r
+\r
   SeekType defines how use Offset to calculate the new file position:\r
   EfiSeekStart  : Position = Offset\r
   EfiSeekCurrent: Position is Offset bytes from the current position\r
   EfiSeekEnd    : Only supported if Offset is zero to seek to end of file.\r
 \r
   @param  Stream    Open File Handle\r
-  @param  Offset    Offset to seek too. \r
+  @param  Offset    Offset to seek too.\r
   @param  SeekType  Type of seek to perform\r
 \r
 \r
   @return EFI_INVALID_PARAMETER  Stream is not an Open File\r
-  @return EFI_UNSUPPORTED        LoadFile and FV doe not support Seek\r
+  @return EFI_UNSUPPORTED        LoadFile and FV does not support Seek\r
   @return EFI_NOT_FOUND          Seek past the end of the file.\r
   @return EFI_SUCCESS            Steam closed\r
 \r
@@ -227,11 +222,11 @@ EfiSeek (
 \r
 \r
 /**\r
-  Read BufferSize bytes from the current locaiton in the file. For load file\r
-  and FV case you must read the entire file. \r
+  Read BufferSize bytes from the current location in the file. For load file\r
+  and FV case you must read the entire file.\r
 \r
   @param  Stream      Open File Handle\r
-  @param  Buffer      Caller allocated buffer. \r
+  @param  Buffer      Caller allocated buffer.\r
   @param  BufferSize  Size of buffer in bytes.\r
 \r
 \r
@@ -252,13 +247,13 @@ EfiRead (
 \r
 /**\r
   Read the entire file into a buffer. This routine allocates the buffer and\r
-  returns it to the user full of the read data. \r
+  returns it to the user full of the read data.\r
 \r
-  This is very useful for load flie where it's hard to know how big the buffer\r
+  This is very useful for load file where it's hard to know how big the buffer\r
   must be.\r
 \r
   @param  Stream      Open File Handle\r
-  @param  Buffer      Pointer to buffer to return. \r
+  @param  Buffer      Pointer to buffer to return.\r
   @param  BufferSize  Pointer to Size of buffer return..\r
 \r
 \r
@@ -278,10 +273,10 @@ EfiReadAllocatePool (
 \r
 \r
 /**\r
-  Write data back to the file. \r
+  Write data back to the file.\r
 \r
   @param  Stream      Open File Handle\r
-  @param  Buffer      Pointer to buffer to return. \r
+  @param  Buffer      Pointer to buffer to return.\r
   @param  BufferSize  Pointer to Size of buffer return..\r
 \r
 \r
@@ -312,12 +307,12 @@ UINTN
 EfiGetDeviceCounts (\r
   IN  EFI_OPEN_FILE_TYPE     Type\r
   );\r
-  \r
+\r
 \r
 /**\r
-  Set the Curent Working Directory (CWD). If a call is made to EfiOpen () and \r
+  Set the Current Working Directory (CWD). If a call is made to EfiOpen () and\r
   the path does not contain a device name, The CWD is prepended to the path.\r
-  \r
+\r
   @param  Cwd     Current Working Directory to set\r
 \r
 \r
@@ -328,22 +323,22 @@ EfiGetDeviceCounts (
 EFI_STATUS\r
 EfiSetCwd (\r
   IN  CHAR8   *Cwd\r
-  );  \r
+  );\r
 \r
 /**\r
-  Set the Curent Working Directory (CWD). If a call is made to EfiOpen () and \r
+  Set the Current Working Directory (CWD). If a call is made to EfiOpen () and\r
   the path does not contain a device name, The CWD is prepended to the path.\r
-  \r
-  @param  Cwd     Current Working Directory \r
+\r
+  @param  Cwd     Current Working Directory\r
 \r
 \r
   @return NULL    No CWD set\r
   @return 'other' malloc'ed buffer contains CWD.\r
-  \r
+\r
 **/\r
 CHAR8 *\r
 EfiGetCwd (\r
   VOID\r
-  );  \r
+  );\r
 \r
 #endif\r