blob: efec61d84ddc1ce9e883a2a0ba6fe67f9a1d2f2e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#include <stdio.h>
#include "stdarg.h"
#include "_stdio.h"
/** read formatted input **/
int scanf(const char * restrict format, ...)
{
int ret = 0;
va_list ap;
struct io_options opt = {0};
opt.fnname = "scanf";
opt.stream = stdout;
va_start(ap, format);
ret = __scanf(&opt, format, ap);
va_end(ap);
/*
RETURN_SUCCESS(the number of input items assigned);
RETURN_FAILURE(CONSTANT(EOF));
*/
return ret;
}
/***
reads formatted input from macro(stdin).
FIXME: scanf format goes here
***/
/*
STDC(1)
*/
|