about summary refs log tree commit diff
path: root/tr2cyr_exec.c
blob: 762dc5e1cb251a65bb86da782a83b2fc8e8dfb31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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);
}