Commit graph

9 commits

Author SHA1 Message Date
Noah 2e2d6f1468
Use typed ioctl calls + other misc changes (#29)
* Use typed ioctl calls

* Make enumerate() return an iterator instead of a vec

* Fix(?) events() behavior

* read() into a buf of mem::MaybeUninit

* Add Device.wait_ready()

* impl AsRawFd for Device

* Add remaining ioctls
2021-02-23 13:31:36 -07:00
Jeff Hiner 73fd0ae421
Round 2 of some refactoring/cleanup (#27)
* Make Key a simple u32 code for future-proofing
* Move MAX for bitflags into associated constants; fix Display, tweak compensation logic
* derive Debug for Device, move constants into constants.rs
* Add docstrings and seatbelts to eviocgbit and eviocgabs
* Increase formality per #243
* Make Device optional fields Option, address unclear naming
2021-02-23 11:28:20 -07:00
Jeff Hiner de2c4e026d
Fix a bunch of unsoundness, and clean up some stuff (#26)
* Fix warnings and remove unsafe code
* Eliminate duplicate structs already in libc; fix incorrect eviocgbit lengths, remove transmute
* Avoid hiding unsafe behind macros; use File rather than libc::open
* Change signatures of eviocgbit and eviocgabs to take slices; use align_to_mut to more safely cast slices
* Replace do_ioctl_buf! with wrapper fn
* Add a sanity check for align_to_mut
* Fix incorrect slice casts, add debug asserts for sanity
* Bump revision
2021-02-22 10:57:25 -07:00
Jeff Hiner 4e700d4671
Edition 2018 (#25)
* Edition 2018
* cargo fmt
* Bump rev to 0.11.0-alpha-2
* Change FF_MAX and KEY_MAX to associated constants
2021-02-20 19:26:34 -07:00
Jeff Hiner fe3d0e9ab0
Update dependencies and fix cross-compatibility issues (#24)
* Update dependencies and fix some cross-compatibility issues
* version 0.11.0-alpha.1
2021-02-20 19:09:39 -07:00
Simon Struck f8c06ece87
Fix mismatched types when compiling for arm 2021-02-08 20:39:43 +01:00
Greg V 13c09cf350 Fix warnings 2017-12-01 23:06:03 +03:00
Greg V e5e7332952 Update nix to 0.9, support FreeBSD
nix 0.9's ioctl macro works with buffers now.
2017-12-01 22:44:06 +03:00
Corey Richardson 9ff9cf4718
Initial port to nix 2017-05-28 16:05:28 -04:00