diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-08-18 14:26:45 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-08-18 14:26:45 +0200 |
| commit | 18c9a8b8905304cf5f8fc15825769046a3144866 (patch) | |
| tree | a7807bb32b0a5d9ded7d3cedccc598f64a9b00fe /src/core/io_trans.h | |
| parent | f25a10e19eca294c4e6a99e4f80ce5cfd11a0e5f (diff) | |
| download | nissy-core-18c9a8b8905304cf5f8fc15825769046a3144866.tar.gz nissy-core-18c9a8b8905304cf5f8fc15825769046a3144866.zip | |
Reorganized folder structure
Diffstat (limited to 'src/core/io_trans.h')
| -rw-r--r-- | src/core/io_trans.h | 25 |
1 files changed, 25 insertions, 0 deletions
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 @@ | |||
| 1 | _static uint8_t readtrans(const char *); | ||
| 2 | _static void writetrans(uint8_t, char *); | ||
| 3 | |||
| 4 | _static uint8_t | ||
| 5 | readtrans(const char *buf) | ||
| 6 | { | ||
| 7 | uint8_t t; | ||
| 8 | |||
| 9 | for (t = 0; t < 48; t++) | ||
| 10 | if (!strncmp(buf, transstr[t], 11)) | ||
| 11 | return t; | ||
| 12 | |||
| 13 | LOG("readtrans error\n"); | ||
| 14 | return _error; | ||
| 15 | } | ||
| 16 | |||
| 17 | _static void | ||
| 18 | writetrans(uint8_t t, char *buf) | ||
| 19 | { | ||
| 20 | if (t >= 48) | ||
| 21 | memcpy(buf, "error trans", 11); | ||
| 22 | else | ||
| 23 | memcpy(buf, transstr[t], 11); | ||
| 24 | buf[11] = '\0'; | ||
| 25 | } | ||
