/usr/include/tclutil/ErrorHandler.h is in skycat 3.1.2+starlink1~b-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | // -*-c++-*-
#ifndef _ErrorHandler_H_
#define _ErrorHandler_H_
/*
* E.S.O. - VLT project
* "@(#) $Id: ErrorHandler.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"
*
* ErrorHandler.h - class for managing Tk Error Handler for catching
* X errors
* See the man page for a complete description.
*
* who when what
* -------------- -------- ----------------------------------------
* Allan Brighton 05/10/95 Created
*/
#include <tk.h>
/*
* This class is used to install and remove Tk X error handlers
* in order to catch X errors and deal with them.
*
* Usage:ErrorHandler errorHandler(display, verbose_flag);
* ... (something that might produce X errors)
* if (errorHandler.errors()) {// errors occurred ... }
*/
class ErrorHandler {
protected:
Display* display_; // X Display pointer
Tk_ErrorHandler errHandle_; // error handler handle returned from Tk
int xErrorFlag_; // flag: true if an X protocol error occurred
// and an error handler is installed
int verbose_; // flag: if true, print diagnostic messages
// -- member functions --
// called for X protocal errors when errorHandler is installed
virtual int error(XErrorEvent*);
public:
// constructor
ErrorHandler(Display* display, int verbose = 1)
: display_(display),
errHandle_(NULL),
xErrorFlag_(0),
verbose_(verbose) {install();}
// destructor
// the call to XSync flushes any pending errors
virtual ~ErrorHandler() {XSync(display_, False); remove();}
// static version of error handler, called from Tk
static int errorProc(ClientData clientData, XErrorEvent *errEventPtr);
// install/remove an X error handler
int install();
int remove();
// return 1 if errors occurred
// the call to XSync is necessary to avoid delays due to X buffering
int errors() {XSync(display_, False); return xErrorFlag_;}
// reset the error flag
int reset() {xErrorFlag_ = 0; return 0;}
};
#endif /* _ErrorHandler_H_ */
|