diff options
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 | } | ||
