summaryrefslogtreecommitdiff
path: root/xkbcommon
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2012-09-23 16:57:16 +0200
committerDaniel Stone <daniel@fooishbar.org>2012-09-24 09:13:32 +1000
commit5d31b9e3e706df2256295d5c92b74935d1e9fbcd (patch)
tree1098bcb83c37da5c343a593ff2a4e7db1c34e6c8 /xkbcommon
parent25b8384404e849a1dafb8fcea720905f8ee6fcb9 (diff)
Add return value the xkb_keysym_get_name
This is useful to see whether the function was successful and whether truncation occurred. It just changes void -> int so shouldn't break API or ABI. Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'xkbcommon')
-rw-r--r--xkbcommon/xkbcommon.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/xkbcommon/xkbcommon.h b/xkbcommon/xkbcommon.h
index 7a97a21..a26744c 100644
--- a/xkbcommon/xkbcommon.h
+++ b/xkbcommon/xkbcommon.h
@@ -204,6 +204,12 @@ struct xkb_rule_names {
*
* @warning If the buffer passed is too small, the string is truncated
* (though still NUL-terminated); a size of at least 32 bytes is recommended.
+ *
+ * @returns The number of bytes in the name, excluding the NUL byte, if
+ * keysym is valid. Otherwise, -1 is returned.
+ *
+ * @remark You may check if truncation has occured by comparing the return
+ * value with the length of buffer, similarly to the snprintf(3) function.
*/
int
xkb_keysym_get_name(xkb_keysym_t keysym, char *buffer, size_t size);