4 * DIGITAL EQUIPMENT CORPORATION
5 * MAYNARD, MASSACHUSETTS
8 * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
9 * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
10 * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
11 * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
14 * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
15 * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
16 * ADDITION TO THAT SET FORTH ABOVE.
18 * Permission to use, copy, modify, and distribute this software and its
19 * documentation for any purpose and without fee is hereby granted, provided
20 * that the above copyright notice appear in all copies and that both that
21 * copyright notice and this permission notice appear in supporting
22 * documentation, and that the name of Digital Equipment Corporation not be
23 * used in advertising or publicity pertaining to distribution of the
24 * software without specific, written prior permission.
34 static FILE *errorFile = NULL;
35 static int outCount = 0;
36 static char *preMsg = NULL;
37 static char *prefix = NULL;
40 uSetErrorFile(char *name)
42 if ((errorFile != NULL) && (errorFile != stderr)) {
43 fprintf(errorFile, "switching to %s\n", name ? name : "stderr");
47 errorFile = fopen(name, "w");
50 if (errorFile == NULL) {
58 uInformation(const char *s, ...)
66 vfprintf(errorFile, s, args);
71 /***====================================================================***/
74 uAction(const char *s, ...)
82 fprintf(errorFile, "%s", prefix);
83 fprintf(errorFile, " ");
85 vfprintf(errorFile, s, args);
90 /***====================================================================***/
93 uWarning(const char *s, ...)
100 if ((outCount == 0) && (preMsg != NULL))
101 fprintf(errorFile, "%s\n", preMsg);
103 fprintf(errorFile, "%s", prefix);
104 fprintf(errorFile, "Warning: ");
106 vfprintf(errorFile, s, args);
112 /***====================================================================***/
115 uError(const char *s, ...)
122 if ((outCount == 0) && (preMsg != NULL))
123 fprintf(errorFile, "%s\n", preMsg);
125 fprintf(errorFile, "%s", prefix);
126 fprintf(errorFile, "Error: ");
128 vfprintf(errorFile, s, args);
134 /***====================================================================***/
137 uFatalError(const char *s, ...)
144 if ((outCount == 0) && (preMsg != NULL))
145 fprintf(errorFile, "%s\n", preMsg);
147 fprintf(errorFile, "%s", prefix);
148 fprintf(errorFile, "Fatal Error: ");
150 vfprintf(errorFile, s, args);
152 fprintf(errorFile, " Exiting\n");
159 /***====================================================================***/
162 uInternalError(const char *s, ...)
169 if ((outCount == 0) && (preMsg != NULL))
170 fprintf(errorFile, "%s\n", preMsg);
172 fprintf(errorFile, "%s", prefix);
173 fprintf(errorFile, "Internal error: ");
175 vfprintf(errorFile, s, args);