From e8a758d1a1b3fd6db757196268ff02375a6a73da Mon Sep 17 00:00:00 2001 From: Nakidai Date: Fri, 10 Jan 2025 04:07:36 +0300 Subject: Make this cooler Now it's a library (installable) UwU --- tr2cyr_exec.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tr2cyr_exec.c (limited to 'tr2cyr_exec.c') diff --git a/tr2cyr_exec.c b/tr2cyr_exec.c new file mode 100644 index 0000000..762dc5e --- /dev/null +++ b/tr2cyr_exec.c @@ -0,0 +1,23 @@ +#include +#include +#include + +#include "tr2cyr.h" + + +static wint_t reader(size_t i, void *arg) +{ + return getwchar(); +} + +static int writer(wchar_t ch, void *arg) +{ + (void)arg; + return putwchar(ch) == WEOF ? -1 : 0; +} + +int main(int argc, char **argv) +{ + setlocale(LC_CTYPE, ""); + tr2cyr(&reader, 0, &writer, 0); +} -- cgit 1.4.1