Shell.h revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
/** @file
function definitions for internal to shell functions.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
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
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _SHELL_INTERNAL_HEADER_
#define _SHELL_INTERNAL_HEADER_
#include <Uefi.h>
#include <ShellBase.h>
#include <Guid/ShellVariableGuid.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/SimpleTextOut.h>
#include <Protocol/EfiShell.h>
#include <Protocol/EfiShellInterface.h>
#include <Protocol/EfiShellEnvironment2.h>
#include <Protocol/EfiShellParameters.h>
#include <Library/UefiApplicationEntryPoint.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/ShellCommandLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/DevicePathLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/ShellLib.h>
#include <Library/PrintLib.h>
#include <Library/HandleParsingLib.h>
#include "ShellParametersProtocol.h"
#include "ShellProtocol.h"
#include "ShellEnvVar.h"
#include "ConsoleLogger.h"
#include "ShellManParser.h"
#include "ConsoleWrappers.h"
typedef struct {
} SPLIT_LIST;
typedef struct {
} SHELL_BITS;
typedef union {
typedef struct {
typedef struct {
typedef struct {
EFI_SHELL_PARAMETERS_PROTOCOL *OldShellParameters; ///< old shell parameters to reinstall upon exiting.
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.
EFI_HANDLE CtrlSNotifyHandle1; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
EFI_HANDLE CtrlSNotifyHandle2; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
EFI_HANDLE CtrlSNotifyHandle3; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
EFI_HANDLE CtrlSNotifyHandle4; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
} SHELL_INFO;
extern SHELL_INFO ShellInfoObject;
/**
Sets all the alias' that were registered with the ShellCommandLib library.
@retval EFI_SUCCESS all init commands were run sucessfully.
**/
);
/**
This function will populate the 2 device path protocol parameters based on the
global gImageHandle. the DevPath will point to the device path for the handle that has
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
@retval EFI_SUCCESS the 2 device paths were sucessfully returned.
@return other a error from gBS->HandleProtocol
@sa HandleProtocol
**/
);
/**
Process all Uefi Shell 2.0 command line options.
see Uefi Shell 2.0 section 3.2 for full details.
the command line should resemble the following:
shell.efi [ShellOpt-options] [options] [file-name [file-name-options]]
ShellOpt options Options which control the initialization behavior of the shell.
These options are read from the EFI global variable "ShellOpt"
and are processed before options or file-name.
options Options which control the initialization behavior of the shell.
file-name The name of a UEFI shell application or script to be executed
after initialization is complete. By default, if file-name is
specified, then -nostartup is implied. Scripts are not supported
by level 0.
file-nameoptions The command-line options that are passed to file-name when it
is invoked.
This will initialize the ShellInitSettings global variable.
@retval EFI_SUCCESS the variable is initialized.
**/
);
/**
Handles all interaction with the default startup script.
this will check that the correct command line parameters were passed, handle the delay, and then start running the script.
@param[in] ImagePath The path to the image for shell. The first place to look for the startup script.
@param[in] FilePath The path to the file for shell. The second place to look for the startup script.
@retval EFI_SUCCESS The variable is initialized.
**/
);
/**
Function to perform the shell prompt looping. It will do a single prompt,
dispatch the result, and then return. It is expected that the caller will
call this function in a loop many times.
@retval EFI_SUCCESS
@retval RETURN_ABORTED
**/
);
/**
Add a buffer to the Buffer To Free List for safely returning buffers to other
places without risking letting them modify internal shell information.
@param Buffer Something to pass to FreePool when the shell is exiting.
**/
VOID*
);
/**
Add a buffer to the Command History List.
@param Buffer[in] The line buffer to add.
**/
);
/**
Function will process and run a command line.
This will determine if the command line represents an internal shell command or dispatch an external application.
@param[in] CmdLine the command line to parse
@retval EFI_SUCCESS the command was completed
@retval EFI_ABORTED the command's operation was aborted
**/
);
/**
Function determins if the CommandName COULD be a valid command. It does not determine whether
this is a valid command. It only checks for invalid characters.
@param[in] CommandName The name to check
@retval TRUE CommandName could be a command name
@retval FALSE CommandName could not be a valid command name
**/
);
/**
Function to process a NSH script file via SHELL_FILE_HANDLE.
@param[in] Handle The handle to the already opened file.
@param[in] Name The name of the script file.
@retval EFI_SUCCESS the script completed sucessfully
**/
);
/**
Function to process a NSH script file.
@param[in] ScriptPath Pointer to the script file name (including file system path).
@retval EFI_SUCCESS the script completed sucessfully
**/
);
#endif //_SHELL_INTERNAL_HEADER_