diff options
| author | Nakidai <nakidai@disroot.org> | 2025-01-10 04:07:36 +0300 |
|---|---|---|
| committer | Nakidai <nakidai@disroot.org> | 2025-01-10 04:07:36 +0300 |
| commit | e8a758d1a1b3fd6db757196268ff02375a6a73da (patch) | |
| tree | 042faa3dc8b2159ef1a5f4ac05b30c53c3a0fcc5 /tr2cyr_exec.c | |
| parent | ac86a131a75474bcc77b92b3d3833f74e1878bfb (diff) | |
| download | tr2cyr-1.1.0.tar.gz tr2cyr-1.1.0.zip | |
Make this cooler v1.1.0
Now it's a library (installable) UwU
Diffstat (limited to 'tr2cyr_exec.c')
| -rw-r--r-- | tr2cyr_exec.c | 23 |
1 files changed, 23 insertions, 0 deletions
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 <locale.h> +#include <stdio.h> +#include <wchar.h> + +#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); +} |