Subversion Repositories Kolibri OS

Rev

Rev 4874 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4874 Rev 4921
Line 24... Line 24...
24
INDEX
24
INDEX
25
	_fputs_r
25
	_fputs_r
Line 26... Line 26...
26
 
26
 
27
ANSI_SYNOPSIS
27
ANSI_SYNOPSIS
28
	#include 
28
	#include 
Line 29... Line 29...
29
	int fputs(const char *<[s]>, FILE *<[fp]>);
29
	int fputs(const char *restrict <[s]>, FILE *restrict <[fp]>);
30
 
30
 
Line 31... Line 31...
31
	#include 
31
	#include 
32
	int _fputs_r(struct _reent *<[ptr]>, const char *<[s]>, FILE *<[fp]>);
32
	int _fputs_r(struct _reent *<[ptr]>, const char *restrict <[s]>, FILE *restrict <[fp]>);
33
 
33
 
34
TRAD_SYNOPSIS
34
TRAD_SYNOPSIS
Line 72... Line 72...
72
 */
72
 */
Line 73... Line 73...
73
 
73
 
74
int
74
int
75
_DEFUN(_fputs_r, (ptr, s, fp),
75
_DEFUN(_fputs_r, (ptr, s, fp),
76
       struct _reent * ptr _AND
76
       struct _reent * ptr _AND
77
       char _CONST * s _AND
77
       char _CONST *__restrict s _AND
78
       FILE * fp)
78
       FILE *__restrict fp)
-
 
79
{
79
{
80
#ifdef _FVWRITE_IN_STREAMIO
80
  int result;
81
  int result;
81
  struct __suio uio;
82
  struct __suio uio;
Line 82... Line 83...
82
  struct __siov iov;
83
  struct __siov iov;
Line 86... Line 87...
86
  uio.uio_iov = &iov;
87
  uio.uio_iov = &iov;
87
  uio.uio_iovcnt = 1;
88
  uio.uio_iovcnt = 1;
Line 88... Line 89...
88
 
89
 
Line 89... Line 90...
89
  CHECK_INIT(ptr, fp);
90
  CHECK_INIT(ptr, fp);
90
 
91
 
91
  _flockfile (fp);
92
  _newlib_flockfile_start (fp);
92
  ORIENT (fp, -1);
93
  ORIENT (fp, -1);
93
  result = __sfvwrite_r (ptr, fp, &uio);
94
  result = __sfvwrite_r (ptr, fp, &uio);
-
 
95
  _newlib_flockfile_end (fp);
-
 
96
  return result;
-
 
97
#else
-
 
98
  _CONST char *p = s;
-
 
99
 
-
 
100
  CHECK_INIT(ptr, fp);
-
 
101
 
-
 
102
  _newlib_flockfile_start (fp);
-
 
103
  ORIENT (fp, -1);
-
 
104
  /* Make sure we can write.  */
-
 
105
  if (cantwrite (ptr, fp))
-
 
106
    goto error;
-
 
107
 
-
 
108
  while (*p)
-
 
109
    {
-
 
110
      if (__sputc_r (ptr, *p++, fp) == EOF)
-
 
111
	goto error;
-
 
112
    }
-
 
113
  _newlib_flockfile_exit (fp);
-
 
114
  return 0;
-
 
115
 
-
 
116
error:
-
 
117
  _newlib_flockfile_end (fp);
94
  _funlockfile (fp);
118
  return EOF;
Line 95... Line 119...
95
  return result;
119
#endif
96
}
120
}
97
 
121
 
98
#ifndef _REENT_ONLY
122
#ifndef _REENT_ONLY
99
int
123
int
100
_DEFUN(fputs, (s, fp),
124
_DEFUN(fputs, (s, fp),
101
       char _CONST * s _AND
125
       char _CONST *__restrict s _AND
102
       FILE * fp)
126
       FILE *__restrict fp)
103
{
127
{