Compare commits

...
Author SHA1 Message Date
Giacomo Catenazzi 1525a75133 Import Debian changes 1.9.5.3-8
g15daemon (1.9.5.3-8) unstable; urgency=low

  * Put the third argument (modes) on open with O_CREAT (Closes: #559649)
  * remove rpath
2009-12-18 07:52:26 +01:00
Giacomo Catenazzi e34c9fcf1c Import Debian changes 1.9.5.3-7
g15daemon (1.9.5.3-7) unstable; urgency=low

  * Don't distribute .la file
2009-10-08 07:22:15 +02:00
Giacomo Catenazzi c9a200ca8e Import Debian changes 1.9.5.3-6
g15daemon (1.9.5.3-6) unstable; urgency=low

  * Shared devices (lcd dispaly + audio) are not good handled
    by udev script. Adding workaround until improving
    programs to handle disconnections (Closes: #541780)
  * Add debugging flag (and code) for init.d and udev scripts
  * Change syslog facility: from user to daemon
  * better (and more secure) screenshort creation in /tmp
2009-08-19 07:33:22 +02:00
Giacomo Catenazzi b6a96a4dd3 Import Debian changes 1.9.5.3-5
g15daemon (1.9.5.3-5) unstable; urgency=low

  * Handle keyboard device with udev, so detecting detachement
    and attachment of keyboarda (Closes: #489978).
  * init.d LSB header: try to start before xorg, to be able
    to have full access to all extra keys.
  * Recent libg15 corrected strange behaviour in new G15 keyboard
    (Closes: #494180)
2009-08-13 08:20:02 +02:00
Giacomo Catenazzi c8d7f9138e Import Debian changes 1.9.5.3-4
g15daemon (1.9.5.3-4) unstable; urgency=low

  * Try to load uinput module, in order to have Gx key working
    (Closes: #475000).
  * Usual updates
2009-08-06 08:32:33 +02:00
Giacomo Catenazzi be8ef5acb3 Import Debian changes 1.9.5.3-3
g15daemon (1.9.5.3-3) unstable; urgency=low

  * Changing default in /etc/default/g15daemon: Use L1 key instead of MR
    as actual upstream default and allowing to use g15macro
    (Closes: #478069)
  * Removed the X11 setup on man page, because it is not relevant
    to recent distributions and could confuse our users (Closes: #463078)
2008-04-28 08:47:07 +02:00
Giacomo Catenazzi c1e37ff1ff Import Debian changes 1.9.5.3-2
g15daemon (1.9.5.3-2) unstable; urgency=low

  * Recommend xkb-data instead of keyboard-config. Adapted patch from
    Amaya, thanks! (Closes: #474451).
2008-04-07 19:56:34 +02:00
Giacomo Catenazzi b0d19d1e70 Import Debian changes 1.9.5.3-1
g15daemon (1.9.5.3-1) unstable; urgency=low

  * New upstream version
2008-02-14 08:08:03 +01:00
Giacomo Catenazzi c7666acd5c Import Upstream version 1.9.5.3 2019-04-29 15:43:03 +02:00
Giacomo Catenazzi 18176a4efe Import Upstream version 1.9.5.2 2019-04-29 15:43:03 +02:00
Giacomo Catenazzi 9602397440 Import Upstream version 1.9.1.0.svn346 2019-04-29 15:43:02 +02:00
Giacomo Catenazzi 9404a6167d Import Upstream version 1.9.0-wip.20070910 2019-04-29 15:43:00 +02:00
Giacomo Catenazzi 1610f485ef Import Debian changes 1.9.5.2-2
g15daemon (1.9.5.2-2) unstable; urgency=low

  * Handle better errors in the init.d script (Closes: #463073)
2008-01-29 20:15:35 +01:00
Giacomo Catenazzi 1577a9b44e Import Debian changes 1.9.5.2-1
g15daemon (1.9.5.2-1) unstable; urgency=low

  * New upstream version
  * Change default behaviour: to switch client use MR (as already documented
    in /etc/default/g15daemon, but wrongly implemented)
2008-01-28 09:12:16 +01:00
Giacomo Catenazzi a5486422e2 Import Debian changes 1.9.1.0.svn346-1
g15daemon (1.9.1.0.svn346-1) unstable; urgency=low

  * New upstream version (from svn)
2007-12-18 09:15:42 +01:00
Giacomo Catenazzi 15b2644256 Import Debian changes 1.9.0-wip.20070910-5
g15daemon (1.9.0-wip.20070910-5) unstable; urgency=low

  * change priority to "extra"
  * force libg15render-dev versioned dependencies
2007-10-09 13:28:56 +02:00
Giacomo Catenazzi 8885aae540 Import Debian changes 1.9.0-wip.20070910-4
g15daemon (1.9.0-wip.20070910-4) unstable; urgency=low

  * Correct building errors (closes: #441919, #442995)
2007-09-18 20:29:54 +02:00
Giacomo Catenazzi 2b7a313c05 Import Debian changes 1.9.0-wip.20070910-3
g15daemon (1.9.0-wip.20070910-3) unstable; urgency=low

  * first try to make a debian/rules full working for
    svn and released version
  * fix directory fixes (closes: #442296)
2007-09-14 20:59:27 +02:00
Giacomo Catenazzi 8337c95069 Import Debian changes 1.9.0-wip.20070910-2
g15daemon (1.9.0-wip.20070910-2) unstable; urgency=low

  * pause() instead of busy loop.
2007-09-11 06:12:01 +02:00
Giacomo Catenazzi 0301e1151b Import Debian changes 1.9.0-wip.20070910-1
g15daemon (1.9.0-wip.20070910-1) unstable; urgency=low

  * New upstream release (from svn)
  * Don't install plugin in /usr/share (Closes: #441619)
2007-09-10 23:02:14 +02:00
Giacomo Catenazzi 6c7461ac31 Import Debian changes 1.9.0-2
g15daemon (1.9.0-2) unstable; urgency=low

  * Updates: better init.d scripts (with support for L1 key)
  * install also the sample plugin (clock, net, uinput)
2007-08-30 23:31:18 +02:00
Giacomo Catenazzi 70c4e045b2 Import Debian changes 1.9.0-1
g15daemon (1.9.0-1) unstable; urgency=low

  * New upstream release

g15daemon (1.2.7-1) unstable; urgency=low

  * Initial release
2007-08-28 20:09:54 +02:00
69 changed files with 8096 additions and 6857 deletions

No files matched your search

+13
View File
@@ -1,9 +1,22 @@
Mike Lampard <mlampard@users.sf.net>
- primary developer
Sven Ludwig
- Python bindings
James Green
- Documentaion updates
Anthony J. Mirabella
- numerous miscellaneous fixes and improvements to just about everything.
Lars Sanders
- Clock plugin fixes
Fabrizio Sestito
- changes required to compile on OS-X
- OS-X kext file
Matthew McGee
- Solaris Documentation
+90 -12
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others
(c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 214 $ - $Date: 2006-12-25 13:08:09 +1030 (Mon, 25 Dec 2006) $ $Author: aneurysm9 $
$Revision: 458 $ - $Date: 2008-01-31 15:48:40 +1030 (Thu, 31 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -84,14 +84,92 @@ allow clients use of all 'L' keys.
1.2.5svn -> current
- Add compiletime check for uinput version, should resolve compilation problems on some distro's
- Security improved - the daemon now sets its effective uid to nobody as soon as possible.
1.9.0SVN
- Add plugin API
- partially rewritten event core
- updated g15daemon_xmms_spectrum plugin with new features, now enabled via configure --enable-xmmsplugin
xmms devel and glib devel packages will need to be installed prior to attempting ./configure --enable-xmmsplugin
Plugin is not compiled by default.
- Clock is now a plugin
- dependency on libdaemon is now removed
- g15daemon is now dependant on libg15render.
- Clock now includes analog clock thanks to Rasta Freak <igor.jusic@zg.t-com.hr>
1.9.0
- Feature: Add plugin API
- Feature: partially rewritten event core
- Feature: updated g15daemon_xmms_spectrum plugin with new features, available in trunk/g15daemon_audio_plugins (SVN)
- Feature: Clock is now a plugin
- Feature: dependency on libdaemon is now removed
- Feature: g15daemon is now dependant on libg15render.
- Feature: Clock now includes analog clock thanks to Rasta Freak <igor.jusic@zg.t-com.hr>
- Moved g15daemon_xmms_spectrum plugin to separate package
1.9.1
- BugFix: Plugins are now installed in ${PREFIX}/{${LIBDIR}/g15daemon/${VERSION}/plugins
- Feature: OS-X support thanks to Fabrizio Sestito.
- Bugfix: libg15daemon_client: keypresses were being corrupted.
- Bugfix: libg15daemon_client: use g15_recv rather than recv.
- Bugfix: use default scheduling for all threads.
- Optimisation: minor optimisation of lcd_cycle() code.
- Security: repair some potential security holes.
- Bugfix: Backlight status was being mis-applied when cycling screens.
- Bugfix: Language bindings were not being distributed.
1.9.2
- BugFix: Add exitfunc to net plugin for exit notification.
- BugFix: Use pause() instead of sleeping
- BugFix: create leaving var as volatile.
- BugFix: Add NAME section to g15daemon_client manpages
- Tweak delay between successive keyboard reads. This reduces cpu load by
50% on my system.
- Bugfix: Ensure that all plugin exit functions are called on leaving.
- Bugfix: if keypress event is received (very early in the startup process,
the daemon would crash. Check that expected pointers are valid.
- Bugfix: Dont attempt compilation of uinput plugin if headers are
unavailable.
- Bugfix: Write a blank buffer to the LCD before exiting.
- Feature: Add --lcdlevel cmdline option to allow setting default LCD brightness level
1.9.3:
- BugFix: The documentation for --switch was inverted. Fix.
- Debug: Print list of commandline args when in debug mode
- BugFix: The decreased delay caused keypresses to be misread on some
machines. REVERT.
1.9.4
- Debug: Log warning if keyboard disappears.
- Bugfix: Fix autoconf autodetect bugs re uinput plugin.
- Feature: If autodetection of uinput fails, configure now has a
--disable-uinput override.
- Feature: WIP should now compile and run on Linux, MacOSX, and Solaris (v10+).
Only Linux and Solaris have been tested.
- Debug: Add more debugging to plugin loader.
- Debug: Log build date,OS and GCC version.
- Feature: Plugin loader will now use DEEP_BIND if available, hopefully
resolving conflicts on OS's that support it.
- Feature: Solaris support. Requires some end-user changes to the usb
stack at the moment. Documentation coming soon.
- BugFix: Plugin loader is now much more robust.
- Feature: Add OS specific documentation for Linux and FreeBSD.
Compilation and use on FreeBSD is completely untested.
- Feature: Debug verbosity of g15daemon_log is now variable.
- Feature: Plugin filenames are now cached in g15daemon.conf to allow
(manual, at this stage) changing of load-order.
- Portability: Add our own daemon() function if platform doesn't have native
support.
- TidyUp: Wrap keyboard read function.
- TidyUp: Make all plugin-internal functions static.
- Portability: Remove mutexes on Solaris, as libusb (and therefore libg15)
blocks on read.
- Optimisation: Use pthread conditional variable to signal LCD state change.
Further reduces unnecessary wakeups.
1.9.5
- Add example udev helper scripts to contrib directory.
- API: Add NEVER_SELECT cmd to client API to enforce non-display on
client-switch. Used by G15Macro if available.
- Debug: Add segfault handler to libg15daemon_client to aid debugging
clients.
- Feature: Add screendump ability. Pressing M1+M3 simultaneously will write
a pbm format image of the currently displayed screen to
/tmp/g15daemon-sc-?.pbm, where ? is an incremental number.
- BugFix: Only wakeup display thread if LCD buffer is visible.
- Packaging: Fix debian packaging to include plugins.
1.9.5.1:
- BugFix: If lcd refresh is requested whilst processing, refreshes were missed.
- Optimisation: The delay between screen updates is no longer required. remove.
1.9.5.2:
- BugFix: IS_USER_SELECTED client command was broken. fix it.
- BugFix: restore client ability to change backlight state.
1.9.5.3:
- BugFix: plugins/g15daemon_net.c: ensure that OOB traffic is not mixed with
normal image buffers.
- Feature: Add --set-backlight to allow clients (and the backlight button)
to set the backlight level for the currently shown screen only. Default is
now to disallow clients changing backlight, and to set backlight globally
via the button.
+3 -109
View File
@@ -13,7 +13,8 @@ The current version of G15Daemon understands the following options:
\-v Show version info.
.P
.HP
\-s By default, g15daemon uses the MR key to switch between client screens. Using this switch on the cmdline alters this, making L1 (the small, round, black button below the LCD) the button to achieve this function.
\-s By default, g15daemon uses the L1 key to switch between client screens. Using this switch on the cmdline alters this, making
MR (Macro Record) the button to achieve this function.
.P
.HP
\-k Stop a previously running copy of G15Daemon. For the keys and LCD to work, you'll have to restart the daemon manually.
@@ -31,118 +32,11 @@ To run the daemon with default options, run:
or
g15daemon \-s
to have the L1 key as the client screen switch.
to have the MR key as the client screen switch.
If all required libraries are installed and in locations known to your operating system, the daemon will slip quietly into the background and a clock will appear on the LCD.
Congratulations! The linux kernel will now output keycodes for all your extra keys.
.SH "Using the keys in X11"
Current versions of the Xorg Xserver dont have support for the extra keys that g15daemon provides. This support will be available in the next release of Xorg (7.2).
For now, if you want access to the extra keys for hotkey support in X11, you need to run the xmodmaprc script on each start of X. This script is available in the contrib folder (if g15daemon is installed in the default location, the contrib folder is in /usr/share/doc/g15daemon\-${VERSION}/contrib
Depending on your linux distribution, copying the xmodmaprc file (or pasting the text below) into ~/.Xmodmap may be all that's required.
.SH "Xmodmaprc file"
Copy the following into ~/.Xmodmap (depending on your distribution) for X11 to recognise all extra G15 keys:
\-\- cut here \-\-
.br
keycode 93 = XF86Launch1
.br
keycode 129 = XF86Launch8
.br
keycode 130 = XF86Launch9
.br
keycode 131 = XF86Launch2
.br
keycode 132 = XF86Phone
.br
keycode 133 = XF86Messenger
.br
keycode 136 = XF86LaunchD
.br
keycode 137 = XF86Support
.br
keycode 138 = XF86Word
.br
keycode 143 = XF86LaunchF
.br
keycode 144 = XF86AudioPrev
.br
keycode 150 = XF86LogOff
.br
keycode 152 = XF86Launch5
.br
keycode 153 = XF86AudioNext
.br
keycode 160 = XF86AudioMute
.br
keycode 161 = XF86Travel
.br
keycode 162 = XF86AudioPlay
.br
keycode 163 = XF86Spell
.br
keycode 164 = XF86AudioStop
.br
keycode 170 = XF86VendorHome
.br
keycode 174 = XF86AudioLowerVolume
.br
keycode 176 = XF86AudioRaiseVolume
.br
keycode 177 = XF86Launch4
.br
keycode 178 = XF86HomePage
.br
keycode 182 = XF86Away
.br
keycode 183 = XF86WebCam
.br
keycode 184 = XF86Launch0
.br
keycode 188 = XF86Music
.br
keycode 190 = XF86Launch6
.br
keycode 194 = XF86Forward
.br
keycode 195 = XF86Send
.br
keycode 205 = XF86Calendar
.br
keycode 208 = XF86Launch7
.br
keycode 209 = XF86LaunchB
.br
keycode 210 = XF86LaunchC
.br
keycode 215 = XF86Save
.br
keycode 219 = XF86WWW
.br
keycode 220 = XF86LaunchE
.br
keycode 223 = XF86Sleep
.br
keycode 228 = XF86Pictures
.br
keycode 231 = XF86LaunchA
.br
keycode 236 = XF86Mail
.br
keycode 237 = XF86AudioMedia
.br
keycode 246 = XF86iTouch
.br
keycode 247 = XF86Launch3
.br
keycode 249 = XF86ToDoList
.br
keycode 251 = XF86Calculater
.br
\-\- end cutting \-\-
.SH "AUTHORS"
The latest release of g15daemon is available at
.P
+2 -1
View File
@@ -1,4 +1,5 @@
.TH "G15daemon Client Development" "" "1.0" "G15Daemon" ""
.SH "NAME" g15daemon_client \- G15Daemon Server / Client communication for g15daemon.
.SH "SYNOPSIS"
#include <libg15.h>
.br
@@ -54,7 +55,7 @@ Example:
int retval = 0;
int screen_fd = new_g15_screen( G15_WBMPBUF );
... do processing and display here ...
... do processing and display here ...
retval = g15_close_screen( screen_fd );
+63 -8
View File
@@ -1,16 +1,20 @@
This file contains some frequently asked questions and answers
regarding G15Daemon and it's installation.
Q1. G15daemon complains that it cant find libg15.so.1 !!
Q1. G15daemon complains that it can't find libg15.so.1 !!
Q1a. G15daemon complains that it can't find libg15render.so.1 !!
Answer:
By default, libg15 is installed in /usr/local/lib. Some distros
don't look there for libraries by default. There are two ways
around this - 1. add /usr/local/lib to /etc/ld.so.conf (you'll
need to be root to do this) and run ldconfig or 2. rerun the
libg15 configure script with --prefix=/usr, then make && make in-
stall. This will install libg15 into the /usr/lib directory.
Some of the g15 libraries are installed in /usr/local/lib.
Some distros don't look there for libraries by default. There
are two ways around this -
1. add /usr/local/lib to /etc/ld.so.conf (you'll need to be root)
and run ldconfig or
2.rerun the library configure script with --prefix=/usr,then make
&& make install. This will install libg15 into the /usr/lib
directory.
Q2. G15daemon complains about not receiving a return value
@@ -33,3 +37,54 @@ you'll find an xmodmaprc script and a bash script in the contrib
directory. Copy the xmodmaprc file to $HOME/.Xmodmap and set the
bash script to run every time X11 starts. KDE has an AutoStart
folder you can put it in, Gnome probably has something similar.
Q4. What devices are currently supported with G15Daemon?
Answer:
G15Daemon is designed to support whatever devices libg15 supports.
Currently,this means the G15 Keyboard(s), the G11 Keyboard and Z10
Speakers.
Q5. Are there any forums supporting the G15Tools?
Answer:
Yes. There are several. G15Tools now has it's own site, including
forums, at www.g15tools.com.There are also forums on the g15daemon
project site: http://sourceforge.net/projects/g15daemon, and a few
Linux distributions have threads setup for G15Tools users.
Q6. Why doesn't G15Daemon use DBUS or DCOP?
Answer:
DBUS is a nice thing, however it's very new and is not available
everywhere. We try to keep dependancies to the minimum, and using
DBUS would mean we have to ensure that G15Daemon is loaded after
the DBUS server, which is something we can't guarantee. Down the
track we will look at providing a DBUS G15Daemon proxy.
Q7. Is G15Daemon able to run on my operating system?
Answer:
G15Daemon currently has support for Linux, MacOSX and Solaris.
Some Linux distributions include the G15Tools in their package
managers, however those may not be up-to-date.
FreeBSD support is possible, see README.FreeBSD for details on
how you can try it out. FreeBSD support is completely untested,
however it may work. Please let us know if it works for you.
Q8. Will G15Daemon ever run on Windows?
Answer:
It might, but not by design. There is commercial support from
Logitech for that operating system.
+10 -3
View File
@@ -2,10 +2,11 @@ LLIBDIR=@LIBDIR@
SUBDIRS = libg15daemon_client g15daemon plugins
INCLUDES = -I$(top_srcdir)/libg15daemon_client -I$(top_srcdir)/g15daemon
EXTRA_DIST = debian contrib Documentation lang-bindings patches rpm README.usage FAQ LICENSE images
EXTRA_DIST = debian contrib Documentation lang-bindings patches rpm README.usage FAQ LICENSE images README.Linux README.FreeBSD README.Solaris
docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION)
doc_DATA = FAQ README.usage README ChangeLog TODO AUTHORS NEWS LICENSE
doc_DATA = FAQ README.usage README ChangeLog TODO AUTHORS NEWS LICENSE README.Linux README.FreeBSD README.Solaris
man1_MANS = $(top_srcdir)/Documentation/g15daemon.1
man3_MANS = $(top_srcdir)/Documentation/g15daemon_client_devel.3
@@ -13,11 +14,17 @@ man3_MANS = $(top_srcdir)/Documentation/g15daemon_client_devel.3
imagedir = $(prefix)/share/g15daemon/splash
image_DATA = images/g15logo2.wbmp
install-data-hook:
if KEXT_INSTALL
cp -Rf $(top_srcdir)/contrib/libusbshield.kext @KEXT_LOCATION@
chown -R root:wheel @KEXT_LOCATION@/libusbshield.kext
endif
dist-hook:
rm -rf `find $(distdir)/debian -name .svn`
rm -rf `find $(distdir)/contrib -name .svn`
rm -rf `find $(distdir)/Documentation -name .svn`
rm -rf `find $(distdir)/lang_bindings -name .svn`
rm -rf `find $(distdir)/lang-bindings -name .svn`
rm -rf `find $(distdir)/patches -name .svn`
rm -rf `find $(distdir)/rpm -name .svn`
rm -rf `find $(distdir)/plugins -name .svn`
+102 -73
View File
@@ -1,8 +1,8 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -14,15 +14,11 @@
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -36,18 +32,19 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
TODO config/config.guess config/config.sub config/depcomp \
config/install-sh config/ltmain.sh config/missing
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
@@ -55,10 +52,11 @@ SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-exec-recursive install-info-recursive \
install-recursive installcheck-recursive installdirs-recursive \
pdf-recursive ps-recursive uninstall-info-recursive \
uninstall-recursive
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
man1dir = $(mandir)/man1
am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" \
"$(DESTDIR)$(docdir)" "$(DESTDIR)$(imagedir)"
@@ -74,6 +72,8 @@ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
docDATA_INSTALL = $(INSTALL_DATA)
imageDATA_INSTALL = $(INSTALL_DATA)
DATA = $(doc_DATA) $(image_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
@@ -89,8 +89,6 @@ GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
@@ -117,11 +115,14 @@ EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
G15DAEMON_PLUGIN_DIR = @G15DAEMON_PLUGIN_DIR@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KEXT_LOCATION = @KEXT_LOCATION@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
@@ -129,6 +130,7 @@ LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -138,17 +140,18 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -160,6 +163,7 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION)
@@ -187,13 +191,20 @@ program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
LLIBDIR = @LIBDIR@
SUBDIRS = libg15daemon_client g15daemon plugins
INCLUDES = -I$(top_srcdir)/libg15daemon_client -I$(top_srcdir)/g15daemon
EXTRA_DIST = debian contrib Documentation lang-bindings patches rpm README.usage FAQ LICENSE images
doc_DATA = FAQ README.usage README ChangeLog TODO AUTHORS NEWS LICENSE
EXTRA_DIST = debian contrib Documentation lang-bindings patches rpm README.usage FAQ LICENSE images README.Linux README.FreeBSD README.Solaris
doc_DATA = FAQ README.usage README ChangeLog TODO AUTHORS NEWS LICENSE README.Linux README.FreeBSD README.Solaris
man1_MANS = $(top_srcdir)/Documentation/g15daemon.1
man3_MANS = $(top_srcdir)/Documentation/g15daemon_client_devel.3
imagedir = $(prefix)/share/g15daemon/splash
@@ -239,7 +250,7 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
$(MAKE) stamp-h1; \
$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@@ -261,10 +272,9 @@ clean-libtool:
distclean-libtool:
-rm -f libtool
uninstall-info-am:
install-man1: $(man1_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
@@ -309,7 +319,7 @@ uninstall-man1:
done
install-man3: $(man3_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man3dir)" || $(mkdir_p) "$(DESTDIR)$(man3dir)"
test -z "$(man3dir)" || $(MKDIR_P) "$(DESTDIR)$(man3dir)"
@list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
@@ -354,7 +364,7 @@ uninstall-man3:
done
install-docDATA: $(doc_DATA)
@$(NORMAL_INSTALL)
test -z "$(docdir)" || $(mkdir_p) "$(DESTDIR)$(docdir)"
test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)"
@list='$(doc_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
@@ -371,7 +381,7 @@ uninstall-docDATA:
done
install-imageDATA: $(image_DATA)
@$(NORMAL_INSTALL)
test -z "$(imagedir)" || $(mkdir_p) "$(DESTDIR)$(imagedir)"
test -z "$(imagedir)" || $(MKDIR_P) "$(DESTDIR)$(imagedir)"
@list='$(image_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
@@ -418,8 +428,7 @@ $(RECURSIVE_TARGETS):
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
$(RECURSIVE_CLEAN_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
@@ -463,8 +472,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -489,8 +498,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -500,13 +509,12 @@ ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
@@ -521,24 +529,22 @@ distclean-tags:
distdir: $(DISTFILES)
$(am__remove_distdir)
mkdir $(distdir)
$(mkdir_p) $(distdir)/config
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
test -d $(distdir) || mkdir $(distdir)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -552,7 +558,7 @@ distdir: $(DISTFILES)
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(mkdir_p) "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
@@ -560,6 +566,8 @@ distdir: $(DISTFILES)
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$top_distdir" \
distdir="$$distdir/$$subdir" \
am__remove_distdir=: \
am__skip_length_check=: \
distdir) \
|| exit 1; \
fi; \
@@ -570,7 +578,7 @@ distdir: $(DISTFILES)
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
@@ -580,6 +588,10 @@ dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
@@ -606,6 +618,8 @@ distcheck: dist
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
@@ -645,7 +659,7 @@ distcheck: dist
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
@@ -670,7 +684,7 @@ all-am: Makefile $(MANS) $(DATA) config.h
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(imagedir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
@@ -717,13 +731,23 @@ info: info-recursive
info-am:
install-data-am: install-docDATA install-imageDATA install-man
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) install-data-hook
install-dvi: install-dvi-recursive
install-exec-am:
install-html: install-html-recursive
install-info: install-info-recursive
install-man: install-man1 install-man3
install-pdf: install-pdf-recursive
install-ps: install-ps-recursive
installcheck-am:
maintainer-clean: maintainer-clean-recursive
@@ -744,37 +768,42 @@ ps: ps-recursive
ps-am:
uninstall-am: uninstall-docDATA uninstall-imageDATA uninstall-info-am \
uninstall-man
uninstall-info: uninstall-info-recursive
uninstall-am: uninstall-docDATA uninstall-imageDATA uninstall-man
uninstall-man: uninstall-man1 uninstall-man3
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
check-am clean clean-generic clean-libtool clean-recursive \
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
dist-hook dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-generic distclean-hdr distclean-libtool \
distclean-recursive distclean-tags distcleancheck distdir \
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
install-data-am install-strip
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-zip \
distcheck distclean distclean-generic distclean-hdr \
distclean-libtool distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am \
install-docDATA install-exec install-exec-am install-imageDATA \
install-info install-info-am install-man install-man1 \
install-man3 install-strip installcheck installcheck-am \
installdirs installdirs-am maintainer-clean \
maintainer-clean-generic maintainer-clean-recursive \
mostlyclean mostlyclean-generic mostlyclean-libtool \
mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
install-data-hook install-docDATA install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-imageDATA install-info install-info-am install-man \
install-man1 install-man3 install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am uninstall-docDATA uninstall-imageDATA \
uninstall-info-am uninstall-man uninstall-man1 uninstall-man3
uninstall-man uninstall-man1 uninstall-man3
install-data-hook:
@KEXT_INSTALL_TRUE@ cp -Rf $(top_srcdir)/contrib/libusbshield.kext @KEXT_LOCATION@
@KEXT_INSTALL_TRUE@ chown -R root:wheel @KEXT_LOCATION@/libusbshield.kext
dist-hook:
rm -rf `find $(distdir)/debian -name .svn`
rm -rf `find $(distdir)/contrib -name .svn`
rm -rf `find $(distdir)/Documentation -name .svn`
rm -rf `find $(distdir)/lang_bindings -name .svn`
rm -rf `find $(distdir)/lang-bindings -name .svn`
rm -rf `find $(distdir)/patches -name .svn`
rm -rf `find $(distdir)/rpm -name .svn`
rm -rf `find $(distdir)/plugins -name .svn`
+5 -4
View File
@@ -1,8 +1,8 @@
** README G15Daemon 1.2 **
$Revision: 214 $
$Date: 2006-12-25 13:08:09 +1030 (Mon, 25 Dec 2006) $
$Author: aneurysm9 $
$Revision: 357 $
$Date: 2007-12-26 19:36:11 +1030 (Wed, 26 Dec 2007) $
$Author: mlampard $
G15daemon takes control of the G15 keyboard, allowing the use of
@@ -45,7 +45,8 @@ LCD clients, and cannot be used for other purposes if the
LCD is being used.
[EDIT] As of 30/10/06 svn, the client switch key can be altered
from MR to L1 by specifying -s on the g15daemon commandline.
from L1 to MR by specifying -s on the g15daemon commandline. This
is not recommended.
***
+30
View File
@@ -0,0 +1,30 @@
$Revision: 377 $
$Date: 2008-01-01 21:56:13 +1030 (Tue, 01 Jan 2008) $
$Author: mlampard $
**** IMPORTANT NOTICE *******************************************************
*** Please Note: G15Daemon is completely untested on FreeBSD.
*** Please report success or failure, any additional steps taken
*** and Operating System version to mlampard@users.sf.net
******************************************************************************
In order for G15Daemon to be able to claim the usb device needed for the LCD and extra keys,
the following _kernel_ configuration changes may be necessary:
First test if ugen is already enabled:
- Plug in the keyboard or other supported USB device.
- dmesg |grep "ugen"
- you should see a line similar to "ugen0: Logitech G15 Keyboard"
If not already enabled:
For FreeBSD versions 5.4 and below, and version 6.0:
Disable uhid
Enable ugen
For FreeBSD versions 5.5, 6.1 and higher:
Enable ugen
Recompile the kernel and reboot.
NetBSD and OpenBSD are not supported at this time due to libusb deficiencies on those platforms.
+7
View File
@@ -0,0 +1,7 @@
$Revision: 377 $
$Date: 2008-01-01 21:56:13 +1030 (Tue, 01 Jan 2008) $
$Author: mlampard $
G15Daemon should compile and run just fine with no intervention.
Please read the README and manpages for further info.
+124
View File
@@ -0,0 +1,124 @@
*************************************************************************************************
Solaris 10+ support is here as of Jan-1-2008
G15 Daemon 1.9.4
LibG15Render-1.2
LibG15-1.2.5
Fully tested on Solaris 10 and and OpenSolaris 11 (Nevada) with G15 Version 1 and G15 Version 2.
The other keyboards should function but I have not tested them.
I will be trying to keep up with new versions and providing packages as needed.
All packages are in SV datastream format.
You can install them using 'pkgadd -d http://URL to package all'
*************************************************************************************************
G15 Daemon requires Solaris 10 and later with libusb installed.
SUNWlibusb Sun wrapper library for libusb
SUNWlibusbS libusb (source)
SUNWlibusbugen SUN libusb ugen plugin
SUNWlibusbugenS libusbugen plugin (source)
*************************************************************************************************
Compiling from source :
Note : Compiling code on Opensolaris 11 (Nevada) does not guarantee
the binaries will be functional on Solaris 10.
*************************************************************************************************
If installing from SVN you must have the following packages from http://sunfreeware.com
installed into /usr/local/bin :
autoconf-2.60-sol10-x86-local
automake-1.10-sol10-x86-local
libiconv-1.11-sol10-x86-local
make-3.81-sol10-x86-local
perl-5.8.8-sol10-x86-local
gcc-3.4.6-sol10-x86-local
libtool-1.5.24-sol10-x86-local
m4-1.4.7-sol10-x86-local
When compiling LibG15 from SVN you may need to set
LD_LIBRARY_PATH=/lib:/usr/lib:/usr/sfw/lib:/opt/g15/lib
export LD_LIBRARY_PATH
If installing from a release source package you must fist compile and install
at least LibG15 1.2.5 and LibG15Render-1.2.
No other packages are required.
Successfully configure options are as follows :
./configure --prefix=/opt/g15 'LDFLAGS='-L/usr/sfw/lib -L/opt/g15/lib' \
'CPPFLAGS=-I/usr/sfw/include -I/opt/g15/include' && gmake && gmake install
*************************************************************************************************
* The following script can be used to configure the device support to Solaris and Opensolaris.
* G15Daemon runs as user nobody so we must provide read/write permissions for user nobody
* or you must run g15daemon with the option : --user root
*************************************************************************************************
#!/bin/ksh
exec 2>/dev/null
echo "Verifying the ugen driver"
add_drv -m '* 0666 root sys' -i 'ugen' ugen
echo "Adding driver support for Logitech G15 V1"
/usr/sbin/update_drv -a -m '* 0660 nobody sys' -i '"usb46d,c222"' ugen
echo "Adding driver support for Logitech G15 V2"
/usr/sbin/update_drv -a -m '* 0660 nobody sys' -i '"usb46d,c227"' ugen
echo "Adding driver support for Logitech G11 V1"
/usr/sbin/update_drv -a -m '* 0660 nobody sys' -i '"usb46d,c225"' ugen
echo "Adding driver support for Logitech Z-10 V1"
/usr/sbin/update_drv -a -m '* 0660 nobody sys' -i '"usb46d,0a07"' ugen
echo "Finished installing device support."
touch /reconfigure
echo "You must reboot to enable ugen in your device tree"
*************************************************************************************************
The following XML document can be used to integrate G15Daemon into SMF.
1. Save it to a file (Suggested location is /var/svc/manifest/site/g15daemon.xml)
2. verify using 'svccfg validate /path_to_file'
3. import using 'svccfg import /path_to_file'
4. enable using 'svcadm enable g15daemon'
*************************************************************************************************
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='SCIG15daemon:default'>
<service name='site/g15daemon' type='service' version='1'>
<create_default_instance enabled='false' />
<single_instance />
<dependency name='localfs' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/system/filesystem/local' />
</dependency>
<dependency name='loopback' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/network/loopback' />
</dependency>
<dependency name='device_files' grouping='require_any' restart_on='restart' type='path'>
<service_fmri value='file://localhost/dev/usb/46d.c222' />
<service_fmri value='file://localhost/dev/usb/46d.c225' />
<service_fmri value='file://localhost/dev/usb/46d.c227' />
<service_fmri value='file://localhost/dev/usb/46d.0a07' />
</dependency>
<exec_method type='method' name='start' exec='/opt/g15/sbin/g15daemon' timeout_seconds='60'/>
<exec_method type='method' name='stop' exec='/opt/g15/sbin/g15daemon -k' timeout_seconds='60' />
<stability value='Unstable' />
<template>
<common_name><loctext xml:lang='C'>G15daemon</loctext></common_name>
<documentation>
<manpage title='g15daemon' section='1' manpath='/opt/g15/share/man' />
<manpage title='g15daemon_client_devl' section='3' manpath='/opt/g15/share/man' />
</documentation>
</template>
</service>
</service_bundle>
*************************************************************************************************
Please read the README and manpages for further info.
*************************************************************************************************
+4 -3
View File
@@ -5,12 +5,11 @@ TODO list for G15daemon. Not in any particular order.
PARTIALLY DONE - Add manpage and other documentation for the client library and it's
bindings.
- Add client to record & playback macros (being worked on)
DONE (G15Macro) - Add client to record & playback macros.
- add a few simple template client examples in various languages
- Read a configuration file. Currently there are no real user-configurable
options, but ....
DONE - Read a configuration file.
DONE - Allow for clients to change LCD backlight.
@@ -32,3 +31,5 @@ will allow the client app to exit without taking the screen with them.
use the 'screen' they previously created, as long as they return within the
'time-to-live' period they set before exiting. This will allow for scripts
etc to periodically update.
- Add DBUS proxy.
Vendored
+944 -488
View File
File diff suppressed because it is too large. Load diff
+36
View File
@@ -1,11 +1,32 @@
/* config.h.in. Generated from configure.in by autoheader. */
/* Date of compilation */
#undef BUILD_DATE
/* Build OS Particulars */
#undef BUILD_OS_NAME
/* Compiler Version */
#undef COMPILER_VERSION
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Define to 1 if you have the `backtrace' function. */
#undef HAVE_BACKTRACE
/* Define to 1 if you have the `backtrace_symbols' function. */
#undef HAVE_BACKTRACE_SYMBOLS
/* Define if daemon() is available */
#undef HAVE_DAEMON
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <execinfo.h> header file. */
#undef HAVE_EXECINFO_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
@@ -84,6 +105,21 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if libusb implementation blocks on read or write */
#undef LIBUSB_BLOCKS
/* Target OS is Darwin */
#undef OSTYPE_DARWIN
/* Target OS is Linux */
#undef OSTYPE_LINUX
/* Target OS is unknown */
#undef OSTYPE_OTHER
/* Target OS is Solaris */
#undef OSTYPE_SOLARIS
/* Name of package */
#undef PACKAGE
+64 -14
View File
@@ -1,9 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
timestamp='2005-08-03'
timestamp='2007-05-17'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -106,7 +107,7 @@ set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@@ -160,6 +161,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
@@ -206,8 +208,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
*:SolidBSD:*:*)
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
exit ;;
macppc:MirBSD:*:*)
echo powerppc-unknown-mirbsd${UNAME_RELEASE}
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
exit ;;
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
@@ -325,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
i86pc:SunOS:5.*:*)
i86pc:SunOS:5.*:* | ix86xen:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
@@ -764,12 +769,19 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
case ${UNAME_MACHINE} in
pc98)
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
i*:MINGW*:*)
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:windows32*:*)
@@ -779,9 +791,15 @@ EOF
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
x86:Interix*:[34]*)
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
*:Interix*:[3456]*)
case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EM64T | authenticamd)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
@@ -817,6 +835,9 @@ EOF
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
exit ;;
@@ -851,7 +872,11 @@ EOF
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^CPU/{
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
mips64:Linux:*:*)
@@ -870,7 +895,11 @@ EOF
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^CPU/{
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
@@ -919,9 +948,15 @@ EOF
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit ;;
xtensa:Linux:*:*)
echo xtensa-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
@@ -964,7 +999,7 @@ EOF
LIBC=gnulibc1
# endif
#else
#ifdef __INTEL_COMPILER
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
LIBC=gnu
#else
LIBC=gnuaout
@@ -974,7 +1009,11 @@ EOF
LIBC=dietlibc
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^LIBC/{
s: ::g
p
}'`"
test x"${LIBC}" != x && {
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit
@@ -1176,6 +1215,15 @@ EOF
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit ;;
SX-7:SUPER-UX:*:*)
echo sx7-nec-superux${UNAME_RELEASE}
exit ;;
SX-8:SUPER-UX:*:*)
echo sx8-nec-superux${UNAME_RELEASE}
exit ;;
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
@@ -1185,7 +1233,6 @@ EOF
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in
*86) UNAME_PROCESSOR=i686 ;;
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
@@ -1264,6 +1311,9 @@ EOF
i*86:skyos:*:*)
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
exit ;;
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
+77 -30
View File
@@ -1,9 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
timestamp='2005-07-08'
timestamp='2007-04-29'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -119,8 +120,9 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -171,6 +173,10 @@ case $os in
-hiux*)
os=-hiuxwe2
;;
-sco6)
os=-sco5v6
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -187,6 +193,10 @@ case $os in
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5v6*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -231,15 +241,16 @@ case $basic_machine in
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore | mep \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -257,28 +268,27 @@ case $basic_machine in
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| ms1 \
| mt \
| msp430 \
| nios | nios2 \
| ns16k | ns32k \
| or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| score \
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b \
| strongarm \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu | strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown
;;
m32c)
basic_machine=$basic_machine-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
@@ -286,6 +296,9 @@ case $basic_machine in
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
ms1)
basic_machine=mt-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
@@ -305,18 +318,18 @@ case $basic_machine in
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* \
| avr-* | avr32-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| m32r-* | m32rle-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
@@ -336,31 +349,30 @@ case $basic_machine in
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| ms1-* \
| mt-* \
| msp430-* \
| nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
| xstormy16-* | xtensa-* \
| ymp-* \
| z8k-*)
;;
m32c-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
@@ -671,6 +683,10 @@ case $basic_machine in
basic_machine=i386-pc
os=-mingw32
;;
mingw32ce)
basic_machine=arm-unknown
os=-mingw32ce
;;
miniframe)
basic_machine=m68000-convergent
;;
@@ -696,6 +712,9 @@ case $basic_machine in
basic_machine=i386-pc
os=-msdos
;;
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
mvs)
basic_machine=i370-ibm
os=-mvs
@@ -803,6 +822,12 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pc98)
basic_machine=i386-pc
;;
pc98-*)
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
@@ -859,6 +884,10 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
rdos)
basic_machine=i386-pc
os=-rdos
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
@@ -885,6 +914,10 @@ case $basic_machine in
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
sde)
basic_machine=mipsisa32-sde
os=-elf
;;
sei)
basic_machine=mips-sei
os=-seiux
@@ -896,6 +929,9 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
sh5el)
basic_machine=sh5le-unknown
;;
sh64)
basic_machine=sh64-unknown
;;
@@ -1101,7 +1137,7 @@ case $basic_machine in
sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sparc | sparcv8 | sparcv9 | sparcv9b)
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
basic_machine=sparc-sun
;;
cydra)
@@ -1174,21 +1210,23 @@ case $os in
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku*)
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1340,6 +1378,12 @@ else
# system, and we'll never get to this point.
case $basic_machine in
score-*)
os=-elf
;;
spu-*)
os=-elf
;;
*-acorn)
os=-riscix1.2
;;
@@ -1377,6 +1421,9 @@ case $basic_machine in
m68*-cisco)
os=-aout
;;
mep-*)
os=-elf
;;
mips*-cisco)
os=-elf
;;
+59 -5
View File
@@ -1,9 +1,10 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2005-07-09.11
scriptversion=2006-10-15.18
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
# Foundation, Inc.
# 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
@@ -91,7 +92,20 @@ gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -eq 0; then :
else
@@ -276,6 +290,46 @@ icc)
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
# Add `dependent.h:' lines.
sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
@@ -288,13 +342,13 @@ tru64)
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mecanism is used in libtool 1.4 series to
# static library. This mechanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in in $dir.libs/$base.o.d and
# compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+251 -67
View File
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2005-05-14.22
scriptversion=2006-10-14.15
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -39,15 +39,24 @@ scriptversion=2005-05-14.22
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# put in absolute paths if you don't have them in your path; or use env. vars.
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
@@ -58,7 +67,13 @@ stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
chmodcmd="$chmodprog 0755"
posix_glob=
posix_mkdir=
# Desired mode of installed file.
mode=0755
chmodcmd=$chmodprog
chowncmd=
chgrpcmd=
stripcmd=
@@ -95,7 +110,7 @@ Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
while test -n "$1"; do
while test $# -ne 0; do
case $1 in
-c) shift
continue;;
@@ -111,9 +126,15 @@ while test -n "$1"; do
--help) echo "$usage"; exit $?;;
-m) chmodcmd="$chmodprog $2"
-m) mode=$2
shift
shift
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
continue;;
-o) chowncmd="$chownprog $2"
@@ -136,9 +157,19 @@ while test -n "$1"; do
--version) echo "$0 $scriptversion"; exit $?;;
*) # When -d is used, all remaining arguments are directories to create.
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
done
if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
test -n "$dir_arg$dstarg" && break
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
@@ -150,11 +181,9 @@ while test -n "$1"; do
shift # arg
dstarg=$arg
done
break;;
esac
done
fi
if test -z "$1"; then
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
@@ -164,6 +193,33 @@ if test -z "$1"; then
exit 0
fi
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
@@ -173,15 +229,11 @@ do
if test -n "$dir_arg"; then
dst=$src
src=
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
if test -d "$dst"; then
mkdircmd=:
chmodcmd=
else
mkdircmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
@@ -208,53 +260,188 @@ do
echo "$0: $dstarg: Is a directory" >&2
exit 1
fi
dst=$dst/`basename "$src"`
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
# This sed command emulates the dirname command.
dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
obsolete_mkdir_used=false
# Make sure that the destination directory exists.
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
# Skip lots of stat calls in the usual case.
if test ! -d "$dstdir"; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix=/ ;;
-*) prefix=./ ;;
*) prefix= ;;
esac
case $posix_glob in
'')
if (set -f) 2>/dev/null; then
posix_glob=true
else
posix_glob=false
fi ;;
esac
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS=/
$posix_glob && set -f
set fnord $dstdir
shift
$posix_glob && set +f
IFS=$oIFS
pathcomp=
prefixes=
while test $# -ne 0 ; do
pathcomp=$pathcomp$1
shift
if test ! -d "$pathcomp"; then
$mkdirprog "$pathcomp"
# mkdir can fail with a `File exist' error in case several
# install-sh are creating the directory concurrently. This
# is OK.
test -d "$pathcomp" || exit
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
pathcomp=$pathcomp/
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
$doit $mkdircmd "$dst" \
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
dstfile=`basename "$dst"`
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
@@ -262,10 +449,9 @@ do
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
trap '(exit $?); exit' 1 2 13 15
# Copy the file name to the temp name.
$doit $cpprog "$src" "$dsttmp" &&
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
@@ -276,10 +462,10 @@ do
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
&& { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
@@ -291,11 +477,12 @@ do
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
if test -f "$dstdir/$dstfile"; then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
if test -f "$dst"; then
$doit $rmcmd -f "$dst" 2>/dev/null \
|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
|| {
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
else
@@ -304,16 +491,13 @@ do
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
$doit $mvcmd "$dsttmp" "$dst"
}
}
fi || { (exit 1); exit 1; }
done
} || exit 1
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); exit 0
}
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
+562 -172
View File
File diff suppressed because it is too large. Load diff
+34 -27
View File
@@ -1,9 +1,9 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2005-06-08.21
scriptversion=2006-05-10.23
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
@@ -33,6 +33,8 @@ if test $# -eq 0; then
fi
run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
@@ -44,7 +46,7 @@ fi
msg="missing on your system"
case "$1" in
case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
@@ -77,6 +79,7 @@ Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
@@ -106,7 +109,7 @@ esac
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case "$1" in
case $1 in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
@@ -135,7 +138,7 @@ esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
case $1 in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
@@ -164,7 +167,7 @@ WARNING: \`$1' is $msg. You should only need it if
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
@@ -192,8 +195,8 @@ WARNING: \`$1' is needed, but is $msg.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
@@ -214,25 +217,25 @@ WARNING: \`$1' $msg. You should only need it if
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
if test $# -ne 1; then
eval LASTARG="\${$#}"
case "$LASTARG" in
case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
if test ! -f y.tab.h; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
@@ -244,18 +247,18 @@ WARNING: \`$1' is $msg. You should only need it if
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
if test $# -ne 1; then
eval LASTARG="\${$#}"
case "$LASTARG" in
case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
@@ -267,11 +270,9 @@ WARNING: \`$1' is $msg. You should only need it if
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
@@ -289,11 +290,17 @@ WARNING: \`$1' is $msg. You should only need it if
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
@@ -317,13 +324,13 @@ WARNING: \`$1' is $msg. You should only need it if
fi
firstarg="$1"
if shift; then
case "$firstarg" in
case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case "$firstarg" in
case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
Vendored
+4102 -5028
View File
File diff suppressed because it is too large. Load diff
+101 -28
View File
@@ -1,19 +1,23 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
# $Revision: 214 $ - $Date: 2006-12-25 13:08:09 +1030 (Mon, 25 Dec 2006) $ $Author: aneurysm9 $
# $Revision: 458 $ - $Date: 2008-01-31 15:48:40 +1030 (Thu, 31 Jan 2008) $ $Author: mlampard $
AC_PREREQ(2.59)
AC_INIT(g15daemon, [1.9.0], [mlampard@users.sf.net])
AC_INIT(g15daemon, [1.9.5.3], [mlampard@users.sf.net])
AC_PREFIX_DEFAULT(/usr)
AC_CONFIG_AUX_DIR(config)
AC_CANONICAL_HOST()
AC_CANONICAL_TARGET()
AM_INIT_AUTOMAKE()
AC_CONFIG_HEADER([config.h])
AC_LIBTOOL_DLOPEN
# Checks for programs.
AC_PROG_CC
AC_PROG_LIBTOOL
AC_PROG_RANLIB
# Checks for libraries.
AC_CHECK_LIB([g15], [initLibG15],,AC_MSG_ERROR(["libg15 (or its devel package) not found. please install it"]))
@@ -21,30 +25,7 @@ AC_CHECK_LIB([g15render], [g15r_loadWbmpSplash],,AC_MSG_ERROR([">=libg15render-1
AC_CHECK_LIB([m], [sin])
AC_CHECK_LIB([pthread], [pthread_mutex_init])
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([ linux/input.h ])
AC_CHECK_HEADERS([ linux/uinput.h arpa/inet.h fcntl.h stdlib.h string.h sys/socket.h unistd.h libg15.h], [], [],
[#if HAVE_LINUX_INPUT_H
#include <linux/input.h>
#endif
])
#if HAVE_LINUX_UINPUT_H
dnl check for uinput.h version 2.4 or 2.6 ?
AC_CHECK_MEMBER([struct uinput_user_dev.id],
[AC_DEFINE(HAVE_UINPUT_USER_DEV_ID, 1,
[Define if struct uinput_user_dev has id member.])],,
[
#include <linux/input.h>
#include <linux/uinput.h>
]
)
dnl end of uinput version checks
#endif
CPPFLAGS=$CPPFLAGS_save
CPPFLAGS="$CPPFLAGS "'-DDATADIR="\"$(datadir)\""'
AC_CHECK_FUNC(daemon,AC_DEFINE(HAVE_DAEMON,1,[Define if daemon() is available]),[])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@@ -55,7 +36,99 @@ AC_TYPE_SIZE_T
AC_PROG_GCC_TRADITIONAL
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([memset select socket strerror])
AC_CHECK_FUNCS([memset select socket strerror backtrace backtrace_symbols])
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([ linux/input.h ])
AC_CHECK_HEADERS([ execinfo.h ])
AC_CHECK_HEADERS([ linux/uinput.h ], [have_linux_uinput_h=yes],[have_linux_uinput_h=],[])
AC_CHECK_HEADERS([ arpa/inet.h fcntl.h stdlib.h string.h sys/socket.h unistd.h libg15.h],,,
[#if HAVE_LINUX_INPUT_H
#include <linux/input.h>
#endif
],,[])
AC_ARG_ENABLE([--disable-uinput],[ --disable-uinput do not build linux uinput plugin (default: autodetect)])
if test "x$enable_uinput" != "xno"; then
if test "x$have_linux_uinput_h" == "xyes"; then
#if HAVE_LINUX_UINPUT_H
dnl check for uinput.h version 2.4 or 2.6 ?
AC_CHECK_MEMBER([struct uinput_user_dev.id],
[AC_DEFINE(HAVE_UINPUT_USER_DEV_ID, 1,
[Define if struct uinput_user_dev has id member.])],,
[
#include <linux/input.h>
#include <linux/uinput.h>
]
)
uinput=true
dnl end of uinput version checks
AC_MSG_NOTICE([Necessary includes exist: Compiling Uinput Plugin])
#endif
else
AC_MSG_NOTICE([Linux Specific Includes Not Found. NOT COMPILING UINPUT PLUGIN.])
fi
else
AC_MSG_NOTICE([Linux UINPUT plugin disabled by request.])
uinput=false
fi
case $host_os in
*linux*)
AC_DEFINE([OSTYPE_LINUX], [1],[Target OS is Linux])
AC_MSG_NOTICE([OS is Linux, using uinput if available])
;;
*darwin*)
AC_DEFINE([OSTYPE_DARWIN], [1],[Target OS is Darwin])
AC_SUBST(KEXT_LOCATION,["/System/Library/Extensions/"])
AC_MSG_NOTICE([OS is Darwin, using OS specific workarounds])
install_kext=true
uinput=false
;;
*solaris*)
AC_DEFINE([OSTYPE_SOLARIS], [1],[Target OS is Solaris])
AC_SEARCH_LIBS([connect],socket,[],[],[])
AC_SEARCH_LIBS([gethostent],nsl,[],[],[])
AC_SEARCH_LIBS([inet_aton],resolv,[],[],[])
AC_SEARCH_LIBS([nanosleep],rt,[],[],[])
AC_MSG_NOTICE([OS is Solaris, using OS specific workarounds])
uinput=false
libusb_blocks=true
;;
*)
AC_DEFINE([OSTYPE_OTHER], [1],[Target OS is unknown])
AC_MSG_NOTICE([Unknown OS type, your milage may vary....])
uinput=false
;;
esac
AM_CONDITIONAL([KEXT_INSTALL], [test x$install_kext = xtrue])
AM_CONDITIONAL(UINPUT_INTERFACE_PLUGIN, [test x$uinput = xtrue])
dnl Some versions of libusb do not honour timeout and block. Suns' version is one of them.
if test "x$libusb_blocks" == "xtrue"; then
AC_DEFINE([LIBUSB_BLOCKS], [1],[Define if libusb implementation blocks on read or write])
fi
G15D_BUILD_CC="`$CC -v 2>&1 | tail -n 1`"
G15D_BUILD_OS="`uname -s -r -m`"
G15D_BUILD_DATE="`date \"+%a %d %b %Y %T\"`"
AC_DEFINE_UNQUOTED([BUILD_OS_NAME],"${G15D_BUILD_OS}",[Build OS Particulars])
AC_DEFINE_UNQUOTED([BUILD_DATE],"${G15D_BUILD_DATE}",[Date of compilation])
AC_DEFINE_UNQUOTED([COMPILER_VERSION],"${G15D_BUILD_CC}",[Compiler Version])
CPPFLAGS=$CPPFLAGS_save
CPPFLAGS="$CPPFLAGS "'-DDATADIR="\"$(datadir)\""'
AC_SUBST(G15DAEMON_PLUGIN_DIR,["$libdir/g15daemon/$PACKAGE_VERSION/plugins"])
CPPFLAGS="$CPPFLAGS "'-DPLUGINDIR=\"$(G15DAEMON_PLUGIN_DIR)\"'
CPPFLAGS="$CPPFLAGS "'-I$(includedir)'
AC_CONFIG_FILES([Makefile g15daemon/Makefile libg15daemon_client/Makefile plugins/Makefile])
+6
View File
@@ -0,0 +1,6 @@
# G15daemon udev rule to autostart g15daemon on connect
# belongs in udev rules directory such as /etc/udev/rules.d/
# and the script g15daemon-hotplug should be in /usr/bin and made
# executable with chmod +x /usr/bin/g15daemon-hotplug
SYSFS{../name}=="Logitech Logitech Gaming Keyboard", RUN+="/usr/bin/g15daemon-hotplug"
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
# G15Daemon udev script to start/stop the daemon
# when device is connected.
# requires a udev script in the udev rules directory
# see 99-g15daemon.rules as an example.
case $ACTION in
"add")
# start g15daemon on keyboard connect
sudo g15daemon
;;
"remove")
# kill g15daemon on keyboard disconnect
sudo g15daemon -k
;;
*)
exit 0
;;
esac
+43
View File
@@ -0,0 +1,43 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key> <string>English</string>
<key>CFBundleGetInfoString</key> <string>Libusb USB device Shield</string>
<key>CFBundleIdentifier</key> <string>com.libusb.USB_Shield</string>
<key>CFBundleInfoDictionaryVersion</key> <string>6.0</string>
<key>CFBundleName</key> <string>Libusb USB device Shield</string>
<key>CFBundlePackageType</key> <string>KEXT</string>
<key>CFBundleSignature</key> <string>????</string>
<key>CFBundleVersion</key> <string>6.0</string>
<key>IOKitPersonalities</key>
<dict>
<key>Logitech G15</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.apple.kernel.iokit</string>
<key>IOClass</key>
<string>IOService</string>
<key>IOProbeScore</key>
<integer>106000</integer>
<key>IOProviderClass</key>
<string>IOUSBInterface</string>
<key>bConfigurationValue</key>
<integer>1</integer>
<key>bInterfaceNumber</key>
<integer>0</integer>
<key>bcdDevice</key>
<integer>259</integer>
<key>idProduct</key>
<integer>49698</integer>
<key>idVendor</key>
<integer>1133</integer>
</dict>
</dict>
<key>OSBundleCompatibleVersion</key> <string>1.8</string>
<key>OSBundleLibraries</key>
<dict>
<key>com.apple.kernel.iokit</key> <string>6.0</string>
</dict>
</dict>
</plist>
+8
View File
@@ -0,0 +1,8 @@
g15daemon (1.9.5.3-3) unstable; urgency=low
* The default key to switch application is changes:
now we use L1 (round small key near the display, instead of MR key.
This will allow other application to use MR (i.e. g15macro).
-- Giacomo Catenazzi <cate@debian.org> Mon, 28 Apr 2008 08:36:27 +0200
+31 -2
View File
@@ -1,6 +1,35 @@
g15daemon for Debian
--------------------
<possible notes regarding this package - if none, delete this file>
-- Anthony J. Mirabella <mirabeaj@gmail.com>, Thu, 28 Sep 2006 04:46:06 -0400
Debian 'xkeyboard-config' package already have support for g15
keyboards, so you don't need to exec 'xmodmap' as described on
original documentations. Anyway you should configure your
xorg.conf file, so that xorg will understand the extra keys.
To have the full support of the extra keys, you should edit the
xorg configuration file /etc/X11/xorg.conf . The 'XkbModel' should
be "logitech_g15".
I.e. on my machine:
Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "logitech_g15"
Option "XkbLayout" "us"
EndSection
Also in KDE and gnome you should set the g15daemon keyboard.
In KDE you find the configuration in:
Control Center
Regional & Accessibility
Keyboard Layout
On the right at the top "Keyboard model" select:
"Logitech G15 extra keys via G15daemon"
-- Giacomo Catenazzi <cate@debian.org> Mon, 30 Aug 2007 08:04:22 +0200
+136 -2
View File
@@ -1,6 +1,140 @@
g15daemon (1.2.1-1) breezy; urgency=low
g15daemon (1.9.5.3-8) unstable; urgency=low
* Put the third argument (modes) on open with O_CREAT (Closes: #559649)
* remove rpath
-- Giacomo Catenazzi <cate@debian.org> Fri, 18 Dec 2009 07:52:26 +0100
g15daemon (1.9.5.3-7) unstable; urgency=low
* Change priority of libg15daemon-client1 from extra to optional
(mumble package needs it)
-- Giacomo Catenazzi <cate@debian.org> Tue, 01 Sep 2009 19:50:38 +0200
g15daemon (1.9.5.3-6) unstable; urgency=low
* Shared devices (lcd dispaly + audio) are not good handled
by udev script. Adding workaround until improving
programs to handle disconnections (Closes: #541780)
* Add debugging flag (and code) for init.d and udev scripts
* Change syslog facility: from user to daemon
* better (and more secure) screenshort creation in /tmp
-- Giacomo Catenazzi <cate@debian.org> Wed, 19 Aug 2009 07:33:22 +0200
g15daemon (1.9.5.3-5) unstable; urgency=low
* Handle keyboard device with udev, so detecting detachement
and attachment of keyboarda (Closes: #489978).
* init.d LSB header: try to start before xorg, to be able
to have full access to all extra keys.
* Recent libg15 corrected strange behaviour in new G15 keyboard
(Closes: #494180)
-- Giacomo Catenazzi <cate@debian.org> Thu, 13 Aug 2009 08:20:02 +0200
g15daemon (1.9.5.3-4) unstable; urgency=low
* Try to load uinput module, in order to have Gx key working
(Closes: #475000).
* Usual updates
-- Giacomo Catenazzi <cate@debian.org> Thu, 06 Aug 2009 08:32:33 +0200
g15daemon (1.9.5.3-3) unstable; urgency=low
* Changing default in /etc/default/g15daemon: Use L1 key instead of MR
as actual upstream default and allowing to use g15macro
(Closes: #478069)
* Removed the X11 setup on man page, because it is not relevant
to recent distributions and could confuse our users (Closes: #463078)
-- Giacomo Catenazzi <cate@debian.org> Mon, 28 Apr 2008 08:47:07 +0200
g15daemon (1.9.5.3-2) unstable; urgency=low
* Recommend xkb-data instead of keyboard-config. Adapted patch from
Amaya, thanks! (Closes: #474451).
-- Giacomo Catenazzi <cate@debian.org> Mon, 07 Apr 2008 19:56:34 +0200
g15daemon (1.9.5.3-1) unstable; urgency=low
* New upstream version
-- Giacomo Catenazzi <cate@debian.org> Thu, 14 Feb 2008 08:08:03 +0100
g15daemon (1.9.5.2-2) unstable; urgency=low
* Handle better errors in the init.d script (Closes: #463073)
-- Giacomo Catenazzi <cate@debian.org> Tue, 29 Jan 2008 20:15:35 +0100
g15daemon (1.9.5.2-1) unstable; urgency=low
* New upstream version
* Change default behaviour: to switch client use MR (as already documented
in /etc/default/g15daemon, but wrongly implemented)
-- Giacomo Catenazzi <cate@debian.org> Mon, 28 Jan 2008 09:12:16 +0100
g15daemon (1.9.1.0.svn346-1) unstable; urgency=low
* New upstream version (from svn)
-- Giacomo Catenazzi <cate@debian.org> Tue, 18 Dec 2007 09:15:42 +0100
g15daemon (1.9.0-wip.20070910-5) unstable; urgency=low
* change priority to "extra"
* force libg15render-dev versioned dependencies
-- Giacomo Catenazzi <cate@debian.org> Tue, 09 Oct 2007 13:28:56 +0200
g15daemon (1.9.0-wip.20070910-4) unstable; urgency=low
* Correct building errors (closes: #441919, #442995)
-- Giacomo Catenazzi <cate@debian.org> Tue, 18 Sep 2007 20:29:54 +0200
g15daemon (1.9.0-wip.20070910-3) unstable; urgency=low
* first try to make a debian/rules full working for
svn and released version
* fix directory fixes (closes: #442296)
-- Giacomo Catenazzi <cate@debian.org> Fri, 14 Sep 2007 20:59:27 +0200
g15daemon (1.9.0-wip.20070910-2) unstable; urgency=low
* pause() instead of busy loop.
-- Giacomo Catenazzi <cate@debian.org> Tue, 11 Sep 2007 06:12:01 +0200
g15daemon (1.9.0-wip.20070910-1) unstable; urgency=low
* New upstream release (from svn)
* Don't install plugin in /usr/share (Closes: #441619)
-- Giacomo Catenazzi <cate@debian.org> Mon, 10 Sep 2007 23:02:14 +0200
g15daemon (1.9.0-2) unstable; urgency=low
* Updates: better init.d scripts (with support for L1 key)
* install also the sample plugin (clock, net, uinput)
-- Giacomo Catenazzi <cate@debian.org> Thu, 30 Aug 2007 23:31:18 +0200
g15daemon (1.9.0-1) unstable; urgency=low
* New upstream release
-- Giacomo Catenazzi <cate@debian.org> Tue, 28 Aug 2007 20:09:54 +0200
g15daemon (1.2.7-1) unstable; urgency=low
* Initial release
-- Anthony J. Mirabella <mirabeaj@gmail.com> Thu, 28 Sep 2006 04:46:06 -0400
-- Giacomo Catenazzi <cate@debian.org> Mon, 27 Aug 2007 20:00:20 +0200
+1 -1
View File
@@ -1 +1 @@
4
5
+20 -12
View File
@@ -1,28 +1,36 @@
Source: g15daemon
Section: utils
Priority: optional
Maintainer: Anthony J. Mirabella <mirabeaj@gmail.com>
Build-Depends: debhelper (>= 4.0.0), autotools-dev, libg15-dev, libg15render-dev
Standards-Version: 3.6.2
Priority: extra
Maintainer: Giacomo Catenazzi <cate@debian.org>
Build-Depends: cdbs, debhelper (>= 5), autotools-dev, automake1.9, libtool, chrpath,
libg15-dev, libg15render-dev (>=1.2.0.svn250-2), libusb-dev, libfreetype6-dev
Standards-Version: 3.8.2
Homepage: http://www.g15tools.com/
Package: g15daemon
Section: utils
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libg15daemon-client (= ${Source-Version})
Depends: libg15daemon-client1 (=${binary:Version}), ${shlibs:Depends}, ${misc:Depends},
Recommends: xkb-data ( >= 0.9+cvs.20070428-1)
Description: Screen multiplexer for Logitech G15 Keyboard
G15daemon provides multiple virtual screens for the LCD on the Logitech
G15 Keyboard
G11 and G15 keyboards.
.
This package contain the daemon and a generic client to talk to the
daemon.
Package: libg15daemon-client
Package: libg15daemon-client1
Section: libs
Priority: optional
Architecture: any
Depends: ${shlibs:Depends}
Description: Client library for communicating with g15daemon
Provides interface functions for clients that wish to communicate with
a running instance of g15daemon
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Development packages for libg15daemon-client
Includes the files needed for developing g15daemon clients
Package: libg15daemon-client-dev
Section: libdevel
Architecture: any
Depends: libg15daemon-client (= ${Source-Version})
Depends: libg15daemon-client1 (= ${binary:Version}), ${misc:Depends}
Description: Development packages for libg15daemon-client
Includes the files needed for developing g15daemon clients
+23 -5
View File
@@ -1,10 +1,28 @@
This package was debianized by Anthony J. Mirabella <mirabeaj@gmail.com> on
Thu, 28 Sep 2006 04:46:06 -0400.
This package was debianized by Giacomo A. Catenazzi <cate@debian.org> on
Mon, 27 Aug 2007 20:00:20 +0200.
It was downloaded from <fill in ftp site>
It was downloaded from http://g15daemon.sourceforge.net/
Copyright Holder: <put author(s) name and email here>
Upstream Authors:
Mike Lampard <mlampard@users.sf.net>
Sven Ludwig
James Green
Philip Lawatsch <philip@lawatsch.at>
Copyright:
Copyright (c) 2006 Mike Lampard, Philip Lawatsch, and others
License:
<Put the license of the package here>
g15tools 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.
License can be found in the file `/usr/share/common-licenses/GPL-2'.
The Debian packaging is (C) 2007, Giacomo Catenazzi <cate@debian.org> and
is licensed under the GPL v2 (or later), see `/usr/share/common-licenses/GPL-2'.
+15
View File
@@ -0,0 +1,15 @@
# Defaults for g15daemon initscript
# SWITCH_KEY selects the key used to switch between client screens
#
# SWITCH_KEY="MR" to use the MR key (on top left)
# SWITCH_KEY="L1 to use the L1 key: the small round key below the LCD
SWITCH_KEY="L1"
# Turn on debugging of g15 init.d and udev scripts
#G15DEBUG="on"
# Additional options that are passed to the Daemon.
DAEMON_OPTS=""
+4
View File
@@ -0,0 +1,4 @@
FAQ
NEWS
README
TODO
+177
View File
@@ -0,0 +1,177 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: g15daemon
# Required-Start: $syslog $local_fs
# Required-Stop: $syslog $local_fs
# Should-Start: $remote_fs
# Should-Stop: $remote_fs
# X-Start-Before: xdm kdm gdm ldm sdm
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: load deamon for Logitech G15 keyboard lcd display
# Description: load deamon for Logitech G15 keyboard lcd display
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/g15daemon
NAME=g15daemon
DESC=g15daemon
[ -x "$DAEMON" ] || exit 0
# Include g15daemon defaults if available
if [ -f /etc/default/g15daemon ] ; then
. /etc/default/g15daemon
fi
if [ "$SWITCH_KEY" = "MR" ]; then
DAEMON_OPTS="-s $DAEMON_OPTS"
fi
set -e
if [ "$G15DEBUG" = "on" ]; then
log() {
logger -p daemon.debug -t g15 -- "$*"
}
else
log() {
true
}
fi
wait_for_file() {
local file=$1
local timeout=$2
[ "$timeout" ] || timeout=120
local count=$(($timeout * 10))
while [ $count != 0 ]; do
[ -e "$file" ] && return 0
sleep 0.1
count=$(($count - 1))
done
return 1
}
load_uinput() {
if [ ! -e /dev/input/uinput ] ; then
modprobe -q uinput || true
wait_for_file /dev/input/uinput 3 || return 1
fi
}
wait_usr_mount() {
if [ ! -e "$DAEMON" ] ; then
wait_for_file "$DAEMON" 7 || return 1
fi
}
is_running() {
start-stop-daemon --stop --test --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON
}
do_start() {
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
--exec $DAEMON -- $DAEMON_OPTS
}
do_stop() {
$DAEMON -k
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
--oknodo --retry 5 --exec $DAEMON
}
case "$1" in
start)
echo -n "Starting $DESC: "
load_uinput || echo -n ".../dev/input/uinput not found ..."
do_start
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
do_stop
echo "$NAME."
;;
#reload)
#
# If the daemon can reload its config files on the fly
# for example by sending it SIGHUP, do it here.
#
# If the daemon responds to changes in its config file
# directly anyway, make this a do-nothing entry.
#
# echo "Reloading $DESC configuration files."
# start-stop-daemon --stop --signal 1 --quiet --pidfile \
# /var/run/$NAME.pid --exec $DAEMON
#;;
force-reload)
#
# If the "reload" option is implemented, move the "force-reload"
# option to the "reload" entry above. If not, "force-reload" is
# just the same as "restart" except that it does nothing if the
# daemon isn't already running.
# check wether $DAEMON is running. If so, restart
is_running && $0 restart || exit 0
;;
restart)
echo -n "Restarting $DESC: "
do_stop
# the device is slow to shut-down
sleep 1
do_start
echo "$NAME."
;;
udev)
log "calling g15 udev; action: $ACTION, product $PRODUCT"
if [ "x$ACTION" = "xadd" ] ; then
load_uinput || true
wait_usr_mount || true
# it seems udev will not release a device if userspace is still
# connected
is_running && ( do_stop; sleep 1 )
do_start
elif [ "x$ACTION" = "xremove" ] ; then
do_stop
else
echo "unknow udev action '$ACTION'"
exit 1
fi
;;
shared-udev)
# some devices share usb also for audio, which causes some spourios
# udev messages.
log "calling g15 shared-dev; action: $ACTION, product $PRODUCT"
if [ "x$ACTION" = "xadd" ] ; then
load_uinput || true
wait_usr_mount || true
do_start
elif [ "x$ACTION" = "xremove" ] ; then
do_stop
else
echo "unknow udev action '$ACTION'"
exit 1
fi
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload|udev}" >&2
exit 1
;;
esac
exit 0
+4 -1
View File
@@ -1 +1,4 @@
usr/sbin/*
debian/tmp/usr/sbin/g15daemon usr/sbin
debian/tmp/usr/lib/g15daemon/1.9.5.3/plugins/*.so usr/lib/g15daemon/1.9.5.3/plugins/
debian/tmp/usr/share/g15daemon/splash/g15logo2.wbmp usr/share/g15daemon/splash/
+1
View File
@@ -0,0 +1 @@
Documentation/g15daemon.1
+20
View File
@@ -0,0 +1,20 @@
# udev rule to start g15daemon when logitech g15 keyboards are attached
#
# Recognized devices from libg15-1.2.7/libg15.c
#
# Logitech g11 -- extra keys, no LCD
SYSFS{idVendor}=="046d", SYSFS{idProduct}=="c225", RUN+="/etc/init.d/g15daemon udev"
# Logitech G15 (blue) -- extra keys and LCD
SYSFS{idVendor}=="046d", SYSFS{idProduct}=="c222", RUN+="/etc/init.d/g15daemon udev"
# Logitech G15 v2 (orange) -- extra keys and LCD
SYSFS{idVendor}=="046d", SYSFS{idProduct}=="c227", RUN+="/etc/init.d/g15daemon shared-udev"
# Logitech Z10 -- extra keys and LCD
SYSFS{idVendor}=="046d", SYSFS{idProduct}=="0a07", RUN+="/etc/init.d/g15daemon udev"
# Logitech G15 Gamepanel -- extra keys and LCD
SYSFS{idVendor}=="046d", SYSFS{idProduct}=="c251", RUN+="/etc/init.d/g15daemon shared-udev"
+5 -6
View File
@@ -1,6 +1,5 @@
usr/include/*
usr/lib/lib*.a
usr/lib/lib*.so
usr/lib/pkgconfig/*
usr/lib/*.la
usr/share/pkgconfig/*
debian/tmp/usr/include/* usr/include/
debian/tmp/usr/lib/lib*.a usr/lib/
debian/tmp/usr/lib/lib*.so usr/lib/
debian/tmp/usr/lib/*.la usr/lib/
+1
View File
@@ -0,0 +1 @@
debian/tmp/usr/lib/lib*.so.* usr/lib/
+1
View File
@@ -0,0 +1 @@
Documentation/g15daemon_client_devel.3
+24 -99
View File
@@ -1,107 +1,32 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# for SVN versions
AUTOMAKE_REMOVE := Makefile Makefile.in */Makefile */Makefile.in configure aclocal.m4
AUTOMAKE_REMOVE += *.lo *.o *.la */*.lo */*.o */*.la
AUTOMAKE_REMOVE += g15daemon/g15daemon g15daemon/g15daemontest
AUTOMAKE_REMOVE += config.status config.log config.h config.h.in config/* libtool stamp-h1
AUTOMAKE_REMOVE += */.libs/
clean::
-rm -Rf debian/docs libg15daemon-client.install
# -rm -Rf $(AUTOMAKE_REMOVE)
#makebuilddir:: Makefile
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
#Makefile:: Makefile.am autogen.sh
# [ -d config ] || mkdir config
# aclocal -I config
# libtoolize --automake --force --copy
# autoheader
# automake --add-missing --copy
# autoconf
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
CFLAGS = -Wall -g
DEB_CONFIGURE_EXTRA_FLAGS = --quiet --disable-rpath
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
install/libg15daemon-client1::
chrpath --delete $(DEB_DESTDIR)/usr/lib/libg15daemon_client.so.1.0.2 $(DEB_DESTDIR)/usr/lib/g15daemon/1.9.5.3/plugins/*.so $(DEB_DESTDIR)/usr/sbin/g15daemon
config.status: configure
dh_testdir
# Add here commands to configure the package.
CFLAGS="$(CFLAGS) -Wl,-z,defs" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
build: build-stamp
build-stamp: config.status
dh_testdir
# Add here commands to compile the package.
$(MAKE)
#docbook-to-man debian/g15daemon.sgml > g15daemon.1
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp
# Add here commands to clean up after the build process.
-$(MAKE) distclean
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
cp -f /usr/share/misc/config.sub config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
cp -f /usr/share/misc/config.guess config.guess
endif
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/g15daemon.
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs
dh_installexamples
dh_install -a --sourcedir=debian/tmp
# dh_installmenu
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_installinit
# dh_installcron
# dh_installinfo
dh_installman Documentation/g15daemon.1 Documentation/g15daemon_client_devel.3
dh_link
dh_strip
dh_compress
dh_fixperms
# dh_perl
# dh_python
# dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
+7
View File
@@ -0,0 +1,7 @@
# See uscan(1) for format
# Compulsory line, this is a version 3 file
version=3
http://sf.net/g15daemon/g15daemon-([1-9].*)\.tar\.gz
+78 -61
View File
@@ -1,8 +1,8 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -15,15 +15,11 @@
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -37,6 +33,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
sbin_PROGRAMS = g15daemon$(EXEEXT)
noinst_PROGRAMS = g15daemontest$(EXEEXT)
subdir = g15daemon
@@ -56,21 +53,25 @@ am_g15daemon_OBJECTS = utility_funcs.$(OBJEXT) main.$(OBJEXT) \
linked_lists.$(OBJEXT) g15_plugins.$(OBJEXT)
g15daemon_OBJECTS = $(am_g15daemon_OBJECTS)
g15daemon_DEPENDENCIES =
g15daemon_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(g15daemon_LDFLAGS) $(LDFLAGS) -o $@
am_g15daemontest_OBJECTS = lcdclient_test.$(OBJEXT)
g15daemontest_OBJECTS = $(am_g15daemontest_OBJECTS)
g15daemontest_DEPENDENCIES = \
$(top_builddir)/libg15daemon_client/libg15daemon_client.la
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(g15daemon_SOURCES) $(g15daemontest_SOURCES)
DIST_SOURCES = $(g15daemon_SOURCES) $(g15daemontest_SOURCES)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@@ -85,8 +86,6 @@ ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
@@ -113,11 +112,14 @@ EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
G15DAEMON_PLUGIN_DIR = @G15DAEMON_PLUGIN_DIR@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KEXT_LOCATION = @KEXT_LOCATION@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
@@ -125,6 +127,7 @@ LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -134,17 +137,18 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -156,6 +160,7 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
@@ -183,8 +188,15 @@ program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
METASOURCES = AUTO
AM_CFLAGS = -DG15DAEMON_BUILD -Wall
noinst_HEADERS = g15logo.h
@@ -237,15 +249,15 @@ clean-noinstPROGRAMS:
done
install-sbinPROGRAMS: $(sbin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)"
test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
@list='$(sbin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
|| test -f $$p1 \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \
else :; fi; \
done
@@ -265,10 +277,10 @@ clean-sbinPROGRAMS:
done
g15daemon$(EXEEXT): $(g15daemon_OBJECTS) $(g15daemon_DEPENDENCIES)
@rm -f g15daemon$(EXEEXT)
$(LINK) $(g15daemon_LDFLAGS) $(g15daemon_OBJECTS) $(g15daemon_LDADD) $(LIBS)
$(g15daemon_LINK) $(g15daemon_OBJECTS) $(g15daemon_LDADD) $(LIBS)
g15daemontest$(EXEEXT): $(g15daemontest_OBJECTS) $(g15daemontest_DEPENDENCIES)
@rm -f g15daemontest$(EXEEXT)
$(LINK) $(g15daemontest_LDFLAGS) $(g15daemontest_OBJECTS) $(g15daemontest_LDADD) $(LIBS)
$(LINK) $(g15daemontest_OBJECTS) $(g15daemontest_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -283,22 +295,22 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utility_funcs.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
@@ -308,13 +320,9 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"
test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
@list='$(include_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
@@ -335,8 +343,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -348,8 +356,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -359,13 +367,12 @@ ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
@@ -379,22 +386,21 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -410,7 +416,7 @@ check: check-am
all-am: Makefile $(PROGRAMS) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(includedir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
@@ -445,7 +451,7 @@ distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
distclean-tags
dvi: dvi-am
@@ -459,12 +465,20 @@ info-am:
install-data-am: install-includeHEADERS
install-dvi: install-dvi-am
install-exec-am: install-sbinPROGRAMS
install-html: install-html-am
install-info: install-info-am
install-man:
install-pdf: install-pdf-am
install-ps: install-ps-am
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -485,22 +499,25 @@ ps: ps-am
ps-am:
uninstall-am: uninstall-includeHEADERS uninstall-info-am \
uninstall-sbinPROGRAMS
uninstall-am: uninstall-includeHEADERS uninstall-sbinPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstPROGRAMS clean-sbinPROGRAMS ctags \
distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-exec install-exec-am \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am \
install-includeHEADERS install-info install-info-am \
install-man install-sbinPROGRAMS install-strip installcheck \
install-man install-pdf install-pdf-am install-ps \
install-ps-am install-sbinPROGRAMS install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-includeHEADERS \
uninstall-info-am uninstall-sbinPROGRAMS
uninstall-sbinPROGRAMS
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
+117 -15
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others
(c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 179 $ - $Date: 2006-11-19 19:03:12 +1030 (Sun, 19 Nov 2006) $ $Author: mlampard $
$Revision: 408 $ - $Date: 2008-01-09 12:07:02 +1030 (Wed, 09 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -46,19 +46,41 @@
#include <libg15render.h>
extern int leaving;
extern volatile int leaving;
void * g15daemon_dlopen_plugin(char *name,unsigned int library) {
void * handle;
char * error;
static int deepbind = 0;
int mode = library==1?RTLD_GLOBAL:RTLD_LOCAL;
#ifdef RTLD_DEEPBIND
mode|=RTLD_DEEPBIND; /* set ordering of symbols so plugin uses its
own symbols in preference to ours */
if(!deepbind)
g15daemon_log(LOG_INFO,"G15Daemon Plugin_Loader - DEEPBIND Flag available. Using it.\n");
deepbind=1;
#endif
handle = dlopen (name,RTLD_NOW | mode);
g15daemon_log(LOG_INFO,"PRELOADING %s",name);
/* remove any pending errors */
dlerror();
handle = dlopen (name,RTLD_LAZY | mode | RTLD_NODELETE);
dlclose(handle);
dlerror();
handle = dlopen (name,RTLD_NOW | mode | RTLD_NOLOAD);
if(!handle) { /* FIXME: retry once more if load failed */
dlerror();
g15daemon_log(LOG_ERR, "Initialisation Failed. Retrying..");
handle = dlopen (name, RTLD_LAZY | mode );
}
if ((error = dlerror()) != NULL) {
g15daemon_log (LOG_ERR, "%s\n", error);
g15daemon_log (LOG_ERR, "Plugin_Loader - Error loading %s - %s\n", name, error);
return(NULL);
}
@@ -67,7 +89,12 @@ void * g15daemon_dlopen_plugin(char *name,unsigned int library) {
int g15daemon_dlclose_plugin(void *handle) {
char * error;
dlclose(handle);
error = dlerror();
if(error != NULL)
g15daemon_log(LOG_ERR, "Error from dlclose %s\n",error);
return 0;
}
@@ -101,6 +128,7 @@ void run_lcd_client(plugin_t *plugin_args) {
if(!leaving)
g15daemon_lcdnode_remove(display);
}
void run_advanced_client(plugin_t *plugin_args)
{
plugin_info_t *info = plugin_args->info;
@@ -129,7 +157,7 @@ void run_advanced_client(plugin_t *plugin_args)
g15daemon_msleep(info->update_msecs);
}
}else{
while(1){
while(!leaving){
g15daemon_msleep(500);
}
}
@@ -144,15 +172,17 @@ void *plugin_thread(plugin_t *plugin_args) {
void *handle = plugin_args->plugin_handle;
if(plugin_args->info->plugin_run!=NULL||plugin_args->info->event_handler!=NULL) {
g15daemon_log(LOG_ERR,"registered plugin \"%s\"",info->name);
g15daemon_log(LOG_ERR,"Plugin \"%s\" boot successful.",info->name);
} else {
return NULL;
}
if(plugin_args->type == G15_PLUGIN_LCD_CLIENT){
g15daemon_log(LOG_INFO,"Starting plugin thread \"%s\" in standard mode\n",info->name);
run_lcd_client(plugin_args);
}
else if(plugin_args->type == G15_PLUGIN_CORE_OS_KB||plugin_args->type == G15_PLUGIN_LCD_SERVER) {
g15daemon_log(LOG_INFO,"Starting plugin thread \"%s\" in advanced mode\n",info->name);
run_advanced_client(plugin_args);
}
@@ -165,6 +195,32 @@ void *plugin_thread(plugin_t *plugin_args) {
return NULL;
}
int g15_count_plugins(char *plugin_directory) {
DIR *directory;
struct dirent *ep;
char pluginname[2048];
int count=0;
directory = opendir (plugin_directory);
if (directory != NULL)
{
while ((ep = readdir (directory))) {
if(strstr(ep->d_name,".so")){
strcpy(pluginname, plugin_directory);
strncat(pluginname,"/",1);
strncat(pluginname,ep->d_name,200);
++count;
}
}
(void) closedir (directory);
}
else
count = -1;
return count;
}
int g15_plugin_load (g15daemon_t *masterlist, char *filename) {
void * plugin_handle = NULL;
@@ -173,14 +229,19 @@ int g15_plugin_load (g15daemon_t *masterlist, char *filename) {
pthread_t client_connection;
pthread_attr_t attr;
lcdnode_t *clientnode;
char *error_str;
if((plugin_handle = g15daemon_dlopen_plugin(filename,G15_PLUGIN_NONSHARED))!=NULL) {
plugin_t *plugin_args=malloc(sizeof(plugin_t));
plugin_args->info = dlsym(plugin_handle, "g15plugin_info");
dlerror();
error_str=dlerror();
if(error_str!=NULL)
g15daemon_log(LOG_ERR,"g15_plugin_load: %s %s\n",filename,error_str);
if(!plugin_args->info) { /* if it doesnt have a valid struct, we should just load it as a library... but we dont at the moment FIXME */
g15daemon_log(LOG_ERR,"%s is not a valid g15daemon plugin\n",filename);
g15daemon_log(LOG_ERR,"%s is not a valid g15daemon plugin. Unloading\n",filename);
g15daemon_dlclose_plugin(plugin_handle);
dlerror();
return -1;
@@ -188,10 +249,14 @@ int g15_plugin_load (g15daemon_t *masterlist, char *filename) {
if(strncasecmp("Load",g15daemon_cfg_read_string(plugin_cfg, plugin_args->info->name,"Load"),5)!=0)
{
g15daemon_log(LOG_ERR, "\"%s\" Plugin disabled in g15daemon.conf - not running\n",plugin_args->info->name);
g15daemon_dlclose_plugin(plugin_handle);
return -1;
}
g15daemon_log(LOG_WARNING, "Booting plugin \"%s\"",plugin_args->info->name);
plugin_args->type = plugin_args->info->type;
/* assign the generic eventhandler if the plugin doesnt provide one - the generic one does nothing atm. FIXME*/
if(plugin_args->info->event_handler==NULL)
@@ -223,7 +288,7 @@ int g15_plugin_load (g15daemon_t *masterlist, char *filename) {
pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED);
pthread_attr_setstacksize(&attr,64*1024); /* set stack to 64k - dont need 8Mb */
if (pthread_create(&client_connection, &attr, (void*)plugin_thread, plugin_args) != 0) {
g15daemon_log(LOG_WARNING,"Unable to create client thread.");
g15daemon_log(LOG_ERR,"Unable to create client thread.");
} else {
pthread_detach(client_connection);
}
@@ -232,26 +297,63 @@ int g15_plugin_load (g15daemon_t *masterlist, char *filename) {
}
void g15_open_all_plugins(g15daemon_t *masterlist, char *plugin_directory) {
int g15_open_all_plugins(g15daemon_t *masterlist, char *plugin_directory) {
DIR *directory;
struct dirent *ep;
char pluginname[2048];
int loadcount = 0;
int count = g15_count_plugins(plugin_directory);
config_section_t *load_cfg = g15daemon_cfg_load_section(masterlist,"PLUGIN_LOAD_ORDER");
if(!uf_search_confitem(load_cfg,"TotalPlugins") ||
(g15daemon_cfg_read_int(load_cfg,"TotalPlugins",0)!=count) ||
(g15daemon_cfg_read_string(load_cfg,"0","")[0]=='/')) {
g15daemon_log(LOG_INFO,"Number of plugins has changed. Rebuilding load order.");
directory = opendir (plugin_directory);
if (directory != NULL)
if (directory != NULL && count)
{
g15daemon_log(LOG_WARNING,"Attempting load of %i plugins",count);
while ((ep = readdir (directory))) {
if(strstr(ep->d_name,".so")){
strcpy(pluginname, plugin_directory);
strncat(pluginname,"/",1);
strncat(pluginname,ep->d_name,200);
g15daemon_log(LOG_INFO, "Loading plugin %s",pluginname);
g15_plugin_load (masterlist, pluginname);
if(g15_plugin_load (masterlist, pluginname)==0){
char tmp[10];
sprintf(tmp,"%i",loadcount);
g15daemon_cfg_write_string(load_cfg,tmp,ep->d_name);
loadcount++;
}
g15daemon_msleep(20);
}
}
(void) closedir (directory);
g15daemon_cfg_write_int(load_cfg,"TotalPlugins",loadcount);
g15daemon_log(LOG_WARNING,"Successfully loaded %i of %i plugins.",loadcount,count);
return loadcount;
}
else
perror ("Couldn't open the directory");
g15daemon_log (LOG_ERR,"Unable to open the directory: %s",plugin_directory);
}else{
int i;
g15daemon_log(LOG_INFO,"Loading %i plugins named in g15daemon.conf.",count);
for(i=0;i<count;i++){
char tmp[10];
char plugin_fname[1024];
sprintf(tmp,"%i",i);
strcpy(plugin_fname,PLUGINDIR);
strncat(plugin_fname,"/",1);
strncat(plugin_fname,g15daemon_cfg_read_string(load_cfg,tmp,""),128);
g15_plugin_load(masterlist,plugin_fname);
g15daemon_msleep(20);
}
return count;
}
return 0;
}
+18 -6
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others
(c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 244 $ - $Date: 2007-01-05 08:04:05 +1030 (Fri, 05 Jan 2007) $ $Author: mlampard $
$Revision: 441 $ - $Date: 2008-01-22 20:39:21 +1030 (Tue, 22 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -40,11 +40,13 @@
#include <config.h>
#endif
#include <pthread.h>
#include <pwd.h>
#include <syslog.h>
#define CLIENT_CMD_GET_KEYSTATE 'k'
#define CLIENT_CMD_SWITCH_PRIORITIES 'p'
#define CLIENT_CMD_NEVER_SELECT 'n'
#define CLIENT_CMD_IS_FOREGROUND 'v'
#define CLIENT_CMD_IS_USER_SELECTED 'u'
#define CLIENT_CMD_BACKLIGHT 0x80
@@ -170,13 +172,14 @@ typedef struct lcd_s
int max_x;
int max_y;
int connection;
long int ident;
unsigned int backlight_state;
unsigned int mkey_state;
unsigned int contrast_state;
unsigned int state_changed;
/* set to 1 if user manually selected this screen 0 otherwise*/
/* set to 1 if user manually selected this screen 0 otherwise */
unsigned int usr_foreground;
/* set to 1 if screen is never to be user-selectable */
unsigned int never_select;
/* only used for plugins */
plugin_t *g15plugin;
@@ -220,13 +223,18 @@ pthread_mutex_t g15lib_mutex;
#ifdef G15DAEMON_BUILD
/* internal g15daemon-only functions */
void uf_write_buf_to_g15(lcd_t *lcd);
void g15daemon_init_refresh();
void g15daemon_quit_refresh();
int uf_write_buf_to_g15(lcd_t *lcd);
/* write a pbm format file 'filename' with image contained in 'buf' */
int uf_screendump_pbm(unsigned char *buf,char *filename);
int uf_read_keypresses(unsigned int *keypresses, unsigned int timeout);
/* return the pid of a running copy of g15daemon, else -1 */
int uf_return_running();
/* create a /var/run/g15daemon.pid file, returning 0 on success else -1 */
int uf_create_pidfile();
/* open & run all plugins in the given directory */
void g15_open_all_plugins(g15daemon_t *masterlist, char *plugin_directory);
int g15_open_all_plugins(g15daemon_t *masterlist, char *plugin_directory);
/* linked lists */
g15daemon_t *ll_lcdlist_init();
void ll_lcdlist_destroy(g15daemon_t **masterlist);
@@ -244,6 +252,10 @@ int internal_generic_eventhandler(plugin_event_t *myevent);
#endif
/* the following functions are available for use by plugins */
/* send notification of LCD buffer update */
void g15daemon_send_refresh(lcd_t *lcd);
/* wait on notification of LCD buffer update */
void g15daemon_wait_refresh();
/* create a new section */
config_section_t *g15daemon_cfg_load_section(g15daemon_t *masterlist,char *name);
/* return string value from key in sectionname */
+15 -11
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others
(c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 161 $ - $Date: 2006-11-17 07:03:45 +1030 (Fri, 17 Nov 2006) $ $Author: aneurysm9 $
$Revision: 381 $ - $Date: 2008-01-01 23:41:08 +1030 (Tue, 01 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -71,12 +71,12 @@ int main(int argc, char *argv[])
// keystate = g15_send_cmd (g15screen_fd, G15DAEMON_GET_KEYSTATE, foo);
//while(1){
//recv(g15screen_fd, &keystate, 4, 0);
recv(g15screen_fd, &keystate, 4, 0);
if(keystate)
printf("keystate = %i\n",keystate);
//}
if(keystate & G15_KEY_G1) //G1 key. See libg15.h for details on key values.
break;
// if(keystate & G15_KEY_G1) //G1 key. See libg15.h for details on key values.
// break;
/* G2,G3 & G4 change LCD backlight */
if(keystate & G15_KEY_G2){
@@ -84,12 +84,16 @@ int main(int argc, char *argv[])
}
if(keystate & G15_KEY_G3){
retval = g15_send_cmd (g15screen_fd, G15DAEMON_BACKLIGHT, G15_BRIGHTNESS_MEDIUM);
unsigned char packet[2];
packet[0] = G15DAEMON_BACKLIGHT|G15_BRIGHTNESS_MEDIUM;
printf("sent %i bytes\n",send(g15screen_fd, packet, 1, MSG_OOB ));
}
if(keystate & G15_KEY_G4){
retval = g15_send_cmd (g15screen_fd, G15DAEMON_BACKLIGHT, G15_BRIGHTNESS_BRIGHT);
}
/* is this client in the foreground?? */
/*
retval = g15_send_cmd (g15screen_fd, G15DAEMON_IS_FOREGROUND, foo);
if(retval)
@@ -103,15 +107,15 @@ int main(int argc, char *argv[])
else
printf("You dastardly wabbit !\n");
// if(retval){ /* we've been backgrounded! */
sleep(2); /* remain in the background for a bit */
// if(retval){
sleep(2);
retval = g15_send_cmd (g15screen_fd, G15DAEMON_SWITCH_PRIORITIES, foo);
sleep(2); /* switch to foreground */
sleep(2);
retval = g15_send_cmd (g15screen_fd, G15DAEMON_SWITCH_PRIORITIES, foo);
// }
*/
sleep(2);
// sleep(2);
#ifdef TEST_KEYHANDLER
/* ok.. request that all G&M keys are passed to us.. */
retval = g15_send_cmd (g15screen_fd, G15DAEMON_KEY_HANDLER, foo);
+18 -12
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others
(c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 177 $ - $Date: 2006-11-19 00:16:03 +1030 (Sun, 19 Nov 2006) $ $Author: mlampard $
$Revision: 451 $ - $Date: 2008-01-25 15:15:04 +1030 (Fri, 25 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -116,35 +116,40 @@ lcdnode_t *g15daemon_lcdnode_add(g15daemon_t **masterlist) {
/* cycle through connected client displays */
void g15daemon_lcdnode_cycle(g15daemon_t *masterlist)
{
lcdnode_t *current_screen = masterlist->current;
lcdnode_t *current_screen = NULL;
pthread_mutex_lock(&lcdlist_mutex);
skip:
current_screen = masterlist->current;
g15daemon_send_event(current_screen->lcd, G15_EVENT_VISIBILITY_CHANGED, SCR_HIDDEN);
do
{
pthread_mutex_lock(&lcdlist_mutex);
g15daemon_send_event(current_screen->lcd, G15_EVENT_USER_FOREGROUND, 0);
masterlist->current->lcd->usr_foreground=0;
if(masterlist->tail == masterlist->current){
masterlist->current = masterlist->head;
}else{
masterlist->current = masterlist->current->prev;
}
pthread_mutex_unlock(&lcdlist_mutex);
}
while (current_screen != masterlist->current);
pthread_mutex_lock(&lcdlist_mutex);
if(masterlist->tail == masterlist->current) {
masterlist->current = masterlist->head;
} else {
masterlist->current = masterlist->current->prev;
}
pthread_mutex_unlock(&lcdlist_mutex);
g15daemon_send_event(masterlist->current->lcd, G15_EVENT_VISIBILITY_CHANGED, SCR_VISIBLE);
g15daemon_send_event(current_screen->lcd, G15_EVENT_USER_FOREGROUND, 1);
pthread_mutex_lock(&lcdlist_mutex);
masterlist->current->lcd->state_changed = 1;
if(masterlist->current->lcd->never_select==1) {
goto skip;
}
masterlist->current->last_priority = masterlist->current;
pthread_mutex_unlock(&lcdlist_mutex);
masterlist->current->lcd->usr_foreground=1;
g15daemon_send_event(masterlist->current->lcd, G15_EVENT_VISIBILITY_CHANGED, SCR_VISIBLE);
}
void g15daemon_lcdnode_remove (lcdnode_t *oldnode) {
@@ -183,6 +188,7 @@ void g15daemon_lcdnode_remove (lcdnode_t *oldnode) {
(*prev)->next = (*masterlist)->tail;
(*masterlist)->head = oldnode->prev;
}
g15daemon_send_refresh((*masterlist)->current->lcd);
free(oldnode);
+147 -53
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others
(c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 244 $ - $Date: 2007-01-05 08:04:05 +1030 (Fri, 05 Jan 2007) $ $Author: mlampard $
$Revision: 457 $ - $Date: 2008-01-31 15:32:46 +1030 (Thu, 31 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -31,6 +31,7 @@
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <fcntl.h>
@@ -48,13 +49,16 @@
#endif
/* all threads will exit if leaving >0 */
int leaving = 0;
volatile int leaving = 0;
int keyboard_backlight_off_onexit = 0;
unsigned int g15daemon_debug = 0;
unsigned int cycle_key;
unsigned int client_handles_keys = 0;
static unsigned int set_backlight = 0;
struct lcd_t *keyhandler = NULL;
static int loaded_plugins = 0;
/* send event to foreground client's eventlistener */
int g15daemon_send_event(void *caller, unsigned int event, unsigned long value)
{
@@ -63,6 +67,10 @@ int g15daemon_send_event(void *caller, unsigned int event, unsigned long value)
static unsigned long lastkeys;
if(!(value & cycle_key) && !(lastkeys & cycle_key)){
lcd_t *lcd = (lcd_t*)caller;
if(!lcd->g15plugin->info)
break;
int *(*plugin_listener)(plugin_event_t *newevent) = (void*)lcd->g15plugin->info->event_handler;
plugin_event_t *newevent=g15daemon_xmalloc(sizeof(plugin_event_t));
newevent->event = event;
@@ -81,9 +89,19 @@ int g15daemon_send_event(void *caller, unsigned int event, unsigned long value)
g15daemon_log(LOG_WARNING,"Error in send: %s\n",strerror(errno));
}
if(value & G15_KEY_LIGHT){ // the backlight key was pressed - maintain user-selected state
lcd_t *displaying = lcd->masterlist->current->lcd;
lcd->masterlist->kb_backlight_state++;
if(lcd->masterlist->kb_backlight_state>2)
lcd->masterlist->kb_backlight_state=0;
lcd->masterlist->kb_backlight_state %= 3;
displaying->backlight_state++;
displaying->backlight_state %= 3; // limit to 0-2 inclusive
}
if(value & G15_KEY_M1 && value & G15_KEY_M3) {
static int scr_num=0;
char filename[128];
lcd_t *displaying = lcd->masterlist->current->lcd;
sprintf(filename,"/tmp/g15daemon-sc-%i.pbm",scr_num);
uf_screendump_pbm(displaying->buf,filename);
scr_num++;
}
free(newevent);
}else{
@@ -91,6 +109,7 @@ int g15daemon_send_event(void *caller, unsigned int event, unsigned long value)
lcd_t *lcd = (lcd_t*)caller;
g15daemon_t* masterlist = lcd->masterlist;
static unsigned int clicktime;
if(value & cycle_key) {
clicktime=g15daemon_gettime_ms();
}else{
@@ -145,8 +164,11 @@ int g15daemon_send_event(void *caller, unsigned int event, unsigned long value)
}
}
pthread_mutex_unlock(&lcdlist_mutex);
g15daemon_send_refresh((lcd_t*)lcdnode->list->current->lcd);
break;
}
case G15_EVENT_VISIBILITY_CHANGED:
g15daemon_send_refresh((lcd_t*)caller);
default: {
lcd_t *lcd = (lcd_t*)caller;
int *(*plugin_listener)(plugin_event_t *newevent) = (void*)lcd->g15plugin->info->event_handler;
@@ -167,68 +189,72 @@ static void *keyboard_watch_thread(void *lcdlist){
unsigned int keypresses = 0;
int retval = 0;
static int lastkeys = 0;
while (!leaving) {
pthread_mutex_lock(&g15lib_mutex);
retval = getPressedKeys(&keypresses, 40);
pthread_mutex_unlock(&g15lib_mutex);
retval = uf_read_keypresses(&keypresses, 20);
/* every 2nd packet contains the codes we want.. immediately try again */
while (retval == G15_ERROR_TRY_AGAIN){
pthread_mutex_lock(&g15lib_mutex);
retval = getPressedKeys(&keypresses, 40);
pthread_mutex_unlock(&g15lib_mutex);
retval = uf_read_keypresses(&keypresses, 20);
}
if(retval == G15_NO_ERROR){
if(retval == G15_NO_ERROR && lastkeys != keypresses) {
g15daemon_send_event(masterlist->current->lcd,
G15_EVENT_KEYPRESS, keypresses);
}
if(retval == -ENODEV && LIBG15_VERSION>=1200) {
lastkeys = keypresses;
}else if(retval == -ENODEV && LIBG15_VERSION>=1200) {
pthread_mutex_lock(&g15lib_mutex);
while((retval=re_initLibG15() != G15_NO_ERROR) && !leaving){
g15daemon_log(LOG_WARNING,"Keyboard has gone.. Retrying\n");
sleep(1);
}
if(!leaving) { masterlist->current->lcd->state_changed=1; masterlist->current->lcd->ident=random();}
if(!leaving) {
masterlist->current->lcd->state_changed=1;
g15daemon_send_refresh(masterlist->current->lcd);
}
pthread_mutex_unlock(&g15lib_mutex);
}
g15daemon_msleep(10);
g15daemon_msleep(40);
}
return NULL;
}
static void *lcd_draw_thread(void *lcdlist){
g15daemon_t *masterlist = (g15daemon_t*)(lcdlist);
static long int lastlcd = 1;
static unsigned int lastscreentime;
/* unsigned int fps = 0; */
lcd_t *displaying = masterlist->tail->lcd;
char *lastdisplayed=NULL;
memset(displaying->buf,0,1024);
static int prev_state=0;
g15daemon_sleep(2);
while (!leaving) {
pthread_mutex_lock(&lcdlist_mutex);
/* wait until a client has updated */
g15daemon_wait_refresh();
pthread_mutex_lock(&lcdlist_mutex);
displaying = masterlist->current->lcd;
if(displaying->ident != lastlcd){
/* monitor 'fps' - due to the TCP protocol, some frames will be bunched up.
discard excess to reduce load on the bus */
/* fps = 1000 / (g15daemon_gettime_ms() - lastscreentime); */
/* if the current screen is less than 20ms from the previous (equivelant to 50fps) delay it */
/* this allows a real-world fps of 40fps with no almost frame loss and reduces peak usb bus-load */
if((g15daemon_gettime_ms() - lastscreentime)>=20||(char*)displaying!=lastdisplayed){
g15daemon_log(LOG_DEBUG,"Updating LCD");
uf_write_buf_to_g15(displaying);
lastscreentime = g15daemon_gettime_ms();
lastdisplayed = (char*)displaying;
lastlcd = displaying->ident;
}
g15daemon_log(LOG_DEBUG,"LCD Update Complete");
if(prev_state!=displaying->backlight_state && set_backlight!=0) {
prev_state=displaying->backlight_state;
pthread_mutex_lock(&g15lib_mutex);
setLCDBrightness(displaying->backlight_state);
usleep(5);
setLCDBrightness(displaying->backlight_state);
setKBBrightness(displaying->backlight_state);
pthread_mutex_unlock(&g15lib_mutex);
}
if(displaying->state_changed){
@@ -236,17 +262,11 @@ static void *lcd_draw_thread(void *lcdlist){
setLCDContrast(displaying->contrast_state);
if(displaying->masterlist->remote_keyhandler_sock==0) // only allow mled control if the macro recorder isnt running
setLEDs(displaying->mkey_state);
if(masterlist->kb_backlight_state)
setLCDBrightness(displaying->backlight_state);
else
setLCDBrightness(masterlist->kb_backlight_state);
pthread_mutex_unlock(&g15lib_mutex);
displaying->state_changed = 0;
}
pthread_mutex_unlock(&lcdlist_mutex);
g15daemon_msleep(5);
}
return NULL;
}
@@ -256,6 +276,7 @@ void g15daemon_sighandler(int sig) {
case SIGUSR1:
keyboard_backlight_off_onexit = 1;
case SIGINT:
case SIGTERM:
case SIGQUIT:
leaving = 1;
break;
@@ -264,6 +285,39 @@ void g15daemon_sighandler(int sig) {
}
}
#ifndef HAVE_DAEMON
/* daemon() is not posix compliant, so we roll our own if needed.*/
int daemon(int nochdir, int noclose) {
pid_t pid;
if(nochdir<1)
chdir("/");
pid = fork();
switch(pid){
case -1:
printf("Unable to daemonise!\n");
return -1;
break;
case 0: {
umask(0);
if(setsid()==-1) {
perror("setsid");
return -1;
}
if(noclose<1) {
freopen( "/dev/null", "r", stdin);
freopen( "/dev/null", "w", stdout);
freopen( "/dev/null", "w", stderr);
}
break;
}
default:
_exit(0);
}
return 0;
}
#endif
int main (int argc, char *argv[])
{
@@ -274,10 +328,11 @@ int main (int argc, char *argv[])
struct sigaction new_action;
cycle_key = G15_KEY_L1;
unsigned char user[256];
unsigned int lcdlevel = 1;
pthread_t keyboard_thread;
pthread_t lcd_thread;
memset(user,0,256);
for (i=0;i<argc;i++) {
char daemonargs[20];
@@ -308,13 +363,14 @@ int main (int argc, char *argv[])
if (!strncmp(daemonargs, "-h",2) || !strncmp(daemonargs, "--help",6)) {
printf("G15Daemon version %s - %s\n",VERSION,uf_return_running() >= 0 ?"Loaded & Running":"Not Running");
printf("%s -h (--help) or -k (--kill) or -s (--switch) or -d (--debug) or -v (--version)\n\n -k will kill a previous incarnation",argv[0]);
printf("%s -h (--help) or -k (--kill) or -s (--switch) or -d (--debug) [level] or -v (--version) or -l (--lcdlevel) [0-2] \n\n -k\twill kill a previous incarnation",argv[0]);
#ifdef LIBG15_VERSION
#if LIBG15_VERSION >= 1200
printf(", if uppercase -K or -KILL turn off the keyboard backlight on the way out.");
printf("\n -K\tturn off the keyboard backlight on the way out.");
#endif
#endif
printf("\n -h shows this help\n -s changes the screen-switch key from MR to L1\n -d debug mode - stay in foreground and output all debug messages to STDERR\n -v show version\n");
printf("\n -h\tshows this help\n -s\tchanges the screen-switch key from L1 to MR (beware)\n -d\tdebug mode - stay in foreground and output all debug messages to STDERR\n -v\tshow version\n -l\tset default LCD backlight level\n");
printf(" --set-backlight sets backlight individually for currently shown screen.\n\t\tDefault is to set backlight globally (keyboard default).\n");
exit(0);
}
@@ -323,6 +379,10 @@ int main (int argc, char *argv[])
cycle_cmdline_override=1;
}
if (!strncmp(daemonargs, "--set-backlight",15)) {
set_backlight = 1;
}
if (!strncmp(daemonargs, "-d",2) || !strncmp(daemonargs, "--debug",7)) {
g15daemon_debug = 1;
if((argv[i+1])!=NULL)
@@ -339,6 +399,21 @@ int main (int argc, char *argv[])
}
}
if (!strncmp(daemonargs, "-l",2) || !strncmp(daemonargs, "--lcdlevel",7)) {
if((argv[i+1])!=NULL)
if(isdigit(argv[i+1][0])){
lcdlevel = atoi(argv[i+1]);
}
}
}
if(g15daemon_debug){
g15daemon_log(LOG_INFO, "G15Daemon %s Build Date: %s",PACKAGE_VERSION,BUILD_DATE);
g15daemon_log(LOG_DEBUG, "Build OS: %s",BUILD_OS_NAME);
g15daemon_log(LOG_DEBUG, "With compiler: %s",COMPILER_VERSION);
fprintf(stderr, "G15Daemon CMDLINE ARGS: ");
for(i=1;i<argc;i++)
fprintf(stderr, "%s ",argv[i]);
fprintf(stderr,"\n");
}
if(uf_return_running()>=0) {
g15daemon_log(LOG_ERR,"G15Daemon already running.. Exiting");
@@ -349,6 +424,21 @@ int main (int argc, char *argv[])
if(LIBG15_VERSION>=1200)
libg15Debug(g15daemon_debug);
#ifdef OSTYPE_DARWIN
/* OS X: load codeless kext */
retval = system("/sbin/kextload " "/System/Library/Extensions/libusbshield.kext");
if (WIFEXITED(retval)){
if (WEXITSTATUS(retval) !=0){
g15daemon_log(LOG_ERR,"Unable to load USB shield kext...exiting");
exit(1);
}
} else {
g15daemon_log(LOG_ERR,"Unable to launch kextload...exiting");
exit(1);
}
#endif
/* init stuff here.. */
if((retval=initLibG15())!=G15_NO_ERROR){
g15daemon_log(LOG_ERR,"Unable to attach to the G15 Keyboard... exiting");
@@ -385,7 +475,8 @@ int main (int argc, char *argv[])
setLCDContrast(1);
setLEDs(0);
lcdlist->kb_backlight_state=1;
setLCDBrightness(lcdlist->kb_backlight_state);
lcdlist->current->lcd->backlight_state=lcdlevel;
setLCDBrightness(lcdlevel);
#ifdef LIBG15_VERSION
#if LIBG15_VERSION >= 1200
@@ -398,27 +489,26 @@ int main (int argc, char *argv[])
if(!cycle_cmdline_override){
cycle_key = 1==g15daemon_cfg_read_bool(global_cfg,"Use MR as Cycle Key",0)?G15_KEY_MR:G15_KEY_L1;
}
#ifndef OSTYPE_SOLARIS
/* all other processes/threads should be seteuid nobody */
if(nobody!=NULL) {
seteuid(nobody->pw_uid);
setegid(nobody->pw_gid);
}
#endif
/* initialise the pthread condition for the LCD thread */
g15daemon_init_refresh();
pthread_mutex_init(&g15lib_mutex, NULL);
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr,512*1024); /* set stack to 512k - dont need 8Mb !! */
pthread_attr_setscope(&attr,PTHREAD_SCOPE_SYSTEM);
int thread_policy=SCHED_RR;
pthread_attr_setschedpolicy(&attr,thread_policy);
pthread_attr_setstacksize(&attr,512*1024); /* set stack to 512k - dont need 8Mb !! */
if (pthread_create(&keyboard_thread, &attr, keyboard_watch_thread, lcdlist) != 0) {
g15daemon_log(LOG_ERR,"Unable to create keyboard listener thread. Exiting");
goto exitnow;
}
pthread_attr_setstacksize(&attr,128*1024);
/* all other threads have a lower priority... maybe */
pthread_attr_setscope(&attr,PTHREAD_SCOPE_PROCESS);
thread_policy=SCHED_OTHER;
pthread_attr_setschedpolicy(&attr,thread_policy);
if (pthread_create(&lcd_thread, &attr, lcd_draw_thread, lcdlist) != 0) {
g15daemon_log(LOG_ERR,"Unable to create display thread. Exiting");
@@ -437,19 +527,19 @@ int main (int argc, char *argv[])
free (canvas);
uf_write_buf_to_g15(lcdlist->tail->lcd);
snprintf((char*)location,1024,"%s/%s",DATADIR,"g15daemon/plugins");
snprintf((char*)location,1024,"%s",PLUGINDIR);
g15_open_all_plugins(lcdlist,(char*)location);
loaded_plugins = g15_open_all_plugins(lcdlist,(char*)location);
new_action.sa_handler = g15daemon_sighandler;
new_action.sa_flags = 0;
sigaction(SIGINT, &new_action, NULL);
sigaction(SIGQUIT, &new_action, NULL);
sigaction(SIGTERM, &new_action, NULL);
sigaction(SIGUSR1, &new_action, NULL);
do {
sleep(1);
pause();
} while( leaving == 0);
g15daemon_log(LOG_INFO,"Leaving by request");
@@ -457,6 +547,9 @@ int main (int argc, char *argv[])
pthread_join(lcd_thread,NULL);
pthread_join(keyboard_thread,NULL);
/* switch off the lcd backlight */
char *blank=g15daemon_xmalloc(G15_BUFFER_LEN);
writePixmapToLCD((unsigned char*)blank);
free(blank);
setLCDBrightness(0);
#ifdef LIBG15_VERSION
#if LIBG15_VERSION >= 1200
@@ -478,6 +571,7 @@ exitnow:
seteuid(0);
setegid(0);
closelog();
g15daemon_quit_refresh();
uf_conf_write(lcdlist,"/etc/g15daemon.conf");
uf_conf_free(lcdlist);
unlink("/var/run/g15daemon.pid");
+136 -19
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others
(c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 190 $ - $Date: 2006-11-22 03:01:03 +1030 (Wed, 22 Nov 2006) $ $Author: mlampard $
$Revision: 449 $ - $Date: 2008-01-24 17:42:07 +1030 (Thu, 24 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -44,10 +44,14 @@
#include "g15daemon.h"
#include <libg15.h>
#include <stdarg.h>
#include <libg15render.h>
extern unsigned int g15daemon_debug;
extern volatile int leaving;
#define G15DAEMON_PIDFILE "/var/run/g15daemon.pid"
pthread_cond_t lcd_refresh = PTHREAD_COND_INITIALIZER;
/* if no exitfunc or eventhandler, member should be NULL */
const plugin_info_t generic_info[] = {
@@ -71,6 +75,45 @@ void *g15daemon_xmalloc(size_t size) {
return ptr;
}
static int refresh_pending=0;
void g15daemon_init_refresh() {
pthread_condattr_t attr;
pthread_cond_init(&lcd_refresh, &attr);
}
void g15daemon_send_refresh(lcd_t *lcd) {
if(lcd==lcd->masterlist->current->lcd||lcd->state_changed) {
pthread_cond_broadcast(&lcd_refresh);
refresh_pending++;
}
}
void g15daemon_wait_refresh() {
pthread_mutex_t dummy_mutex;
struct timespec timeout;
int retval;
if(refresh_pending<1) {
/* Create a dummy mutex which doesn't unlock for sure while waiting. */
pthread_mutex_init(&dummy_mutex, NULL);
pthread_mutex_lock(&dummy_mutex);
start:
time(&timeout.tv_sec);
timeout.tv_sec += 1;
timeout.tv_nsec = 0L;
retval=pthread_cond_timedwait(&lcd_refresh, &dummy_mutex, &timeout);
if(!leaving && retval == ETIMEDOUT)
goto start;
pthread_mutex_unlock(&dummy_mutex);
pthread_mutex_destroy(&dummy_mutex);
}
refresh_pending--;
}
void g15daemon_quit_refresh() {
pthread_cond_destroy(&lcd_refresh);
}
int uf_return_running(){
int fd;
char pidtxt[128];
@@ -133,20 +176,36 @@ int uf_create_pidfile() {
/* syslog wrapper */
int g15daemon_log (int priority, const char *fmt, ...) {
va_list argp;
va_start (argp, fmt);
if(g15daemon_debug == 0)
int real_prio=0;
switch(g15daemon_debug) {
case 0:
case 1:
real_prio = LOG_WARNING;
break;
case 2:
real_prio = LOG_INFO;
break;
default:
real_prio = LOG_DEBUG;
}
if(real_prio>=priority) {
if(g15daemon_debug == 0) {
vsyslog(priority, fmt, argp);
else {
} else {
vfprintf(stderr,fmt,argp);
fprintf(stderr,"\n");
}
}
va_end (argp);
return 0;
}
/* takes a 6880 byte (1byte==1pixel) buffer and packs it into libg15 format. */
void g15daemon_convert_buf(lcd_t *lcd, unsigned char * orig_buf)
{
unsigned int x,y,val;
@@ -166,13 +225,31 @@ void g15daemon_convert_buf(lcd_t *lcd, unsigned char * orig_buf)
}
}
/* wrap the libg15 function */
void uf_write_buf_to_g15(lcd_t *lcd)
/* wrap the libg15 functions */
int uf_write_buf_to_g15(lcd_t *lcd)
{
int retval = 0;
#ifdef LIBUSB_BLOCKS
retval = writePixmapToLCD(lcd->buf);
#else
pthread_mutex_lock(&g15lib_mutex);
writePixmapToLCD(lcd->buf);
retval = writePixmapToLCD(lcd->buf);
pthread_mutex_unlock(&g15lib_mutex);
return;
#endif
return retval;
}
int uf_read_keypresses(unsigned int *keypresses, unsigned int timeout)
{
int retval=0;
#ifdef LIBUSB_BLOCKS
retval = getPressedKeys(keypresses, timeout);
#else
pthread_mutex_lock(&g15lib_mutex);
retval = getPressedKeys(keypresses, timeout);
pthread_mutex_unlock(&g15lib_mutex);
#endif
return retval;
}
/* Sleep routine (hackish). */
@@ -195,18 +272,24 @@ void g15daemon_sleep(int seconds) {
pthread_mutex_destroy(&dummy_mutex);
}
/* microsecond sleep routine. */
int g15daemon_usleep(int useconds) {
struct timeval timeout;
if(useconds < 10000)
useconds = 10000;
timeout.tv_sec = useconds / 1000000;
timeout.tv_usec = useconds % 1000000;
return select (0,0,0,0,&timeout);
}
/* millisecond sleep routine. */
int g15daemon_msleep(int milliseconds) {
struct timespec timeout;
if(milliseconds>999)
milliseconds=999;
timeout.tv_sec = 0;
timeout.tv_nsec = milliseconds*1000000;
return nanosleep (&timeout, NULL);
return g15daemon_usleep(milliseconds*1000);
}
unsigned int g15daemon_gettime_ms(){
struct timeval tv;
gettimeofday(&tv,NULL);
@@ -273,7 +356,7 @@ int uf_conf_write(g15daemon_t *list,char *filename)
config_items_t * item=NULL;
char line[1024];
config_fd = open(filename,O_CREAT|O_RDWR|O_TRUNC);
config_fd = open(filename,O_CREAT|O_RDWR|O_TRUNC, 0644);
if(config_fd){
snprintf(line,1024,"# G15Daemon Configuration File\n# any items entered before a [section] header\n# will be in the Global config space\n# comments you wish to keep should start with a semicolon';'\n");
write(config_fd,line,strlen(line));
@@ -367,7 +450,6 @@ char * uf_remove_whitespace(char *str){
int g15daemon_cfg_write_string(config_section_t *section, char *key, char *val){
config_items_t *new = NULL;
const char empty[]=" ";
if(section==NULL)
return -1;
@@ -519,7 +601,7 @@ int uf_conf_open(g15daemon_t *list, char *filename) {
int config_fd=-1;
char *sect;
char *start;
char *bar;
char *bar = NULL;
int i;
struct stat stats;
@@ -583,3 +665,38 @@ int uf_conf_open(g15daemon_t *list, char *filename) {
return 0;
}
int uf_screendump_pbm(unsigned char *buffer,char *filename) {
int fd;
FILE *f;
int x,y;
#define WIDTH 40
g15canvas *canvas=g15daemon_xmalloc(sizeof(g15canvas));
memcpy(canvas->buffer,buffer,LCD_BUFSIZE);
fd = open(filename, O_CREAT|O_EXCL|O_WRONLY, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
if(fd == -1) {
g15daemon_log(LOG_WARNING, "uf_screendump_pbm failed: open, %s.\n", strerror(errno));
return -1;
}
f = fdopen(fd,"w");
if(f==NULL) {
close(fd);
g15daemon_log(LOG_WARNING, "uf_screendump_pbm failed: fdopen, %s.\n", strerror(errno));
return -1;
}
fprintf(f,"P1\n160 43\n");
fprintf(f,"# G15 screendump - %s\n\n",filename);
for(y=0;y<43;y++)
for(x=0;x<160;x++) {
fprintf(f,"%i",g15r_getPixel(canvas,x,y));
if(x%WIDTH==WIDTH-1)
fprintf(f,"\n");
}
fclose(f);
fsync(fd);
close(fd);
free(canvas);
return 0;
}
-29
View File
@@ -1,29 +0,0 @@
K 25
svn:wc:ra_dav:version-url
V 65
/svnroot/g15daemon/!svn/ver/103/trunk/g15daemon-wip/lang-bindings
END
perl-G15Daemon-0.2.tar.gz
K 25
svn:wc:ra_dav:version-url
V 91
/svnroot/g15daemon/!svn/ver/103/trunk/g15daemon-wip/lang-bindings/perl-G15Daemon-0.2.tar.gz
END
pyg15daemon-0.0.tar.bz2
K 25
svn:wc:ra_dav:version-url
V 89
/svnroot/g15daemon/!svn/ver/103/trunk/g15daemon-wip/lang-bindings/pyg15daemon-0.0.tar.bz2
END
G15Daemon.pm
K 25
svn:wc:ra_dav:version-url
V 78
/svnroot/g15daemon/!svn/ver/103/trunk/g15daemon-wip/lang-bindings/G15Daemon.pm
END
README
K 25
svn:wc:ra_dav:version-url
V 72
/svnroot/g15daemon/!svn/ver/103/trunk/g15daemon-wip/lang-bindings/README
END
-80
View File
@@ -1,80 +0,0 @@
8
dir
251
https://svn.sourceforge.net/svnroot/g15daemon/trunk/g15daemon-wip/lang-bindings
https://svn.sourceforge.net/svnroot/g15daemon
2006-11-09T21:23:46.211835Z
103
mlampard
svn:special svn:externals svn:needs-lock
ab83d0d9-5618-0410-a047-8efd564e0644
perl-G15Daemon-0.2.tar.gz
file
2006-12-25T21:02:07.000000Z
e4a60ccd47ceeb28a9322a12ddc3eae0
2006-11-09T21:23:46.211835Z
103
mlampard
has-props
pyg15daemon-0.0.tar.bz2
file
2006-12-25T21:02:07.000000Z
dbf57324f0bef4625b9fb75d8122c86a
2006-11-09T21:23:46.211835Z
103
mlampard
has-props
G15Daemon.pm
file
2006-12-25T21:02:07.000000Z
6c2a3e258866b77162a3e758bf03ce2e
2006-11-09T21:23:46.211835Z
103
mlampard
has-props
README
file
2006-12-25T21:02:07.000000Z
e353e41bc9d3d686a4258961bbf48331
2006-11-09T21:23:46.211835Z
103
mlampard
has-props
-1
View File
@@ -1 +0,0 @@
8
@@ -1,13 +0,0 @@
K 13
svn:eol-style
V 6
native
K 12
svn:keywords
V 23
Author Date Id Revision
K 13
svn:mime-type
V 10
text/plain
END
@@ -1,13 +0,0 @@
K 13
svn:eol-style
V 6
native
K 12
svn:keywords
V 23
Author Date Id Revision
K 13
svn:mime-type
V 10
text/plain
END
@@ -1,5 +0,0 @@
K 13
svn:mime-type
V 24
application/octet-stream
END
@@ -1,5 +0,0 @@
K 13
svn:mime-type
V 24
application/octet-stream
END
@@ -1,99 +0,0 @@
package G15Daemon;
use base 'Exporter';
use warnings;
use strict;
use 5.008007;
our $VERSION = '0.2';
require Exporter;
our @EXPORT = qw( $g15wbmp $g15pbuf $g15txt );
use Inline C =>
DATA =>
LIBS => '-lg15daemon_client';
our $WIDTH = '160';
our $HEIGHT = '43';
*g15pbuf = \0;
*g15txt = \1;
*g15wbmp = \2;
sub apiversion {
my $self = shift;
return g15version();
}
sub width {
my $self = shift;
return $WIDTH;
}
sub height {
my $self = shift;
return $HEIGHT;
}
sub new
{
my ($class, $screentype) = @_;
my $sock = g15newscreen ($screentype);
my $self = {socket => $sock};
bless $self, $_[0];
}
sub DESTROY {
my $self = shift;
return g15closescreen($self->{socket});
}
sub closescreen {
my $self = shift;
return g15closescreen($self->{socket});
}
sub send {
my $self = shift;
my ($buffer) = @_;
my $len = length($buffer);
return g15send($self->{socket}, $buffer, $len);
}
sub recv{
my $self = shift;
my ($buffer, $len) = @_;
return g15recv($self->{socket}, $buffer, $len);
}
1;
__DATA__
__C__
#include <g15daemon_client.h>
SV* g15version() {
return newSVpvf("%s\n", G15DAEMON_VERSION);
}
int g15newscreen (int screentype) {
return new_g15_screen(screentype);
}
int g15closescreen(int sockfd) {
return g15_close_screen(sockfd);
}
int g15send(int sockfd, char *buf, unsigned int len) {
int retval = g15_send(sockfd, buf, len);
memset(buf,0,len);
return retval;
}
char * g15recv(int sockfd, char *buf, unsigned int len) {
g15_recv(sockfd, buf, len);
return buf;
}
__END__
@@ -1,16 +0,0 @@
***** Perl bindings *****
To use the perl language bindings for libg15daemon_client, copy the
G15Daemon.pm file into a perl include folder, or untar the archive and run
the makefile with:
perl Makefile.PL && make && make install
You'll need to have the
Inline:: perl module installed, which is (as usual) available on CPAN.
The bindings are pretty basic, see the contribs folder for an example of
use.
***** Python Bindings *****
The pyg15daemon bindings are available in this folder, or the latest release
of these bindings are available at http://abraumhal.de/pyg15daemon/
+84 -68
View File
@@ -1,8 +1,8 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -15,15 +15,11 @@
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -37,6 +33,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = libg15daemon_client
DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
@@ -59,17 +56,21 @@ LTLIBRARIES = $(lib_LTLIBRARIES)
libg15daemon_client_la_LIBADD =
am_libg15daemon_client_la_OBJECTS = g15daemon_net.lo
libg15daemon_client_la_OBJECTS = $(am_libg15daemon_client_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
libg15daemon_client_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libg15daemon_client_la_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(libg15daemon_client_la_SOURCES)
DIST_SOURCES = $(libg15daemon_client_la_SOURCES)
includeHEADERS_INSTALL = $(INSTALL_HEADER)
@@ -78,8 +79,6 @@ ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
@@ -106,11 +105,14 @@ EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
G15DAEMON_PLUGIN_DIR = @G15DAEMON_PLUGIN_DIR@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KEXT_LOCATION = @KEXT_LOCATION@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
@@ -118,6 +120,7 @@ LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -127,17 +130,18 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -149,6 +153,7 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
@@ -176,8 +181,15 @@ program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
METASOURCES = AUTO
lib_LTLIBRARIES = libg15daemon_client.la
libg15daemon_client_la_LDFLAGS = -version-info 1:2:0
@@ -218,21 +230,21 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
else :; fi; \
done
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
done
clean-libLTLIBRARIES:
@@ -244,7 +256,7 @@ clean-libLTLIBRARIES:
rm -f "$${dir}/so_locations"; \
done
libg15daemon_client.la: $(libg15daemon_client_la_OBJECTS) $(libg15daemon_client_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(libg15daemon_client_la_LDFLAGS) $(libg15daemon_client_la_OBJECTS) $(libg15daemon_client_la_LIBADD) $(LIBS)
$(libg15daemon_client_la_LINK) -rpath $(libdir) $(libg15daemon_client_la_OBJECTS) $(libg15daemon_client_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -255,22 +267,22 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g15daemon_net.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
@@ -280,13 +292,9 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"
test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
@list='$(include_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
@@ -307,8 +315,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -320,8 +328,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -331,13 +339,12 @@ ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
@@ -351,22 +358,21 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -382,7 +388,7 @@ check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
@@ -417,7 +423,7 @@ distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
distclean-tags
dvi: dvi-am
@@ -431,12 +437,20 @@ info-am:
install-data-am: install-includeHEADERS
install-dvi: install-dvi-am
install-exec-am: install-libLTLIBRARIES
install-html: install-html-am
install-info: install-info-am
install-man:
install-pdf: install-pdf-am
install-ps: install-ps-am
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -457,21 +471,23 @@ ps: ps-am
ps-am:
uninstall-am: uninstall-includeHEADERS uninstall-info-am \
uninstall-libLTLIBRARIES
uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-exec \
install-exec-am install-includeHEADERS install-info \
install-info-am install-libLTLIBRARIES install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am tags uninstall uninstall-am \
uninstall-includeHEADERS uninstall-info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-includeHEADERS install-info \
install-info-am install-libLTLIBRARIES install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-includeHEADERS \
uninstall-libLTLIBRARIES
# Tell versions [3.59,3.63) of GNU make to not export all variables.
+5 -3
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others
(c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 240 $ - $Date: 2007-01-04 02:35:38 +1030 (Thu, 04 Jan 2007) $ $Author: mlampard $
$Revision: 410 $ - $Date: 2008-01-13 13:28:55 +1030 (Sun, 13 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -38,6 +38,7 @@ extern "C"
#define G15_TEXTBUF 1
#define G15_WBMPBUF 2
#define G15_G15RBUF 3
#define G15_SHMRBUF 4
/* client / server commands - see README.devel for details on use */
#define G15DAEMON_KEY_HANDLER 0x10
@@ -49,6 +50,7 @@ extern "C"
#define G15DAEMON_SWITCH_PRIORITIES 'p'
#define G15DAEMON_IS_FOREGROUND 'v'
#define G15DAEMON_IS_USER_SELECTED 'u'
#define G15DAEMON_NEVER_SELECT 'n'
const char *g15daemon_version();
@@ -66,7 +68,7 @@ int g15_send(int sock, char *buf, unsigned int len);
int g15_recv(int sock, char *buf, unsigned int len);
/* send a command (defined above) to the daemon. any replies from the daemon are returned */
int g15_send_cmd (int sock, unsigned char command, unsigned char value);
unsigned long g15_send_cmd (int sock, unsigned char command, unsigned char value);
/* receive an oob byte from the daemon, used internally by g15_send_cmd, but useful elsewhere */
#define G15_FOREGROUND_SENT_OOB 1
int g15_recv_oob_answer(int sock);
+65 -8
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others
(c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 244 $ - $Date: 2007-01-05 08:04:05 +1030 (Fri, 05 Jan 2007) $ $Author: mlampard $
$Revision: 451 $ - $Date: 2008-01-25 15:15:04 +1030 (Fri, 25 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -25,6 +25,7 @@
*/
#include <string.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/wait.h>
@@ -33,12 +34,17 @@
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <config.h>
#include <libg15.h>
#include "g15daemon_client.h"
#ifndef SO_PRIORITY
#define SO_PRIORITY 12
#endif
#define G15SERVER_PORT 15550
#define G15SERVER_ADDR "127.0.0.1"
int leaving = 0;
@@ -47,14 +53,61 @@ const char *g15daemon_version () {
return VERSION;
}
#ifdef HAVE_BACKTRACE
#include <signal.h>
#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
#endif
#define BACKTRACE_LEN 100
_Bool segv_init = 0;
/* sighandler function to print backtrace on segfault */
void g15_sighandler(int sig) {
int i,nptrs;
void *buf[BACKTRACE_LEN];
char **btfuncs;
switch (sig) {
case SIGSEGV:
#ifdef HAVE_EXECINFO_H
fprintf(stderr, "The application (or it's libraries) caught a Segmentation Fault. Backtrace follows:\n");
nptrs = backtrace(buf,BACKTRACE_LEN);
btfuncs = backtrace_symbols(buf,nptrs);
if(btfuncs == NULL)
return;
for(i=0;i<nptrs;i++)
fprintf(stderr,"Backtrace: %s\n",btfuncs[i]);
fprintf(stderr,"End of Backtrace.\n");
free(btfuncs);
exit(1);
#endif
break;
}
}
#endif
int new_g15_screen(int screentype)
{
struct sigaction new_sigaction;
int g15screen_fd;
struct sockaddr_in serv_addr;
static int sighandler_init=0;
/* raise the priority of our packets */
int tos = 0x6;
char buffer[256];
if(sighandler_init==0) {
#ifdef HAVE_BACKTRACE
new_sigaction.sa_handler = g15_sighandler;
new_sigaction.sa_flags = 0;
sigaction(SIGSEGV,&new_sigaction,NULL);
#endif
sighandler_init=1;
}
g15screen_fd = socket(AF_INET, SOCK_STREAM, 0);
if (g15screen_fd < 0)
@@ -173,7 +226,7 @@ int g15_recv_oob_answer(int sock) {
return packet[0];
}
int g15_send_cmd (int sock, unsigned char command, unsigned char value)
unsigned long g15_send_cmd (int sock, unsigned char command, unsigned char value)
{
int retval;
unsigned char packet[2];
@@ -213,11 +266,15 @@ int g15_send_cmd (int sock, unsigned char command, unsigned char value)
packet[0] = (unsigned char)command;
retval = send( sock, packet, 1, MSG_OOB );
break;
case G15DAEMON_NEVER_SELECT:
packet[0] = (unsigned char)command;
retval = send( sock, packet, 1, MSG_OOB );
break;
case G15DAEMON_GET_KEYSTATE:{
retval = 0;
packet[0] = (unsigned char)command;
send( sock, packet, 1, MSG_OOB );
recv(sock, &retval, sizeof(retval),0);
unsigned long keystate = 0;
g15_recv(sock, (char*)&keystate, sizeof(keystate));
return keystate;
break;
}
case G15DAEMON_IS_FOREGROUND:{
@@ -229,12 +286,12 @@ int g15_send_cmd (int sock, unsigned char command, unsigned char value)
case G15DAEMON_IS_USER_SELECTED:{
packet[0] = (unsigned char)command;
send( sock, packet, 1, MSG_OOB );
retval = g15_recv_oob_answer(sock) - 48;
retval = g15_recv_oob_answer(sock);
break;
}
default:
return -1;
}
usleep(1000);
return retval;
}
+7 -4
View File
@@ -1,13 +1,16 @@
METASOURCES = AUTO
libdir = /usr/share/g15daemon/plugins
libdir = @G15DAEMON_PLUGIN_DIR@
AM_CFLAGS = -Wall
lib_LTLIBRARIES =g15plugin_uinput.la g15plugin_tcpserver.la g15plugin_clock.la
INCLUDES = -I$(top_builddir)/libg15daemon_client/ -I$(top_builddir)/g15daemon
if UINPUT_INTERFACE_PLUGIN
g15plugin_uinput_la_SOURCES = g15_plugin_uinput.c
g15plugin_uinput_la_LDFLAGS = -avoid-version -module
input_la = g15plugin_uinput.la
endif
lib_LTLIBRARIES = ${input_la} g15plugin_tcpserver.la g15plugin_clock.la
INCLUDES = -I$(top_builddir)/libg15daemon_client/ -I$(top_builddir)/g15daemon
g15plugin_tcpserver_la_SOURCES = g15_plugin_net.c
g15plugin_tcpserver_la_LDFLAGS = -avoid-version -module
+99 -71
View File
@@ -1,8 +1,8 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -14,15 +14,11 @@
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -36,6 +32,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = plugins
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -57,35 +54,47 @@ LTLIBRARIES = $(lib_LTLIBRARIES)
g15plugin_clock_la_LIBADD =
am_g15plugin_clock_la_OBJECTS = g15_plugin_clock.lo
g15plugin_clock_la_OBJECTS = $(am_g15plugin_clock_la_OBJECTS)
g15plugin_clock_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(g15plugin_clock_la_LDFLAGS) $(LDFLAGS) -o $@
g15plugin_tcpserver_la_LIBADD =
am_g15plugin_tcpserver_la_OBJECTS = g15_plugin_net.lo
g15plugin_tcpserver_la_OBJECTS = $(am_g15plugin_tcpserver_la_OBJECTS)
g15plugin_tcpserver_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(g15plugin_tcpserver_la_LDFLAGS) $(LDFLAGS) -o $@
g15plugin_uinput_la_LIBADD =
am_g15plugin_uinput_la_OBJECTS = g15_plugin_uinput.lo
am__g15plugin_uinput_la_SOURCES_DIST = g15_plugin_uinput.c
@UINPUT_INTERFACE_PLUGIN_TRUE@am_g15plugin_uinput_la_OBJECTS = \
@UINPUT_INTERFACE_PLUGIN_TRUE@ g15_plugin_uinput.lo
g15plugin_uinput_la_OBJECTS = $(am_g15plugin_uinput_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
g15plugin_uinput_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(g15plugin_uinput_la_LDFLAGS) $(LDFLAGS) -o $@
@UINPUT_INTERFACE_PLUGIN_TRUE@am_g15plugin_uinput_la_rpath = -rpath \
@UINPUT_INTERFACE_PLUGIN_TRUE@ $(libdir)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(g15plugin_clock_la_SOURCES) \
$(g15plugin_tcpserver_la_SOURCES) \
$(g15plugin_uinput_la_SOURCES)
DIST_SOURCES = $(g15plugin_clock_la_SOURCES) \
$(g15plugin_tcpserver_la_SOURCES) \
$(g15plugin_uinput_la_SOURCES)
$(am__g15plugin_uinput_la_SOURCES_DIST)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
@@ -112,11 +121,14 @@ EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
G15DAEMON_PLUGIN_DIR = @G15DAEMON_PLUGIN_DIR@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KEXT_LOCATION = @KEXT_LOCATION@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
@@ -124,6 +136,7 @@ LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -133,17 +146,18 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -155,6 +169,7 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
@@ -169,7 +184,7 @@ htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = /usr/share/g15daemon/plugins
libdir = @G15DAEMON_PLUGIN_DIR@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
@@ -182,14 +197,22 @@ program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
METASOURCES = AUTO
AM_CFLAGS = -Wall
lib_LTLIBRARIES = g15plugin_uinput.la g15plugin_tcpserver.la g15plugin_clock.la
@UINPUT_INTERFACE_PLUGIN_TRUE@g15plugin_uinput_la_SOURCES = g15_plugin_uinput.c
@UINPUT_INTERFACE_PLUGIN_TRUE@g15plugin_uinput_la_LDFLAGS = -avoid-version -module
@UINPUT_INTERFACE_PLUGIN_TRUE@input_la = g15plugin_uinput.la
lib_LTLIBRARIES = ${input_la} g15plugin_tcpserver.la g15plugin_clock.la
INCLUDES = -I$(top_builddir)/libg15daemon_client/ -I$(top_builddir)/g15daemon
g15plugin_uinput_la_SOURCES = g15_plugin_uinput.c
g15plugin_uinput_la_LDFLAGS = -avoid-version -module
g15plugin_tcpserver_la_SOURCES = g15_plugin_net.c
g15plugin_tcpserver_la_LDFLAGS = -avoid-version -module
g15plugin_clock_la_SOURCES = g15_plugin_clock.c
@@ -229,21 +252,21 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
else :; fi; \
done
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
done
clean-libLTLIBRARIES:
@@ -255,11 +278,11 @@ clean-libLTLIBRARIES:
rm -f "$${dir}/so_locations"; \
done
g15plugin_clock.la: $(g15plugin_clock_la_OBJECTS) $(g15plugin_clock_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(g15plugin_clock_la_LDFLAGS) $(g15plugin_clock_la_OBJECTS) $(g15plugin_clock_la_LIBADD) $(LIBS)
$(g15plugin_clock_la_LINK) -rpath $(libdir) $(g15plugin_clock_la_OBJECTS) $(g15plugin_clock_la_LIBADD) $(LIBS)
g15plugin_tcpserver.la: $(g15plugin_tcpserver_la_OBJECTS) $(g15plugin_tcpserver_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(g15plugin_tcpserver_la_LDFLAGS) $(g15plugin_tcpserver_la_OBJECTS) $(g15plugin_tcpserver_la_LIBADD) $(LIBS)
$(g15plugin_tcpserver_la_LINK) -rpath $(libdir) $(g15plugin_tcpserver_la_OBJECTS) $(g15plugin_tcpserver_la_LIBADD) $(LIBS)
g15plugin_uinput.la: $(g15plugin_uinput_la_OBJECTS) $(g15plugin_uinput_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(g15plugin_uinput_la_LDFLAGS) $(g15plugin_uinput_la_OBJECTS) $(g15plugin_uinput_la_LIBADD) $(LIBS)
$(g15plugin_uinput_la_LINK) $(am_g15plugin_uinput_la_rpath) $(g15plugin_uinput_la_OBJECTS) $(g15plugin_uinput_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -272,22 +295,22 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g15_plugin_uinput.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
@@ -298,17 +321,13 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -320,8 +339,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -331,13 +350,12 @@ ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
@@ -351,22 +369,21 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -382,7 +399,7 @@ check: check-am
all-am: Makefile $(LTLIBRARIES)
installdirs:
for dir in "$(DESTDIR)$(libdir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
@@ -417,7 +434,7 @@ distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
distclean-tags
dvi: dvi-am
@@ -431,12 +448,20 @@ info-am:
install-data-am:
install-dvi: install-dvi-am
install-exec-am: install-libLTLIBRARIES
install-html: install-html-am
install-info: install-info-am
install-man:
install-pdf: install-pdf-am
install-ps: install-ps-am
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -457,20 +482,23 @@ ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES
uninstall-am: uninstall-libLTLIBRARIES
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am \
install-libLTLIBRARIES install-man install-strip installcheck \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am \
install-libLTLIBRARIES install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-info-am \
uninstall-libLTLIBRARIES
tags uninstall uninstall-am uninstall-libLTLIBRARIES
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
+19 -16
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others
(c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 197 $ - $Date: 2006-12-11 12:26:17 +1030 (Mon, 11 Dec 2006) $ $Author: aneurysm9 $
$Revision: 391 $ - $Date: 2008-01-02 17:02:46 +1030 (Wed, 02 Jan 2008) $ $Author: mlampard $
simple Clock plugin, replace the various functions with your own, and change the g15plugin_info struct below to suit,
edit Makefile.am and compile. Add salt and pepper to taste. For a more advanced plugin that creates it's own lcd screens on-the-fly,
@@ -61,7 +61,7 @@ g15canvas *static_canvas = NULL;
//----------------------------------------------------------------------------
// calc x,y for given minute/hour/sec (pos), cut_off is for radius variations
// ( ie. shorter/longer clock-hands, line parts....)
void get_clock_pos(int pos, int *x, int *y, int cut_off)
static void get_clock_pos(int pos, int *x, int *y, int cut_off)
{
// pos = [0-60]
@@ -86,7 +86,7 @@ void get_clock_pos(int pos, int *x, int *y, int cut_off)
//----------------------------------------------------------------------------
// draw clock frame (only once, as it is stored in static_canvas)
// NOTE - coords here are hardcoded !
void draw_static_canvas(void)
static void draw_static_canvas(void)
{
g15canvas *c = static_canvas;
int i;
@@ -248,10 +248,10 @@ static int draw_analog(g15canvas *c)
strftime(time,sizeof(time),"%r",t);
if(showdate) {
g15r_renderString(c, (unsigned char*)time, 0, G15_TEXT_LARGE, 60, 5);
g15r_renderString(c, (unsigned char*)time, 0, G15_TEXT_LARGE, 60, 4);
g15r_renderString(c, (unsigned char*)day, 1, G15_TEXT_LARGE, 60, 5);
g15r_renderString(c, (unsigned char*)date, 2, G15_TEXT_LARGE, 60, 5);
g15r_renderString(c, (unsigned char*)year, 3, G15_TEXT_LARGE, 60, 5);
g15r_renderString(c, (unsigned char*)date, 2, G15_TEXT_LARGE, 60, 6);
g15r_renderString(c, (unsigned char*)year, 3, G15_TEXT_LARGE, 60, 7);
} else
g15r_renderString(c, (unsigned char*)time, 0, G15_TEXT_LARGE, 60, 18);
@@ -259,18 +259,20 @@ static int draw_analog(g15canvas *c)
}
static int *lcdclock(lcd_t *lcd)
static int lcdclock(lcd_t *lcd)
{
int ret = 0;
g15canvas *canvas = (g15canvas *) malloc (sizeof (g15canvas));
if (canvas != NULL)
{
if (canvas == NULL) {
g15daemon_log(LOG_ERR, "Unable to allocate canvas");
return G15_PLUGIN_QUIT;
}
memset(canvas->buffer, 0, G15_BUFFER_LEN);
canvas->mode_cache = 0;
canvas->mode_reverse = 0;
canvas->mode_xor = 0;
}
memset(lcd->buf,0,G15_BUFFER_LEN);
@@ -280,7 +282,7 @@ static int *lcdclock(lcd_t *lcd)
ret = draw_analog(canvas);
memcpy (lcd->buf, canvas->buffer, G15_BUFFER_LEN);
lcd->ident = random();
g15daemon_send_refresh(lcd);
free(canvas);
return G15_PLUGIN_OK;
}
@@ -317,12 +319,13 @@ static int myeventhandler(plugin_event_t *myevent) {
}
/* completely uncessary function called when plugin is exiting */
static void *callmewhenimdone(lcd_t *lcd){
return NULL;
static void callmewhenimdone(lcd_t *lcd){
if(static_canvas != NULL) free(static_canvas);
return;
}
/* completely unnecessary initialisation function which could just as easily have been set to NULL in the g15plugin_info struct */
static void *myinithandler(lcd_t *lcd){
static int myinithandler(lcd_t *lcd){
config_section_t *clockcfg = g15daemon_cfg_load_section(lcd->masterlist,"Clock");
mode=g15daemon_cfg_read_bool(clockcfg, "24hrFormat",1);
showdate=g15daemon_cfg_read_bool(clockcfg, "ShowDate",0);
@@ -338,7 +341,7 @@ static void *myinithandler(lcd_t *lcd){
draw_static_canvas();
}
return NULL;
return static_canvas == NULL ? G15_PLUGIN_QUIT : G15_PLUGIN_OK;
}
/* if no exitfunc or eventhandler, member should be NULL */
+50 -38
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others
(c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 244 $ - $Date: 2007-01-05 08:04:05 +1030 (Fri, 05 Jan 2007) $ $Author: mlampard $
$Revision: 456 $ - $Date: 2008-01-28 16:35:31 +1030 (Mon, 28 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -40,8 +40,12 @@
#include <libg15.h>
#include <g15daemon.h>
static int leaving;
int server_events(plugin_event_t *myevent);
static int leaving = 0;
static int server_events(plugin_event_t *myevent);
#ifndef SO_PRIORITY
#define SO_PRIORITY 12
#endif
/* tcp server defines */
#define LISTEN_PORT 15550
@@ -65,6 +69,12 @@ static void process_client_cmds(lcdnode_t *lcdnode, int sock, unsigned int *msgb
g15daemon_send_event(lcdnode,G15_EVENT_REQ_PRIORITY,1);
break;
}
case CLIENT_CMD_NEVER_SELECT: { /* client can never be user-selected */
pthread_mutex_lock(&lcdlist_mutex);
lcdnode->lcd->never_select = 1;
pthread_mutex_unlock(&lcdlist_mutex);
break;
}
case CLIENT_CMD_IS_FOREGROUND: { /* client wants to know if it's currently viewable */
pthread_mutex_lock(&lcdlist_mutex);
memset(msgbuf,0,2);
@@ -79,30 +89,12 @@ static void process_client_cmds(lcdnode_t *lcdnode, int sock, unsigned int *msgb
}
case CLIENT_CMD_IS_USER_SELECTED: { /* client wants to know if it was set to foreground by the user */
pthread_mutex_lock(&lcdlist_mutex);
if(lcdnode->lcd->usr_foreground) /* user manually selected this lcd */
msgbuf[0] = '1';
if(lcdnode->lcd->usr_foreground==1) /* user manually selected this lcd */
msgbuf[0] = 1;
else
msgbuf[0] = '0';
msgbuf[0] = 0;
pthread_mutex_unlock(&lcdlist_mutex);
send(sock,msgbuf,1,0);
break;
}
case CLIENT_CMD_BACKLIGHT: { /* client wants to change the LCD backlight */
/* return current state to the client then implement the new state */
send(sock,&lcdnode->lcd->backlight_state,1,MSG_OOB);
lcdnode->lcd->backlight_state = msgbuf[0]-0x80;
lcdnode->lcd->state_changed = 1;
break;
}
case CLIENT_CMD_KB_BACKLIGHT: { /* client wants to change the KB backlight */
setKBBrightness((unsigned int)msgbuf[0]-0x80);
break;
}
case CLIENT_CMD_CONTRAST: { /* client wants to change the LCD contrast */
/* send current state to the client */
send(sock,&lcdnode->lcd->contrast_state,1,MSG_OOB);
lcdnode->lcd->contrast_state = msgbuf[0]-0x40;
lcdnode->lcd->state_changed = 1;
send(sock,msgbuf,1,MSG_OOB);
break;
}
default:
@@ -120,12 +112,28 @@ static void process_client_cmds(lcdnode_t *lcdnode, int sock, unsigned int *msgb
lcdnode->list->remote_keyhandler_sock = sock;
g15daemon_log(LOG_WARNING, "Client has taken over keystate");
}
else if (msgbuf[0] & CLIENT_CMD_BACKLIGHT)
{
unsigned char retval = lcdnode->lcd->backlight_state;
send(sock,&retval,1,MSG_OOB);
lcdnode->lcd->backlight_state = msgbuf[0]-0x80;
lcdnode->lcd->state_changed = 1;
}
else if (msgbuf[0] & CLIENT_CMD_KB_BACKLIGHT)
{
setKBBrightness((unsigned int)msgbuf[0]-0x8);
}
else if (msgbuf[0] & CLIENT_CMD_CONTRAST)
{
send(sock,&lcdnode->lcd->contrast_state,1,MSG_OOB);
lcdnode->lcd->contrast_state = msgbuf[0]-0x40;
lcdnode->lcd->state_changed = 1;
}
}
}
/* create and open a socket for listening */
int init_sockserver(){
static int init_sockserver(){
int listening_socket;
int yes=1;
int tos = 0x18;
@@ -159,7 +167,7 @@ int init_sockserver(){
}
int g15_send(int sock, char *buf, unsigned int len)
static int g15_send(int sock, char *buf, unsigned int len)
{
int total = 0;
int retval = 0;
@@ -189,7 +197,7 @@ int g15_send(int sock, char *buf, unsigned int len)
}
int g15_recv(lcdnode_t *lcdnode, int sock, char *buf, unsigned int len)
static int g15_recv(lcdnode_t *lcdnode, int sock, char *buf, unsigned int len)
{
int total = 0;
int retval = 0;
@@ -211,7 +219,7 @@ int g15_recv(lcdnode_t *lcdnode, int sock, char *buf, unsigned int len)
}
process_client_cmds(lcdnode, sock, msgbuf,len);
}
else if(pfd[0].revents & POLLIN && !(pfd[0].revents & POLLERR || pfd[0].revents & POLLHUP || pfd[0].revents & POLLNVAL)) {
else if(pfd[0].revents & POLLIN && !(pfd[0].revents & POLLERR || pfd[0].revents & POLLHUP || pfd[0].revents & POLLNVAL || pfd[0].revents & POLLPRI)) {
retval = recv(sock, buf+total, bytesleft, 0);
if (retval < 1) {
@@ -237,7 +245,7 @@ int g15_recv(lcdnode_t *lcdnode, int sock, char *buf, unsigned int len)
* once the client disconnects by closing the socket, the LCD buffer is
* removed and will no longer be displayed.
*/
void *lcd_client_thread(void *display) {
static void *lcd_client_thread(void *display) {
lcdnode_t *g15node = display;
lcd_t *client_lcd = g15node->lcd;
@@ -265,7 +273,7 @@ void *lcd_client_thread(void *display) {
pthread_mutex_lock(&lcdlist_mutex);
memset(client_lcd->buf,0,1024);
g15daemon_convert_buf(client_lcd,tmpbuf);
client_lcd->ident = random();
g15daemon_send_refresh(client_lcd);
pthread_mutex_unlock(&lcdlist_mutex);
}
}
@@ -277,7 +285,7 @@ void *lcd_client_thread(void *display) {
}
pthread_mutex_lock(&lcdlist_mutex);
memcpy(client_lcd->buf,tmpbuf,sizeof(client_lcd->buf));
client_lcd->ident = random();
g15daemon_send_refresh(client_lcd);
pthread_mutex_unlock(&lcdlist_mutex);
}
}
@@ -310,7 +318,7 @@ void *lcd_client_thread(void *display) {
pthread_mutex_lock(&lcdlist_mutex);
memcpy(client_lcd->buf,tmpbuf+header,buflen+header);
client_lcd->ident = random();
g15daemon_send_refresh(client_lcd);
pthread_mutex_unlock(&lcdlist_mutex);
}
}
@@ -325,7 +333,7 @@ exitthread:
}
/* poll the listening socket for connections, spawning new threads as needed to handle clients */
int g15_clientconnect (g15daemon_t **g15daemon, int listening_socket) {
static int g15_clientconnect (g15daemon_t **g15daemon, int listening_socket) {
int conn_s;
struct pollfd pfd[1];
@@ -398,7 +406,7 @@ static void lcdserver_thread(void *lcdlist){
}
/* incoming events */
int server_events(plugin_event_t *event) {
static int server_events(plugin_event_t *event) {
lcd_t *lcd = (lcd_t*) event->lcd;
switch (event->event)
@@ -425,10 +433,14 @@ int server_events(plugin_event_t *event) {
return G15_PLUGIN_OK;
}
static void g15plugin_net_exit() {
leaving = 1;
}
/* if no exitfunc or eventhandler, member should be NULL */
plugin_info_t g15plugin_info[] = {
/* TYPE, name, initfunc, updatefreq, exitfunc, eventhandler, initfunc */
{G15_PLUGIN_LCD_SERVER, "LCDServer" , (void*)lcdserver_thread, 500, NULL, (void*)server_events, NULL},
{G15_PLUGIN_LCD_SERVER, "LCDServer" , (void*)lcdserver_thread, 500, (void*)g15plugin_net_exit, (void*)server_events, NULL},
{G15_PLUGIN_NONE, "" , NULL, 0, NULL, NULL, NULL}
};
+7 -7
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others
(c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 177 $ - $Date: 2006-11-19 00:16:03 +1030 (Sun, 19 Nov 2006) $ $Author: mlampard $
$Revision: 388 $ - $Date: 2008-01-02 12:57:03 +1030 (Wed, 02 Jan 2008) $ $Author: mlampard $
UINPUT key processing plugin. receives events and sends keycodes to the linux kernel.
*/
@@ -54,7 +54,7 @@ static int map_Lkeys = 0;
#define G15KEY_DOWN 1
#define G15KEY_UP 0
int g15_init_uinput(void *plugin_args) {
static int g15_init_uinput(void *plugin_args) {
int i=0;
char *custom_filename;
@@ -115,7 +115,7 @@ void g15_exit_uinput(void *plugin_args){
}
void g15_uinput_keydown(unsigned char code)
static void g15_uinput_keydown(unsigned char code)
{
struct input_event event;
memset(&event, 0, sizeof(event));
@@ -127,7 +127,7 @@ void g15_uinput_keydown(unsigned char code)
write (uinp_fd, &event, sizeof(event));
}
void g15_uinput_keyup(unsigned char code)
static void g15_uinput_keyup(unsigned char code)
{
struct input_event event;
memset(&event, 0, sizeof(event));
@@ -147,7 +147,7 @@ void g15_uinput_keyup(unsigned char code)
#endif
#endif
void g15_process_keys(g15daemon_t *masterlist, unsigned int currentkeys, unsigned int lastkeys)
static void g15_process_keys(g15daemon_t *masterlist, unsigned int currentkeys, unsigned int lastkeys)
{
/* 'G' keys */
if((currentkeys & G15_KEY_G1) && !(lastkeys & G15_KEY_G1))
@@ -292,7 +292,7 @@ void g15_process_keys(g15daemon_t *masterlist, unsigned int currentkeys, unsigne
}
int keyevents(plugin_event_t *myevent) {
static int keyevents(plugin_event_t *myevent) {
lcd_t *lcd = (lcd_t*) myevent->lcd;
static int lastkeys;
switch (myevent->event)
+2 -4
View File
@@ -3,18 +3,16 @@
%define prefix /usr
Summary: Daemon to control logitech G15 keyboards
Name: g15daemon
Version: 1.9.0
Version: 1.9.5.3
Release: 1
Copyright: GPL
Group: Applications/System
Source: ftp://prdownloads.sf.net/g15daemon-1.9.0.tar.bz2
Source: ftp://prdownloads.sf.net/g15daemon-1.9.5.3.tar.bz2
URL: http://g15daemon.sf.net
Distribution: Linux
Vendor: NONE
Packager: Mike Lampard <mlampard@users.sourceforge.net>
Buildroot: /var/tmp/g15daemon-%{PACKAGE_VERSION}-root
BuildRequires: daemon-devel
Requires: daemon
Requires: libg15
Provides: g15daemon