]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Application/Shell/FileHandleWrappers.c
ShellPkg: Clean up source files
[mirror_edk2.git] / ShellPkg / Application / Shell / FileHandleWrappers.c
index 63aad69fe89799e038791059d51a07eccbffe4b5..8c62eb58628c26489478d4f4f72224ecf5bf85ea 100644 (file)
 #define MEM_WRITE_REALLOC_OVERHEAD 1024\r
 \r
 /**\r
-  File style interface for console (Open).  \r
-  \r
+  File style interface for console (Open).\r
+\r
   @param[in] This       Ignored.\r
   @param[out] NewHandle Ignored.\r
   @param[in] FileName   Ignored.\r
   @param[in] OpenMode   Ignored.\r
   @param[in] Attributes Ignored.\r
-  \r
+\r
   @retval EFI_NOT_FOUND\r
 **/\r
 EFI_STATUS\r
@@ -46,9 +46,9 @@ FileInterfaceOpenNotFound(
 \r
 /**\r
   File style interface for console (Close, Delete, & Flush)\r
-  \r
+\r
   @param[in] This       Ignored.\r
-  \r
+\r
   @retval EFI_SUCCESS\r
 **/\r
 EFI_STATUS\r
@@ -65,7 +65,7 @@ FileInterfaceNopGeneric(
 \r
   @param[in] This       Ignored.\r
   @param[out] Position  Ignored.\r
-  \r
+\r
   @retval EFI_UNSUPPORTED\r
 **/\r
 EFI_STATUS\r
@@ -80,10 +80,10 @@ FileInterfaceNopGetPosition(
 \r
 /**\r
   File style interface for console (SetPosition).\r
-  \r
+\r
   @param[in] This       Ignored.\r
   @param[in] Position   Ignored.\r
-  \r
+\r
   @retval EFI_UNSUPPORTED\r
 **/\r
 EFI_STATUS\r
@@ -98,12 +98,12 @@ FileInterfaceNopSetPosition(
 \r
 /**\r
   File style interface for console (GetInfo).\r
-  \r
+\r
   @param[in] This              Ignored.\r
   @param[in] InformationType   Ignored.\r
   @param[in, out] BufferSize   Ignored.\r
   @param[out] Buffer           Ignored.\r
-  \r
+\r
   @retval EFI_UNSUPPORTED\r
 **/\r
 EFI_STATUS\r
@@ -120,12 +120,12 @@ FileInterfaceNopGetInfo(
 \r
 /**\r
   File style interface for console (SetInfo).\r
-  \r
+\r
   @param[in] This       Ignored.\r
   @param[in] InformationType   Ignored.\r
   @param[in] BufferSize Ignored.\r
   @param[in] Buffer     Ignored.\r
-  \r
+\r
   @retval EFI_UNSUPPORTED\r
 **/\r
 EFI_STATUS\r
@@ -144,11 +144,11 @@ FileInterfaceNopSetInfo(
   File style interface for StdOut (Write).\r
 \r
   Writes data to the screen.\r
-  \r
+\r
   @param[in] This              The pointer to the EFI_FILE_PROTOCOL object.\r
   @param[in, out] BufferSize   Size in bytes of Buffer.\r
   @param[in] Buffer            The pointer to the buffer to write.\r
-  \r
+\r
   @retval EFI_UNSUPPORTED No output console is supported.\r
   @return A return value from gST->ConOut->OutputString.\r
 **/\r
@@ -171,11 +171,11 @@ FileInterfaceStdOutWrite(
 \r
 /**\r
   File style interface for StdIn (Write).\r
-  \r
+\r
   @param[in] This            Ignored.\r
   @param[in, out] BufferSize Ignored.\r
   @param[in] Buffer          Ignored.\r
-  \r
+\r
   @retval EFI_UNSUPPORTED\r
 **/\r
 EFI_STATUS\r
@@ -193,11 +193,11 @@ FileInterfaceStdInWrite(
   File style interface for console StdErr (Write).\r
 \r
   Writes error to the error output.\r
-  \r
+\r
   @param[in] This              The pointer to the EFI_FILE_PROTOCOL object.\r
   @param[in, out] BufferSize   Size in bytes of Buffer.\r
   @param[in] Buffer            The pointer to the buffer to write.\r
-  \r
+\r
   @return A return value from gST->StdErr->OutputString.\r
 **/\r
 EFI_STATUS\r
@@ -213,11 +213,11 @@ FileInterfaceStdErrWrite(
 \r
 /**\r
   File style interface for console StdOut (Read).\r
-  \r
+\r
   @param[in] This              Ignored.\r
   @param[in, out] BufferSize   Ignored.\r
   @param[out] Buffer           Ignored.\r
-  \r
+\r
   @retval EFI_UNSUPPORTED\r
 **/\r
 EFI_STATUS\r
@@ -233,11 +233,11 @@ FileInterfaceStdOutRead(
 \r
 /**\r
   File style interface for console StdErr (Read).\r
-  \r
+\r
   @param[in] This              Ignored.\r
   @param[in, out] BufferSize   Ignored.\r
   @param[out] Buffer           Ignored.\r
-  \r
+\r
   @retval EFI_UNSUPPORTED Always.\r
 **/\r
 EFI_STATUS\r
@@ -253,11 +253,11 @@ FileInterfaceStdErrRead(
 \r
 /**\r
   File style interface for NUL file (Read).\r
-  \r
+\r
   @param[in] This              Ignored.\r
   @param[in, out] BufferSize   Poiner to 0 upon return.\r
   @param[out] Buffer           Ignored.\r
-  \r
+\r
   @retval EFI_SUCCESS Always.\r
 **/\r
 EFI_STATUS\r
@@ -274,11 +274,11 @@ FileInterfaceNulRead(
 \r
 /**\r
   File style interface for NUL file (Write).\r
-  \r
+\r
   @param[in] This              Ignored.\r
   @param[in, out] BufferSize   Ignored.\r
   @param[in] Buffer            Ignored.\r
-  \r
+\r
   @retval EFI_SUCCESS\r
 **/\r
 EFI_STATUS\r
@@ -304,7 +304,7 @@ FileInterfaceNulWrite(
 EFI_STATUS\r
 CreateTabCompletionList (\r
   IN CONST CHAR16             *InputString,\r
-  IN CONST UINTN              StringLen, \r
+  IN CONST UINTN              StringLen,\r
   IN CONST UINTN              BufferSize,\r
   IN OUT EFI_SHELL_FILE_INFO  **TabCompletionList,\r
   IN OUT   UINTN              *TabUpdatePos\r
@@ -1025,9 +1025,9 @@ typedef struct {
   File style interface for Environment Variable (Close).\r
 \r
   Frees the memory for this object.\r
-  \r
+\r
   @param[in] This       The pointer to the EFI_FILE_PROTOCOL object.\r
-  \r
+\r
   @retval EFI_SUCCESS\r
 **/\r
 EFI_STATUS\r
@@ -1043,8 +1043,8 @@ FileInterfaceEnvClose(
   UINTN       TotalSize;\r
 \r
   //\r
-  // Most if not all UEFI commands will have an '\r\n' at the end of any output. \r
-  // Since the output was redirected to a variable, it does not make sense to \r
+  // Most if not all UEFI commands will have an '\r\n' at the end of any output.\r
+  // Since the output was redirected to a variable, it does not make sense to\r
   // keep this.  So, before closing, strip the trailing '\r\n' from the variable\r
   // if it exists.\r
   //\r
@@ -1063,12 +1063,12 @@ FileInterfaceEnvClose(
     NewBuffer = AllocateZeroPool (TotalSize);\r
     if (NewBuffer == NULL) {\r
       return EFI_OUT_OF_RESOURCES;\r
-    }  \r
+    }\r
     Status = SHELL_GET_ENVIRONMENT_VARIABLE(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, &NewSize, NewBuffer);\r
   }\r
-  \r
+\r
   if (!EFI_ERROR(Status) && NewBuffer != NULL) {\r
-    \r
+\r
     if (TotalSize / sizeof (CHAR16) >= 3) {\r
       if ( (((CHAR16*)NewBuffer)[TotalSize / sizeof (CHAR16) - 2] == CHAR_LINEFEED) &&\r
            (((CHAR16*)NewBuffer)[TotalSize / sizeof (CHAR16) - 3] == CHAR_CARRIAGE_RETURN)\r
@@ -1112,8 +1112,8 @@ FileInterfaceEnvClose(
         }\r
       }\r
     }\r
-  } \r
-  \r
+  }\r
+\r
   SHELL_FREE_NON_NULL(NewBuffer);\r
   FreePool((EFI_FILE_PROTOCOL_ENVIRONMENT*)This);\r
   return (Status);\r
@@ -1121,9 +1121,9 @@ FileInterfaceEnvClose(
 \r
 /**\r
   File style interface for Environment Variable (Delete).\r
-  \r
+\r
   @param[in] This       The pointer to the EFI_FILE_PROTOCOL object.\r
-  \r
+\r
   @retval The return value from FileInterfaceEnvClose().\r
 **/\r
 EFI_STATUS\r
@@ -1138,11 +1138,11 @@ FileInterfaceEnvDelete(
 \r
 /**\r
   File style interface for Environment Variable (Read).\r
-  \r
+\r
   @param[in] This              The pointer to the EFI_FILE_PROTOCOL object.\r
   @param[in, out] BufferSize   Size in bytes of Buffer.\r
   @param[out] Buffer           The pointer to the buffer to fill.\r
-  \r
+\r
   @retval EFI_SUCCESS   The data was read.\r
 **/\r
 EFI_STATUS\r
@@ -1162,11 +1162,11 @@ FileInterfaceEnvRead(
 /**\r
   File style interface for Volatile Environment Variable (Write).\r
   This function also caches the environment variable into gShellEnvVarList.\r
-  \r
+\r
   @param[in] This              The pointer to the EFI_FILE_PROTOCOL object.\r
   @param[in, out] BufferSize   Size in bytes of Buffer.\r
   @param[in] Buffer            The pointer to the buffer to write.\r
-  \r
+\r
   @retval EFI_SUCCESS             The data was successfully write to variable.\r
   @retval SHELL_OUT_OF_RESOURCES  A memory allocation failed.\r
 **/\r
@@ -1239,11 +1239,11 @@ FileInterfaceEnvVolWrite(
 /**\r
   File style interface for Non Volatile Environment Variable (Write).\r
   This function also caches the environment variable into gShellEnvVarList.\r
-  \r
+\r
   @param[in] This              The pointer to the EFI_FILE_PROTOCOL object.\r
   @param[in, out] BufferSize   Size in bytes of Buffer.\r
   @param[in] Buffer            The pointer to the buffer to write.\r
-  \r
+\r
   @retval EFI_SUCCESS             The data was successfully write to variable.\r
   @retval SHELL_OUT_OF_RESOURCES  A memory allocation failed.\r
 **/\r
@@ -1362,7 +1362,7 @@ CreateFileInterfaceEnv(
   EnvFileInterface->Flush       = FileInterfaceNopGeneric;\r
   EnvFileInterface->Delete      = FileInterfaceEnvDelete;\r
   EnvFileInterface->Read        = FileInterfaceEnvRead;\r
-  \r
+\r
   CopyMem(EnvFileInterface->Name, EnvName, EnvNameSize);\r
 \r
   //\r
@@ -1513,10 +1513,10 @@ typedef struct {
 \r
 /**\r
   File style interface for Mem (SetPosition).\r
-  \r
+\r
   @param[in] This       The pointer to the EFI_FILE_PROTOCOL object.\r
   @param[out] Position  The position to set.\r
-  \r
+\r
   @retval EFI_SUCCESS             The position was successfully changed.\r
   @retval EFI_INVALID_PARAMETER   The Position was invalid.\r
 **/\r
@@ -1537,12 +1537,12 @@ FileInterfaceMemSetPosition(
 \r
 /**\r
   File style interface for Mem (GetPosition).\r
-  \r
+\r
   @param[in] This       The pointer to the EFI_FILE_PROTOCOL object.\r
   @param[out] Position  The pointer to the position.\r
-  \r
+\r
   @retval EFI_SUCCESS   The position was retrieved.\r
-**/ \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 FileInterfaceMemGetPosition(\r
@@ -1604,11 +1604,11 @@ FileInterfaceMemGetInfo(
 \r
 /**\r
   File style interface for Mem (Write).\r
-  \r
+\r
   @param[in] This              The pointer to the EFI_FILE_PROTOCOL object.\r
   @param[in, out] BufferSize   Size in bytes of Buffer.\r
   @param[in] Buffer            The pointer to the buffer to write.\r
-  \r
+\r
   @retval EFI_OUT_OF_RESOURCES The operation failed due to lack of resources.\r
   @retval EFI_SUCCESS          The data was written.\r
 **/\r
@@ -1659,11 +1659,11 @@ FileInterfaceMemWrite(
 \r
 /**\r
   File style interface for Mem (Read).\r
-  \r
+\r
   @param[in] This              The pointer to the EFI_FILE_PROTOCOL object.\r
   @param[in, out] BufferSize   Size in bytes of Buffer.\r
   @param[in] Buffer            The pointer to the buffer to fill.\r
-  \r
+\r
   @retval EFI_SUCCESS   The data was read.\r
 **/\r
 EFI_STATUS\r
@@ -1689,11 +1689,11 @@ FileInterfaceMemRead(
   File style interface for Mem (Close).\r
 \r
   Frees all memory associated with this object.\r
-  \r
+\r
   @param[in] This       The pointer to the EFI_FILE_PROTOCOL object.\r
-  \r
+\r
   @retval EFI_SUCCESS   The 'file' was closed.\r
-**/ \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 FileInterfaceMemClose(\r
@@ -1784,7 +1784,7 @@ typedef struct {
 \r
   @param  This            Protocol instance pointer.\r
   @param  Position        Byte position from the start of the file.\r
-                          \r
+\r
   @retval EFI_SUCCESS     Data was written.\r
   @retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open.\r
 \r
@@ -1804,7 +1804,7 @@ FileInterfaceFileSetPosition(
 \r
   @param  This            Protocol instance pointer.\r
   @param  Position        Byte position from the start of the file.\r
-                          \r
+\r
   @retval EFI_SUCCESS     Data was written.\r
   @retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open..\r
 \r
@@ -1999,7 +1999,7 @@ FileInterfaceFileOpen (
   Close and delete the file handle.\r
 \r
   @param  This                     Protocol instance pointer.\r
-                                   \r
+\r
   @retval EFI_SUCCESS              The device was opened.\r
   @retval EFI_WARN_DELETE_FAILURE  The handle was closed but the file was not deleted.\r
 \r
@@ -2018,9 +2018,9 @@ FileInterfaceFileDelete(
 \r
 /**\r
   File style interface for File (Close).\r
-  \r
+\r
   @param[in] This       The pointer to the EFI_FILE_PROTOCOL object.\r
-  \r
+\r
   @retval EFI_SUCCESS   The file was closed.\r
 **/\r
 EFI_STATUS\r
@@ -2038,13 +2038,13 @@ FileInterfaceFileClose(
 /**\r
   File style interface for File (Write).\r
 \r
-  If the file was opened with ASCII mode the data will be processed through \r
+  If the file was opened with ASCII mode the data will be processed through\r
   AsciiSPrint before writing.\r
-  \r
+\r
   @param[in] This              The pointer to the EFI_FILE_PROTOCOL object.\r
   @param[in, out] BufferSize   Size in bytes of Buffer.\r
   @param[in] Buffer            The pointer to the buffer to write.\r
-  \r
+\r
   @retval EFI_SUCCESS   The data was written.\r
 **/\r
 EFI_STATUS\r
@@ -2081,10 +2081,10 @@ FileInterfaceFileWrite(
 \r
   This will create a new EFI_FILE_PROTOCOL identical to the Templace\r
   except that the new one has Unicode and Ascii knowledge.\r
-  \r
+\r
   @param[in] Template   A pointer to the EFI_FILE_PROTOCOL object.\r
   @param[in] Unicode    TRUE for UCS-2, FALSE for ASCII.\r
-  \r
+\r
   @return a new EFI_FILE_PROTOCOL object to be used instead of the template.\r
 **/\r
 EFI_FILE_PROTOCOL*\r