Search
lxdream.org :: lxdream/src/drivers/input_lirc.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/drivers/input_lirc.c
changeset 1024:c67f2d61ab97
prev1015:ad448bedc48a
next1050:7d88277590d9
author nkeynes
date Wed Jun 24 02:41:12 2009 +0000 (14 years ago)
permissions -rw-r--r--
last change Add initial VMU support
file annotate diff log raw
1.1 --- a/src/drivers/input_lirc.c Tue Jun 02 23:16:26 2009 +0000
1.2 +++ b/src/drivers/input_lirc.c Wed Jun 24 02:41:12 2009 +0000
1.3 @@ -16,9 +16,6 @@
1.4 * GNU General Public License for more details.
1.5 */
1.6
1.7 -#ifndef _GNU_SOURCE
1.8 -#define _GNU_SOURCE
1.9 -#endif
1.10 #include <sys/types.h>
1.11 #include <sys/ioctl.h>
1.12 #include <errno.h>
1.13 @@ -37,9 +34,9 @@
1.14 #include <lirc/lirc_client.h>
1.15
1.16 #include "lxdream.h"
1.17 +#include "plugin.h"
1.18 #include "display.h"
1.19 #include "maple/maple.h"
1.20 -#include "drivers/input_lirc.h"
1.21
1.22 typedef struct input_lirc {
1.23 struct input_driver driver;
1.24 @@ -57,7 +54,7 @@
1.25
1.26 input_driver_t system_lirc_driver;
1.27
1.28 -void input_lirc_create()
1.29 +static gboolean input_lirc_init()
1.30 {
1.31 input_lirc_t system_lirc_driver = g_malloc0(sizeof(struct input_lirc));
1.32 strcpy(system_lirc_driver->name, "LIRC");
1.33 @@ -69,7 +66,7 @@
1.34 system_lirc_driver->fd = lirc_init("lxdream", 1);
1.35 if (system_lirc_driver->fd == -1) {
1.36 WARN("Could not initialize LIRC. LIRC hotkeys will be disabled.");
1.37 - return;
1.38 + return FALSE;
1.39 }
1.40
1.41 system_lirc_driver->channel = g_io_channel_unix_new(system_lirc_driver->fd);
1.42 @@ -77,7 +74,7 @@
1.43 g_io_add_watch(system_lirc_driver->channel, G_IO_IN|G_IO_ERR|G_IO_HUP, input_lirc_callback, system_lirc_driver);
1.44 memset(keysyms, 0, MAX_KEYSYMS);
1.45 input_register_device((input_driver_t)system_lirc_driver, MAX_KEYSYMS - 1);
1.46 - INFO("LIRC initialized");
1.47 + return TRUE;
1.48 }
1.49
1.50 void input_lirc_shutdown(void)
1.51 @@ -124,7 +121,7 @@
1.52 return NULL;
1.53 }
1.54
1.55 -gboolean input_lirc_callback( GIOChannel *source, GIOCondition condition, gpointer data )
1.56 +static gboolean input_lirc_callback( GIOChannel *source, GIOCondition condition, gpointer data )
1.57 {
1.58 int ret;
1.59 char *code, *c;
1.60 @@ -154,3 +151,4 @@
1.61 return TRUE;
1.62 }
1.63
1.64 +DEFINE_PLUGIN( PLUGIN_INPUT_DRIVER, "lirc", input_lirc_init );
.