diff --git a/configure.ac.weak-wgetch b/configure.ac.weak-wgetch deleted file mode 100644 index ab2b201..0000000 --- a/configure.ac.weak-wgetch +++ /dev/null @@ -1,161 +0,0 @@ -AC_INIT([gpm],[1.20.7],[http://www.nico.schottelius.org/software/gpm/]) - -releasedate=" 2012-10-26" -release="1.20.7" -AC_REVISION(configure.in,v 1.8 2012-10-26 nico) - -dnl Process this file with autoconf to produce a configure script. -dnl written jan/1997 - T.E.Dickey - -AC_PREREQ(2.61) - -AC_CONFIG_SRCDIR([src/daemon/main.c]) -AC_CONFIG_AUX_DIR([config]) -AC_CONFIG_HEADER([src/headers/config.h]) - -AC_CANONICAL_HOST - -dnl Make srcdir an absolute path. -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -# -# Versioning stuff -# -abi_lev="2" -abi_age="1" -abi_rev="0" -abi_full="${abi_lev}.${abi_age}.${abi_rev}" - -AC_DEFINE_UNQUOTED([GPM_ABI_LEV], [$abi_lev], [Library level]) -AC_DEFINE_UNQUOTED([GPM_ABI_AGE], [$abi_age], [Library age]) -AC_DEFINE_UNQUOTED([GPM_ABI_REV], [$abi_rev], [Library revision]) -AC_DEFINE_UNQUOTED([GPM_ABI_FULL],["$abi_full"],[Full library version]) - -# -# Find programs -# - -AC_PROG_CC -AC_PROG_LIBTOOL -AC_PROG_INSTALL -AC_PROG_YACC -AC_PROG_LN_S - -# check for programs. -AC_PATH_PROG(DVIPS,dvips,no) -AC_PATH_PROG(TEXI2HTML,texi2html,no) -AC_PATH_PROG(TEX,tex,no) -AC_PATH_PROG(TEXINDEX,texindex,no) -AC_PATH_PROG(MAKEINFO,makeinfo,no) -AC_PATH_PROG(DIFF,diff,no) -AC_PATH_PROG(SED,sed,no) -AC_PATH_PROG(emacs,emacs,no) - -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - ITZ_PATH_SITE_LISP - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - -# Header-checks -AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) - -# Required headers -AC_CHECK_HEADERS(sys/socket.h,,[AC_MSG_ERROR([Required header file missing])]) - -AC_ARG_ENABLE([static], -[ --enable-static build static libraries @<:@default=no@:>@]) - -LIBGPM_A= - -AS_IF([test "x$enable_static" = "xyes"], [ - LIBGPM_A=lib/libgpm.a -]) - - -AC_ARG_WITH(curses, -[ --without-curses disable curses support even if curses found]) - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - - -ITZ_CHECK_TYPE(__u32,linux/types.h) -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - AC_DEFINE(HAVE___U32, 1, [define if the __u32 type exists either in sys/types.h or in linux/types.h]) -fi - -ITZ_SYS_ELF -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - SHLIB=libgpm.so -else - SHLIB= -fi - -AC_CHECK_FUNCS(vsyslog syslog) -AC_FUNC_ALLOCA - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, tputs) - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -GPMXTERM= -AC_SUBST(GPMXTERM) -AC_SUBST(abi_lev) -AC_SUBST(abi_full) -AC_SUBST(EMACS) -AC_SUBST(ELISP) -AC_SUBST(SHLIB) -AC_SUBST(PICFLAGS) -AC_SUBST(SOLDFLAGS) -AC_SUBST(LIBGPM_A) -AC_SUBST(CURSES_OBJS) -AC_SUBST(SHARED_LIBS) -AC_SUBST(lispdir) -AC_SUBST(release) -AC_SUBST(release_date) - -CPPFLAGS="$CPPFLAGS "'-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\"" -D_GNU_SOURCE' -LDFLAGS="$LDFLAGS "'-L$(srcdir)' - -dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir") -dnl AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir") -AC_OUTPUT(Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm) diff --git a/contrib/Makefile.in b/contrib/Makefile.in index 73ca330..af9a7ce 100644 --- a/contrib/Makefile.in +++ b/contrib/Makefile.in @@ -9,10 +9,10 @@ top_builddir = .. include $(top_builddir)/Makefile.include -all: $(filter-out %.elc,$(srcdir)/$(ELISP)) +all: $(srcdir)/$(ELISP) install: all - if [ -n "$(filter-out %.elc,$(ELISP))" ]; then for i in `echo $(filter-out %.elc,$(ELISP))`; do \ + if [ -n "$(ELISP)" ]; then for i in `echo $(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 "$(filter-out %.elc,$(ELISP))" ]; then for i in `echo $(filter-out %.elc,$(ELISP))`; do \ + if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ rm -f $(lispdir)/$$i ;\ done; fi @@ -28,4 +28,4 @@ dist: $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ clean distclean: - $(RM) $(srcdir)/emacs/*.elc Makefile + $(RM) -f $(srcdir)/emacs/*.elc Makefile diff --git a/contrib/Makefile.in.multilib b/contrib/Makefile.in.multilib deleted file mode 100644 index af9a7ce..0000000 --- a/contrib/Makefile.in.multilib +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(srcdir)/$(ELISP) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/$$i ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc Makefile diff --git a/doc/Makefile.in b/doc/Makefile.in index 7e1ef23..709fa6d 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -130,8 +130,8 @@ install: all installdirs #i keep all my infopages compressed and i'm tired to do it by #hand, so check if there are any compressed pages and do this #one too - #-ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ - # && gzip -f $(infodir)/gpm.info + -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ + && gzip -f $(infodir)/gpm.info # Hmm.... shouldn't man pages be compressed too? # maybe they should, but at least at my system they are not. diff --git a/doc/Makefile.in.multilib b/doc/Makefile.in.multilib deleted file mode 100644 index 709fa6d..0000000 --- a/doc/Makefile.in.multilib +++ /dev/null @@ -1,190 +0,0 @@ -# -*-makefile-*- (gpm/doc) -# -# Copyright (C) 1994 Alessandro Rubini -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# -# -# Do you ever got headache from reading Makefiles ? I will help you and -# me to understand this Makefile: -# -# The main file is doc.gpm (which is generated by configure from doc.gpm.in). -# -# doc.gpm is not 'real' texinfo, real texinfo is generated by infofilter -# to gpm.texinfo. -# -# gpm.texinfo is the source of all other formats. -# -# info is generated by makeinfo (I make that for you). -# -# man pages are generated with the help of manpager. -# -# dvi is generated from texinfo with a small block in this Makefile. -# -# ps is generated from dvi source. -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -all: $(srcdir)/gpm.info gpm.man - -# HTML (texi2html) -%.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) -monolithic $< ;fi - -# TEXINFO (-) -%.texinfo: doc.% Makefile - @rm -f $@ # correct here ? - $(SED) -f $(srcdir)/infofilter $< > $@ - chmod 400 $@ - -# PS (dvips) -%.ps: %.dvi - if [ $(DVIPS) != "no" ]; then $(DVIPS) -f $< > $@; fi - -# INFO (makeinfo) -%.info: %.texinfo - if [ "$(MAKEINFO)" != "no" ]; then $(MAKEINFO) --no-split $< -o $@; fi - -# TXT (-) -%.txt: %.info - $(AWK) -f $(srcdir)/mktxt $< > $@ - -# MAN (-) -$(MANPAGES): gpm.man -gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; - touch gpm.man - - -# DVI -# This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -%.dvi: %.texinfo - -# create a spurious index file to please silly sh (bash will work anyway) -# is this still needed for someone ? - touch $*.oo - -# get the index list, but only if tex is installed -# check the file list, the file and if needed run TeX again -# -# can somebody tell me in a very short way what format dvi is and why we -# cannot generate ps directly ? - - if [ -n "`ls $*.?? $*.aux 2>/dev/null`" -a "$(TEX)" != "no" -a \ - "$(TEXINDEX)" != "no" ]; then \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do cp $$i $$i~; done; \ - $(TEX) $< \ - old="`ls $*.??~ $*.aux~ 2>/dev/null | $(SED) 's/~//g'`"; \ - new="`ls $*.?? $*.aux 2>/dev/null`"; \ - need="n"; \ - if test "$$old" != "$$new"; then need="y"; \ - else \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do \ - cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \ - done; \ - fi; \ - if test "$$need" = "y"; then \ - $(TEXINDEX) $*.?? && $(TEX) $<; \ - fi; \ - fi - -# Main portion - -all: $(srcdir)/gpm.info $(MANPAGES) - -# why gpmdoc.ps and gpm.ps?? -# there is no gpm.ps in my tree and no rule to generate gpm.ps. -gpmdoc.ps: gpm.ps - -$(CP) $< $@ - -# install & uninstall - -installdirs: - $(MKDIR) $(man1dir) $(man7dir) $(man8dir) $(infodir) - -install: all installdirs - $(INSTALL_DATA) -m 644 mev.1 $(man1dir) - $(INSTALL_DATA) -m 644 mouse-test.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-root.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-types.7 $(man7dir) - $(INSTALL_DATA) -m 644 gpm.8 $(man8dir) - $(INSTALL_DATA) -m 644 $(srcdir)/gpm.info $(infodir) - # Use install-info if available - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir $(infodir)/gpm.info; \ - fi; \ - fi - #itz Sat Dec 26 23:21:05 PST 1998 - #i keep all my infopages compressed and i'm tired to do it by - #hand, so check if there are any compressed pages and do this - #one too - -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ - && gzip -f $(infodir)/gpm.info - # Hmm.... shouldn't man pages be compressed too? - # maybe they should, but at least at my system they are not. - -# This potentially leaves around cached manpages, -# e.g. /var/cache/man/cat1/mev.1.gz. Deleting these is not our job, -# but the job of the man program on the host. -uninstall: - cd $(man1dir) && rm -f mev.1 mouse-test.1 gpm-root.1 - rm -f $(man7dir)/gpm-types.7 $(man8dir)/gpm.8 - rm -f $(infodir)/gpm.info $(infodir)/gpm.info.gz - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir \ - --remove $(infodir)/gpm.info; \ - fi; \ - fi - -# configure & unconfigure - -Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in - cd $(top_builddir) && $(SHELL) config.status - -## CLEANUP section -# normal cleanup -clean: - rm -f gpmdoc.ps gpmdoc.txt $(MANPAGES) *~ - rm -f gpm.?? gpm.??? - rm -f gpm.texinfo - -# for creating distribution -distclean: clean - rm -f Makefile doc.gpm - -# to even remove things we leave for end-users -allclean: distclean - rm -f gpm.info - -# Maintainer portion, use at your own risk - -# ignore this: -TAGS: - -## DIST section -# when we cleaned it, we can securely copy us. -dist: distclean - # unneeded now: using pax + -s option and create tars in .. - #$(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -.INTERMEDIATE: gpm.ps -.SECONDARY: %.ps %.texinfo %.dvi - -gs: gpm.ps - gs -sDEVICE=linux -r640x480x2 $< - -gv: gpm.ps - ghostview gpm.ps -magstep -1 -a4 diff --git a/doc/doc.gpm.in b/doc/doc.gpm.in index 00fd18d..afd5a29 100644 --- a/doc/doc.gpm.in +++ b/doc/doc.gpm.in @@ -600,7 +600,7 @@ error. When the document refer to ``standard serial options'' it means that one of @t{\-o dtr}, @t{\-o rts}, @t{\-o both} can be specified to toggle the control lines of the serial port. -The following mouse type are currently recognized: +The following mouse type are corrently recognized: @table @code @item bare Microsoft @@ -621,7 +621,7 @@ The following mouse type are currently recognized: this is your case, use the @samp{bare} mouse type. Some new two-button devices are ``plug and play'', and they don't play fair at all; in this case try @t{\-t pnp}. Many (most) - three-button devices that use the Microsoft protocol fail to + three-button devices that use the microsoft protocol fail to report some middle-button events during mouse motion. Since the protocol does not distinguish between the middle button going up and the middle button going down it would be liable @@ -649,7 +649,7 @@ The following mouse type are currently recognized: decoder gets into a confused state where it thinks the middle button is up when it's down and vice versa. (If you get sick of having to do this, please don't blame gpm; blame your buggy - mouse! Note that most three-button mice that do the Microsoft + mouse! Note that most three-button mice that do the microsoft protocol can be made to do the MouseSystems protocol instead. The ``3 Button Serial Mouse mini-HOWTO'' has information about this.) This mouse decoder accepts standard diff --git a/src/Makefile.in b/src/Makefile.in index 56df704..d3b1dcd 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -96,7 +96,7 @@ $(DEPFILE) dep: prog/gpm-root.c # create dependencies for DEPS in `echo *.c */*.c`; do \ - $(CC) -I. -Iheaders -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \ + $(CC) -I. -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \ $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done ### INSTALL diff --git a/src/daemon/open_console.c b/src/daemon/open_console.c index 0948501..98297c9 100644 --- a/src/daemon/open_console.c +++ b/src/daemon/open_console.c @@ -23,10 +23,6 @@ #include /* stat() */ #include /* ioctl */ -#ifdef HAVE_SYS_SYSMACROS_H -#include /* major() w/newer glibc */ -#endif - /* Linux specific (to be outsourced in gpm2 */ #include /* for serial console check */ #include /* for serial console check */ diff --git a/src/daemon/startup.c b/src/daemon/startup.c index 4d85e8c..1d00255 100644 --- a/src/daemon/startup.c +++ b/src/daemon/startup.c @@ -135,13 +135,6 @@ 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 ***********************/ diff --git a/src/daemon/startup.c.close-fds b/src/daemon/startup.c.close-fds deleted file mode 100644 index 1d00255..0000000 --- a/src/daemon/startup.c.close-fds +++ /dev/null @@ -1,144 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *Startup and Daemon functions* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* atexit() */ -#include /* strlen() */ -#include /* errno */ -#include /* unlink,geteuid */ -#include /* geteuid, mknod */ -#include /* mknod */ -#include /* mknod */ - - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -void startup(int argc, char **argv) -{ - int i, opt; - - static struct { - char *in; - char *out; - } seq[] = { - {"123","01234567"}, - {"132","02134657"}, - {"213","01452367"}, /* warning: these must be readable as integers... */ - {"231","02461357"}, - {"312","04152637"}, - {"321","04261537"}, - {NULL,NULL} - }; - - /* log to debug, who we are */ - gpm_report(GPM_PR_DEBUG, GPM_MESS_VERSION); - - /* basic settings */ - option.run_status = GPM_RUN_STARTUP; /* 10,9,8,... let's go */ - option.autodetect = 0; /* no mouse autodection */ - option.progname = argv[0]; /* who we are */ - option.consolename = Gpm_get_console(); /* get consolename */ - - /* basic2: are not necessary for oops()ing, if not root */ - option.no_mice = 0; /* counts -m + -t */ - option.micelist = NULL; /* no mice found yet */ - option.repeater = 0; /* repeat data */ - option.repeater_type = NULL; /* type of */ - - - cmdline(argc, argv); /* parse command line */ - - if (geteuid() != 0) gpm_report(GPM_PR_OOPS,GPM_MESS_ROOT); /* root or exit */ - - /* Planned for gpm-1.30, but only with devfs */ - /* if(option.autodetect) autodetect(); */ - - - /****************** OLD CODE from gpn.c ***********************/ - - openlog(option.progname, LOG_PID, - option.run_status != GPM_RUN_DEBUG ? LOG_DAEMON : LOG_USER); - loadlut(opt_lut); - - if (option.repeater) { - if(mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) - gpm_report(GPM_PR_OOPS,GPM_MESS_CREATE_FIFO,GPM_NODE_FIFO); - if((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_FIFO); - } - - /* duplicate initialization */ - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if ((which_mouse->opt_accel) < 1) exit(usage("acceleration")); - if ((which_mouse->opt_delta) < 2) exit(usage("delta")); - if (strlen((which_mouse->opt_sequence)) != 3 || atoi((which_mouse->opt_sequence))<100) - exit(usage("sequence")); - if ((which_mouse->opt_glidepoint_tap) > 3) exit(usage("glidepoint tap button")); - if ((which_mouse->opt_glidepoint_tap)) - (which_mouse->opt_glidepoint_tap)=GPM_B_LEFT >> ((which_mouse->opt_glidepoint_tap)-1); - - /* choose the sequence */ - for (opt=0; seq[opt].in && strcmp(seq[opt].in,(which_mouse->opt_sequence)); opt++) ; - if(!seq[opt].in) exit(usage("button sequence")); - (which_mouse->opt_sequence)=strdup(seq[opt].out); /* I can rewrite on it */ - - /* look for the mouse type */ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if (!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); - } - - /* Check repeater status */ - if (option.repeater) { - if (strcmp(option.repeater_type,"raw") == 0) - opt_rawrep = 1; - else { - /* look for the type */ - repeated_type = find_mouse_by_name(option.repeater_type); - - if(!repeated_type) exit(M_listTypes()); /* not found */ - - if (!(repeated_type->repeat_fun)) /* unsupported translation */ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_REPEAT,option.repeater_type); - } - } - - if (option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */ - if (daemon(0,0)) - gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED); /* error */ - - option.run_status = GPM_RUN_DAEMON; /* child */ - } - - /* damon init: check whether we run or not, display message */ - check_uniqueness(); - gpm_report(GPM_PR_INFO,GPM_MESS_STARTED); - - //return mouse_table[1].fd; /* the second is handled in the main() */ - - /****************** OLD CODE from gpn.c END ***********************/ - - init_mice(option.micelist); /* reads option.micelist */ - atexit(gpm_exited); /* call gpm_exited at the end */ -} diff --git a/src/lib/libcurses.c b/src/lib/libcurses.c index 814cce5..e7ebf84 100644 --- a/src/lib/libcurses.c +++ b/src/lib/libcurses.c @@ -41,12 +41,7 @@ #endif /* HAVE_NCURSES_CURSES_H */ #endif /* HAVE_NCURSES_H */ -/* 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()) +#define GET(win) ((win) ? wgetch(win) : getch()) int Gpm_Wgetch(WINDOW *win) { diff --git a/src/lib/libcurses.c.weak-wgetch b/src/lib/libcurses.c.weak-wgetch deleted file mode 100644 index e7ebf84..0000000 --- a/src/lib/libcurses.c.weak-wgetch +++ /dev/null @@ -1,158 +0,0 @@ -/* - * libcurses.c - client library - curses level (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 2002 nico@schottelius.org (Nico Schottelius) - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include /* select(); */ -#include /* timeval */ -#include /* socket() */ - -#include "headers/gpmInt.h" - -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_NCURSES_CURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif /* HAVE_CURSES_H */ -#endif /* HAVE_NCURSES_CURSES_H */ -#endif /* HAVE_NCURSES_H */ - -#define GET(win) ((win) ? wgetch(win) : getch()) - -int Gpm_Wgetch(WINDOW *win) -{ -fd_set selSet; -int max, flag, result; -int fd=STDIN_FILENO; -static Gpm_Event ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - -/*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - if (gpm_fd>-1) - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (FD_ISSET(fd,&selSet)) - return GET(win); - - if (flag==-1) - continue; - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else -/*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -/* JD patch 11/08/1998 */ -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - -/* JD patch 11/08/1998 */ - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; -/* if ungetc() didn't suffice... */ -/* if ((c=prevchar)!=EOF) - { - prevchar=EOF; - return c; - } -*/ - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=GET(win))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=GET(win))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - if ((c=GET(win))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - /* {ungetc(c,stdin);prevchar='['; return 0x1B;} */ - - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=GET(win); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - return 0; -} diff --git a/src/lib/report-lib.c b/src/lib/report-lib.c index 56870a7..c0ae086 100644 --- a/src/lib/report-lib.c +++ b/src/lib/report-lib.c @@ -24,16 +24,8 @@ #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; @@ -55,7 +47,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) log_level = LOG_CRIT; break; } #ifdef HAVE_VSYSLOG - syslog(log_level, "%s", string); + syslog(log_level, string); vsyslog(log_level, text, ap); #else fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); diff --git a/src/lib/report-lib.c.lib-silent b/src/lib/report-lib.c.lib-silent deleted file mode 100644 index c0ae086..0000000 --- a/src/lib/report-lib.c.lib-silent +++ /dev/null @@ -1,59 +0,0 @@ -/* - * report-lib.c: the exported version of gpm_report. used in Gpm_Open and co. - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* exit() */ - -#include "headers/message.h" - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - char *string = NULL; - int log_level; - va_list ap; - - if (stat == GPM_STAT_DEBUG) return; - - va_start(ap,text); - - switch(stat) { - case GPM_STAT_INFO : string = GPM_TEXT_INFO ; - log_level = LOG_INFO; break; - case GPM_STAT_WARN : string = GPM_TEXT_WARN ; - log_level = LOG_WARNING; break; - case GPM_STAT_ERR : string = GPM_TEXT_ERR ; - log_level = LOG_ERR; break; - case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; - log_level = LOG_DEBUG; break; - case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; - log_level = LOG_CRIT; break; - } -#ifdef HAVE_VSYSLOG - syslog(log_level, string); - vsyslog(log_level, text, ap); -#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ -} diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y index f007fee..069d801 100644 --- a/src/prog/gpm-root.y +++ b/src/prog/gpm-root.y @@ -1196,7 +1196,11 @@ int main(int argc, char **argv) LOG_DAEMON : LOG_USER); /* reap your zombies */ childaction.sa_handler=reap_children; - sigemptyset(&childaction.sa_mask); +#if defined(__GLIBC__) + __sigemptyset(&childaction.sa_mask); +#else /* __GLIBC__ */ + childaction.sa_mask=0; +#endif /* __GLIBC__ */ childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */ sigaction(SIGCHLD,&childaction,NULL);