From 4abab5ad6c8465a7528ccdd5f49367da05f78bbd Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Tue, 1 Oct 2024 15:47:05 +0200 Subject: Initial version --- src/stdio/fwide.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/stdio/fwide.c (limited to 'src/stdio/fwide.c') diff --git a/src/stdio/fwide.c b/src/stdio/fwide.c new file mode 100644 index 0000000..8bab634 --- /dev/null +++ b/src/stdio/fwide.c @@ -0,0 +1,16 @@ +#include +#include "stdio_impl.h" +#include "locale_impl.h" + +int fwide(FILE *f, int mode) +{ + FLOCK(f); + if (mode) { + if (!f->locale) f->locale = MB_CUR_MAX==1 + ? C_LOCALE : UTF8_LOCALE; + if (!f->mode) f->mode = mode>0 ? 1 : -1; + } + mode = f->mode; + FUNLOCK(f); + return mode; +} -- cgit v1.2.3