Rev 647 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 647 | Rev 6412 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | void skipspaces(FILE* file) |
2 | void skipspaces(FILE* file) |
3 | { |
3 | { |
4 | int c; |
4 | int c; |
5 | while(1) |
5 | while(1) |
6 | { |
6 | { |
7 | c=getc(file); |
7 | c=fgetc(file); |
8 | if (c!=' ' && c!='\r' && c!='\n') |
8 | if (c!=' ' && c!='\r' && c!='\n') |
9 | { |
9 | { |
10 | ungetc(c,file); |
10 | ungetc(c,file); |
11 | return; |
11 | return; |
12 | } |
12 | } |
13 | } |
13 | } |
14 | } |
14 | } |
- | 15 | ||
15 | int fscanf(FILE* file,const char* format, ...) |
16 | int fscanf(FILE* file,const char* format, ...) |
16 | { |
17 | { |
17 | int res; |
18 | int res; |
18 | void* arg; |
19 | void* arg; |
19 | int i; |
20 | int i; |
Line 32... | Line 33... | ||
32 | if (*format!='%') |
33 | if (*format!='%') |
33 | { |
34 | { |
34 | c=fgetc(file); |
35 | c=fgetc(file); |
35 | if (c!=*format) |
36 | if (c!=*format) |
36 | { |
37 | { |
37 | fungetc(c,file); |
38 | ungetc(c,file); |
38 | return -1; |
39 | return -1; |
39 | } |
40 | } |
40 | format++; |
41 | format++; |
41 | continue; |
42 | continue; |
42 | } |
43 | } |