From 26ef76349e5c009740baa985cb16963e79d13765 Mon Sep 17 00:00:00 2001 From: Paul LeoNerd Evans Date: Thu, 31 Mar 2011 11:08:43 +0100 Subject: Renamed snprint_key() to strfkey(); provide redirection trampoline --- demo-async.c | 2 +- demo.c | 2 +- termkey.c | 6 ++++++ termkey.h.in | 3 +++ 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,7 +935,13 @@ 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 -- cgit v1.2.3-70-g09d2