0001-Revert-Drop-deprecated-functions.patch 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. From 51bf0ead89df5c1ddaa22d2f7fc0e04cedbdc590 Mon Sep 17 00:00:00 2001
  2. From: Adam Williamson <awilliam@redhat.com>
  3. Date: Thu, 26 Dec 2013 18:58:23 -0800
  4. Subject: [PATCH] Revert "Drop deprecated functions"
  5. This reverts commit 7a38f4abc3ed1df368d5bad32a1d72559acdc234. It is incorrect and dangerous to drop functions without an soname bump. This broke GNOME.
  6. ---
  7. libevdev/libevdev.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
  8. libevdev/libevdev.h | 30 ++++++++++++++++++++++++++++++
  9. 2 files changed, 79 insertions(+)
  10. diff --git a/libevdev/libevdev.c b/libevdev/libevdev.c
  11. index 8a37204..02e4f78 100644
  12. --- a/libevdev/libevdev.c
  13. +++ b/libevdev/libevdev.c
  14. @@ -162,6 +162,14 @@ libevdev_free(struct libevdev *dev)
  15. free(dev);
  16. }
  17. +/* DEPRECATED */
  18. +LIBEVDEV_EXPORT void
  19. +libevdev_set_log_handler(struct libevdev *dev, libevdev_log_func_t logfunc)
  20. +{
  21. + /* Can't be backwards compatible to this yet, so don't even try */
  22. + fprintf(stderr, "libevdev: ABI change. Log function will not be honored.\n");
  23. +}
  24. +
  25. LIBEVDEV_EXPORT void
  26. libevdev_set_log_function(libevdev_log_func_t logfunc, void *data)
  27. {
  28. @@ -1244,6 +1252,12 @@ libevdev_disable_event_code(struct libevdev *dev, unsigned int type, unsigned in
  29. }
  30. LIBEVDEV_EXPORT int
  31. +libevdev_kernel_set_abs_value(struct libevdev *dev, unsigned int code, const struct input_absinfo *abs)
  32. +{
  33. + return libevdev_kernel_set_abs_info(dev, code, abs);
  34. +}
  35. +
  36. +LIBEVDEV_EXPORT int
  37. libevdev_kernel_set_abs_info(struct libevdev *dev, unsigned int code, const struct input_absinfo *abs)
  38. {
  39. int rc;
  40. @@ -1296,12 +1310,22 @@ libevdev_grab(struct libevdev *dev, enum libevdev_grab_mode grab)
  41. return rc < 0 ? -errno : 0;
  42. }
  43. +/* DEPRECATED */
  44. +LIBEVDEV_EXPORT int
  45. +libevdev_is_event_type(const struct input_event *ev, unsigned int type)
  46. +ALIAS(libevdev_event_is_type);
  47. +
  48. LIBEVDEV_EXPORT int
  49. libevdev_event_is_type(const struct input_event *ev, unsigned int type)
  50. {
  51. return type < EV_CNT && ev->type == type;
  52. }
  53. +/* DEPRECATED */
  54. +LIBEVDEV_EXPORT int
  55. +libevdev_is_event_code(const struct input_event *ev, unsigned int type, unsigned int code)
  56. +ALIAS(libevdev_event_is_code);
  57. +
  58. LIBEVDEV_EXPORT int
  59. libevdev_event_is_code(const struct input_event *ev, unsigned int type, unsigned int code)
  60. {
  61. @@ -1314,6 +1338,11 @@ libevdev_event_is_code(const struct input_event *ev, unsigned int type, unsigned
  62. return (max > -1 && code <= (unsigned int)max && ev->code == code);
  63. }
  64. +/* DEPRECATED */
  65. +LIBEVDEV_EXPORT const char*
  66. +libevdev_get_event_type_name(unsigned int type)
  67. +ALIAS(libevdev_event_type_get_name);
  68. +
  69. LIBEVDEV_EXPORT const char*
  70. libevdev_event_type_get_name(unsigned int type)
  71. {
  72. @@ -1323,6 +1352,11 @@ libevdev_event_type_get_name(unsigned int type)
  73. return ev_map[type];
  74. }
  75. +/* DEPRECATED */
  76. +LIBEVDEV_EXPORT const char*
  77. +libevdev_get_event_code_name(unsigned int type, unsigned int code)
  78. +ALIAS(libevdev_event_code_get_name);
  79. +
  80. LIBEVDEV_EXPORT const char*
  81. libevdev_event_code_get_name(unsigned int type, unsigned int code)
  82. {
  83. @@ -1334,6 +1368,16 @@ libevdev_event_code_get_name(unsigned int type, unsigned int code)
  84. return event_type_map[type][code];
  85. }
  86. +/* DEPRECATED */
  87. +LIBEVDEV_EXPORT const char*
  88. +libevdev_get_input_prop_name(unsigned int prop)
  89. +ALIAS(libevdev_property_get_name);
  90. +
  91. +/* DEPRECATED */
  92. +LIBEVDEV_EXPORT const char*
  93. +libevdev_get_property_name(unsigned int prop)
  94. +ALIAS(libevdev_property_get_name);
  95. +
  96. LIBEVDEV_EXPORT const char*
  97. libevdev_property_get_name(unsigned int prop)
  98. {
  99. @@ -1343,6 +1387,11 @@ libevdev_property_get_name(unsigned int prop)
  100. return input_prop_map[prop];
  101. }
  102. +/* DEPRECATED */
  103. +LIBEVDEV_EXPORT int
  104. +libevdev_get_event_type_max(unsigned int type)
  105. +ALIAS(libevdev_event_type_get_max);
  106. +
  107. LIBEVDEV_EXPORT int
  108. libevdev_event_type_get_max(unsigned int type)
  109. {
  110. diff --git a/libevdev/libevdev.h b/libevdev/libevdev.h
  111. index 37ca2f4..c89f4ad 100644
  112. --- a/libevdev/libevdev.h
  113. +++ b/libevdev/libevdev.h
  114. @@ -1642,6 +1642,36 @@ int libevdev_get_repeat(const struct libevdev *dev, int *delay, int *period);
  115. #define LIBEVDEV_DEPRECATED
  116. #endif
  117. +LIBEVDEV_DEPRECATED extern const enum libevdev_read_flag LIBEVDEV_READ_SYNC;
  118. +LIBEVDEV_DEPRECATED extern const enum libevdev_read_flag LIBEVDEV_READ_NORMAL;
  119. +LIBEVDEV_DEPRECATED extern const enum libevdev_read_flag LIBEVDEV_FORCE_SYNC;
  120. +LIBEVDEV_DEPRECATED extern const enum libevdev_read_flag LIBEVDEV_READ_BLOCKING;
  121. +
  122. +/* replacement: libevdev_kernel_set_abs_info */
  123. +int libevdev_kernel_set_abs_value(struct libevdev *dev, unsigned int code, const struct input_absinfo *abs) LIBEVDEV_DEPRECATED;
  124. +
  125. +
  126. +/* replacement: libevdev_set_log_function */
  127. +void libevdev_set_log_handler(struct libevdev *dev, libevdev_log_func_t logfunc) LIBEVDEV_DEPRECATED;
  128. +
  129. +/** replacement: libevdev_event_type_get_max */
  130. +int libevdev_get_event_type_max(unsigned int type) LIBEVDEV_DEPRECATED;
  131. +
  132. +/** replacement: libevdev_property_get_name */
  133. +const char* libevdev_get_property_name(unsigned int prop) LIBEVDEV_DEPRECATED;
  134. +
  135. +/** replacement: libevdev_event_type_get_name */
  136. +const char * libevdev_get_event_type_name(unsigned int type) LIBEVDEV_DEPRECATED;
  137. +/** replacement: libevdev_event_code_get_name */
  138. +const char * libevdev_get_event_code_name(unsigned int type, unsigned int code) LIBEVDEV_DEPRECATED;
  139. +
  140. +/** replacement: libevdev_event_is_type */
  141. +int libevdev_is_event_type(const struct input_event *ev, unsigned int type) LIBEVDEV_DEPRECATED;
  142. +
  143. +/** replacement: libevdev_event_is_code */
  144. +int libevdev_is_event_code(const struct input_event *ev, unsigned int type, unsigned int code) LIBEVDEV_DEPRECATED;
  145. +/**************************************/
  146. +
  147. #ifdef __cplusplus
  148. }
  149. #endif
  150. --
  151. 1.8.5.2