diff options
Diffstat (limited to 'src/ctype/wctrans.c')
-rw-r--r-- | src/ctype/wctrans.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ctype/wctrans.c b/src/ctype/wctrans.c new file mode 100644 index 0000000..03e9fd6 --- /dev/null +++ b/src/ctype/wctrans.c @@ -0,0 +1,16 @@ +#include <wctype.h> +#include <string.h> + +wctrans_t wctrans(const char *class) +{ + if (!strcmp(class, "toupper")) return 1; + if (!strcmp(class, "tolower")) return 2; + return 0; +} + +wint_t towctrans(wint_t wc, wctrans_t trans) +{ + if (trans == 1) return towupper(wc); + if (trans == 2) return towlower(wc); + return wc; +} |