input: rearrange code to avoid forward declarations
authorDavid Herrmann <dh.herrmann@googlemail.com>
Sat, 31 Dec 2011 11:04:17 +0000 (12:04 +0100)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Sat, 31 Dec 2011 11:04:17 +0000 (12:04 +0100)
commit0799fbb4bec8ebb7a04cd0de6aac7684dbcc2981
tree73983daa5e52220508dbefcf99c47821b0b8e8eb
parent33afda84213fcb730e9d2b369a90936f596f6c37
input: rearrange code to avoid forward declarations

The diff may look a bit wild but this mostly fixes coding style issues:
 - sort includes alphabetically
 - add missing includes
 - rearrange structures/functions to avoid forward declarations
 - adding "data" user-defineable field to input structure (for callbacks)
 - correctly handle errors in device_data_arrived
 - remove device_added/device_removed
 - merge input_init into constructor
 - add some log messages for debugging
 - remove devices when wake-up fails
 - set cb/data fields on eloop connection, not on initialization
 - remove all devices when disconnecting eloop so the eloop is guaranteed to be
   not used by the input subsystem after disconnection.
 - some error handling fixes
 - remove some TODOs which are correctly implemented
 - Add O_NONBLOCK when opening the device node (I don't know how it actually
   worked without it in the data_arrived callback)

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/input.c
src/input.h