diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2021-12-19 23:03:18 +0330 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-12-21 21:24:36 +0330 |
commit | 14b91a3fe9e17583f87639d00e72807df102fd23 (patch) | |
tree | d00c91722694dfc3e78ffa1032305cde3c3f8481 | |
parent | f0709c7a24098ef5fbd568c37a99670d56f15616 (diff) | |
download | serenity-14b91a3fe9e17583f87639d00e72807df102fd23.zip |
LibC: Stub out some wscanf variants
-rw-r--r-- | Userland/Libraries/LibC/wchar.h | 7 | ||||
-rw-r--r-- | Userland/Libraries/LibC/wstdio.cpp | 53 |
2 files changed, 60 insertions, 0 deletions
diff --git a/Userland/Libraries/LibC/wchar.h b/Userland/Libraries/LibC/wchar.h index 034009e3ba..9d244daffa 100644 --- a/Userland/Libraries/LibC/wchar.h +++ b/Userland/Libraries/LibC/wchar.h @@ -87,4 +87,11 @@ int vwprintf(const wchar_t* __restrict format, va_list args); int vfwprintf(FILE* __restrict stream, const wchar_t* __restrict format, va_list args); int vswprintf(wchar_t* __restrict wcs, size_t maxlen, const wchar_t* __restrict format, va_list args); +int fwscanf(FILE* __restrict stream, const wchar_t* __restrict format, ...); +int swscanf(const wchar_t* __restrict ws, const wchar_t* __restrict format, ...); +int wscanf(const wchar_t* __restrict format, ...); +int vfwscanf(FILE* __restrict stream, const wchar_t* __restrict format, va_list arg); +int vswscanf(const wchar_t* __restrict ws, const wchar_t* __restrict format, va_list arg); +int vwscanf(const wchar_t* __restrict format, va_list arg); + __END_DECLS diff --git a/Userland/Libraries/LibC/wstdio.cpp b/Userland/Libraries/LibC/wstdio.cpp index d98fb71925..931f71da3d 100644 --- a/Userland/Libraries/LibC/wstdio.cpp +++ b/Userland/Libraries/LibC/wstdio.cpp @@ -174,4 +174,57 @@ int vswprintf(wchar_t* __restrict wcs, size_t max_length, wchar_t const* __restr wcs, fmt, args); return static_cast<int>(length_so_far); } + +int fwscanf(FILE* __restrict stream, wchar_t const* __restrict format, ...) +{ + va_list ap; + va_start(ap, format); + auto rc = vfwscanf(stream, format, ap); + va_end(ap); + return rc; +} + +int swscanf(wchar_t const* __restrict ws, wchar_t const* __restrict format, ...) +{ + va_list ap; + va_start(ap, format); + auto rc = vswscanf(ws, format, ap); + va_end(ap); + return rc; +} + +int wscanf(wchar_t const* __restrict format, ...) +{ + va_list ap; + va_start(ap, format); + auto rc = vfwscanf(stdout, format, ap); + va_end(ap); + return rc; +} + +int vfwscanf(FILE* __restrict stream, wchar_t const* __restrict format, va_list arg) +{ + (void)stream; + (void)format; + (void)arg; + dbgln("FIXME: Implement vfwscanf()"); + TODO(); +} + +int vswscanf(wchar_t const* __restrict ws, wchar_t const* __restrict format, va_list arg) +{ + (void)ws; + (void)format; + (void)arg; + dbgln("FIXME: Implement vswscanf()"); + TODO(); +} + +int vwscanf(wchar_t const* __restrict format, va_list arg) +{ + (void)format; + (void)arg; + dbgln("FIXME: Implement vwscanf()"); + TODO(); +} } |