From 14b91a3fe9e17583f87639d00e72807df102fd23 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Sun, 19 Dec 2021 23:03:18 +0330 Subject: LibC: Stub out some wscanf variants --- Userland/Libraries/LibC/wchar.h | 7 +++++ Userland/Libraries/LibC/wstdio.cpp | 53 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) 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(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(); +} } -- cgit v1.2.3