Updating include path in files previously missed.
[reactos.git] / reactos / lib / crtdll / stdio / fputs.c
1 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
2 #include <msvcrt/stdio.h>
3 #include <msvcrt/internal/file.h>
4 #include <msvcrt/string.h>
5 #include <windows.h>
6
7 int
8 fputs(const char *s, FILE *f)
9 {
10
11 int r = 0;
12 int c;
13 int unbuffered;
14 char localbuf[BUFSIZ];
15
16 unbuffered = f->_flag & _IONBF;
17 if (unbuffered)
18 {
19 f->_flag &= ~_IONBF;
20 f->_ptr = f->_base = localbuf;
21 f->_bufsiz = BUFSIZ;
22 }
23
24 while ((c = *s++))
25 r = putc(c, f);
26
27 if (unbuffered)
28 {
29 fflush(f);
30 f->_flag |= _IONBF;
31 f->_base = NULL;
32 f->_bufsiz = 0;
33 f->_cnt = 0;
34 }
35
36 return(r);
37
38 }