Blame


1 0206bd51 2008-01-30 rsc I have edited this code to work on modern compilers.
2 0206bd51 2008-01-30 rsc
3 0206bd51 2008-01-30 rsc Russ Cox
4 0206bd51 2008-01-30 rsc
5 0206bd51 2008-01-30 rsc ---
6 0206bd51 2008-01-30 rsc
7 0206bd51 2008-01-30 rsc There are times during debugging when it would be real useful to be able to
8 0206bd51 2008-01-30 rsc print the fields of an event in a human readable form. Too many times I found
9 0206bd51 2008-01-30 rsc myself scrounging around in section 8 of the Xlib manual looking for the valid
10 0206bd51 2008-01-30 rsc fields for the events I wanted to see, then adding printf's to display the
11 0206bd51 2008-01-30 rsc numeric values of the fields, and then scanning through X.h trying to decode
12 0206bd51 2008-01-30 rsc the cryptic detail and state fields. After playing with xev, I decided to
13 0206bd51 2008-01-30 rsc write a couple of standard functions that I could keep in a library and call
14 0206bd51 2008-01-30 rsc on whenever I needed a little debugging verbosity. The first function,
15 0206bd51 2008-01-30 rsc GetType(), is useful for returning the string representation of the type of
16 0206bd51 2008-01-30 rsc an event. The second function, ShowEvent(), is used to display all the fields
17 0206bd51 2008-01-30 rsc of an event in a readable format. The functions are not complicated, in fact,
18 0206bd51 2008-01-30 rsc they are mind-numbingly boring - but that's just the point nobody wants to
19 0206bd51 2008-01-30 rsc spend the time writing functions like this, they just want to have them when
20 0206bd51 2008-01-30 rsc they need them.
21 0206bd51 2008-01-30 rsc
22 0206bd51 2008-01-30 rsc A simple, sample program is included which does little else but to demonstrate
23 0206bd51 2008-01-30 rsc the use of these two functions. These functions have saved me many an hour
24 0206bd51 2008-01-30 rsc during debugging and I hope you find some benefit to these. If you have any
25 0206bd51 2008-01-30 rsc comments, suggestions, improvements, or if you find any blithering errors you
26 0206bd51 2008-01-30 rsc can get it touch with me at the following location:
27 0206bd51 2008-01-30 rsc
28 0206bd51 2008-01-30 rsc ken@richsun.UUCP