Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4973 | right-hear | 1 | /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ |
2 | #include |
||
3 | #include |
||
4 | #include |
||
5 | #include |
||
6 | |||
7 | int |
||
8 | sscanf(const char *str, const char *fmt, ...) |
||
9 | { |
||
10 | int r; |
||
11 | va_list a=0; |
||
12 | FILE _strbuf; |
||
13 | |||
14 | va_start(a, fmt); |
||
15 | |||
16 | _strbuf._flag = _IOREAD|_IOSTRG; |
||
17 | _strbuf._ptr = _strbuf._base = unconst(str, char *); |
||
18 | _strbuf._cnt = 0; |
||
19 | while (*str++) |
||
20 | _strbuf._cnt++; |
||
21 | _strbuf._bufsiz = _strbuf._cnt; |
||
22 | r = _doscan(&_strbuf, fmt, a); |
||
23 | va_end(a); |
||
24 | return r; |
||
25 | } |