Module: Fusuma::Plugin::Sendkey::Linux::Ioctl
- Included in:
- Input
- Defined in:
- lib/fusuma/plugin/sendkey/linux/ioctl.rb
Overview
Instance Method Summary collapse
- #_IOC(dir, type, nr, size) ⇒ Object
-
#_IOC_DIRBITS ⇒ Integer
2.
- #_IOC_DIRMASK ⇒ Integer
- #_IOC_DIRSHIFT ⇒ Integer
-
#_IOC_NONE ⇒ Integer
no data transfer.
-
#_IOC_NRBITS ⇒ Integer
8.
- #_IOC_NRMASK ⇒ Integer
- #_IOC_NRSHIFT ⇒ Integer
-
#_IOC_READ ⇒ Integer
2.
-
#_IOC_SIZEBITS ⇒ Integer
14.
- #_IOC_SIZEMASK ⇒ Integer
- #_IOC_SIZESHIFT ⇒ Integer
-
#_IOC_TYPEBITS ⇒ Integer
8.
- #_IOC_TYPEMASK ⇒ Integer
- #_IOC_TYPESHIFT ⇒ Integer
-
#_IOC_WRITE ⇒ Integer
1.
- #IOC_IN ⇒ Object
- #IOC_INOUT ⇒ Object
- #IOC_OUT ⇒ Object
- #IOCSIZE_MASK ⇒ Integer
- #IOCSIZE_SHIFT ⇒ Integer
- #native_signed_long(number) ⇒ Object
Instance Method Details
#_IOC(dir, type, nr, size) ⇒ Object
116 117 118 119 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 116 def _IOC(dir, type, nr, size) (native_signed_long(dir << _IOC_DIRSHIFT) | (type.ord << _IOC_TYPESHIFT) | (nr << _IOC_NRSHIFT) | (size << _IOC_SIZESHIFT)) end |
#_IOC_DIRBITS ⇒ Integer
Returns 2.
25 26 27 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 25 def _IOC_DIRBITS 2 end |
#_IOC_DIRMASK ⇒ Integer
45 46 47 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 45 def _IOC_DIRMASK ((1 << _IOC_DIRBITS) - 1) end |
#_IOC_DIRSHIFT ⇒ Integer
65 66 67 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 65 def _IOC_DIRSHIFT (_IOC_SIZESHIFT + _IOC_SIZEBITS) end |
#_IOC_NONE ⇒ Integer
no data transfer
95 96 97 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 95 def _IOC_NONE 0 end |
#_IOC_NRBITS ⇒ Integer
Returns 8.
10 11 12 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 10 def _IOC_NRBITS 8 end |
#_IOC_NRMASK ⇒ Integer
30 31 32 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 30 def _IOC_NRMASK ((1 << _IOC_NRBITS) - 1) end |
#_IOC_NRSHIFT ⇒ Integer
50 51 52 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 50 def _IOC_NRSHIFT 0 end |
#_IOC_READ ⇒ Integer
Returns 2.
105 106 107 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 105 def _IOC_READ 2 end |
#_IOC_SIZEBITS ⇒ Integer
Returns 14.
20 21 22 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 20 def _IOC_SIZEBITS 14 end |
#_IOC_SIZEMASK ⇒ Integer
40 41 42 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 40 def _IOC_SIZEMASK ((1 << _IOC_SIZEBITS) - 1) end |
#_IOC_SIZESHIFT ⇒ Integer
60 61 62 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 60 def _IOC_SIZESHIFT (_IOC_TYPESHIFT + _IOC_TYPEBITS) end |
#_IOC_TYPEBITS ⇒ Integer
Returns 8.
15 16 17 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 15 def _IOC_TYPEBITS 8 end |
#_IOC_TYPEMASK ⇒ Integer
35 36 37 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 35 def _IOC_TYPEMASK ((1 << _IOC_TYPEBITS) - 1) end |
#_IOC_TYPESHIFT ⇒ Integer
55 56 57 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 55 def _IOC_TYPESHIFT (_IOC_NRSHIFT + _IOC_NRBITS) end |
#_IOC_WRITE ⇒ Integer
Returns 1.
100 101 102 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 100 def _IOC_WRITE 1 end |
#IOC_IN ⇒ Object
69 70 71 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 69 def IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) end |
#IOC_INOUT ⇒ Object
77 78 79 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 77 def IOC_INOUT ((_IOC_WRITE | _IOC_READ) << _IOC_DIRSHIFT) end |
#IOC_OUT ⇒ Object
73 74 75 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 73 def IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) end |
#IOCSIZE_MASK ⇒ Integer
82 83 84 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 82 def IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) end |
#IOCSIZE_SHIFT ⇒ Integer
87 88 89 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 87 def IOCSIZE_SHIFT _IOC_SIZESHIFT end |
#native_signed_long(number) ⇒ Object
124 125 126 |
# File 'lib/fusuma/plugin/sendkey/linux/ioctl.rb', line 124 def native_signed_long(number) [number].pack("l!").unpack1("l!") end |