doc: add a note regarding truncation of id_* fields
authorNayan Deshmukh <nayan26deshmukh@gmail.com>
Sun, 4 Aug 2019 11:58:56 +0000 (20:58 +0900)
committerPeter Hutterer <peter.hutterer@who-t.net>
Sun, 4 Aug 2019 22:26:15 +0000 (08:26 +1000)
The id_* fields are 16 bits in linux/input.h and we mirror
the kernel API here. Even though we accept an int for this
fields in ABI the value is truncated at 16 bits.

Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
libevdev/libevdev.h

index 32a4317..8fd8a5b 100644 (file)
@@ -1272,7 +1272,9 @@ int libevdev_get_id_product(const struct libevdev *dev);
  * @param product_id The product ID to assign to this device
  *
  * @note This function may be called before libevdev_set_fd(). A call to
- * libevdev_set_fd() will overwrite any previously set value.
+ * libevdev_set_fd() will overwrite any previously set value. Even though
+ * the function accepts an int for product_id the value is truncated at 16
+ * bits.
  */
 void libevdev_set_id_product(struct libevdev *dev, int product_id);
 
@@ -1294,7 +1296,9 @@ int libevdev_get_id_vendor(const struct libevdev *dev);
  * @param vendor_id The vendor ID to assign to this device
  *
  * @note This function may be called before libevdev_set_fd(). A call to
- * libevdev_set_fd() will overwrite any previously set value.
+ * libevdev_set_fd() will overwrite any previously set value. Even though
+ * the function accepts an int for vendor_id the value is truncated at 16
+ * bits.
  */
 void libevdev_set_id_vendor(struct libevdev *dev, int vendor_id);
 
@@ -1316,7 +1320,9 @@ int libevdev_get_id_bustype(const struct libevdev *dev);
  * @param bustype The bustype to assign to this device
  *
  * @note This function may be called before libevdev_set_fd(). A call to
- * libevdev_set_fd() will overwrite any previously set value.
+ * libevdev_set_fd() will overwrite any previously set value. Even though
+ * the function accepts an int for bustype the value is truncated at 16
+ * bits.
  */
 void libevdev_set_id_bustype(struct libevdev *dev, int bustype);
 
@@ -1338,7 +1344,9 @@ int libevdev_get_id_version(const struct libevdev *dev);
  * @param version The version to assign to this device
  *
  * @note This function may be called before libevdev_set_fd(). A call to
- * libevdev_set_fd() will overwrite any previously set value.
+ * libevdev_set_fd() will overwrite any previously set value. Even though
+ * the function accepts an int for version the value is truncated at 16
+ * bits.
  */
 void libevdev_set_id_version(struct libevdev *dev, int version);