home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
cprog
/
btree.zip
/
RUNERR.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1992-02-16
|
1KB
|
65 lines
// C++ Runtime Error Logging
// (c) 1990,1991 Larry A. Walker
// This source is proprietary information which cannot be distributed
// without written permission of Larry A. Walker
#ifndef RUNERR_H
#define RUNERR_H
// Define one of these three:
/*
#define UNIX
#define XENIX
*/
#define MSDOS
/* The error handler is the basic class for all error calls */
#define LOGGING 1
#define NOLOG 0
#define PRINTERRORS 1
#define NOPRINTERRORS 0
#define WARNING -1
#define FATAL -2
#ifndef ON
#define ON 1
#endif
#ifndef OFF
#define OFF 0
#endif
#include <stdio.h>
class RunError {
FILE * log_fd; // log file destination, NULL = none
int display_errors_ ; // display errors 1 = true, 0 = false
FILE * display_dest_; // display destination, stdout stderr
int fatal_; // processing a fatal error 0 = no,
// 1 = yes
public:
// log errors, display errors
RunError();
~RunError(){
if(log_fd != NULL)
fclose(log_fd);
}
void set_display ( int , FILE *); // on/off, destination
void set_log ( int, char * , int ); // log name, append yes/no
void proc_error (int, int, char *, char *, int);
};
#endif RUNERR_H