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 ...

Get Advanced UNIX Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.