]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Include/Library/FileHandleLib.h
fixed license header / copyright date on all files.
[mirror_edk2.git] / ShellPkg / Include / Library / FileHandleLib.h
index b265d85bb9bf790b06135753c8e08bb18c34466b..1a942a1ccfdbd26b3bdefbbf2d22d36ce4a25a80 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   Provides interface to EFI_FILE_HANDLE functionality.\r
 \r
-  Copyright (c) 2009, Intel Corporation<BR>\r
-  All rights reserved. This program and the accompanying materials\r
+  Copyright (c) 2009-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
   http://opensource.org/licenses/bsd-license.php\r
@@ -22,13 +22,13 @@ enum {
 };\r
 \r
 /**\r
-  This function will retrieve the information about the file for the handle \r
+  This function will retrieve the information about the file for the handle\r
   specified and store it in allocated pool memory.\r
 \r
-  This function allocates a buffer to store the file's information. It is the \r
+  This function allocates a buffer to store the file's information. It is the\r
   caller's responsibility to free the buffer.\r
 \r
-  @param  FileHandle  The file handle of the file for which information is \r
+  @param  FileHandle  The file handle of the file for which information is\r
                       being requested.\r
 \r
   @retval NULL        information could not be retrieved.\r
@@ -42,15 +42,16 @@ FileHandleGetInfo (
   );\r
 \r
 /**\r
-  This function will set the information about the file for the opened handle \r
+  This function will set the information about the file for the opened handle\r
   specified.\r
 \r
-  @param  FileHandle            The file handle of the file for which information \r
+  @param  FileHandle            The file handle of the file for which information\r
                                 is being set.\r
 \r
   @param  FileInfo              The information to set.\r
 \r
   @retval EFI_SUCCESS                  The information was set.\r
+  @retval EFI_INVALID_PARAMETER A Parameter was out of range or invalid.\r
   @retval EFI_UNSUPPORTED       The FileHandle does not support FileInfo.\r
   @retval EFI_NO_MEDIA               The device has no medium.\r
   @retval EFI_DEVICE_ERROR         The device reported an error.\r
@@ -69,21 +70,21 @@ FileHandleSetInfo (
 /**\r
   This function reads information from an opened file.\r
 \r
-  If FileHandle is not a directory, the function reads the requested number of \r
-  bytes from the file at the file's current position and returns them in Buffer. \r
+  If FileHandle is not a directory, the function reads the requested number of\r
+  bytes from the file at the file's current position and returns them in Buffer.\r
   If the read goes beyond the end of the file, the read length is truncated to the\r
-  end of the file. The file's current position is increased by the number of bytes \r
-  returned.  If FileHandle is a directory, the function reads the directory entry \r
-  at the file's current position and returns the entry in Buffer. If the Buffer \r
-  is not large enough to hold the current directory entry, then \r
-  EFI_BUFFER_TOO_SMALL is returned and the current file position is not updated. \r
-  BufferSize is set to be the size of the buffer needed to read the entry. On \r
-  success, the current position is updated to the next directory entry. If there \r
-  are no more directory entries, the read returns a zero-length buffer. \r
+  end of the file. The file's current position is increased by the number of bytes\r
+  returned.  If FileHandle is a directory, the function reads the directory entry\r
+  at the file's current position and returns the entry in Buffer. If the Buffer\r
+  is not large enough to hold the current directory entry, then\r
+  EFI_BUFFER_TOO_SMALL is returned and the current file position is not updated.\r
+  BufferSize is set to be the size of the buffer needed to read the entry. On\r
+  success, the current position is updated to the next directory entry. If there\r
+  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
-  @param BufferSize             On input the size of buffer in bytes.  On return \r
+  @param BufferSize             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
@@ -91,7 +92,7 @@ FileHandleSetInfo (
   @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_BUFFER_TO_SMALL    Buffer is too small. ReadSize contains required\r
                                 size.\r
 \r
 **/\r
@@ -106,11 +107,11 @@ FileHandleRead(
 /**\r
   Write data to a file.\r
 \r
-  This function writes the specified number of bytes to the file at the current \r
-  file position. The current file position is advanced the actual number of bytes \r
-  written, which is returned in BufferSize. Partial writes only occur when there \r
-  has been a data error during the write attempt (such as "volume space full"). \r
-  The file is automatically grown to hold the data if required. Direct writes to \r
+  This function writes the specified number of bytes to the file at the current\r
+  file position. The current file position is advanced the actual number of bytes\r
+  written, which is returned in BufferSize. Partial writes only occur when there\r
+  has been a data error during the write attempt (such as "volume space full").\r
+  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
@@ -135,11 +136,11 @@ FileHandleWrite(
   IN VOID                       *Buffer\r
   );\r
 \r
-/** \r
+/**\r
   Close an open file handle.\r
 \r
-  This function closes a specified file handle. All "dirty" cached file data is \r
-  flushed to the device, and the file is closed. In all cases the handle is \r
+  This function closes a specified file handle. All "dirty" cached file data is\r
+  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
@@ -156,13 +157,13 @@ FileHandleClose (
   Delete a file and close the handle.\r
 \r
   This function closes and deletes a file. In all cases the file handle is closed.\r
-  If the file cannot be deleted, the warning code EFI_WARN_DELETE_FAILURE is \r
+  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
 \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
+  @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
@@ -175,19 +176,19 @@ FileHandleDelete (
 /**\r
   Set the current position in a file.\r
 \r
-  This function sets the current file position for the handle to the position \r
+  This function sets the current file position for the handle to the position\r
   supplied. With the exception of seeking to position 0xFFFFFFFFFFFFFFFF, only\r
-  absolute positioning is supported, and seeking past the end of the file is \r
-  allowed (a subsequent write would grow the file). Seeking to position \r
+  absolute positioning is supported, and seeking past the end of the file is\r
+  allowed (a subsequent write would grow the file). Seeking to position\r
   0xFFFFFFFFFFFFFFFF causes the current position to be set to the end of the file.\r
-  If FileHandle is a directory, the only position that may be set is zero. This \r
+  If FileHandle is a directory, the only position that may be set is zero. This\r
   has the effect of starting the read process of the directory entries over.\r
 \r
   @param FileHandle             The file handle on which the position is being set\r
   @param Position               Byte position from begining of file\r
 \r
   @retval EFI_SUCCESS           Operation completed sucessfully.\r
-  @retval EFI_UNSUPPORTED       the seek request for non-zero is not valid on \r
+  @retval EFI_UNSUPPORTED       the seek request for non-zero is not valid on\r
                                 directories.\r
   @retval INVALID_PARAMETER     One of the parameters has an invalid value.\r
 **/\r
@@ -198,11 +199,11 @@ FileHandleSetPosition (
   IN UINT64            Position\r
   );\r
 \r
-/** \r
+/**\r
   Gets a file's current position.\r
 \r
-  This function retrieves the current file position for the file handle. For \r
-  directories, the current file position has no meaning outside of the file \r
+  This function retrieves the current file position for the file handle. For\r
+  directories, the current file position has no meaning outside of the file\r
   system driver and as such the operation is not supported. An error is returned\r
   if FileHandle is a directory.\r
 \r
@@ -221,7 +222,7 @@ FileHandleGetPosition (
   );\r
 /**\r
   Flushes data on a file.\r
-  \r
+\r
   This function flushes all modified data associated with a file to a device.\r
 \r
   @param FileHandle             The file handle on which to flush data.\r
@@ -262,8 +263,8 @@ FileHandleIsDirectory (
 /**\r
   Retrieves the first file from a directory.\r
 \r
-  This function opens a directory and gets the first file's info in the \r
-  directory. Caller can use FileHandleFindNextFile() to get other files.  When \r
+  This function opens a directory and gets the first file's info in the\r
+  directory. Caller can use FileHandleFindNextFile() to get other files.  When\r
   complete the caller is responsible for calling FreePool() on *Buffer.\r
 \r
   @param DirHandle              The file handle of the directory to search\r
@@ -286,12 +287,12 @@ FileHandleFindFirstFile (
 /**\r
   Retrieves the next file in a directory.\r
 \r
-  To use this function, caller must call the FileHandleFindFirstFile() to get the \r
-  first file, and then use this function get other files. This function can be \r
-  called for several times to get each file's information in the directory. If \r
-  the call of FileHandleFindNextFile() got the last file in the directory, the next \r
-  call of this function has no file to get. *NoFile will be set to TRUE and the \r
-  Buffer memory will be automatically freed. \r
+  To use this function, caller must call the FileHandleFindFirstFile() to get the\r
+  first file, and then use this function get other files. This function can be\r
+  called for several times to get each file's information in the directory. If\r
+  the call of FileHandleFindNextFile() got the last file in the directory, the next\r
+  call of this function has no file to get. *NoFile will be set to TRUE and the\r
+  Buffer memory will be automatically freed.\r
 \r
   @param DirHandle              the file handle of the directory\r
   @param Buffer                                    pointer to buffer for file's information\r
@@ -316,7 +317,7 @@ FileHandleFindNextFile(
   If FileHandle is NULL then ASSERT()\r
   If Size is NULL then ASSERT()\r
 \r
-  This function extracts the file size info from the FileHandle's EFI_FILE_INFO \r
+  This function extracts the file size info from the FileHandle's EFI_FILE_INFO\r
   data.\r
 \r
   @param FileHandle             The file handle from which size is retrieved.\r
@@ -333,11 +334,11 @@ FileHandleGetSize (
   );\r
 \r
 /**\r
-  Function to get a full filename given a EFI_FILE_HANDLE somewhere lower on the \r
+  Function to get a full filename given a EFI_FILE_HANDLE somewhere lower on the\r
   directory 'stack'.\r
 \r
   @param[in] Handle             Handle to the Directory or File to create path to.\r
-  @param[out] FullFileName      Pointer to pointer to generated full file name.  It \r
+  @param[out] FullFileName      Pointer to pointer to generated full file name.  It\r
                                 is the responsibility of the caller to free this memory\r
                                 with a call to FreePool().\r
   @retval EFI_SUCCESS           the operation was sucessful and the FullFileName is valid.\r
@@ -355,23 +356,23 @@ FileHandleGetFileName (
 /**\r
   Function to read a single line (up to but not including the \n) from a file.\r
 \r
-  If the position upon start is 0, then the Ascii Boolean will be set.  This should be \r
+  If the position upon start is 0, then the Ascii Boolean will be set.  This should be\r
   maintained and not changed for all operations with the same file.\r
 \r
   @param[in]      Handle        FileHandle to read from\r
   @param[in,out]  Buffer        pointer to buffer to read into\r
   @param[in,out]  Size          pointer to number of bytes in buffer\r
   @param[in]      Truncate      if TRUE then allows for truncation of the line to fit.\r
-                                if FALSE will reset the position to the begining of the \r
+                                if FALSE will reset the position to the begining of the\r
                                 line if the buffer is not large enough.\r
-  @param[in,out]  Ascii         Boolean value for indicating whether the file is \r
+  @param[in,out]  Ascii         Boolean value for indicating whether the file is\r
                                 Ascii (TRUE) or UCS2 (FALSE);\r
 \r
-  @retval EFI_SUCCESS           the operation was sucessful.  the line is stored in \r
+  @retval EFI_SUCCESS           the operation was sucessful.  the line is stored in\r
                                 Buffer.\r
   @retval EFI_INVALID_PARAMETER Handle was NULL.\r
   @retval EFI_INVALID_PARAMETER Size was NULL.\r
-  @retval EFI_BUFFER_TOO_SMALL  Size was not enough space to store the line.  \r
+  @retval EFI_BUFFER_TOO_SMALL  Size was not enough space to store the line.\r
                                 Size was updated to minimum space required.\r
   @sa FileHandleRead\r
 **/\r
@@ -386,10 +387,10 @@ FileHandleReadLine(
   );\r
 \r
 /**\r
-  Function to read a single line from a file. The \n is not included in the returned \r
+  Function to read a single line from a file. The \n is not included in the returned\r
   buffer.  The returned buffer must be callee freed.\r
 \r
-  If the position upon start is 0, then the Ascii Boolean will be set.  This should be \r
+  If the position upon start is 0, then the Ascii Boolean will be set.  This should be\r
   maintained and not changed for all operations with the same file.\r
 \r
   @param[in]      Handle        FileHandle to read from.\r
@@ -412,7 +413,7 @@ FileHandleReturnLine(
   If Handle is NULL, ASSERT.\r
 \r
   @param[in]     Handle         FileHandle to write to\r
-  @param[in]     Buffer         Buffer to write, if NULL the function will \r
+  @param[in]     Buffer         Buffer to write, if NULL the function will\r
                                 take no action and return EFI_SUCCESS.\r
 \r
   @retval  EFI_SUCCESS          the data was written.\r