#include "defs.h"
-#include <linux/ioctl.h>
-
#ifdef HAVE_LINUX_INPUT_H
-#include <linux/input.h>
-#include "xlat/evdev_abs.h"
-#include "xlat/evdev_autorepeat.h"
-#include "xlat/evdev_ff_status.h"
-#include "xlat/evdev_ff_types.h"
-#include "xlat/evdev_keycode.h"
-#include "xlat/evdev_leds.h"
-#include "xlat/evdev_misc.h"
-#include "xlat/evdev_mtslots.h"
-#include "xlat/evdev_prop.h"
-#include "xlat/evdev_relative_axes.h"
-#include "xlat/evdev_snd.h"
-#include "xlat/evdev_switch.h"
-#include "xlat/evdev_sync.h"
-
-#ifndef SYN_MAX
-# define SYN_MAX 0xf
-#endif
+
+# include <linux/ioctl.h>
+# include <linux/input.h>
+# include "xlat/evdev_abs.h"
+# include "xlat/evdev_autorepeat.h"
+# include "xlat/evdev_ff_status.h"
+# include "xlat/evdev_ff_types.h"
+# include "xlat/evdev_keycode.h"
+# include "xlat/evdev_leds.h"
+# include "xlat/evdev_misc.h"
+# include "xlat/evdev_mtslots.h"
+# include "xlat/evdev_prop.h"
+# include "xlat/evdev_relative_axes.h"
+# include "xlat/evdev_snd.h"
+# include "xlat/evdev_switch.h"
+# include "xlat/evdev_sync.h"
+
+# ifndef SYN_MAX
+# define SYN_MAX 0xf
+# endif
static void
decode_envelope(struct ff_envelope *envelope)
tprintf(", maximum=%" PRIu32 ", fuzz=%" PRIu32,
absinfo.maximum, absinfo.fuzz);
tprintf(", flat=%" PRIu32, absinfo.flat);
-#ifdef HAVE_STRUCT_INPUT_ABSINFO_RESOLUTION
+# ifdef HAVE_STRUCT_INPUT_ABSINFO_RESOLUTION
tprintf(", resolution=%" PRIu32, absinfo.resolution);
-#endif
+# endif
tprints("}");
} else {
tprints(", ...}");
return 1;
}
-#ifdef EVIOCGKEYCODE_V2
+# ifdef EVIOCGKEYCODE_V2
static int
keycode_V2_ioctl(struct tcb *tcp, long arg)
{
}
return 1;
}
-#endif /* EVIOCGKEYCODE_V2 */
+# endif /* EVIOCGKEYCODE_V2 */
static int
getid_ioctl(struct tcb *tcp, long arg)
return 1;
}
-#ifdef EVIOCGMTSLOTS
+# ifdef EVIOCGMTSLOTS
static int
mtslots_ioctl(struct tcb *tcp, const unsigned int code, long arg)
{
tprints("]}");
return 1;
}
-#endif /* EVIOCGMTSLOTS */
+# endif /* EVIOCGMTSLOTS */
-#if defined EVIOCGREP || defined EVIOCSREP
+# if defined EVIOCGREP || defined EVIOCSREP
static int
repeat_ioctl(struct tcb *tcp, long arg)
{
printpair_int(tcp, arg, "%u");
return 1;
}
-#endif /* EVIOCGREP || EVIOCSREP */
+# endif /* EVIOCGREP || EVIOCSREP */
static int
evdev_read_ioctl(struct tcb *tcp, const unsigned int code, long arg)
case EV_MSC:
return decode_bitset(tcp, arg,
evdev_misc, MSC_MAX, "MSC_???");
-#ifdef EV_SW
+# ifdef EV_SW
case EV_SW:
return decode_bitset(tcp, arg,
evdev_switch, SW_MAX, "SW_???");
-#endif
+# endif
case EV_LED:
return decode_bitset(tcp, arg,
evdev_leds, LED_MAX, "LED_???");
return 1;
case EVIOCGID:
return getid_ioctl(tcp, arg);
-#ifdef EVIOCGREP
+# ifdef EVIOCGREP
case EVIOCGREP:
return repeat_ioctl(tcp, arg);;
-#endif
+# endif
case EVIOCGKEYCODE:
return keycode_ioctl(tcp, arg);
-#ifdef EVIOCGKEYCODE_V2
+# ifdef EVIOCGKEYCODE_V2
case EVIOCGKEYCODE_V2:
return keycode_V2_ioctl(tcp, arg);
-#endif
+# endif
}
switch (_IOC_NR(code)) {
-#ifdef EVIOCGMTSLOTS
+# ifdef EVIOCGMTSLOTS
case _IOC_NR(EVIOCGMTSLOTS(0)):
return mtslots_ioctl(tcp, code, arg);
-#endif
+# endif
case _IOC_NR(EVIOCGNAME(0)):
case _IOC_NR(EVIOCGPHYS(0)):
case _IOC_NR(EVIOCGUNIQ(0)):
tprints(", ");
printstr(tcp, arg, tcp->u_rval - 1);
return 1;
-#ifdef EVIOCGPROP
+# ifdef EVIOCGPROP
case _IOC_NR(EVIOCGPROP(0)):
return decode_bitset(tcp, arg,
evdev_prop, INPUT_PROP_MAX, "PROP_???");
-#endif
+# endif
case _IOC_NR(EVIOCGSND(0)):
return decode_bitset(tcp, arg,
evdev_snd, SND_MAX, "SND_???");
-#ifdef EVIOCGSW
+# ifdef EVIOCGSW
case _IOC_NR(EVIOCGSW(0)):
return decode_bitset(tcp, arg,
evdev_switch, SW_MAX, "SW_???");
-#endif
+# endif
case _IOC_NR(EVIOCGKEY(0)):
return decode_bitset(tcp, arg,
evdev_keycode, KEY_MAX, "KEY_???");
return abs_ioctl(tcp, arg);
switch (code) {
-#ifdef EVIOCSREP
+# ifdef EVIOCSREP
case EVIOCSREP:
return repeat_ioctl(tcp, arg);
-#endif
+# endif
case EVIOCSKEYCODE:
return keycode_ioctl(tcp, arg);
-#ifdef EVIOCSKEYCODE_V2
+# ifdef EVIOCSKEYCODE_V2
case EVIOCSKEYCODE_V2:
return keycode_V2_ioctl(tcp, arg);
-#endif
+# endif
case EVIOCSFF:
return ff_effect_ioctl(tcp, arg);
case EVIOCRMFF:
-#ifdef EVIOCSCLOCKID
+# ifdef EVIOCSCLOCKID
case EVIOCSCLOCKID:
-#endif
+# endif
case EVIOCGRAB:
-#ifdef EVIOCREVOKE
+# ifdef EVIOCREVOKE
case EVIOCREVOKE:
-#endif
+# endif
tprints(", ");
printnum_int(tcp, arg, "%u");
return 1;