O'Reilly logo

Advanced UNIX Programming by Warren W. Gay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

An Xlib Client Program

Listing 27.1 shows the listing of the include file that is used by the source modules xeg.c and events.c.

Code Listing 27.1. xeg.h—Common Include File for xeg.c and events.c
 1: /* xeg.h */ 2: 3: #include <stdio.h> 4: #include <strings.h> 5: #include <X11/Xlib.h> 6: #include <X11/Xutil.h> 7: 8: typedef unsigned long Ulong; 9: 10: #define B1 1 /* Left button */ 11: #define B2 2 /* Middle button */ 12: #define B3 4 /* Right button */ 13: 14: extern Display *disp; /* Display */ 15: extern int scr; /* Screen */ 16: 17: extern Ulong bg; /* Background color */ 18: extern Ulong fg; /* Foreground color */ 19: 20: extern Ulong wht; /* White */ 21: extern Ulong blk; /* Black */ 22: 23: extern Ulong red; /* red */ 24: extern Ulong ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required