commit gpm for openSUSE:Factory
Hello community, here is the log from the commit of package gpm for openSUSE:Factory checked in at Fri Jan 28 17:03:56 CET 2011. -------- --- gpm/gpm.changes 2010-10-26 18:45:24.000000000 +0200 +++ gpm/gpm.changes 2011-01-27 17:00:19.000000000 +0100 @@ -1,0 +2,6 @@ +Thu Jan 27 16:57:52 CET 2011 - pth@suse.de + +- Through out the PS/2 patches that lead to gpm not working. +- Add patches from Fedora. + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- gpm-ps2_command_bytes.patch gpm-ps2_read.patch gpm-ps2_reconnection.patch gpm-quiet_libgpm.patch gpm-silitek.patch New: ---- gpm-close-fds.patch gpm-gcc4.3.patch gpm-lib-silent.patch gpm-libtool.patch gpm-multilib.patch gpm-weak-wgetch.patch inputattach.c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gpm.spec ++++++ --- /var/tmp/diff_new_pack.dENjw2/_old 2011-01-28 16:56:16.000000000 +0100 +++ /var/tmp/diff_new_pack.dENjw2/_new 2011-01-28 16:56:16.000000000 +0100 @@ -1,7 +1,7 @@ # -# spec file for package gpm (Version 1.20.6) +# spec file for package gpm # -# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -32,7 +32,7 @@ %endif # Version: 1.20.6 -Release: 2 +Release: 3 Summary: Console Mouse Support Source0: gpm-%{version}.tar.lzma Source1: gpm-%{version}-patches.tar.lzma @@ -40,15 +40,11 @@ Source3: sysconfig.mouse-%{name} Source4: README.SuSE Source5: baselibs.conf +Source6: inputattach.c Patch0: gpm-DESTDIR.patch -Patch1: gpm-ps2_command_bytes.patch -Patch2: gpm-ps2_read.patch -Patch3: gpm-ps2_reconnection.patch Patch4: gpm-syn_conf.patch -Patch5: gpm-silitek.patch Patch6: gpm-conf.patch Patch7: gpm-va_arg.patch -Patch8: gpm-quiet_libgpm.patch Patch9: gpm-no_templates_for_new_multiple_mode.patch Patch10: gpm-ceil.patch Patch11: gpm-Gpm_Open.patch @@ -58,6 +54,12 @@ Patch18: gpm-glibc210.patch Patch19: gpm-use_getdtablesize.patch Patch20: gpm-int_ptr_casts.patch +Patch21: gpm-close-fds.patch +Patch22: gpm-gcc4.3.patch +Patch23: gpm-lib-silent.patch +Patch24: gpm-libtool.patch +Patch25: gpm-multilib.patch +Patch26: gpm-weak-wgetch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build PreReq: %install_info_prereq @@ -86,14 +88,9 @@ %prep %setup -q %patch0 -%patch1 -%patch2 -%patch3 %patch4 -%patch5 %patch6 %patch7 -%patch8 %patch9 %patch10 %patch11 @@ -103,7 +100,12 @@ %patch18 %patch19 %patch20 - +%patch21 +%patch22 +%patch23 +%patch24 +%patch25 +%patch26 cp %{S:2} %{S:3} %{S:4} . %build @@ -117,10 +119,11 @@ %ifarch %arm make CC="gcc -lm" %endif -make +make %{?_smp_mflags} +%__cc %{optflags} -o inputattach %{SOURCE6} %install -make ROOT="" DESTDIR=$RPM_BUILD_ROOT install +%makeinstall ROOT="" # # gpm confings install -d $RPM_BUILD_ROOT/etc/${file/conf\/gpm-/gpm\/} @@ -138,6 +141,7 @@ install -m 755 -d $RPM_BUILD_ROOT/var/adm/fillup-templates install -m 755 -d $RPM_BUILD_ROOT/etc/init.d install -m 755 -d $RPM_BUILD_ROOT/usr/sbin +install -m 755 inputattach %{buildroot}%{_sbindir} install -m 644 sysconfig.mouse-%{name} $RPM_BUILD_ROOT/var/adm/fillup-templates install -m 755 rcgpm $RPM_BUILD_ROOT/etc/init.d/gpm ln -sf ../../etc/init.d/gpm $RPM_BUILD_ROOT/usr/sbin/rcgpm ++++++ gpm-close-fds.patch ++++++ --- src/daemon/startup.c.close-fds 2008-06-13 10:08:19.000000000 +0200 +++ src/daemon/startup.c 2008-12-02 10:11:12.000000000 +0100 @@ -135,6 +135,13 @@ void startup(int argc, char **argv) check_uniqueness(); gpm_report(GPM_PR_INFO,GPM_MESS_STARTED); + // close extra fds + if (option.run_status == GPM_RUN_STARTUP ) { + close(0); + close(1); + close(2); + } + //return mouse_table[1].fd; /* the second is handled in the main() */ /****************** OLD CODE from gpn.c END ***********************/ ++++++ gpm-conf.patch ++++++ --- /var/tmp/diff_new_pack.dENjw2/_old 2011-01-28 16:56:16.000000000 +0100 +++ /var/tmp/diff_new_pack.dENjw2/_new 2011-01-28 16:56:16.000000000 +0100 @@ -11,33 +11,7 @@ directory, test it out and then edit it to suit your feels. * You'd like to name the gpm info file inside /usr/info/dir. Just insert -Index: doc/README.silitek -=================================================================== ---- doc/README.silitek.orig 2010-09-08 13:26:13.916055341 +0200 -+++ doc/README.silitek 2010-09-08 13:26:14.084036415 +0200 -@@ -14,11 +14,11 @@ This IR commander can be used with two t - - Both types of mouse driver uses the system wide configuration file - -- /etc/gpm-silitek.conf -+ /etc/gpm/silitek.conf - - which defines the return values of any key not being mouse button - or mouse stick. For this keys the drag mouse button works as a --modifier: pressed once, the last column in /etc/gpm-silitek.conf -+modifier: pressed once, the last column in /etc/gpm/silitek.conf - is used. To switch back to the normal return values, the drag mouse - button has to be pressed again. It is allowed to use escaped - sequences as return values. Characters other than printable can -@@ -169,7 +169,7 @@ EOF - -------------------------------------------------------------------- - - the Multimedia keys on IR Keyboard SK-7100 are usable (for ncurses --based programs see below). After editing /etc/gpm-silitek.conf -+based programs see below). After editing /etc/gpm/silitek.conf - to get the similar named keys to work similar, both the IR Keyboard - SK-7100 and the IR commander SM-1000 are usable in parallel. - + Index: doc/README.synaptics =================================================================== --- doc/README.synaptics.orig 2009-02-09 10:58:53.000000000 +0100 @@ -118,6 +92,7 @@ $(HOME)/.gpm-root The user configuration file. /dev/vcs* Virtual Console Screens .fi + Index: doc/gpm.info =================================================================== --- doc/gpm.info.orig 2009-02-09 10:59:44.000000000 +0100 @@ -131,19 +106,7 @@ configuration information. This option is intended for those system administrators who fear security could be broken by this daemon. Things should be sufficiently secure, but if you find a -Index: src/headers/silitek.h -=================================================================== ---- src/headers/silitek.h.orig 2010-09-08 13:26:14.000045878 +0200 -+++ src/headers/silitek.h 2010-09-08 13:26:14.224020642 +0200 -@@ -27,7 +27,7 @@ extern void silitek_keys(unsigned char * - extern void silitek_keys_ps2(unsigned char *data, int *drag); - extern int silitek_ghost_ps2(unsigned char *data); - extern int fd_silitek; --#define SILI_SYSTEM_FILE SYSCONFDIR "/gpm-silitek.conf" -+#define SILI_SYSTEM_FILE SYSCONFDIR "/silitek.conf" - #define SILISTRLEN 32 - #define SILISTRSCN "key %32s %32s %32s" - extern void silitek_mapping(void); + Index: src/headers/twiddler.h =================================================================== --- src/headers/twiddler.h.orig 2009-02-09 10:58:53.000000000 +0100 @@ -171,6 +134,7 @@ #define DEFAULT_FORE 7 #define DEFAULT_BACK 0 + Index: src/synaptics.c =================================================================== --- src/synaptics.c.orig 2009-02-09 10:58:53.000000000 +0100 ++++++ gpm-gcc4.3.patch ++++++ --- src/daemon/open_console.c.gcc4.3 2008-05-28 11:12:34.000000000 +0200 +++ src/daemon/open_console.c 2008-05-28 11:12:40.000000000 +0200 @@ -21,7 +21,6 @@ #include <fcntl.h> /* open and co. */ #include <sys/stat.h> /* stat() */ -#include <stropts.h> /* ioctl */ /* Linux specific (to be outsourced in gpm2 */ #include <linux/serial.h> /* for serial console check */ ++++++ gpm-lib-silent.patch ++++++ --- src/lib/report-lib.c.lib-silent 2002-12-24 23:57:16.000000000 +0100 +++ src/lib/report-lib.c 2006-01-18 17:55:38.000000000 +0100 @@ -24,8 +24,16 @@ #include "headers/message.h" +static int gpm_silent() { + if ( getenv( "GPM_VERBOSE" ) == NULL ) return 1; + return 0; +} + void gpm_report(int line, char *file, int stat, char *text, ... ) { + if ( gpm_silent() && stat != GPM_STAT_OOPS ) + return; + char *string = NULL; int log_level; va_list ap; ++++++ gpm-libtool.patch ++++++ --- configure.ac.libtool 2009-02-11 08:12:00.000000000 +0100 +++ configure.ac 2009-02-11 08:12:08.000000000 +0100 @@ -42,7 +42,7 @@ release="`cat $srcdir/.gitversion`" # AC_PROG_CC -AC_PROG_RANLIB +AC_PROG_LIBTOOL AC_PROG_INSTALL AC_PROG_YACC AC_PROG_LN_S ++++++ gpm-multilib.patch ++++++ Index: contrib/Makefile.in =================================================================== --- contrib/Makefile.in.orig 2008-06-19 07:48:48.000000000 +0200 +++ contrib/Makefile.in 2011-01-27 12:31:18.404745581 +0100 @@ -9,10 +9,10 @@ top_builddir = .. include $(top_builddir)/Makefile.include -all: $(srcdir)/$(ELISP) +all: $(filter-out %.elc,$(srcdir)/$(ELISP)) install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ + if [ -n "$(filter-out %.elc,$(ELISP))" ]; then for i in `echo $(filter-out %.elc,$(ELISP))`; do \ $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ done; fi @@ -20,7 +20,7 @@ install: all $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ + if [ -n "$(filter-out %.elc,$(ELISP))" ]; then for i in `echo $(filter-out %.elc,$(ELISP))`; do \ rm -f $(lispdir)/$$i ;\ done; fi @@ -28,4 +28,4 @@ dist: $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc Makefile + $(RM) $(srcdir)/emacs/*.elc Makefile ++++++ gpm-weak-wgetch.patch ++++++ --- src/lib/libcurses.c.weak-wgetch 2002-12-24 17:57:16.000000000 -0500 +++ src/lib/libcurses.c 2004-03-22 15:51:24.000000000 -0500 @@ -41,7 +41,12 @@ #endif /* HAVE_NCURSES_CURSES_H */ #endif /* HAVE_NCURSES_H */ -#define GET(win) ((win) ? wgetch(win) : getch()) +/* If win != NULL, it must have been created by ncurses anyway. + Avoid circular library dependencies. */ +#pragma weak wgetch +#pragma weak stdscr + +#define GET(win) ((win && wgetch) ? wgetch(win) : getch()) int Gpm_Wgetch(WINDOW *win) { --- configure.ac.weak-wgetch 2004-03-22 15:49:51.000000000 -0500 +++ configure.ac 2004-03-22 15:51:24.000000000 -0500 @@ -115,7 +115,7 @@ AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) else :; fi done - SHARED_LIBS="$LIBS $TERMLIBS -lc" + SHARED_LIBS="-lc" LIBS=$SAVELIBS ;; esac ++++++ inputattach.c ++++++ /* * $Id: inputattach.c,v 1.2 2007/04/02 14:18:54 tjanouse Exp $ * * Copyright (c) 1999-2000 Vojtech Pavlik * * Sponsored by SuSE * * Twiddler support Copyright (c) 2001 Arndt Schoenewald * Sponsored by Quelltext AG (http://www.quelltext-ag.de), Dortmund, Germany */ /* * Input line discipline attach program */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Should you need to contact me, the author, you can do so either by * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail: * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ #include <linux/serio.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/ioctl.h> #include <sys/time.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <termios.h> #include <string.h> #include <assert.h> #include <ctype.h> int readchar(int fd, unsigned char *c, int timeout) { struct timeval tv; fd_set set; tv.tv_sec = 0; tv.tv_usec = timeout * 1000; FD_ZERO(&set); FD_SET(fd, &set); if (!select(fd+1, &set, NULL, NULL, &tv)) return -1; if (read(fd, c, 1) != 1) return -1; return 0; } void setline(int fd, int flags, int speed) { struct termios t; tcgetattr(fd, &t); t.c_cflag = flags | CREAD | HUPCL | CLOCAL; t.c_iflag = IGNBRK | IGNPAR; t.c_oflag = 0; t.c_lflag = 0; t.c_cc[VMIN ] = 1; t.c_cc[VTIME] = 0; cfsetispeed(&t, speed); cfsetospeed(&t, speed); tcsetattr(fd, TCSANOW, &t); } int logitech_command(int fd, char *c) { int i; unsigned char d; for (i = 0; c[i]; i++) { write(fd, c + i, 1); if (readchar(fd, &d, 1000)) return -1; if (c[i] != d) return -1; } return 0; } int magellan_init(int fd, long *id, long *extra) { write(fd, "m3\rpBB\rz\r", 9); return 0; } int warrior_init(int fd, long *id, long *extra) { if (logitech_command(fd, "*S")) return -1; setline(fd, CS8, B4800); return 0; } int spaceball_waitchar(int fd, unsigned char c, unsigned char *d, int timeout) { unsigned char b = 0; while (!readchar(fd, &b, timeout)) { if (b == 0x0a) continue; *d++ = b; if (b == c) break; } *d = 0; return -(b != c); } int spaceball_waitcmd(int fd, char c, char *d) { int i; for (i = 0; i < 8; i++) { if (spaceball_waitchar(fd, 0x0d, d, 1000)) return -1; if (d[0] == c) return 0; } return -1; } int spaceball_cmd(int fd, char *c, char *d) { int i; for (i = 0; c[i]; i++) write(fd, c + i, 1); write(fd, "\r", 1); i = spaceball_waitcmd(fd, toupper(c[0]), d); return i; } #define SPACEBALL_1003 1 #define SPACEBALL_2003B 3 #define SPACEBALL_2003C 4 #define SPACEBALL_3003C 7 #define SPACEBALL_4000FLX 8 #define SPACEBALL_4000FLX_L 9 int spaceball_init(int fd, long *id, long *extra) { char r[64]; if (spaceball_waitchar(fd, 0x11, r, 4000) || spaceball_waitchar(fd, 0x0d, r, 1000)) return -1; if (spaceball_waitcmd(fd, '@', r)) return -1; if (strncmp("@1 Spaceball alive", r, 18)) return -1; if (spaceball_waitcmd(fd, '@', r)) return -1; if (spaceball_cmd(fd, "hm", r)) return -1; if (!strncmp("Hm2003B", r, 7)) *id = SPACEBALL_2003B; if (!strncmp("Hm2003C", r, 7)) *id = SPACEBALL_2003C; if (!strncmp("Hm3003C", r, 7)) *id = SPACEBALL_3003C; if (!strncmp("HvFirmware", r, 10)) { if (spaceball_cmd(fd, "\"", r)) return -1; if (strncmp("\"1 Spaceball 4000 FLX", r, 21)) return -1; if (spaceball_waitcmd(fd, '"', r)) return -1; if (strstr(r, " L ")) *id = SPACEBALL_4000FLX_L; else *id = SPACEBALL_4000FLX; if (spaceball_waitcmd(fd, '"', r)) return -1; if (spaceball_cmd(fd, "YS", r)) return -1; if (spaceball_cmd(fd, "M", r)) return -1; return 0; } if (spaceball_cmd(fd, "P@A@A", r) || spaceball_cmd(fd, "FT@", r) || spaceball_cmd(fd, "MSS", r)) return -1; return 0; } int stinger_init(int fd, long *id, long *extra) { int i; unsigned char c; unsigned char *response = "\r\n0600520058C272"; if (write(fd, " E5E5", 5) != 5) /* Enable command */ return -1; for (i = 0; i < 16; i++) /* Check for Stinger */ if (readchar(fd, &c, 200) || (c != response[i])) return -1; return 0; } int mzp_init(int fd, long *id, long *extra) { if (logitech_command(fd, "*X*q")) return -1; setline(fd, CS8, B9600); return 0; } int newton_init(int fd, long *id, long *extra) { int i; unsigned char c; unsigned char response[35] = { 0x16, 0x10, 0x02, 0x64, 0x5f, 0x69, 0x64, 0x00, 0x00, 0x00, 0x0c, 0x6b, 0x79, 0x62, 0x64, 0x61, 0x70, 0x70, 0x6c, 0x00, 0x00, 0x00, 0x01, 0x6e, 0x6f, 0x66, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x10, 0x03, 0xdd, 0xe7 }; for (i = 0; i < 35; i++) if (readchar(fd, &c, 400) || (c != response[i])) return -1; return 0; } int twiddler_init(int fd, long *id, long *extra) { unsigned char c[10]; int count, line; /* Turn DTR off, otherwise the Twiddler won't send any data. */ if (ioctl(fd, TIOCMGET, &line)) return -1; line &= ~TIOCM_DTR; if (ioctl(fd, TIOCMSET, &line)) return -1; /* Check whether the device on the serial line is the Twiddler. * * The Twiddler sends data packets of 5 bytes which have the following * properties: the MSB is 0 on the first and 1 on all other bytes, and * the high order nibble of the last byte is always 0x8. * * We read and check two of those 5 byte packets to be sure that we * are indeed talking to a Twiddler. */ /* Read at most 5 bytes until we find one with the MSB set to 0 */ for (count = 0; count < 5; count++) { if (readchar(fd, c+0, 500)) return -1; if ((c[0] & 0x80) == 0) break; } if (count == 5) { /* Could not find header byte in data stream */ return -1; } /* Read remaining 4 bytes plus the full next data packet */ for (count = 1; count < 10; count++) { if (readchar(fd, c+count, 500)) return -1; } /* Check whether the bytes of both data packets obey the rules */ for (count = 1; count < 10; count++) { if ((count % 5 == 0 && (c[count] & 0x80) != 0) || (count % 5 == 4 && (c[count] & 0xF0) != 0x80) || (count % 5 != 0 && (c[count] & 0x80) != 0x80)) { /* Invalid byte in data packet */ return -1; } } return 0; } int dump_init(int fd, long *id, long *extra) { unsigned char c, o = 0; c = 0x80; if (write(fd, &c, 1) != 1) /* Enable command */ return -1; while (1) if (!readchar(fd, &c, 1)) { printf("%02x (%c) ", c, ((c > 32) && (c < 127)) ? c : 'x'); o = 1; } else { if (o) { printf("\n"); o = 0; } } } struct input_types { char name[16]; char name2[16]; int speed; int flags; unsigned long type; unsigned long id; unsigned long extra; int flush; int (*init)(int fd, long *id, long *extra); }; struct input_types input_types[] = { { "--sunkbd", "-skb", B1200, CS8, SERIO_SUNKBD, 0, 0, 1, NULL }, { "--lkkbd", "-lk", B4800, CS8|CSTOPB, SERIO_LKKBD, 0, 0, 1, NULL }, { "--vsxxx-aa", "-vs", B4800, CS8|CSTOPB|PARENB|PARODD,SERIO_VSXXXAA, 0, 0, 1, NULL }, { "--spaceorb", "-orb", B9600, CS8, SERIO_SPACEORB, 0, 0, 1, NULL }, { "--spaceball", "-sbl", B9600, CS8, SERIO_SPACEBALL,0, 0, 0, spaceball_init }, { "--magellan", "-mag", B9600, CS8 | CSTOPB | CRTSCTS, SERIO_MAGELLAN, 0, 0, 1, magellan_init }, { "--warrior", "-war", B1200, CS7 | CSTOPB, SERIO_WARRIOR, 0, 0, 1, warrior_init }, { "--stinger", "-sting", B1200, CS8, SERIO_STINGER, 0, 0, 1, stinger_init }, { "--mousesystems", "-msc", B1200, CS8, SERIO_MSC, 0, 0x01, 1, NULL }, { "--sunmouse", "-sun", B1200, CS8, SERIO_SUN, 0, 0x01, 1, NULL }, { "--microsoft", "-bare", B1200, CS7, SERIO_MS, 0, 0, 1, NULL }, { "--mshack", "-ms", B1200, CS7, SERIO_MS, 0, 0x01, 1, NULL }, { "--mouseman", "-mman", B1200, CS7, SERIO_MP, 0, 0x01, 1, NULL }, { "--intellimouse", "-ms3", B1200, CS7, SERIO_MZ, 0, 0x11, 1, NULL }, { "--mmwheel", "-mmw", B1200, CS7 | CSTOPB, SERIO_MZP, 0, 0x13, 1, mzp_init }, { "--iforce", "-ifor", B38400, CS8, SERIO_IFORCE, 0, 0, 0, NULL }, { "--newtonkbd", "-newt", B9600, CS8, SERIO_NEWTON, 0, 0, 0, newton_init }, { "--h3600ts", "-ipaq", B115200, CS8, SERIO_H3600, 0, 0, 0, NULL }, { "--stowawaykbd", "-ipaqkbd", B115200, CS8, SERIO_STOWAWAY, 0, 0, 0, NULL }, { "--ps2serkbd", "-ps2ser", B1200, CS8, SERIO_PS2SER, 0, 0, 1, NULL }, { "--twiddler", "-twid", B2400, CS8, SERIO_TWIDKBD, 0, 0, 0, twiddler_init }, { "--twiddler-joy", "-twidjoy", B2400, CS8, SERIO_TWIDJOY, 0, 0, 0, twiddler_init }, { "--elotouch", "-elo", B9600, CS8 | CRTSCTS, SERIO_ELO, 0, 0, 0, NULL }, { "--elo4002", "-elo6b", B9600, CS8 | CRTSCTS, SERIO_ELO, 1, 0, 0, NULL }, { "--elo271-140", "-elo4b", B9600, CS8 | CRTSCTS, SERIO_ELO, 2, 0, 0, NULL }, { "--elo261-280", "-elo3b", B9600, CS8 | CRTSCTS, SERIO_ELO, 3, 0, 0, NULL }, { "--dump", "-dump", B2400, CS8, 0, 0, 0, 0, dump_init }, { "", "", 0, 0 } }; int main(int argc, char **argv) { unsigned long devt; int ldisc; int type; long id, extra; int fd; char c; if (argc < 2 || argc > 4 || (argc == 4 && strcmp(argv[3], "--daemon")) || !strcmp("--help", argv[1])) { puts(""); puts("Usage: inputttach <mode> <device>"); puts(""); puts("Modes:"); puts(" --sunkbd -skb Sun Type 4 and Type 5 keyboards"); puts(" --lkkbd -lk DEC LK201 / LK401 keyboards"); puts(" --vsxxx-aa -vs DEC VSXXX-AA / VSXXX-GA mouse and VSXXX-AB tablet"); puts(" --spaceorb -orb SpaceOrb 360 / SpaceBall Avenger"); puts(" --spaceball -sbl SpaceBall 2003 / 3003 / 4000 FLX"); puts(" --magellan -mag Magellan / SpaceMouse"); puts(" --warrior -war WingMan Warrior"); puts(" --stinger -stng Gravis Stinger"); puts(" --mousesystems -msc 3-button Mouse Systems mice"); puts(" --sunmouse -sun 3-button Sun mice"); puts(" --microsoft -bare 2-button Microsoft mice"); puts(" --mshack -ms 3-button mice in Microsoft mode"); puts(" --mouseman -mman 3-button Logitech and Genius mice"); puts(" --intellimouse -ms3 Microsoft IntelliMouse"); puts(" --mmwheel -mmw Logitech mice with 4-5 buttons or wheel"); puts(" --iforce -ifor I-Force joysticks and wheels"); puts(" --h3600ts -ipaq Ipaq h3600 touchscreen"); puts(" --stowawaykbd -ipaqkbd Stowaway keyboard"); puts(" --ps2serkbd -ps2ser PS/2 via serial keyboard"); puts(" --twiddler -twid Handykey Twiddler chording keyboard"); puts(" --twiddler-joy -twidjoy Handykey Twiddler used as a joystick"); puts(""); return 1; } for (type = 0; input_types[type].speed; type++) { if (!strncasecmp(argv[1], input_types[type].name, 16) || !strncasecmp(argv[1], input_types[type].name2, 16)) break; } if (!input_types[type].speed) { fprintf(stderr, "inputattach: invalid mode\n"); return 1; } if ((fd = open(argv[2], O_RDWR | O_NOCTTY | O_NONBLOCK)) < 0) { perror("inputattach"); return 1; } setline(fd, input_types[type].flags, input_types[type].speed); if (input_types[type].flush) while (!readchar(fd, &c, 100)); id = input_types[type].id; extra = input_types[type].extra; if (input_types[type].init && input_types[type].init(fd, &id, &extra)) { fprintf(stderr, "inputattach: device initialization failed\n"); return 1; } ldisc = N_MOUSE; if(ioctl(fd, TIOCSETD, &ldisc)) { fprintf(stderr, "inputattach: can't set line discipline\n"); return 1; } devt = input_types[type].type | (id << 8) | (extra << 16); if(ioctl(fd, SPIOCSTYPE, &devt)) { fprintf(stderr, "inputattach: can't set device type\n"); return 1; } if (argc == 4 && !strcmp(argv[3],"--daemon")) daemon(0,0); read(fd, NULL, 0); ldisc = 0; ioctl(fd, TIOCSETD, &ldisc); close(fd); return 0; } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de