]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupport.h
MdeModulePkg/EbcDxe: Add comments for functions
[mirror_edk2.git] / MdeModulePkg / Universal / EbcDxe / EbcDebugger / EdbSupport.h
index 8908718edb91a8816534453ec10b6681e62f7457..68becd6d80eb1546e0f8f1d6b5a82b11205443a3 100644 (file)
@@ -25,36 +25,83 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \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
   );\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
   );\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
   );\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
   );\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
   );\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
@@ -62,6 +109,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
@@ -69,6 +128,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
@@ -76,6 +147,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
@@ -83,12 +162,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
@@ -96,12 +189,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
@@ -109,12 +217,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
@@ -122,6 +245,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
@@ -129,6 +259,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
@@ -136,12 +274,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
@@ -149,12 +302,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
@@ -162,6 +330,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
@@ -170,7 +345,14 @@ PatchForAsciiStrTokenBefore (
   );\r
 \r
 /**\r
-Shell Library.\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
@@ -180,12 +362,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
@@ -193,6 +388,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
@@ -202,6 +408,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
@@ -212,6 +430,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
@@ -222,6 +459,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