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