aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--demo-async.c2
-rw-r--r--demo.c2
-rw-r--r--termkey.c6
-rw-r--r--termkey.h.in3
4 files changed, 11 insertions, 2 deletions
diff --git a/demo-async.c b/demo-async.c
index 9b48434..dd869a8 100644
--- a/demo-async.c
+++ b/demo-async.c
@@ -6,7 +6,7 @@
static void on_key(TermKey *tk, TermKeyKey *key)
{
char buffer[50];
- termkey_snprint_key(tk, buffer, sizeof buffer, key, TERMKEY_FORMAT_VIM);
+ termkey_strfkey(tk, buffer, sizeof buffer, key, TERMKEY_FORMAT_VIM);
printf("%s\n", buffer);
}
diff --git a/demo.c b/demo.c
index 290327d..4df859a 100644
--- a/demo.c
+++ b/demo.c
@@ -44,7 +44,7 @@ int main(int argc, char *argv[])
printf("\e[?%dhMouse mode active\n", mouse);
while((ret = termkey_waitkey(tk, &key)) != TERMKEY_RES_EOF) {
- termkey_snprint_key(tk, buffer, sizeof buffer, &key, format);
+ termkey_strfkey(tk, buffer, sizeof buffer, &key, format);
printf("%s\n", buffer);
if(key.type == TERMKEY_TYPE_UNICODE &&
diff --git a/termkey.c b/termkey.c
index bfd577f..81b5133 100644
--- a/termkey.c
+++ b/termkey.c
@@ -935,8 +935,14 @@ static TermKeySym register_c0_full(TermKey *tk, TermKeySym sym, int modifier_set
return sym;
}
+/* Previous name for this function */
size_t termkey_snprint_key(TermKey *tk, char *buffer, size_t len, TermKeyKey *key, TermKeyFormat format)
{
+ return termkey_strfkey(tk, buffer, len, key, format);
+}
+
+size_t termkey_strfkey(TermKey *tk, char *buffer, size_t len, TermKeyKey *key, TermKeyFormat format)
+{
size_t pos = 0;
size_t l = 0;
diff --git a/termkey.h.in b/termkey.h.in
index 34ad090..5405036 100644
--- a/termkey.h.in
+++ b/termkey.h.in
@@ -189,6 +189,9 @@ typedef enum {
#define TERMKEY_FORMAT_VIM (TERMKEY_FORMAT_ALTISMETA|TERMKEY_FORMAT_WRAPBRACKET)
+size_t termkey_strfkey(TermKey *tk, char *buffer, size_t len, TermKeyKey *key, TermKeyFormat format);
+
+// Old name for termkey_strfkey()
size_t termkey_snprint_key(TermKey *tk, char *buffer, size_t len, TermKeyKey *key, TermKeyFormat format);
// Legacy name typedefs