]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupport.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Universal / EbcDxe / EbcDebugger / EdbSupport.h
index 7ad5860f50c56019ab296a81d106e7b2f8b17d35..ba8b936b3ab1c589900c3409b3490ecc4add6d98 100644 (file)
@@ -1,22 +1,10 @@
-/*++\r
+/** @file\r
 \r
-Copyright (c) 2007, Intel Corporation\r
-All rights reserved. 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
-http://opensource.org/licenses/bsd-license.php\r
+Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
-Module Name:\r
-\r
-  EdbSupport.h\r
-\r
-Abstract:\r
-\r
-\r
---*/\r
+**/\r
 \r
 #ifndef _EFI_EDB_SUPPORT_H_\r
 #define _EFI_EDB_SUPPORT_H_\r
@@ -31,36 +19,83 @@ Abstract:
 \r
 #define EFI_DEBUG_MAX_PRINT_BUFFER   (80 * 4)\r
 \r
+/**\r
+\r
+  Convert hex string to uint.\r
+\r
+  @param  Str  -  The string\r
+\r
+**/\r
 UINTN\r
 EFIAPI\r
 Xtoi (\r
-  CHAR16  *str\r
+  CHAR16  *Str\r
   );\r
 \r
+/**\r
+\r
+  Convert hex string to uint.\r
+\r
+  @param  Str  -  The string\r
+\r
+**/\r
 UINT64\r
 EFIAPI\r
 LXtoi (\r
-  CHAR16  *str\r
+  CHAR16  *Str\r
   );\r
 \r
+/**\r
+\r
+  Convert hex string to uint.\r
+\r
+  @param Str  -  The string\r
+\r
+**/\r
 UINTN\r
 EFIAPI\r
 Atoi (\r
-  CHAR16  *str\r
+  CHAR16  *Str\r
   );\r
 \r
+/**\r
+\r
+  Convert hex string to uint.\r
+\r
+  @param  Str  -  The string\r
+\r
+**/\r
 UINTN\r
 EFIAPI\r
 AsciiXtoi (\r
-  CHAR8  *str\r
+  CHAR8  *Str\r
   );\r
 \r
+/**\r
+\r
+  Convert hex string to uint.\r
+\r
+  @param Str  -  The string\r
+\r
+**/\r
 UINTN\r
 EFIAPI\r
 AsciiAtoi (\r
-  CHAR8  *str\r
+  CHAR8  *Str\r
   );\r
 \r
+/**\r
+  Compare the Unicode and Ascii string pointed by String to the string pointed by String2.\r
+\r
+  @param String - Unicode String to process\r
+\r
+  @param String2 - Ascii string to process\r
+\r
+  @return Return a positive integer if String is lexicall greater than String2; Zero if\r
+  the two strings are identical; and a negative interger if String is lexically\r
+  less than String2.\r
+\r
+**/\r
 INTN\r
 EFIAPI\r
 StrCmpUnicodeAndAscii (\r
@@ -68,6 +103,18 @@ StrCmpUnicodeAndAscii (
   IN CHAR8    *String2\r
   );\r
 \r
+/**\r
+\r
+  Compare the Unicode string pointed by String to the string pointed by String2.\r
+\r
+  @param  String - Unicode String to process\r
+  @param  String2 - Unicode string to process\r
+\r
+  @return Return a positive integer if String is lexically greater than String2; Zero if\r
+  the two strings are identical; and a negative integer if String is lexically\r
+  less than String2.\r
+\r
+**/\r
 INTN\r
 EFIAPI\r
 StriCmp (\r
@@ -75,6 +122,18 @@ StriCmp (
   IN CHAR16   *String2\r
   );\r
 \r
+/**\r
+\r
+  Compare the Unicode and Ascii string pointed by String to the string pointed by String2.\r
+\r
+  @param  String - Unicode String to process\r
+  @param  String2 - Ascii string to process\r
+\r
+  @return Return a positive integer if String is lexically greater than String2; Zero if\r
+  the two strings are identical; and a negative integer if String is lexically\r
+  less than String2.\r
+\r
+**/\r
 INTN\r
 EFIAPI\r
 StriCmpUnicodeAndAscii (\r
@@ -82,6 +141,14 @@ StriCmpUnicodeAndAscii (
   IN CHAR8    *String2\r
   );\r
 \r
+/**\r
+\r
+  Verify if the string is end with the sub string.\r
+\r
+  @param  Str - The string where to search the sub string\r
+  @param  SubStr - The substring.\r
+\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 StrEndWith (\r
@@ -89,12 +156,26 @@ StrEndWith (
   IN CHAR16                       *SubStr\r
   );\r
 \r
+/**\r
+  Duplicate a string.\r
+\r
+  @param  Src  The string to be duplicated.\r
+\r
+**/\r
 CHAR16 *\r
 EFIAPI\r
 StrDuplicate (\r
   IN CHAR16   *Src\r
   );\r
 \r
+/**\r
+\r
+  Find the next token after one or more specified characters.\r
+\r
+  @param  String    Point to the string where to find the substring.\r
+  @param  CharSet   Point to the string to be found.\r
+\r
+**/\r
 CHAR16 *\r
 EFIAPI\r
 StrGetNewTokenLine (\r
@@ -102,12 +183,27 @@ StrGetNewTokenLine (
   IN CHAR16                       *CharSet\r
   );\r
 \r
+/**\r
+\r
+  Find the next token after one or more specified characters.\r
+\r
+  @param  CharSet   Point to the string to be found.\r
+\r
+**/\r
 CHAR16 *\r
 EFIAPI\r
 StrGetNextTokenLine (\r
   IN CHAR16                       *CharSet\r
   );\r
 \r
+/**\r
+\r
+  Find the next token after one specificed characters.\r
+\r
+  @param  String    Point to the string where to find the substring.\r
+  @param  CharSet   Point to the string to be found.\r
+\r
+**/\r
 CHAR16 *\r
 EFIAPI\r
 StrGetNewTokenField (\r
@@ -115,12 +211,27 @@ StrGetNewTokenField (
   IN CHAR16                       *CharSet\r
   );\r
 \r
+/**\r
+\r
+  Find the next token after one specificed characters.\r
+\r
+  @param  CharSet   Point to the string to be found.\r
+\r
+**/\r
 CHAR16 *\r
 EFIAPI\r
 StrGetNextTokenField (\r
   IN CHAR16                       *CharSet\r
   );\r
 \r
+/**\r
+\r
+  Patch a character to the end of a string.\r
+\r
+  @param  Buffer   The string to be patched.\r
+  @param  Patch    The patch character.\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 PatchForStrTokenAfter (\r
@@ -128,6 +239,13 @@ PatchForStrTokenAfter (
   IN CHAR16    Patch\r
   );\r
 \r
+/**\r
+  Patch a character at the beginning of a string.\r
+\r
+  @param  Buffer   The string to be patched.\r
+  @param  Patch    The patch character.\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 PatchForStrTokenBefore (\r
@@ -135,6 +253,14 @@ PatchForStrTokenBefore (
   IN CHAR16    Patch\r
   );\r
 \r
+/**\r
+\r
+  Find the next token after one or more specified characters.\r
+\r
+  @param  String    Point to the string where to find the substring.\r
+  @param  CharSet   Point to the string to be found.\r
+\r
+**/\r
 CHAR8 *\r
 EFIAPI\r
 AsciiStrGetNewTokenLine (\r
@@ -142,12 +268,27 @@ AsciiStrGetNewTokenLine (
   IN CHAR8                       *CharSet\r
   );\r
 \r
+/**\r
+\r
+  Find the next token after one or more specified characters.\r
+\r
+  @param  CharSet   Point to the string to be found.\r
+\r
+**/\r
 CHAR8 *\r
 EFIAPI\r
 AsciiStrGetNextTokenLine (\r
   IN CHAR8                       *CharSet\r
   );\r
 \r
+/**\r
+\r
+  Find the next token after one specificed characters.\r
+\r
+  @param  String    Point to the string where to find the substring.\r
+  @param  CharSet   Point to the string to be found.\r
+\r
+**/\r
 CHAR8 *\r
 EFIAPI\r
 AsciiStrGetNewTokenField (\r
@@ -155,12 +296,27 @@ AsciiStrGetNewTokenField (
   IN CHAR8                       *CharSet\r
   );\r
 \r
+/**\r
+\r
+  Find the next token after one specificed characters.\r
+\r
+  @param  CharSet   Point to the string to be found.\r
+\r
+**/\r
 CHAR8 *\r
 EFIAPI\r
 AsciiStrGetNextTokenField (\r
   IN CHAR8                       *CharSet\r
   );\r
 \r
+/**\r
+\r
+  Patch a character to the end of a string.\r
+\r
+  @param  Buffer   The string to be patched.\r
+  @param  Patch    The patch character.\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 PatchForAsciiStrTokenAfter (\r
@@ -168,6 +324,13 @@ PatchForAsciiStrTokenAfter (
   IN CHAR8    Patch\r
   );\r
 \r
+/**\r
+  Patch a character at the beginning of a string.\r
+\r
+  @param  Buffer   The string to be patched.\r
+  @param  Patch    The patch character.\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 PatchForAsciiStrTokenBefore (\r
@@ -175,9 +338,16 @@ PatchForAsciiStrTokenBefore (
   IN CHAR8    Patch\r
   );\r
 \r
-//\r
-// Shell Library\r
-//\r
+/**\r
+\r
+  Shell Library.\r
+  Get user input.\r
+\r
+  @param  Prompt    The prompt string.\r
+  @param  InStr     Point to the input string.\r
+  @param  StrLen    The max length of string user can input.\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 Input (\r
@@ -186,12 +356,25 @@ Input (
   IN UINTN     StrLen\r
   );\r
 \r
+/**\r
+\r
+  SetPageBreak.\r
+\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 SetPageBreak (\r
   VOID\r
   );\r
 \r
+/**\r
+  Print a Unicode string to the output device.\r
+\r
+  @param  Format    A Null-terminated Unicode format string.\r
+  @param  ...       The variable argument list that contains pointers to Null-\r
+                    terminated Unicode strings to be printed\r
+\r
+**/\r
 UINTN\r
 EFIAPI\r
 EDBPrint (\r
@@ -199,6 +382,17 @@ EDBPrint (
   ...\r
   );\r
 \r
+/**\r
+  Print a Unicode string to the output buffer.\r
+\r
+  @param  Buffer          A pointer to the output buffer for the produced Null-terminated\r
+                          Unicode string.\r
+  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+  @param  Format          A Null-terminated Unicode format string.\r
+  @param  ...             The variable argument list that contains pointers to Null-\r
+                          terminated Unicode strings to be printed\r
+\r
+**/\r
 UINTN\r
 EFIAPI\r
 EDBSPrint (\r
@@ -208,6 +402,18 @@ EDBSPrint (
   ...\r
   );\r
 \r
+/**\r
+  Print a Unicode string to the output buffer with specified offset..\r
+\r
+  @param  Buffer          A pointer to the output buffer for the produced Null-terminated\r
+                          Unicode string.\r
+  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+  @param  Offset          The offset of the buffer.\r
+  @param  Format          A Null-terminated Unicode format string.\r
+  @param  ...             The variable argument list that contains pointers to Null-\r
+                          terminated Unicode strings to be printed\r
+\r
+**/\r
 UINTN\r
 EFIAPI\r
 EDBSPrintWithOffset (\r
@@ -218,6 +424,25 @@ EDBSPrintWithOffset (
   ...\r
   );\r
 \r
+/**\r
+\r
+  Read a file.\r
+  If ScanFs is FLASE, it will use DebuggerPrivate->Vol as default Fs.\r
+  If ScanFs is TRUE, it will scan all FS and check the file.\r
+  If there is only one file match the name, it will be read.\r
+  If there is more than one file match the name, it will return Error.\r
+\r
+  @param  DebuggerPrivate - EBC Debugger private data structure\r
+  @param  FileName        - The file to be read.\r
+  @param  BufferSize      - The file buffer size\r
+  @param  Buffer          - The file buffer\r
+  @param  ScanFs          - Need Scan all FS\r
+\r
+  @retval EFI_SUCCESS    - read file successfully\r
+  @retval EFI_NOT_FOUND  - file not found\r
+  @retval EFI_NO_MAPPING - there is duplicated files found\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ReadFileToBuffer (\r
@@ -228,6 +453,18 @@ ReadFileToBuffer (
   IN  BOOLEAN                     ScanFs\r
   );\r
 \r
+/**\r
+\r
+  Get file name under this dir with index\r
+\r
+  @param  DebuggerPrivate - EBC Debugger private data structure\r
+  @param  DirName         - The dir to be read.\r
+  @param  FileName        - The file name pattern under this dir\r
+  @param  Index           - The file index under this dir\r
+\r
+  @return File Name which match the pattern and index.\r
+\r
+**/\r
 CHAR16 *\r
 EFIAPI\r
 GetFileNameUnderDir (\r