aboutsummaryrefslogtreecommitdiffstats
path: root/libterminput_unmarshal_text__.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2025-02-19 23:06:02 +0100
committerMattias Andrée <m@maandree.se>2025-02-19 23:06:02 +0100
commit24ebd3c309c5d6cad63bbf1b40de8c17aead0366 (patch)
tree7deab3ddadf241ccfaefc31e65916b6036689285 /libterminput_unmarshal_text__.c
parentAdd tests for new escape sequences (diff)
downloadlibterminput-24ebd3c309c5d6cad63bbf1b40de8c17aead0366.tar.gz
libterminput-24ebd3c309c5d6cad63bbf1b40de8c17aead0366.tar.bz2
libterminput-24ebd3c309c5d6cad63bbf1b40de8c17aead0366.tar.xz
Add state marshalling and unmarshalling functions
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libterminput_unmarshal_text__.c')
-rw-r--r--libterminput_unmarshal_text__.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libterminput_unmarshal_text__.c b/libterminput_unmarshal_text__.c
new file mode 100644
index 0000000..4843db4
--- /dev/null
+++ b/libterminput_unmarshal_text__.c
@@ -0,0 +1,13 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+
+
+int
+libterminput_unmarshal_text__(struct libterminput_unmarshaller *how, struct libterminput_text *what)
+{
+ what->type = LIBTERMINPUT_TEXT;
+ if (how->load(how, &what->nbytes, sizeof(what->nbytes)) ||
+ how->load(how, what->bytes, sizeof(what->nbytes)))
+ return -1;
+ return 0;
+}