X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ShellPkg%2FApplication%2FShell%2FShell.h;h=c20ee3a803bf3c871aceee4132caaab8da202b6d;hp=ec32355b6c1a7b73e8aedf4b2603c87048a7d563;hb=a308e0588b3ad87b94611391e9e7a04a8eb05ebf;hpb=8be0ba36fc347bac7199e7dbb8d373ea5e4bf0af diff --git a/ShellPkg/Application/Shell/Shell.h b/ShellPkg/Application/Shell/Shell.h index ec32355b6c..c20ee3a803 100644 --- a/ShellPkg/Application/Shell/Shell.h +++ b/ShellPkg/Application/Shell/Shell.h @@ -1,7 +1,8 @@ /** @file function definitions for internal to shell functions. - Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ (C) Copyright 2014, Hewlett-Packard Development Company, L.P. + Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -19,6 +20,7 @@ #include #include +#include #include #include @@ -44,12 +46,16 @@ #include #include #include +#include +#include #include "ShellParametersProtocol.h" #include "ShellProtocol.h" #include "ShellEnvVar.h" #include "ConsoleLogger.h" #include "ShellManParser.h" +#include "ConsoleWrappers.h" +#include "FileHandleWrappers.h" typedef struct { LIST_ENTRY Link; ///< Standard linked list handler. @@ -66,7 +72,8 @@ typedef struct { UINT32 NoMap:1; ///< Was "-nomap" found on command line. UINT32 NoVersion:1; ///< Was "-noversion" found on command line. UINT32 Delay:1; ///< Was "-delay[:n] found on command line - UINT32 Reserved:8; ///< Extra bits + UINT32 Exit:1; ///< Was "-_exit" found on command line + UINT32 Reserved:7; ///< Extra bits } SHELL_BITS; typedef union { @@ -105,14 +112,53 @@ typedef struct { EFI_SHELL_PARAMETERS_PROTOCOL *OldShellParameters; ///< old shell parameters to reinstall upon exiting. SHELL_PROTOCOL_HANDLE_LIST OldShellList; ///< List of other instances to reinstall when closing. SPLIT_LIST SplitList; ///< List of Splits in FILO stack. - EFI_HANDLE CtrlCNotifyHandle1; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify. - EFI_HANDLE CtrlCNotifyHandle2; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify. - EFI_HANDLE CtrlCNotifyHandle3; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify. - EFI_HANDLE CtrlCNotifyHandle4; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify. + VOID *CtrlCNotifyHandle1; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify. + VOID *CtrlCNotifyHandle2; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify. + VOID *CtrlCNotifyHandle3; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify. + VOID *CtrlCNotifyHandle4; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify. + VOID *CtrlSNotifyHandle1; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify. + VOID *CtrlSNotifyHandle2; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify. + VOID *CtrlSNotifyHandle3; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify. + VOID *CtrlSNotifyHandle4; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify. + BOOLEAN HaltOutput; ///< TRUE to start a CTRL-S halt. } SHELL_INFO; extern SHELL_INFO ShellInfoObject; +typedef enum { + Internal_Command, + Script_File_Name, + Efi_Application, + File_Sys_Change, + Unknown_Invalid +} SHELL_OPERATION_TYPES; + +/** + Converts the command line to it's post-processed form. this replaces variables and alias' per UEFI Shell spec. + + @param[in,out] CmdLine pointer to the command line to update + + @retval EFI_SUCCESS The operation was successful + @retval EFI_OUT_OF_RESOURCES A memory allocation failed. + @return some other error occured +**/ +EFI_STATUS +EFIAPI +ProcessCommandLineToFinal( + IN OUT CHAR16 **CmdLine + ); + +/** + Function to update the shell variable "lasterror". + + @param[in] ErrorCode the error code to put into lasterror +**/ +EFI_STATUS +EFIAPI +SetLastError( + IN CONST SHELL_STATUS ErrorCode + ); + /** Sets all the alias' that were registered with the ShellCommandLib library. @@ -130,8 +176,8 @@ SetBuiltInAlias( loaded image protocol installed on it. the FilePath will point to the device path for the file that was loaded. - @param[in,out] DevPath on a sucessful return the device path to the loaded image - @param[in,out] FilePath on a sucessful return the device path to the file + @param[in, out] DevPath on a sucessful return the device path to the loaded image + @param[in, out] FilePath on a sucessful return the device path to the file @retval EFI_SUCCESS the 2 device paths were sucessfully returned. @return other a error from gBS->HandleProtocol @@ -282,13 +328,19 @@ RunScriptFileHandle ( Function to process a NSH script file. @param[in] ScriptPath Pointer to the script file name (including file system path). + @param[in] Handle the handle of the script file already opened. + @param[in] CmdLine the command line to run. + @param[in] ParamProtocol the shell parameters protocol pointer @retval EFI_SUCCESS the script completed sucessfully **/ EFI_STATUS EFIAPI RunScriptFile ( - IN CONST CHAR16 *ScriptPath + IN CONST CHAR16 *ScriptPath, + IN SHELL_FILE_HANDLE Handle OPTIONAL, + IN CONST CHAR16 *CmdLine, + IN EFI_SHELL_PARAMETERS_PROTOCOL *ParamProtocol );