7 Devoted to Cyril Slobin for his excellent works in area
10 Copyright (C) 2002 by V. Wagner
12 void report(const char *function, const char *name);
13 XFontStruct *(*RealLoadQueryFont) (Display *display, const char* name);
14 Font (*RealLoadFont) (Display *display, const char *name);
15 Display* XOpenDisplay( const char* display_name) {
16 void * handle=dlopen("libX11.so.6", RTLD_NOW | RTLD_GLOBAL);
17 void *(*RealOpenDisplay)(const char*);
18 if (!handle) exit(127);
19 RealOpenDisplay=dlsym(handle, "XOpenDisplay");
20 RealLoadQueryFont=dlsym(handle, "XLoadQueryFont");
21 RealLoadFont=dlsym(handle,"XLoadFont");
22 return (*RealOpenDisplay)(display_name);
24 XFontStruct *XLoadQueryFont (Display *display, _Xconst char* name) {
25 report("XLoadQueryFont",name);
26 return (*RealLoadQueryFont) (display, name);
28 Font XLoadFont (Display *display, _Xconst char *name) {
29 report("XLoadFont",name);
30 return (*RealLoadFont) (display, name);
33 void report (const char *function,const char *name) {
35 strcpy(buffer,function);
39 write(2,buffer,strlen(buffer));