Initial checkin

cvs
Eduardo Cavazos 2005-11-30 09:56:48 +00:00
parent 51094d8b8a
commit 597f3368c7
3 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,3 @@
gcc -c simple-error-handler.c
gcc -L /usr/X11R6/lib -shared -o simple-error-handler.so \
simple-error-handler.o -lX11

View File

@ -0,0 +1,13 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
int SimpleErrorHandler ( Display* dpy, XErrorEvent* event ) {
char msg[255];
printf ( "X11 : SimpleErrorHandler called!!!\n\n" ) ;
XGetErrorText ( dpy, event->error_code, msg, sizeof msg ) ;
printf ( "X error (%#lx): %s", event->resourceid, msg ) ;
return 0 ;
}
void SetSimpleErrorHandler() { XSetErrorHandler( SimpleErrorHandler ) ; }

View File

@ -0,0 +1,5 @@
IN: simple-error-handler USING: compiler alien xlib ;
LIBRARY: simple-error-handler
"simple-error-handler" "simple-error-handler.so" "cdecl" add-library
FUNCTION: void SetSimpleErrorHandler ( ) ;
\ SetSimpleErrorHandler compile