X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ShellPkg%2FLibrary%2FUefiShellLevel1CommandsLib%2FUefiShellLevel1CommandsLib.c;h=bae834f1646fa0639a0683dfad6961410c86739b;hp=47b6f92864931931b95ba423cb3cd6c5cb4e801e;hb=77dcec128bde3e7f0db64d60501b5a072f9f0e8f;hpb=a47c681fc0fd1c2ebc08973a4742f0188eafcf44 diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c index 47b6f92864..bae834f164 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c @@ -1,7 +1,7 @@ /** @file Main file for NULL named library for level 1 shell command functions. - Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2011, 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 @@ -22,6 +22,11 @@ CONST EFI_GUID gShellLevel1HiiGuid = \ }; +/** + Return the help text filename. Only used if no HII information found. + + @retval the filename. +**/ CONST CHAR16* EFIAPI ShellCommandGetManFileNameLevel1 ( @@ -64,6 +69,7 @@ ShellLevel1CommandsLibConstructor ( // // install our shell command handlers that are always installed // + ShellCommandRegisterCommandName(L"stall", ShellCommandRunStall , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_STALL) )); ShellCommandRegisterCommandName(L"for", ShellCommandRunFor , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_FOR) )); ShellCommandRegisterCommandName(L"goto", ShellCommandRunGoto , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_GOTO) )); ShellCommandRegisterCommandName(L"if", ShellCommandRunIf , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_IF) )); @@ -78,6 +84,9 @@ ShellLevel1CommandsLibConstructor ( /** Destructor for the library. free any resources. + + @param ImageHandle The image handle of the process. + @param SystemTable The EFI System Table pointer. **/ EFI_STATUS EFIAPI @@ -92,6 +101,29 @@ ShellLevel1CommandsLibDestructor ( return (EFI_SUCCESS); } +/** + Test a node to see if meets the criterion. + + It functions so that count starts at 1 and it increases or decreases when it + hits the specified tags. when it hits zero the location has been found. + + DecrementerTag and IncrementerTag are used to get around for/endfor and + similar paired types where the entire middle should be ignored. + + If label is used it will be used instead of the count. + + @param[in] Function The function to use to enumerate through the + list. Normally GetNextNode or GetPreviousNode. + @param[in] DecrementerTag The tag to decrement the count at. + @param[in] IncrementerTag The tag to increment the count at. + @param[in] Label A label to look for. + @param[in,out] ScriptFile The pointer to the current script file structure. + @param[in] MovePast TRUE makes function return 1 past the found + location. + @param[in] FindOnly TRUE to not change the ScriptFile. + @param[in] CommandNode The pointer to the Node to test. + @param[in,out] TargetCount The pointer to the current count. +**/ BOOLEAN EFIAPI TestNodeForMove ( @@ -99,11 +131,11 @@ TestNodeForMove ( IN CONST CHAR16 *DecrementerTag, IN CONST CHAR16 *IncrementerTag, IN CONST CHAR16 *Label OPTIONAL, - IN SCRIPT_FILE *ScriptFile, + IN OUT SCRIPT_FILE *ScriptFile, IN CONST BOOLEAN MovePast, IN CONST BOOLEAN FindOnly, IN CONST SCRIPT_COMMAND_LIST *CommandNode, - IN UINTN *TargetCount + IN OUT UINTN *TargetCount ) { BOOLEAN Found; @@ -186,6 +218,29 @@ TestNodeForMove ( return (Found); } +/** + Move the script pointer from 1 tag (line) to another. + + It functions so that count starts at 1 and it increases or decreases when it + hits the specified tags. when it hits zero the location has been found. + + DecrementerTag and IncrementerTag are used to get around for/endfor and + similar paired types where the entire middle should be ignored. + + If label is used it will be used instead of the count. + + @param[in] Function The function to use to enumerate through the + list. Normally GetNextNode or GetPreviousNode. + @param[in] DecrementerTag The tag to decrement the count at. + @param[in] IncrementerTag The tag to increment the count at. + @param[in] Label A label to look for. + @param[in,out] ScriptFile The pointer to the current script file structure. + @param[in] MovePast TRUE makes function return 1 past the found + location. + @param[in] FindOnly TRUE to not change the ScriptFile. + @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in + searching. +**/ BOOLEAN EFIAPI MoveToTag ( @@ -193,7 +248,7 @@ MoveToTag ( IN CONST CHAR16 *DecrementerTag, IN CONST CHAR16 *IncrementerTag, IN CONST CHAR16 *Label OPTIONAL, - IN SCRIPT_FILE *ScriptFile, + IN OUT SCRIPT_FILE *ScriptFile, IN CONST BOOLEAN MovePast, IN CONST BOOLEAN FindOnly, IN CONST BOOLEAN WrapAroundScript