Check for allocation failure in libevdev_new()

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Free the event queue on cleanup.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Split libevdev_new() into _new and _new_from_fd()

libevdev_new() can only fail on allocation failures, but with an fd the
failure options are more. Split into a new function that can return an error
code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
gitignore: Ignore tarballs

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Change libevdev_grab to take an enum

Enum values fo 3 and 4 to avoid callers using true/false values for grabbing
and ungrabbing. If the evdev mute ioctl is merged, we can extend this
without having to worry about breaking callers.

[1] http://lwn.net/Articles/476830/

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Don't allow re-setting the fd

If a caller needs to re-init a device, libevdev_new_from_fd() is a better
choice.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Add a fixme: if we're dropping sync event, libedev loses state info too

If a client doesn't care about syncing that's one thing, but
libevdev functions still need to return the right _current_ (i.e. synced)
value.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Add a FIXME for lack of O_NONBLOCK

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Rename pid/vid to product-id and vendor-id

Slightly more expressive and it's not that painful to type.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>