1
0

xkbcommon-errors.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. /*
  2. * Copyright © 2026 Pierre Le Marre
  3. *
  4. * SPDX-License-Identifier: MIT
  5. *
  6. * Author: Pierre Le Marre <dev@wismill.eu>
  7. */
  8. #ifndef _XKBCOMMON_ERRORS_H_
  9. #define _XKBCOMMON_ERRORS_H_
  10. /* This file is autogenerated; please do not commit directly. */
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. /**
  15. * @file
  16. * @brief Error-handling related features
  17. */
  18. /**
  19. * @defgroup error-api Error handling
  20. * Error-handling related features
  21. *
  22. * @{
  23. */
  24. /**
  25. * @enum xkb_error_code
  26. * Error codes returned by the API.
  27. *
  28. * The numeric values are stable identifiers that are also used in logging.
  29. * See the @ref error-index for the full list of logging codes.
  30. *
  31. * <details>
  32. * <summary>About the numeric values</summary>
  33. *
  34. * Codes are small positive integers assigned *non-sequentially* by design:
  35. * it prevents callers from assuming adjacency implies relatedness.
  36. *
  37. * See [these guidelines] for further details on the methodology.
  38. *
  39. * The value -1 (`::XKB_ERROR_INVALID`) is reserved for pre-1.14
  40. * functions and does not follow the above scheme.
  41. * </details>
  42. *
  43. * @since 1.14.0
  44. *
  45. * [these guidelines]: https://github.com/haskellfoundation/error-message-index/blob/main/tool-developers.md#code-assignment-recommendations
  46. */
  47. enum xkb_error_code {
  48. /**
  49. * An unspecified error occurred.
  50. *
  51. * Reserved for pre-1.14 functions, which signal errors via -1 return
  52. * values documented per-function.
  53. *
  54. * @since 1.14.0
  55. */
  56. XKB_ERROR_INVALID = -1,
  57. /**
  58. * The operation completed successfully.
  59. *
  60. * @since 1.14.0
  61. */
  62. XKB_SUCCESS = 0,
  63. /**
  64. * Unsupported modifier mask
  65. *
  66. * The modifier mask does not represent valid modifiers.
  67. *
  68. * @since 1.14.0
  69. */
  70. XKB_ERROR_UNSUPPORTED_MODIFIER_MASK = 60,
  71. /**
  72. * The given layout out-of-range policy is not supported
  73. *
  74. * Use the following to check if the linked libxkbcommon library supports a
  75. * given flag:
  76. *
  77. * ```c
  78. * xkb_feature_supported(XKB_FEATURE_ENUM_LAYOUT_OUT_OF_RANGE_POLICY, flag)
  79. * ```
  80. *
  81. * @since 1.14.0
  82. */
  83. XKB_ERROR_UNSUPPORTED_LAYOUT_OUT_OF_RANGE_POLICY = 214,
  84. /**
  85. * Layout index is not supported
  86. *
  87. * libxkbcommon supports different *layout index* ranges, depending on the
  88. * target
  89. * *keymap format*:
  90. * - `::XKB_KEYMAP_FORMAT_TEXT_V1`: 1..4
  91. * - `::XKB_KEYMAP_FORMAT_TEXT_V2`: 1..32
  92. *
  93. * @since 1.14.0
  94. */
  95. XKB_ERROR_UNSUPPORTED_LAYOUT_INDEX = 237,
  96. /**
  97. * Unsupported keymap format
  98. *
  99. * See `xkb_keymap_format` for the list of valid values.
  100. *
  101. * @since 1.14.0
  102. */
  103. XKB_ERROR_UNSUPPORTED_KEYMAP_FORMAT = 277,
  104. /**
  105. * Layout count limit exceeded for the corresponding keymap format
  106. *
  107. * @since 1.14.0
  108. */
  109. XKB_ERROR_LAYOUT_COUNT_LIMIT_EXCEEDED = 366,
  110. /**
  111. * Unsupported `xkb_a11y_flags` value
  112. *
  113. * Use the following to check if the linked libxkbcommon library supports a
  114. * given flag:
  115. *
  116. * ```c
  117. * xkb_feature_supported(XKB_FEATURE_ENUM_A11Y_FLAGS, flag)
  118. * ```
  119. *
  120. * @since 1.14.0
  121. */
  122. XKB_ERROR_UNSUPPORTED_A11Y_FLAGS = 371,
  123. /**
  124. * A `xkb_state` object has an unexpected `xkb_state_mode`
  125. *
  126. * @since 1.14.0
  127. */
  128. XKB_ERROR_UNEXPECTED_STATE_MODE = 399,
  129. /**
  130. * ABI struct size check failed
  131. *
  132. * The `size` field of a versioned structure does not match any known
  133. * version of that structure. This typically indicates the caller failed
  134. * to initialize the struct correctly, e.g. by omitting:
  135. *
  136. * ```c
  137. * .size = sizeof(struct xkb_foo)
  138. * ```
  139. *
  140. * @since 1.14.0
  141. */
  142. XKB_ERROR_ABI_INVALID_STRUCT_SIZE = 450,
  143. /**
  144. * Cannot allocate memory
  145. *
  146. * @since 1.14.0
  147. */
  148. XKB_ERROR_ALLOCATION_FAILURE = 550,
  149. /**
  150. * Unsupported keymap serialization flags
  151. *
  152. * See `::xkb_keymap_serialize_flags` for the list of valid flags.
  153. *
  154. * @since 1.14.0
  155. */
  156. XKB_ERROR_UNSUPPORTED_KEYMAP_SERIALIZATION_FLAGS = 829,
  157. /**
  158. * ABI forward-compatibility check failed
  159. *
  160. * The caller was compiled against a newer version of the library and is
  161. * using fields unknown to this version.
  162. *
  163. * @since 1.14.0
  164. */
  165. XKB_ERROR_ABI_FORWARD_COMPAT = 876,
  166. /**
  167. * ABI backward-compatibility check failed
  168. *
  169. * The caller was compiled against an older version of the library and is
  170. * missing fields that are mandatory in this version.
  171. *
  172. * @since 1.14.0
  173. */
  174. XKB_ERROR_ABI_BACKWARD_COMPAT = 914,
  175. };
  176. /** @} */
  177. #ifdef __cplusplus
  178. } /* extern "C" */
  179. #endif
  180. #endif /* _XKBCOMMON_ERRORS_H_ */