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