Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6433 | siemargl | 1 | #include |
2 | |||
3 | int fputs ( const char * str, FILE * file ) |
||
4 | { |
||
5 | int rc; |
||
6 | |||
7 | if(!file || !str) |
||
8 | { |
||
9 | errno = E_INVALIDPTR; |
||
10 | return EOF; |
||
11 | } |
||
12 | |||
13 | if ((file->mode & 3)==FILE_OPEN_READ) |
||
14 | { |
||
15 | errno = E_ACCESS; |
||
16 | return EOF; |
||
17 | } |
||
18 | |||
19 | while(*str) |
||
20 | { |
||
21 | rc = fputc(*str, file); |
||
22 | if (rc < 0) return rc; |
||
23 | str++; |
||
24 | } |
||
25 | |||
26 | return 0; |
||
27 | }> |