--- revoco.c 2007-09-01 19:50:57.000000000 +0400 +++ revoco.c 2008-06-30 23:48:33.000000000 +0400 @@ -4,6 +4,7 @@ * Requires hiddev. * * Written November 2006 by E. Toernig's bonobo - no copyrights. + * Cleanup by Petteri Räty and adapted to 0.4 by evadim * * Contact: Edgar Toernig * @@ -47,6 +48,9 @@ #include #include #include +// hiddev and the headers it requires +#include +#include #define streq(a,b) (strcmp((a), (b)) == 0) #define strneq(a,b,c) (strncmp((a), (b), (c)) == 0) @@ -55,57 +59,6 @@ #define MX_REVOLUTION 0xc51a // version RR41.01_B0025 #define MX_REVOLUTION2 0xc525 // version RQR02.00_B0020 -/*** extracted from hiddev.h ***/ - -typedef signed short s16; -typedef signed int s32; -typedef unsigned int u32; - -struct hiddev_devinfo { - u32 bustype; - u32 busnum; - u32 devnum; - u32 ifnum; - s16 vendor; - s16 product; - s16 version; - u32 num_applications; -}; - -struct hiddev_report_info { - u32 report_type; - u32 report_id; - u32 num_fields; -}; - -#define HID_REPORT_TYPE_INPUT 1 -#define HID_REPORT_TYPE_OUTPUT 2 -#define HID_REPORT_TYPE_FEATURE 3 - -struct hiddev_usage_ref { - u32 report_type; - u32 report_id; - u32 field_index; - u32 usage_index; - u32 usage_code; - s32 value; -}; - -struct hiddev_usage_ref_multi { - struct hiddev_usage_ref uref; - u32 num_values; - s32 values[1024]; -}; - -#define HIDIOCGDEVINFO _IOR('H', 0x03, struct hiddev_devinfo) -#define HIDIOCGREPORT _IOW('H', 0x07, struct hiddev_report_info) -#define HIDIOCSREPORT _IOW('H', 0x08, struct hiddev_report_info) -#define HIDIOCGUSAGES _IOWR('H', 0x13, struct hiddev_usage_ref_multi) -#define HIDIOCSUSAGES _IOW('H', 0x14, struct hiddev_usage_ref_multi) - -/*** end hiddev.h ***/ - - static void fatal(const char *fmt, ...) { @@ -337,8 +290,8 @@ static void usage(void) { - printf("Revoco v"VERSION" - Change the wheel behaviour of " - "Logitech's MX-Revolution mouse.\n\n"); + printf("Revoco v%.1f - Change the wheel behaviour of " + "Logitech's MX-Revolution mouse.\n\n", VERSION); printf("Usage:\n"); printf(" revoco free free spinning mode\n"); printf(" revoco click click-to-click mode\n");