aboutsummaryrefslogtreecommitdiffstats
path: root/libgamepad_get_button_name.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgamepad_get_button_name.c')
-rw-r--r--libgamepad_get_button_name.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libgamepad_get_button_name.c b/libgamepad_get_button_name.c
index 8e7a07f..031e528 100644
--- a/libgamepad_get_button_name.c
+++ b/libgamepad_get_button_name.c
@@ -2,4 +2,12 @@
#include "common.h"
-extern inline const char *libgamepad_get_button_name(uint16_t);
+const char *
+libgamepad_get_button_name(const struct libgamepad_device *device, uint16_t code) /* will not be pure */
+{
+ if (device)
+ return NULL;
+ if ((size_t)code > ELEMSOF(libgamepad_button_names__))
+ return NULL;
+ return libgamepad_button_names__[code];
+}