]> git.proxmox.com Git - mirror_edk2.git/commitdiff
fixing build errors
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 8 Jul 2009 17:26:58 +0000 (17:26 +0000)
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 8 Jul 2009 17:26:58 +0000 (17:26 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8824 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Include/Library/ShellLib.h
ShellPkg/Library/BaseFileHandleLib/BaseFileHandleLib.c
ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.c
ShellPkg/Library/UefiShellLib/UefiShellLib.c

index 6bf4e6ec9b41fe7771733f776fe8a6d4dfcd1693..1018b35a8bcd3ffbf456a1cca9c2c676a06e4100 100644 (file)
@@ -47,7 +47,7 @@ ShellGetFileInfo (
 \r
   @param  FileInfo              The infotmation to set.\r
 \r
-  @retval EFI_SUCCESS                  The information was set.\r
+  @retval EFI_SUCCESS            The information was set.\r
   @retval EFI_UNSUPPORTED       The InformationType is not known.\r
   @retval EFI_NO_MEDIA               The device has no medium.\r
   @retval EFI_DEVICE_ERROR         The device reported an error.\r
@@ -115,22 +115,22 @@ ShellOpenFileByDevicePath(
   @param  OpenMode               the mode to open the file with.\r
   @param  Attributes           the file's file attributes.\r
 \r
-  @retval EFI_SUCCESS          The information was set.\r
+  @retval EFI_SUCCESS                  The information was set.\r
   @retval EFI_INVALID_PARAMETER        One of the parameters has an invalid value.\r
-  @retval EFI_UNSUPPORTED      Could not open the file path.   \r
+  @retval EFI_UNSUPPORTED            Could not open the file path.     \r
   @retval EFI_NOT_FOUND                The specified file could not be found on the \r
                                 device or the file system could not be found \r
                                 on the device.\r
-  @retval EFI_NO_MEDIA         The device has no medium.\r
-  @retval EFI_MEDIA_CHANGED    The device has a different medium in it or the \r
+  @retval EFI_NO_MEDIA               The device has no medium.\r
+  @retval EFI_MEDIA_CHANGED        The device has a different medium in it or the \r
                                 medium is no longer supported.\r
-  @retval EFI_DEVICE_ERROR     The device reported an error.\r
+  @retval EFI_DEVICE_ERROR         The device reported an error.\r
   @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
-  @retval EFI_WRITE_PROTECTED  The file or medium is write protected.\r
-  @retval EFI_ACCESS_DENIED    The file was opened read only.\r
+  @retval EFI_WRITE_PROTECTED    The file or medium is write protected.\r
+  @retval EFI_ACCESS_DENIED        The file was opened read only.\r
   @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the \r
                                 file.\r
-  @retval EFI_VOLUME_FULL      The volume is full.\r
+  @retval EFI_VOLUME_FULL            The volume is full.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -157,16 +157,16 @@ ShellOpenFileByName(
   @retval EFI_NOT_FOUND                The specified file could not be found on the \r
                                 device or the file system could not be found \r
                                 on the device.\r
-  @retval EFI_NO_MEDIA         The device has no medium.\r
-  @retval EFI_MEDIA_CHANGED    The device has a different medium in it or the \r
+  @retval EFI_NO_MEDIA               The device has no medium.\r
+  @retval EFI_MEDIA_CHANGED        The device has a different medium in it or the \r
                                 medium is no longer supported.\r
-  @retval EFI_DEVICE_ERROR     The device reported an error.\r
+  @retval EFI_DEVICE_ERROR         The device reported an error.\r
   @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
-  @retval EFI_WRITE_PROTECTED  The file or medium is write protected.\r
-  @retval EFI_ACCESS_DENIED    The file was opened read only.\r
+  @retval EFI_WRITE_PROTECTED    The file or medium is write protected.\r
+  @retval EFI_ACCESS_DENIED        The file was opened read only.\r
   @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the \r
                                 file.\r
-  @retval EFI_VOLUME_FULL      The volume is full.\r
+  @retval EFI_VOLUME_FULL            The volume is full.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -198,11 +198,11 @@ ShellCreateDirectory(
 \r
   @param Buffer                 the buffer to put read data into.\r
 \r
- @retval EFI_SUCCESS           Data was read.\r
- @retval EFI_NO_MEDIA          The device has no media.\r
- @retval EFI_DEVICE_ERROR      The device reported an error.\r
- @retval EFI_VOLUME_CORRUPTED  The file system structures are corrupted.\r
- @retval EFI_BUFFER_TO_SMALL   Buffer is too small. ReadSize contains required \r
+ @retval EFI_SUCCESS             Data was read.\r
+ @retval EFI_NO_MEDIA            The device has no media.\r
+ @retval EFI_DEVICE_ERROR            The device reported an error.\r
+ @retval EFI_VOLUME_CORRUPTED    The file system structures are corrupted.\r
+ @retval EFI_BUFFER_TO_SMALL     Buffer is too small. ReadSize contains required \r
                                 size.\r
 \r
 **/\r
@@ -232,13 +232,13 @@ ShellReadFile(
   @param Buffer                 the buffer containing data to write is stored.\r
 \r
  @retval EFI_SUCCESS           Data was written.\r
- @retval EFI_UNSUPPORTED       Writes to an open directory are not supported.\r
+ @retval EFI_UNSUPPORTED           Writes to an open directory are not supported.\r
  @retval EFI_NO_MEDIA          The device has no media.\r
- @retval EFI_DEVICE_ERROR      The device reported an error.\r
+ @retval EFI_DEVICE_ERROR          The device reported an error.\r
  @retval EFI_VOLUME_CORRUPTED  The file system structures are corrupted.\r
  @retval EFI_WRITE_PROTECTED   The device is write-protected.\r
- @retval EFI_ACCESS_DENIED     The file was open for read only.\r
- @retval EFI_VOLUME_FULL       The volume is full.\r
+ @retval EFI_ACCESS_DENIED       The file was open for read only.\r
+ @retval EFI_VOLUME_FULL           The volume is full.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -606,6 +606,7 @@ typedef enum {
   TypeFlag  = 0,\r
   TypeValue,\r
   TypePosition,\r
+  TypeStart,\r
   TypeMax,\r
 } ParamType;\r
 \r
index 9136b9c20080b5dca78088beb64fb5ac1f519624..d04a797bdf7a88a870c677e41e13b809679b8433 100644 (file)
@@ -714,7 +714,7 @@ StrnCatGrowLeft (
     *Destination = AllocateZeroPool((Count+1)*sizeof(CHAR16));\r
   }\r
 \r
-  *Destination = CopyMem(*Destination+StrLen(Source), *Destination, StrSize(*Destination));\r
+  *Destination = CopyMem((*Destination)+StrLen(Source), *Destination, StrSize(*Destination));\r
   *Destination = CopyMem(*Destination, Source, StrLen(Source));\r
   return (*Destination);\r
 }\r
@@ -798,7 +798,7 @@ FileHandleGetFileName (
   }\r
 \r
   if (EFI_ERROR(Status) && *FullFileName != NULL) {\r
-    FreePool(FullFileName);\r
+    FreePool(*FullFileName);\r
   }\r
 \r
   return (Status);\r
@@ -808,8 +808,8 @@ FileHandleGetFileName (
   Function to read a single line (up to but not including the \n) from a file.\r
 \r
   @param[in]      Handle        FileHandle to read from\r
-  @param[in,out] Buffer        pointer to buffer to read into\r
-  @param[in,out] Size          pointer to number of bytes in buffer\r
+  @param[in,out]  Buffer        pointer to buffer to read into\r
+  @param[in,out]  Size          pointer to number of bytes in buffer\r
   @param[in[      Truncate      if TRUE then allows for truncation of the line to fit.\r
                                 if FALSE will reset the position to the begining of the \r
                                 line if the buffer is not large enough.\r
index 43d429e6a560f4244d7bfe8fae9e1362d256138f..80f56c00148f2915799d421dd8da6e01786947de 100644 (file)
@@ -50,7 +50,7 @@ ShellCEntryLib (
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
 {\r
-  INT32                         ReturnFromMain;\r
+  INTN                           ReturnFromMain;\r
   EFI_SHELL_PARAMETERS_PROTOCOL *EfiShellParametersProtocol;\r
   EFI_SHELL_INTERFACE           *EfiShellInterface;\r
   EFI_STATUS                    Status;\r
index 20805725fcec08578277bbdb393c6991d75449e5..7b7533a32739ec92fcb4e066aef914148f49077d 100644 (file)
@@ -79,9 +79,7 @@ ShellFindSE2 (
   //\r
   // look for the mEfiShellEnvironment2 protocol at a higher level\r
   //\r
-  if (EFI_ERROR (Status) || !(CompareGuid (&mEfiShellEnvironment2->SESGuid, &gEfiShellEnvironment2ExtGuid) != FALSE &&\r
-     (mEfiShellEnvironment2->MajorVersion > EFI_SHELL_MAJOR_VER ||\r
-     (mEfiShellEnvironment2->MajorVersion == EFI_SHELL_MAJOR_VER && mEfiShellEnvironment2->MinorVersion >= EFI_SHELL_MINOR_VER)))) {\r
+  if (EFI_ERROR (Status) || !(CompareGuid (&mEfiShellEnvironment2->SESGuid, &gEfiShellEnvironment2ExtGuid) != FALSE)){\r
     //\r
     // figure out how big of a buffer we need.\r
     //\r
@@ -113,9 +111,7 @@ ShellFindSE2 (
                                    NULL,\r
                                    EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
                                    );\r
-         if (CompareGuid (&mEfiShellEnvironment2->SESGuid, &gEfiShellEnvironment2ExtGuid) != FALSE &&\r
-          (mEfiShellEnvironment2->MajorVersion > EFI_SHELL_MAJOR_VER ||\r
-          (mEfiShellEnvironment2->MajorVersion == EFI_SHELL_MAJOR_VER && mEfiShellEnvironment2->MinorVersion >= EFI_SHELL_MINOR_VER))) {\r
+         if (CompareGuid (&mEfiShellEnvironment2->SESGuid, &gEfiShellEnvironment2ExtGuid) != FALSE) {\r
           mEfiShellEnvironment2Handle = Buffer[HandleIndex];\r
           Status = EFI_SUCCESS;\r
           break;\r
@@ -1484,9 +1480,13 @@ InternalIsOnCheckList (
   //\r
   for (TempListItem = (SHELL_PARAM_ITEM*)CheckList ; TempListItem->Name != NULL ; TempListItem++) {\r
     //\r
-    // If the Name matches set the type and return TRUE\r
+    // If the Type is TypeStart only check the first characters of the passed in param\r
+    // If it matches set the type and return TRUE\r
     //\r
-    if (StrCmp(Name, TempListItem->Name) == 0) {\r
+    if (TempListItem->Type == TypeStart && StrnCmp(Name, TempListItem->Name, StrLen(TempListItem->Name)) == 0) {\r
+      *Type = TempListItem->Type;\r
+      return (TRUE);\r
+    } else if (StrCmp(Name, TempListItem->Name) == 0) {\r
       *Type = TempListItem->Type;\r
       return (TRUE);\r
     }\r
@@ -1767,7 +1767,10 @@ ShellCommandLineFreeVarList (
   //\r
   // for each node in the list\r
   //\r
-  for (Node = GetFirstNode(CheckPackage); Node != CheckPackage ; Node = GetFirstNode(CheckPackage)) {\r
+  for ( Node = GetFirstNode(CheckPackage)\r
+      ; Node != CheckPackage \r
+      ; Node = GetFirstNode(CheckPackage)\r
+      ){\r
     //\r
     // Remove it from the list\r
     //\r
@@ -1835,12 +1838,22 @@ ShellCommandLineGetFlag (
   //\r
   // enumerate through the list of parametrs\r
   //\r
-  for (Node = GetFirstNode(CheckPackage) ; !IsNull (CheckPackage, Node) ; Node = GetNextNode(CheckPackage, Node) ) {\r
+  for ( Node = GetFirstNode(CheckPackage) \r
+      ; !IsNull (CheckPackage, Node) \r
+      ; Node = GetNextNode(CheckPackage, Node) \r
+      ){\r
     //\r
     // If the Name matches, return TRUE (and there may be NULL name)\r
     //\r
     if (((SHELL_PARAM_PACKAGE*)Node)->Name != NULL) {\r
-      if (StrCmp(KeyString, ((SHELL_PARAM_PACKAGE*)Node)->Name) == 0) {\r
+      //\r
+      // If Type is TypeStart then only compare the begining of the strings\r
+      //\r
+      if ( ((SHELL_PARAM_PACKAGE*)Node)->Type == TypeStart \r
+        && StrnCmp(KeyString, ((SHELL_PARAM_PACKAGE*)Node)->Name, StrLen(KeyString)) == 0\r
+        ){\r
+        return (TRUE);\r
+      } else if (StrCmp(KeyString, ((SHELL_PARAM_PACKAGE*)Node)->Name) == 0) {\r
         return (TRUE);\r
       }\r
     }\r
@@ -1879,12 +1892,28 @@ ShellCommandLineGetValue (
   //\r
   // enumerate through the list of parametrs\r
   //\r
-  for (Node = GetFirstNode(CheckPackage) ; !IsNull (CheckPackage, Node) ; Node = GetNextNode(CheckPackage, Node) ) {\r
+  for ( Node = GetFirstNode(CheckPackage) \r
+      ; !IsNull (CheckPackage, Node) \r
+      ; Node = GetNextNode(CheckPackage, Node) \r
+      ){\r
     //\r
     // If the Name matches, return the value (name can be NULL)\r
     //\r
     if (((SHELL_PARAM_PACKAGE*)Node)->Name != NULL) {\r
-      if (StrCmp(KeyString, ((SHELL_PARAM_PACKAGE*)Node)->Name) == 0) {\r
+      //\r
+      // If Type is TypeStart then only compare the begining of the strings\r
+      //\r
+      if ( ((SHELL_PARAM_PACKAGE*)Node)->Type == TypeStart \r
+        && StrnCmp(KeyString, ((SHELL_PARAM_PACKAGE*)Node)->Name, StrLen(KeyString)) == 0\r
+        ){\r
+        //\r
+        // return the string part after the flag\r
+        //\r
+        return (((SHELL_PARAM_PACKAGE*)Node)->Name + StrLen(KeyString));\r
+      } else if (StrCmp(KeyString, ((SHELL_PARAM_PACKAGE*)Node)->Name) == 0) {\r
+        //\r
+        // return the value\r
+        //\r
         return (((SHELL_PARAM_PACKAGE*)Node)->Value);\r
       }\r
     }\r
@@ -1981,7 +2010,7 @@ CopyReplace(
   while (*SourceString != L'\0') {\r
     if (StrnCmp(SourceString, FindTarget, StrLen(FindTarget)) == 0) {\r
       SourceString += StrLen(FindTarget);\r
-      if (StrSize(NewString) + (StrLen(ReplaceWith)*sizeof(CHAR16)) > NewSize) {\r
+      if ((StrSize(NewString) + (StrLen(ReplaceWith)*sizeof(CHAR16))) > NewSize) {\r
         return (EFI_BUFFER_TOO_SMALL);\r
       }\r
       StrCat(NewString, ReplaceWith);\r