5 * DIGITAL EQUIPMENT CORPORATION
6 * MAYNARD, MASSACHUSETTS
9 * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
10 * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
11 * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
12 * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
15 * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
16 * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
17 * ADDITION TO THAT SET FORTH ABOVE.
19 * Permission to use, copy, modify, and distribute this software and its
20 * documentation for any purpose and without fee is hereby granted, provided
21 * that the above copyright notice appear in all copies and that both that
22 * copyright notice and this permission notice appear in supporting
23 * documentation, and that the name of Digital Equipment Corporation not be
24 * used in advertising or publicity pertaining to distribution of the
25 * software without specific, written prior permission.
35 static FILE *errorFile = NULL;
36 static int outCount = 0;
37 static char *preMsg = NULL;
38 static char *prefix = NULL;
41 uSetErrorFile(char *name)
43 if ((errorFile != NULL) && (errorFile != stderr))
45 fprintf(errorFile, "switching to %s\n", name ? name : "stderr");
49 errorFile = fopen(name, "w");
52 if (errorFile == NULL)
61 uInformation(const char *s, ...)
69 vfprintf(errorFile, s, args);
74 /***====================================================================***/
77 uAction(const char *s, ...)
85 fprintf(errorFile, "%s", prefix);
86 fprintf(errorFile, " ");
88 vfprintf(errorFile, s, args);
93 /***====================================================================***/
96 uWarning(const char *s, ...)
103 if ((outCount == 0) && (preMsg != NULL))
104 fprintf(errorFile, "%s\n", preMsg);
106 fprintf(errorFile, "%s", prefix);
107 fprintf(errorFile, "Warning: ");
109 vfprintf(errorFile, s, args);
115 /***====================================================================***/
118 uError(const char *s, ...)
125 if ((outCount == 0) && (preMsg != NULL))
126 fprintf(errorFile, "%s\n", preMsg);
128 fprintf(errorFile, "%s", prefix);
129 fprintf(errorFile, "Error: ");
131 vfprintf(errorFile, s, args);
137 /***====================================================================***/
140 uFatalError(const char *s, ...)
147 if ((outCount == 0) && (preMsg != NULL))
148 fprintf(errorFile, "%s\n", preMsg);
150 fprintf(errorFile, "%s", prefix);
151 fprintf(errorFile, "Fatal Error: ");
153 vfprintf(errorFile, s, args);
155 fprintf(errorFile, " Exiting\n");
162 /***====================================================================***/
165 uInternalError(const char *s, ...)
172 if ((outCount == 0) && (preMsg != NULL))
173 fprintf(errorFile, "%s\n", preMsg);
175 fprintf(errorFile, "%s", prefix);
176 fprintf(errorFile, "Internal error: ");
178 vfprintf(errorFile, s, args);