EfiUtilityMsgs.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /** @file
  2. Defines and prototypes for common EFI utility error and debug messages.
  3. Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef _EFI_UTILITY_MSGS_H_
  7. #define _EFI_UTILITY_MSGS_H_
  8. #include <Common/UefiBaseTypes.h>
  9. //
  10. // Log message print Level
  11. //
  12. #define VERBOSE_LOG_LEVEL 15
  13. #define WARNING_LOG_LEVEL 15
  14. #define INFO_LOG_LEVEL 20
  15. #define KEY_LOG_LEVEL 40
  16. #define ERROR_LOG_LEVLE 50
  17. //
  18. // Status codes returned by EFI utility programs and functions
  19. //
  20. #define STATUS_SUCCESS 0
  21. #define STATUS_WARNING 1
  22. #define STATUS_ERROR 2
  23. #define VOID void
  24. typedef int STATUS;
  25. #define MAX_LINE_LEN 0x200
  26. #define MAXIMUM_INPUT_FILE_NUM 10
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. //
  31. // When we call Error() or Warning(), the module keeps track of the worst
  32. // case reported. GetUtilityStatus() will get the worst-case results, which
  33. // can be used as the return value from the app.
  34. //
  35. STATUS
  36. GetUtilityStatus (
  37. VOID
  38. );
  39. //
  40. // If someone prints an error message and didn't specify a source file name,
  41. // then we print the utility name instead. However they must tell us the
  42. // utility name early on via this function.
  43. //
  44. VOID
  45. SetUtilityName (
  46. CHAR8 *ProgramName
  47. )
  48. ;
  49. VOID
  50. PrintMessage (
  51. CHAR8 *Type,
  52. CHAR8 *FileName,
  53. UINT32 LineNumber,
  54. UINT32 MessageCode,
  55. CHAR8 *Text,
  56. CHAR8 *MsgFmt,
  57. va_list List
  58. );
  59. VOID
  60. Error (
  61. CHAR8 *FileName,
  62. UINT32 LineNumber,
  63. UINT32 ErrorCode,
  64. CHAR8 *OffendingText,
  65. CHAR8 *MsgFmt,
  66. ...
  67. )
  68. ;
  69. VOID
  70. Warning (
  71. CHAR8 *FileName,
  72. UINT32 LineNumber,
  73. UINT32 WarningCode,
  74. CHAR8 *OffendingText,
  75. CHAR8 *MsgFmt,
  76. ...
  77. )
  78. ;
  79. VOID
  80. DebugMsg (
  81. CHAR8 *FileName,
  82. UINT32 LineNumber,
  83. UINT64 MsgLevel,
  84. CHAR8 *OffendingText,
  85. CHAR8 *MsgFmt,
  86. ...
  87. )
  88. ;
  89. VOID
  90. VerboseMsg (
  91. CHAR8 *MsgFmt,
  92. ...
  93. );
  94. VOID
  95. NormalMsg (
  96. CHAR8 *MsgFmt,
  97. ...
  98. );
  99. VOID
  100. KeyMsg (
  101. CHAR8 *MsgFmt,
  102. ...
  103. );
  104. VOID
  105. SetPrintLevel (
  106. UINT64 LogLevel
  107. );
  108. VOID
  109. ParserSetPosition (
  110. CHAR8 *SourceFileName,
  111. UINT32 LineNum
  112. )
  113. ;
  114. VOID
  115. ParserError (
  116. UINT32 ErrorCode,
  117. CHAR8 *OffendingText,
  118. CHAR8 *MsgFmt,
  119. ...
  120. )
  121. ;
  122. VOID
  123. ParserWarning (
  124. UINT32 ErrorCode,
  125. CHAR8 *OffendingText,
  126. CHAR8 *MsgFmt,
  127. ...
  128. )
  129. ;
  130. VOID
  131. SetPrintLimits (
  132. UINT32 NumErrors,
  133. UINT32 NumWarnings,
  134. UINT32 NumWarningsPlusErrors
  135. )
  136. ;
  137. #ifdef __cplusplus
  138. }
  139. #endif
  140. #endif // #ifndef _EFI_UTILITY_MSGS_H_