Are you using a Wacom Cintiq21UX Tablet?
If your not then that code will not work you will need to look here
http://linuxwacom.sourceforge.net/ &
http://www.gtk.org/~otaylor/xinput/
As far as segmentation fault you need some code to handle errors so instead
of your code crashing it will print a message like "Wacom Cintiq21UX Tablet Not Found"
pad-cintiq21ux
stylus-cintiq21ux
eraser-cintiq21ux
cursor-cintiq21ux
These are not devices. A device would be "cintiq21ux"
These are functions to interact with the "pad, stylus, eraser, cursor" parts of the "cintiq21ux"
wacom device.
Lastly you posted this in the wrong forum this forum is for working example code you should post stuff like with in GTK+ Programming