From 18c9a8b8905304cf5f8fc15825769046a3144866 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sun, 18 Aug 2024 14:26:45 +0200 Subject: Reorganized folder structure --- src/core/io_trans.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/core/io_trans.h (limited to 'src/core/io_trans.h') diff --git a/src/core/io_trans.h b/src/core/io_trans.h new file mode 100644 index 0000000..7187b7a --- /dev/null +++ b/src/core/io_trans.h @@ -0,0 +1,25 @@ +_static uint8_t readtrans(const char *); +_static void writetrans(uint8_t, char *); + +_static uint8_t +readtrans(const char *buf) +{ + uint8_t t; + + for (t = 0; t < 48; t++) + if (!strncmp(buf, transstr[t], 11)) + return t; + + LOG("readtrans error\n"); + return _error; +} + +_static void +writetrans(uint8_t t, char *buf) +{ + if (t >= 48) + memcpy(buf, "error trans", 11); + else + memcpy(buf, transstr[t], 11); + buf[11] = '\0'; +} -- cgit v1.3