]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/TianoTools/Common/EfiUtilityMsgs.c
Fix capitalization
[mirror_edk2.git] / Tools / Source / TianoTools / Common / EfiUtilityMsgs.c
CommitLineData
878ddf1f 1/*++\r
2\r
3Copyright (c) 2004, 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.c\r
15 \r
16Abstract:\r
17\r
18 EFI tools utility functions to display warning, error, and informational\r
19 messages.\r
20 \r
21--*/\r
22\r
23#include <stdio.h>\r
24#include <string.h>\r
25#include <ctype.h>\r
26#include <stdarg.h>\r
27\r
28/*\r
29#include "Tiano.h"\r
30*/\r
31#include "EfiUtilityMsgs.h"\r
32\r
33#define MAX_LINE_LEN 200\r
34\r
35//\r
36// Declare module globals for keeping track of the the utility's\r
37// name and other settings.\r
38//\r
39static STATUS mStatus = STATUS_SUCCESS;\r
40static CHAR8 mUtilityName[50] = { 0 };\r
41static UINT32 mDebugMsgMask = 0;\r
42static CHAR8 *mSourceFileName = NULL;\r
43static UINT32 mSourceFileLineNum = 0;\r
44static UINT32 mErrorCount = 0;\r
45static UINT32 mWarningCount = 0;\r
46static UINT32 mMaxErrors = 0;\r
47static UINT32 mMaxWarnings = 0;\r
48static UINT32 mMaxWarningsPlusErrors = 0;\r
49static INT8 mPrintLimitsSet = 0;\r
50\r
51static\r
52void\r
53PrintMessage (\r
54 CHAR8 *Type,\r
55 CHAR8 *FileName,\r
56 UINT32 LineNumber,\r
57 UINT32 MessageCode,\r
58 CHAR8 *Text,\r
59 CHAR8 *MsgFmt,\r
60 va_list List\r
61 );\r
62\r
63static\r
64void\r
65PrintLimitExceeded (\r
66 VOID\r
67 );\r
68\r
69void\r
70Error (\r
71 CHAR8 *FileName,\r
72 UINT32 LineNumber,\r
73 UINT32 MessageCode,\r
74 CHAR8 *Text,\r
75 CHAR8 *MsgFmt,\r
76 ...\r
77 )\r
78/*++\r
79\r
80Routine Description:\r
81 Prints an error message.\r
82 \r
83Arguments:\r
84 All arguments are optional, though the printed message may be useless if\r
85 at least something valid is not specified.\r
86 \r
87 FileName - name of the file or application. If not specified, then the\r
88 utilty name (as set by the utility calling SetUtilityName()\r
89 earlier) is used. Otherwise "Unknown utility" is used.\r
90 \r
91 LineNumber - the line number of error, typically used by parsers. If the\r
92 utility is not a parser, then 0 should be specified. Otherwise\r
93 the FileName and LineNumber info can be used to cause\r
94 MS Visual Studio to jump to the error.\r
95 \r
96 MessageCode - an application-specific error code that can be referenced in\r
97 other documentation. \r
98\r
99 Text - the text in question, typically used by parsers.\r
100 \r
101 MsgFmt - the format string for the error message. Can contain formatting\r
102 controls for use with the varargs.\r
103 \r
104Returns:\r
105 None.\r
106 \r
107Notes:\r
108 We print the following (similar to the Warn() and Debug() \r
109 W\r
110 Typical error/warning message format:\r
111\r
112 bin\VfrCompile.cpp(330) : error C2660: 'AddVfrDataStructField' : function does not take 2 parameters\r
113\r
114 BUGBUG -- these three utility functions are almost identical, and\r
115 should be modified to share code.\r
116\r
117 Visual Studio does not find error messages with:\r
118 \r
119 " error :"\r
120 " error 1:"\r
121 " error c1:"\r
122 " error 1000:"\r
123 " error c100:"\r
124\r
125 It does find:\r
126 " error c1000:" \r
127--*/\r
128{\r
129 va_list List;\r
130 //\r
131 // If limits have been set, then check that we have not exceeded them\r
132 //\r
133 if (mPrintLimitsSet) {\r
134 //\r
135 // See if we've exceeded our total count\r
136 //\r
137 if (mMaxWarningsPlusErrors != 0) {\r
138 if (mErrorCount + mWarningCount > mMaxWarningsPlusErrors) {\r
139 PrintLimitExceeded ();\r
140 return ;\r
141 }\r
142 }\r
143 //\r
144 // See if we've exceeded our error count\r
145 //\r
146 if (mMaxErrors != 0) {\r
147 if (mErrorCount > mMaxErrors) {\r
148 PrintLimitExceeded ();\r
149 return ;\r
150 }\r
151 }\r
152 }\r
153\r
154 mErrorCount++;\r
155 va_start (List, MsgFmt);\r
156 PrintMessage ("error", FileName, LineNumber, MessageCode, Text, MsgFmt, List);\r
157 va_end (List);\r
158 //\r
159 // Set status accordingly\r
160 //\r
161 if (mStatus < STATUS_ERROR) {\r
162 mStatus = STATUS_ERROR;\r
163 }\r
164}\r
165\r
166void\r
167ParserError (\r
168 UINT32 MessageCode,\r
169 CHAR8 *Text,\r
170 CHAR8 *MsgFmt,\r
171 ...\r
172 )\r
173/*++\r
174\r
175Routine Description:\r
176 Print a parser error, using the source file name and line number\r
177 set by a previous call to SetParserPosition().\r
178\r
179Arguments:\r
180 MessageCode - application-specific error code\r
181 Text - text to print in the error message\r
182 MsgFmt - format string to print at the end of the error message\r
183\r
184Returns:\r
185 NA\r
186\r
187--*/\r
188{\r
189 va_list List;\r
190 //\r
191 // If limits have been set, then check them\r
192 //\r
193 if (mPrintLimitsSet) {\r
194 //\r
195 // See if we've exceeded our total count\r
196 //\r
197 if (mMaxWarningsPlusErrors != 0) {\r
198 if (mErrorCount + mWarningCount > mMaxWarningsPlusErrors) {\r
199 PrintLimitExceeded ();\r
200 return ;\r
201 }\r
202 }\r
203 //\r
204 // See if we've exceeded our error count\r
205 //\r
206 if (mMaxErrors != 0) {\r
207 if (mErrorCount > mMaxErrors) {\r
208 PrintLimitExceeded ();\r
209 return ;\r
210 }\r
211 }\r
212 }\r
213\r
214 mErrorCount++;\r
215 va_start (List, MsgFmt);\r
216 PrintMessage ("error", mSourceFileName, mSourceFileLineNum, MessageCode, Text, MsgFmt, List);\r
217 va_end (List);\r
218 //\r
219 // Set status accordingly\r
220 //\r
221 if (mStatus < STATUS_ERROR) {\r
222 mStatus = STATUS_ERROR;\r
223 }\r
224}\r
225\r
226void\r
227ParserWarning (\r
228 UINT32 ErrorCode,\r
229 CHAR8 *OffendingText,\r
230 CHAR8 *MsgFmt,\r
231 ...\r
232 )\r
233/*++\r
234\r
235Routine Description:\r
236 Print a parser warning, using the source file name and line number\r
237 set by a previous call to SetParserPosition().\r
238\r
239Arguments:\r
240 ErrorCode - application-specific error code\r
241 OffendingText - text to print in the warning message\r
242 MsgFmt - format string to print at the end of the warning message\r
243\r
244Returns:\r
245 NA\r
246\r
247--*/\r
248{\r
249 va_list List;\r
250 //\r
251 // If limits have been set, then check them\r
252 //\r
253 if (mPrintLimitsSet) {\r
254 //\r
255 // See if we've exceeded our total count\r
256 //\r
257 if (mMaxWarningsPlusErrors != 0) {\r
258 if (mErrorCount + mWarningCount > mMaxWarningsPlusErrors) {\r
259 PrintLimitExceeded ();\r
260 return ;\r
261 }\r
262 }\r
263 //\r
264 // See if we've exceeded our warning count\r
265 //\r
266 if (mMaxWarnings != 0) {\r
267 if (mWarningCount > mMaxWarnings) {\r
268 PrintLimitExceeded ();\r
269 return ;\r
270 }\r
271 }\r
272 }\r
273\r
274 mWarningCount++;\r
275 va_start (List, MsgFmt);\r
276 PrintMessage ("warning", mSourceFileName, mSourceFileLineNum, ErrorCode, OffendingText, MsgFmt, List);\r
277 va_end (List);\r
278 //\r
279 // Set status accordingly\r
280 //\r
281 if (mStatus < STATUS_WARNING) {\r
282 mStatus = STATUS_WARNING;\r
283 }\r
284}\r
285\r
286void\r
287Warning (\r
288 CHAR8 *FileName,\r
289 UINT32 LineNumber,\r
290 UINT32 MessageCode,\r
291 CHAR8 *Text,\r
292 CHAR8 *MsgFmt,\r
293 ...\r
294 )\r
295/*++\r
296\r
297Routine Description:\r
298 Print a warning message.\r
299\r
300Arguments:\r
301 FileName - name of the file where the warning was detected, or the name\r
302 of the application that detected the warning\r
303 \r
304 LineNumber - the line number where the warning was detected (parsers).\r
305 0 should be specified if the utility is not a parser.\r
306 \r
307 MessageCode - an application-specific warning code that can be referenced in\r
308 other documentation. \r
309\r
310 Text - the text in question (parsers)\r
311 \r
312 MsgFmt - the format string for the warning message. Can contain formatting\r
313 controls for use with varargs.\r
314 \r
315Returns:\r
316 None.\r
317\r
318--*/\r
319{\r
320 va_list List;\r
321 //\r
322 // If limits have been set, then check them\r
323 //\r
324 if (mPrintLimitsSet) {\r
325 //\r
326 // See if we've exceeded our total count\r
327 //\r
328 if (mMaxWarningsPlusErrors != 0) {\r
329 if (mErrorCount + mWarningCount > mMaxWarningsPlusErrors) {\r
330 PrintLimitExceeded ();\r
331 return ;\r
332 }\r
333 }\r
334 //\r
335 // See if we've exceeded our warning count\r
336 //\r
337 if (mMaxWarnings != 0) {\r
338 if (mWarningCount > mMaxWarnings) {\r
339 PrintLimitExceeded ();\r
340 return ;\r
341 }\r
342 }\r
343 }\r
344\r
345 mWarningCount++;\r
346 va_start (List, MsgFmt);\r
347 PrintMessage ("warning", FileName, LineNumber, MessageCode, Text, MsgFmt, List);\r
348 va_end (List);\r
349 //\r
350 // Set status accordingly\r
351 //\r
352 if (mStatus < STATUS_WARNING) {\r
353 mStatus = STATUS_WARNING;\r
354 }\r
355}\r
356\r
357void\r
358DebugMsg (\r
359 CHAR8 *FileName,\r
360 UINT32 LineNumber,\r
361 UINT32 MsgMask,\r
362 CHAR8 *Text,\r
363 CHAR8 *MsgFmt,\r
364 ...\r
365 )\r
366/*++\r
367\r
368Routine Description:\r
369 Print a warning message.\r
370\r
371Arguments:\r
372 FileName - typically the name of the utility printing the debug message, but\r
373 can be the name of a file being parsed.\r
374 \r
375 LineNumber - the line number in FileName (parsers) \r
376 \r
377 MsgMask - an application-specific bitmask that, in combination with mDebugMsgMask,\r
378 determines if the debug message gets printed.\r
379\r
380 Text - the text in question (parsers)\r
381 \r
382 MsgFmt - the format string for the debug message. Can contain formatting\r
383 controls for use with varargs.\r
384 \r
385Returns:\r
386 None.\r
387\r
388--*/\r
389{\r
390 va_list List;\r
391 //\r
392 // If the debug mask is not applicable, then do nothing.\r
393 //\r
394 if ((MsgMask != 0) && ((mDebugMsgMask & MsgMask) == 0)) {\r
395 return ;\r
396 }\r
397\r
398 va_start (List, MsgFmt);\r
399 PrintMessage ("debug", FileName, LineNumber, 0, Text, MsgFmt, List);\r
400 va_end (List);\r
401}\r
402\r
403static\r
404void\r
405PrintMessage (\r
406 CHAR8 *Type,\r
407 CHAR8 *FileName,\r
408 UINT32 LineNumber,\r
409 UINT32 MessageCode,\r
410 CHAR8 *Text,\r
411 CHAR8 *MsgFmt,\r
412 va_list List\r
413 )\r
414/*++\r
415\r
416Routine Description:\r
417 Worker routine for all the utility printing services. Prints the message in\r
418 a format that Visual Studio will find when scanning build outputs for\r
419 errors or warnings.\r
420\r
421Arguments:\r
422 Type - "warning" or "error" string to insert into the message to be\r
423 printed. The first character of this string (converted to uppercase)\r
424 is used to preceed the MessageCode value in the output string.\r
425\r
426 FileName - name of the file where the warning was detected, or the name\r
427 of the application that detected the warning\r
428 \r
429 LineNumber - the line number where the warning was detected (parsers).\r
430 0 should be specified if the utility is not a parser.\r
431 \r
432 MessageCode - an application-specific warning code that can be referenced in\r
433 other documentation. \r
434\r
435 Text - part of the message to print\r
436 \r
437 MsgFmt - the format string for the message. Can contain formatting\r
438 controls for use with varargs.\r
439 List - the variable list.\r
440 \r
441Returns:\r
442 None.\r
443\r
444Notes:\r
445 If FileName == NULL then this utility will use the string passed into SetUtilityName(). \r
446 \r
447 LineNumber is only used if the caller is a parser, in which case FileName refers to the\r
448 file being parsed.\r
449\r
450 Text and MsgFmt are both optional, though it would be of little use calling this function with\r
451 them both NULL.\r
452\r
453 Output will typically be of the form:\r
454 <FileName>(<LineNumber>) : <Type> <Type[0]><MessageCode>: <Text> : <MsgFmt>\r
455\r
456 Parser (LineNumber != 0)\r
457 VfrCompile.cpp(330) : error E2660: AddVfrDataStructField : function does not take 2 parameters\r
458 Generic utility (LineNumber == 0) \r
459 UtilityName : error E1234 : Text string : MsgFmt string and args\r
460\r
461--*/\r
462{\r
463 CHAR8 Line[MAX_LINE_LEN];\r
464 CHAR8 Line2[MAX_LINE_LEN];\r
465 CHAR8 *Cptr;\r
466 //\r
467 // If given a filename, then add it (and the line number) to the string.\r
468 // If there's no filename, then use the program name if provided.\r
469 //\r
470 if (FileName != NULL) {\r
471 Cptr = FileName;\r
472 } else if (mUtilityName[0] != 0) {\r
473 Cptr = mUtilityName;\r
474 } else {\r
475 Cptr = "Unknown utility";\r
476 }\r
477\r
478 strcpy (Line, Cptr);\r
479 if (LineNumber != 0) {\r
480 sprintf (Line2, "(%d)", LineNumber);\r
481 strcat (Line, Line2);\r
482 }\r
483 //\r
484 // Have to print an error code or Visual Studio won't find the\r
485 // message for you. It has to be decimal digits too.\r
486 //\r
487 sprintf (Line2, " : %s %c%04d", Type, toupper (Type[0]), MessageCode);\r
488 strcat (Line, Line2);\r
489 fprintf (stdout, "%s", Line);\r
490 //\r
491 // If offending text was provided, then print it\r
492 //\r
493 if (Text != NULL) {\r
494 fprintf (stdout, ": %s ", Text);\r
495 }\r
496 //\r
497 // Print formatted message if provided\r
498 //\r
499 if (MsgFmt != NULL) {\r
500 vsprintf (Line2, MsgFmt, List);\r
501 fprintf (stdout, ": %s", Line2);\r
502 }\r
503\r
504 fprintf (stdout, "\n");\r
505}\r
506\r
507void\r
508ParserSetPosition (\r
509 CHAR8 *SourceFileName,\r
510 UINT32 LineNum\r
511 )\r
512/*++\r
513\r
514Routine Description:\r
515 Set the position in a file being parsed. This can be used to \r
516 print error messages deeper down in a parser.\r
517\r
518Arguments:\r
519 SourceFileName - name of the source file being parsed\r
520 LineNum - line number of the source file being parsed\r
521\r
522Returns:\r
523 NA\r
524\r
525--*/\r
526{\r
527 mSourceFileName = SourceFileName;\r
528 mSourceFileLineNum = LineNum;\r
529}\r
530\r
531void\r
532SetUtilityName (\r
533 CHAR8 *UtilityName\r
534 )\r
535/*++\r
536\r
537Routine Description:\r
538 All printed error/warning/debug messages follow the same format, and\r
539 typically will print a filename or utility name followed by the error\r
540 text. However if a filename is not passed to the print routines, then\r
541 they'll print the utility name if you call this function early in your\r
542 app to set the utility name.\r
543 \r
544Arguments:\r
545 UtilityName - name of the utility, which will be printed with all\r
546 error/warning/debug messags.\r
547\r
548Returns:\r
549 NA\r
550 \r
551--*/\r
552{\r
553 //\r
554 // Save the name of the utility in our local variable. Make sure its\r
555 // length does not exceed our buffer.\r
556 //\r
557 if (UtilityName != NULL) {\r
558 if (strlen (UtilityName) >= sizeof (mUtilityName)) {\r
559 Error (UtilityName, 0, 0, "application error", "utility name length exceeds internal buffer size");\r
560 strncpy (mUtilityName, UtilityName, sizeof (mUtilityName) - 1);\r
561 mUtilityName[sizeof (mUtilityName) - 1] = 0;\r
562 return ;\r
563 } else {\r
564 strcpy (mUtilityName, UtilityName);\r
565 }\r
566 } else {\r
567 Error (NULL, 0, 0, "application error", "SetUtilityName() called with NULL utility name");\r
568 }\r
569}\r
570\r
571STATUS\r
572GetUtilityStatus (\r
573 VOID\r
574 )\r
575/*++\r
576\r
577Routine Description:\r
578 When you call Error() or Warning(), this module keeps track of it and\r
579 sets a local mStatus to STATUS_ERROR or STATUS_WARNING. When the utility\r
580 exits, it can call this function to get the status and use it as a return\r
581 value.\r
582 \r
583Arguments:\r
584 None.\r
585\r
586Returns:\r
587 Worst-case status reported, as defined by which print function was called.\r
588 \r
589--*/\r
590{\r
591 return mStatus;\r
592}\r
593\r
594void\r
595SetDebugMsgMask (\r
596 UINT32 DebugMask\r
597 )\r
598/*++\r
599\r
600Routine Description:\r
601 Set the debug printing mask. This is used by the DebugMsg() function\r
602 to determine when/if a debug message should be printed.\r
603\r
604Arguments:\r
605 DebugMask - bitmask, specific to the calling application\r
606\r
607Returns:\r
608 NA\r
609\r
610--*/\r
611{\r
612 mDebugMsgMask = DebugMask;\r
613}\r
614\r
615void\r
616SetPrintLimits (\r
617 UINT32 MaxErrors,\r
618 UINT32 MaxWarnings,\r
619 UINT32 MaxWarningsPlusErrors\r
620 )\r
621/*++\r
622\r
623Routine Description:\r
624 Set the limits of how many errors, warnings, and errors+warnings\r
625 we will print.\r
626\r
627Arguments:\r
628 MaxErrors - maximum number of error messages to print\r
629 MaxWarnings - maximum number of warning messages to print\r
630 MaxWarningsPlusErrors \r
631 - maximum number of errors+warnings to print\r
632\r
633Returns:\r
634 NA\r
635\r
636--*/\r
637{\r
638 mMaxErrors = MaxErrors;\r
639 mMaxWarnings = MaxWarnings;\r
640 mMaxWarningsPlusErrors = MaxWarningsPlusErrors;\r
641 mPrintLimitsSet = 1;\r
642}\r
643\r
644static\r
645void\r
646PrintLimitExceeded (\r
647 VOID\r
648 )\r
649{\r
650 static INT8 mPrintLimitExceeded = 0;\r
651 //\r
652 // If we've already printed the message, do nothing. Otherwise\r
653 // temporarily increase our print limits so we can pass one\r
654 // more message through.\r
655 //\r
656 if (mPrintLimitExceeded == 0) {\r
657 mPrintLimitExceeded++;\r
658 mMaxErrors++;\r
659 mMaxWarnings++;\r
660 mMaxWarningsPlusErrors++;\r
661 Error (NULL, 0, 0, "error/warning print limit exceeded", NULL);\r
662 mMaxErrors--;\r
663 mMaxWarnings--;\r
664 mMaxWarningsPlusErrors--;\r
665 }\r
666}\r
667\r
668#if 0\r
669void\r
670TestUtilityMessages (\r
671 VOID\r
672 )\r
673{\r
674 char *ArgStr = "ArgString";\r
675 int ArgInt;\r
676\r
677 ArgInt = 0x12345678;\r
678 //\r
679 // Test without setting utility name\r
680 //\r
681 fprintf (stdout, "* Testing without setting utility name\n");\r
682 fprintf (stdout, "** Test debug message not printed\n");\r
683 DebugMsg (NULL, 0, 0x00000001, NULL, NULL);\r
684 fprintf (stdout, "** Test warning with two strings and two args\n");\r
685 Warning (NULL, 0, 1234, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);\r
686 fprintf (stdout, "** Test error with two strings and two args\n");\r
687 Warning (NULL, 0, 1234, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);\r
688 fprintf (stdout, "** Test parser warning with nothing\n");\r
689 ParserWarning (0, NULL, NULL);\r
690 fprintf (stdout, "** Test parser error with nothing\n");\r
691 ParserError (0, NULL, NULL);\r
692 //\r
693 // Test with utility name set now\r
694 //\r
695 fprintf (stdout, "** Testingin with utility name set\n");\r
696 SetUtilityName ("MyUtilityName");\r
697 //\r
698 // Test debug prints\r
699 //\r
700 SetDebugMsgMask (2);\r
701 fprintf (stdout, "** Test debug message with one string\n");\r
702 DebugMsg (NULL, 0, 0x00000002, "Text1", NULL);\r
703 fprintf (stdout, "** Test debug message with one string\n");\r
704 DebugMsg (NULL, 0, 0x00000002, NULL, "Text2");\r
705 fprintf (stdout, "** Test debug message with two strings\n");\r
706 DebugMsg (NULL, 0, 0x00000002, "Text1", "Text2");\r
707 fprintf (stdout, "** Test debug message with two strings and two args\n");\r
708 DebugMsg (NULL, 0, 0x00000002, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);\r
709 //\r
710 // Test warning prints\r
711 //\r
712 fprintf (stdout, "** Test warning with no strings\n");\r
713 Warning (NULL, 0, 1234, NULL, NULL);\r
714 fprintf (stdout, "** Test warning with one string\n");\r
715 Warning (NULL, 0, 1234, "Text1", NULL);\r
716 fprintf (stdout, "** Test warning with one string\n");\r
717 Warning (NULL, 0, 1234, NULL, "Text2");\r
718 fprintf (stdout, "** Test warning with two strings and two args\n");\r
719 Warning (NULL, 0, 1234, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);\r
720 //\r
721 // Test error prints\r
722 //\r
723 fprintf (stdout, "** Test error with no strings\n");\r
724 Error (NULL, 0, 1234, NULL, NULL);\r
725 fprintf (stdout, "** Test error with one string\n");\r
726 Error (NULL, 0, 1234, "Text1", NULL);\r
727 fprintf (stdout, "** Test error with one string\n");\r
728 Error (NULL, 0, 1234, NULL, "Text2");\r
729 fprintf (stdout, "** Test error with two strings and two args\n");\r
730 Error (NULL, 0, 1234, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);\r
731 //\r
732 // Test parser prints\r
733 //\r
734 fprintf (stdout, "** Test parser errors\n");\r
735 ParserSetPosition (__FILE__, __LINE__ + 1);\r
736 ParserError (1234, NULL, NULL);\r
737 ParserSetPosition (__FILE__, __LINE__ + 1);\r
738 ParserError (1234, "Text1", NULL);\r
739 ParserSetPosition (__FILE__, __LINE__ + 1);\r
740 ParserError (1234, NULL, "Text2");\r
741 ParserSetPosition (__FILE__, __LINE__ + 1);\r
742 ParserError (1234, "Text1", "Text2");\r
743 ParserSetPosition (__FILE__, __LINE__ + 1);\r
744 ParserError (1234, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);\r
745\r
746 fprintf (stdout, "** Test parser warnings\n");\r
747 ParserSetPosition (__FILE__, __LINE__ + 1);\r
748 ParserWarning (4321, NULL, NULL);\r
749 ParserSetPosition (__FILE__, __LINE__ + 1);\r
750 ParserWarning (4321, "Text1", NULL);\r
751 ParserSetPosition (__FILE__, __LINE__ + 1);\r
752 ParserWarning (4321, NULL, "Text2");\r
753 ParserSetPosition (__FILE__, __LINE__ + 1);\r
754 ParserWarning (4321, "Text1", "Text2");\r
755 ParserSetPosition (__FILE__, __LINE__ + 1);\r
756 ParserWarning (4321, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);\r
757}\r
758#endif\r