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