home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
vis-ftp.cs.umass.edu
/
vis-ftp.cs.umass.edu.tar
/
vis-ftp.cs.umass.edu
/
pub
/
Software
/
ASCENDER
/
ascendMar8.tar
/
UMass
/
Triangulate
/
error_message.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-04-13
|
6KB
|
225 lines
static char sccsid[] = "@(#)error_message.c 1.8 1/18/95";
/*
* Module Purpose: Contains the standard error routine used by the parser.
*
* Creation Date: 87/10/23
*
* Compiler Version:
*
* Hardware Used: SUN 3
*
* Operating Systems: UNIX -- SUN Release 3.4
*
*
* Class 3: General Electric Proprietary Data
* Copyright (C) 1987 General Electric Company
*
* Modified: 2/15/94 Bob Collins @ UMass
* modified variable args to work for our site
*/
#include "cvar.h"
#include <stdio.h>
#include "rh_util.h"
#ifndef CPARSE_RIH
/*# include <varargs.h>*/ /* BobC 2/15 */
# include <stdarg.h> /* BobC 2/15 */
#else
# include "varargs_parse.h"
#endif
static BOOLEAN output_informative_messages = FALSE;
static BOOLEAN output_warning_messages = TRUE;
static BOOLEAN output_error_messages = TRUE;
static BOOLEAN output_debugging_messages = FALSE;
/* Routines for setting the error enable flags */
FUNCTION_DEF ( void enable_debugging_messages, ())
{
output_debugging_messages = TRUE;
}
FUNCTION_DEF ( void enable_informative_messages, ())
{
output_informative_messages = TRUE;
}
FUNCTION_DEF ( void enable_warning_messages, ())
{
output_warning_messages = TRUE;
}
FUNCTION_DEF ( void enable_error_messages, ())
{
output_error_messages = TRUE;
}
FUNCTION_DEF ( void disable_informative_messages, ())
{
output_informative_messages = FALSE;
}
FUNCTION_DEF ( void disable_warning_messages, ())
{
output_warning_messages = FALSE;
}
FUNCTION_DEF ( void disable_error_messages, ())
{
output_error_messages = FALSE;
}
FUNCTION_DEF ( void disable_debugging_messages, ())
{
output_debugging_messages = FALSE;
}
/*>>
Routines for outputting the messages.
<<*/
/* void debugging_message (va_alist) */
FUNCTION_DEF ( void debugging_message, (char* fmt, DOTDOTDOT))
{
/* Get the message and print the specific error message */
/* Check to see whether we should output the message */
if (! output_debugging_messages) return;
/* Output the message */
{
va_list args;
/* Initialize the parameter list */
va_start (args, fmt); /* BobC 2/15 */
/* Print the message */
/* vfprintf is basically the same as _doprnt */
vfprintf (stderr, fmt, args);
/* Print a line feed */
fprintf (stderr, "\n");
/* Finish with the arguments */
va_end (args);
}
}
/* void informative_message (va_alist) */
FUNCTION_DEF ( void informative_message, (char* fmt, DOTDOTDOT))
{
/* Get the message and print the specific error message */
/* Check to see whether we should output the message */
if (! output_informative_messages) return;
/* Output the message */
{
va_list args;
/* Initialize the parameter list */
va_start (args, fmt); /* BobC 2/15 */
/* Print the message */
/* vfprintf is basically the same as _doprnt */
vfprintf (stderr, fmt, args);
/* Print a line feed */
fprintf (stderr, "\n");
/* Finish with the arguments */
va_end (args);
}
}
/* void warning_message (va_alist) */
FUNCTION_DEF ( void warning_message, (char* fmt, DOTDOTDOT))
{
/* Print the general message header */
/* Check to see whether we should output the message */
if (! output_warning_messages) return;
fprintf (stderr, "Warning : ");
/* Get the message and print the specific error message */
{
va_list args;
/* Initialize the parameter list */
va_start (args, fmt); /* BobC 2/15 */
/* Print the message */
/* vfprintf is basically the same as _doprnt */
vfprintf (stderr, fmt, args);
/* Print a line feed */
fprintf (stderr, "\n");
/* Finish with the arguments */
va_end (args);
}
}
/* void error_message (va_alist) */
FUNCTION_DEF ( void error_message, (char* fmt, DOTDOTDOT))
{
/* Print the general message header */
/* Check to see whether we should output the message */
if (! output_error_messages) return;
fprintf (stderr,"Error : ");
/* Get the message and print the specific error message */
{
va_list args;
/* Initialize the parameter list */
va_start (args, fmt); /* BobC 2/15 */
/* Print the message */
/* vfprintf is basically the same as _doprnt */
vfprintf (stderr, fmt, args);
/* Print a line feed */
fprintf (stderr, "\n");
/* Finish with the arguments */
va_end (args);
}
}
/* void nerror (va_alist) */
FUNCTION_DEF ( void nerror, (char* fmt, DOTDOTDOT))
{
/* Print the general message header */
fprintf (stderr,"Numerical Recipes run-time error ...\n");
/* Get the message and print the specific error message */
{
va_list args;
/* Initialize the parameter list */
va_start (args, fmt); /* BobC 2/15 */
/* Print the message */
/* vfprintf is basically the same as _doprnt */
vfprintf (stderr, fmt, args);
/* Print a line feed */
fprintf (stderr, "\n");
/* Finish with the arguments */
va_end (args);
}
/* Exit the program */
fprintf (stderr, "\t... Exiting numerical routine ...\n");
bail_out (1);
}