diff options
Diffstat (limited to '')
-rw-r--r-- | libterminput_marshal_keypress__.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libterminput_marshal_keypress__.c b/libterminput_marshal_keypress__.c new file mode 100644 index 0000000..1ffba01 --- /dev/null +++ b/libterminput_marshal_keypress__.c @@ -0,0 +1,16 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" + + +int +libterminput_marshal_keypress__(struct libterminput_marshaller *how, const struct libterminput_keypress *what) +{ + if (how->store(how, &what->key, sizeof(what->key)) || + how->store(how, &what->times, sizeof(what->times)) || + how->store(how, &what->mods, sizeof(what->mods))) + return -1; + if (what->key == LIBTERMINPUT_SYMBOL) + return how->store(how, what->symbol, sizeof(what->symbol)); + else + return 0; +} |