#endif
#include <sys/fcntl.h>
-#ifdef USE_INPUT_API
-#include <linux/input.h>
-#endif /* USE_INPUT_API */
-
#include "tslib-private.h"
extern struct tslib_module_info __ts_raw;
if( (tsdevice = getenv("TSLIB_TSDEVICE")) != NULL ) {
ts = ts_open(tsdevice,0);
} else {
-#ifdef USE_INPUT_API
- ts = ts_open("/dev/input/event0", 0);
-#else
- ts = ts_open("/dev/touchscreen/ucb1x00", 0);
-#endif /* USE_INPUT_API */
+ if (!(ts = ts_open("/dev/input/event0", 0)))
+ ts = ts_open("/dev/touchscreen/ucb1x00", 0)
}
if (!ts) {
signal(SIGINT, sig);
signal(SIGTERM, sig);
- if ((tsdevice = getenv("TSLIB_TSDEVICE")) == NULL) {
-#ifdef USE_INPUT_API
- tsdevice = strdup ("/dev/input/event0");
-#else
- tsdevice = strdup ("/dev/touchscreen/ucb1x00");
-#endif /* USE_INPUT_API */
- }
-
- ts = ts_open (tsdevice, 0);
+ if( (tsdevice = getenv("TSLIB_TSDEVICE")) != NULL ) {
+ ts = ts_open(tsdevice,0);
+ } else {
+ if (!(ts = ts_open("/dev/input/event0", 0)))
+ ts = ts_open("/dev/touchscreen/ucb1x00", 0)
+ }
if (!ts) {
- perror (tsdevice);
+ perror("ts_open");
exit(1);
}
struct tsdev *ts;
char *tsdevice=NULL;
- if( (tsdevice = getenv("TSLIB_TSDEVICE")) != NULL ) {
- ts = ts_open(tsdevice,0);
- } else {
-#ifdef USE_INPUT_API
- ts = ts_open("/dev/input/event0", 0);
-#else
- ts = ts_open("/dev/touchscreen/ucb1x00", 0);
-#endif /* USE_INPUT_API */
- }
+ if( (tsdevice = getenv("TSLIB_TSDEVICE")) != NULL ) {
+ ts = ts_open(tsdevice,0);
+ } else {
+ if (!(ts = ts_open("/dev/input/event0", 0)))
+ ts = ts_open("/dev/touchscreen/ucb1x00", 0)
+ }
if (!ts) {
perror("ts_open");
struct tsdev *ts;
char *tsdevice=NULL;
- if( (tsdevice = getenv("TSLIB_TSDEVICE")) != NULL ) {
- ts = ts_open(tsdevice,0);
- } else {
-#ifdef USE_INPUT_API
- ts = ts_open("/dev/input/event0", 0);
-#else
- ts = ts_open("/dev/touchscreen/ucb1x00", 0);
-#endif /* USE_INPUT_API */
- }
+ if( (tsdevice = getenv("TSLIB_TSDEVICE")) != NULL ) {
+ ts = ts_open(tsdevice,0);
+ } else {
+ if (!(ts = ts_open("/dev/input/event0", 0)))
+ ts = ts_open("/dev/touchscreen/ucb1x00", 0)
+ }
if (!ts) {
perror("ts_open");
signal(SIGINT, sig);
signal(SIGTERM, sig);
- if ((tsdevice = getenv("TSLIB_TSDEVICE")) == NULL) {
-#ifdef USE_INPUT_API
- tsdevice = strdup ("/dev/input/event0");
-#else
- tsdevice = strdup ("/dev/touchscreen/ucb1x00");
-#endif /* USE_INPUT_API */
- }
-
- ts = ts_open (tsdevice, 0);
+ if( (tsdevice = getenv("TSLIB_TSDEVICE")) != NULL ) {
+ ts = ts_open(tsdevice,0);
+ } else {
+ if (!(ts = ts_open("/dev/input/event0", 0)))
+ ts = ts_open("/dev/touchscreen/ucb1x00", 0)
+ }
if (!ts) {
- perror (tsdevice);
+ perror("ts_open");
exit(1);
}