diff options
author | Gunnar Beutner <gbeutner@serenityos.org> | 2021-05-08 20:35:25 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-09 15:35:01 +0200 |
commit | 4c6a91d0c0f6596d69c0763a55a672959423559b (patch) | |
tree | 326400023123a3d0f64c8eddca37fb166391936c /Userland/Libraries | |
parent | e6747fefa78eb381d4e79698069bff3a89f38ac3 (diff) | |
download | serenity-4c6a91d0c0f6596d69c0763a55a672959423559b.zip |
LibC: Implement vscanf
libstdc++v3 checks whether vscanf is available and only then makes C99
stdio functions available in the std namespace.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibC/stdio.cpp | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibC/stdio.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibC/stdio.cpp b/Userland/Libraries/LibC/stdio.cpp index b12c547e5d..2d3aa0bfc8 100644 --- a/Userland/Libraries/LibC/stdio.cpp +++ b/Userland/Libraries/LibC/stdio.cpp @@ -1257,6 +1257,11 @@ int vfscanf(FILE* stream, const char* fmt, va_list ap) return vsscanf(buffer, fmt, ap); } +int vscanf(const char* fmt, va_list ap) +{ + return vfscanf(stdin, fmt, ap); +} + void flockfile([[maybe_unused]] FILE* filehandle) { dbgln("FIXME: Implement flockfile()"); diff --git a/Userland/Libraries/LibC/stdio.h b/Userland/Libraries/LibC/stdio.h index c1634ce011..b4ff5a8e75 100644 --- a/Userland/Libraries/LibC/stdio.h +++ b/Userland/Libraries/LibC/stdio.h @@ -89,6 +89,7 @@ void perror(const char*); int scanf(const char* fmt, ...) __attribute__((format(scanf, 1, 2))); int sscanf(const char* str, const char* fmt, ...) __attribute__((format(scanf, 2, 3))); int fscanf(FILE*, const char* fmt, ...) __attribute__((format(scanf, 2, 3))); +int vscanf(const char*, va_list) __attribute__((format(scanf, 1, 0))); int vfscanf(FILE*, const char*, va_list) __attribute__((format(scanf, 2, 0))); int vsscanf(const char*, const char*, va_list) __attribute__((format(scanf, 2, 0))); int setvbuf(FILE*, char* buf, int mode, size_t); |