summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-02-28 15:33:22 -0500
committerJakob Kaivo <jkk@ung.org>2019-02-28 15:33:22 -0500
commitc73db4ce616ba2fefd0b2dcd034600fa1a7e7bfa (patch)
tree31d6192a2acff238755b0c6bfc3292a35cff996b /src
parent3cf39d63902bdbdff2450e542a80e103ceb34571 (diff)
implement in terms of __scanf()
Diffstat (limited to 'src')
-rw-r--r--src/stdio/vfscanf.c7
-rw-r--r--src/stdio/vsscanf.c7
-rw-r--r--src/wchar/vfwscanf.c7
-rw-r--r--src/wchar/vswscanf.c7
4 files changed, 28 insertions, 0 deletions
diff --git a/src/stdio/vfscanf.c b/src/stdio/vfscanf.c
index 44ce6ea2..6c0f97ee 100644
--- a/src/stdio/vfscanf.c
+++ b/src/stdio/vfscanf.c
@@ -1,7 +1,14 @@
#include <stdio.h>
+#include "nonstd/io.h"
int vfscanf(FILE * restrict stream, const char * restrict format, va_list arg)
{
+ int ret = 0;
+ struct io_options opt = {0};
+ opt.fnname = __func__;
+ opt.stream = stream;
+ ret = __scanf(&opt, format, arg);
+ return ret;
}
/*
diff --git a/src/stdio/vsscanf.c b/src/stdio/vsscanf.c
index 534f30ea..d5322078 100644
--- a/src/stdio/vsscanf.c
+++ b/src/stdio/vsscanf.c
@@ -1,8 +1,15 @@
#include <stdio.h>
#include "stdarg.h"
+#include "nonstd/io.h"
int vsscanf(const char * restrict s, const char * restrict format, va_list arg)
{
+ int ret = 0;
+ struct io_options opt = {0};
+ opt.fnname = __func__;
+ opt.string = (char*)s;
+ ret = __scanf(&opt, format, arg);
+ return ret;
}
/*
diff --git a/src/wchar/vfwscanf.c b/src/wchar/vfwscanf.c
index 75451ac6..d2e90c5f 100644
--- a/src/wchar/vfwscanf.c
+++ b/src/wchar/vfwscanf.c
@@ -1,8 +1,15 @@
#include "stdio.h"
#include <wchar.h>
+#include "nonstd/io.h"
int vfwscanf(FILE * restrict stream, const wchar_t * restrict format, va_list arg)
{
+ int ret = 0;
+ struct io_options opt = {0};
+ opt.fnname = __func__;
+ opt.stream = stream;
+ ret = __scanf(&opt, (const char*)format, arg);
+ return ret;
}
/*
diff --git a/src/wchar/vswscanf.c b/src/wchar/vswscanf.c
index b0896b75..b0f1271a 100644
--- a/src/wchar/vswscanf.c
+++ b/src/wchar/vswscanf.c
@@ -1,7 +1,14 @@
#include <wchar.h>
+#include "nonstd/io.h"
int vswscanf(const wchar_t * restrict s, const wchar_t * restrict format, va_list arg)
{
+ int ret = 0;
+ struct io_options opt = {0};
+ opt.fnname = __func__;
+ opt.string = (char*)s;
+ ret = __scanf(&opt, (const char*)format, arg);
+ return ret;
}
/*