]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Source/C/Common/EfiUtilityMsgs.h
BaseTools: Clean up source files
[mirror_edk2.git] / BaseTools / Source / C / Common / EfiUtilityMsgs.h
CommitLineData
30fdf114 1/** @file\r
97fa0ee9 2Defines and prototypes for common EFI utility error and debug messages.\r
30fdf114 3\r
f7496d71
LG
4Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
30fdf114 12\r
30fdf114
LG
13**/\r
14\r
15#ifndef _EFI_UTILITY_MSGS_H_\r
16#define _EFI_UTILITY_MSGS_H_\r
17\r
18#include <Common/UefiBaseTypes.h>\r
19\r
20//\r
21// Log message print Level\r
22//\r
23#define VERBOSE_LOG_LEVEL 15\r
24#define WARNING_LOG_LEVEL 15\r
25#define INFO_LOG_LEVEL 20\r
26#define KEY_LOG_LEVEL 40\r
27#define ERROR_LOG_LEVLE 50\r
28\r
29//\r
30// Status codes returned by EFI utility programs and functions\r
31//\r
32#define STATUS_SUCCESS 0\r
33#define STATUS_WARNING 1\r
34#define STATUS_ERROR 2\r
f7496d71 35#define VOID void\r
30fdf114
LG
36\r
37typedef int STATUS;\r
38\r
39#define MAX_LINE_LEN 0x200\r
40#define MAXIMUM_INPUT_FILE_NUM 10\r
41\r
42#ifdef __cplusplus\r
43extern "C" {\r
44#endif\r
45//\r
46// When we call Error() or Warning(), the module keeps track of the worst\r
47// case reported. GetUtilityStatus() will get the worst-case results, which\r
48// can be used as the return value from the app.\r
49//\r
50STATUS\r
51GetUtilityStatus (\r
52 VOID\r
53 );\r
54\r
55//\r
56// If someone prints an error message and didn't specify a source file name,\r
57// then we print the utility name instead. However they must tell us the\r
58// utility name early on via this function.\r
59//\r
60VOID\r
61SetUtilityName (\r
62 CHAR8 *ProgramName\r
63 )\r
64;\r
65\r
52302d4d
LG
66VOID\r
67PrintMessage (\r
68 CHAR8 *Type,\r
69 CHAR8 *FileName,\r
70 UINT32 LineNumber,\r
71 UINT32 MessageCode,\r
72 CHAR8 *Text,\r
73 CHAR8 *MsgFmt,\r
74 va_list List\r
75 );\r
76\r
30fdf114
LG
77VOID\r
78Error (\r
79 CHAR8 *FileName,\r
80 UINT32 LineNumber,\r
81 UINT32 ErrorCode,\r
82 CHAR8 *OffendingText,\r
83 CHAR8 *MsgFmt,\r
84 ...\r
85 )\r
86;\r
87\r
88VOID\r
89Warning (\r
90 CHAR8 *FileName,\r
91 UINT32 LineNumber,\r
92 UINT32 WarningCode,\r
93 CHAR8 *OffendingText,\r
94 CHAR8 *MsgFmt,\r
95 ...\r
96 )\r
97;\r
98\r
99VOID\r
100DebugMsg (\r
101 CHAR8 *FileName,\r
102 UINT32 LineNumber,\r
fd171542 103 UINT64 MsgLevel,\r
30fdf114
LG
104 CHAR8 *OffendingText,\r
105 CHAR8 *MsgFmt,\r
106 ...\r
107 )\r
108;\r
109\r
110VOID\r
111VerboseMsg (\r
112 CHAR8 *MsgFmt,\r
113 ...\r
114 );\r
115\r
116VOID\r
117NormalMsg (\r
118 CHAR8 *MsgFmt,\r
119 ...\r
120 );\r
121\r
122VOID\r
123KeyMsg (\r
124 CHAR8 *MsgFmt,\r
125 ...\r
126 );\r
127\r
128VOID\r
129SetPrintLevel (\r
fd171542 130 UINT64 LogLevel\r
30fdf114
LG
131 );\r
132\r
133VOID\r
134ParserSetPosition (\r
135 CHAR8 *SourceFileName,\r
136 UINT32 LineNum\r
137 )\r
138;\r
139\r
140VOID\r
141ParserError (\r
142 UINT32 ErrorCode,\r
143 CHAR8 *OffendingText,\r
144 CHAR8 *MsgFmt,\r
145 ...\r
146 )\r
147;\r
148\r
149VOID\r
150ParserWarning (\r
151 UINT32 ErrorCode,\r
152 CHAR8 *OffendingText,\r
153 CHAR8 *MsgFmt,\r
154 ...\r
155 )\r
156;\r
157\r
158VOID\r
159SetPrintLimits (\r
160 UINT32 NumErrors,\r
161 UINT32 NumWarnings,\r
162 UINT32 NumWarningsPlusErrors\r
163 )\r
164;\r
165\r
166#ifdef __cplusplus\r
167}\r
168#endif\r
169\r
170#endif // #ifndef _EFI_UTILITY_MSGS_H_\r