ReactOS 0.4.16-dev-927-g467dec4
fputs.cpp File Reference
Include dependency graph for fputs.cpp:

Go to the source code of this file.

Functions

static int __cdecl _fputs_internal (char const *const string, FILE *const stream, __crt_cached_ptd_host &ptd)
 
int __cdecl fputs (char const *const string, FILE *const stream)
 

Function Documentation

◆ _fputs_internal()

static int __cdecl _fputs_internal ( char const *const  string,
FILE *const  stream,
__crt_cached_ptd_host &  ptd 
)
static

Definition at line 16 of file fputs.cpp.

17{
18 _UCRT_VALIDATE_RETURN(ptd, string != nullptr, EINVAL, EOF);
21
22 size_t const length = strlen(string);
23
24 return __acrt_lock_stream_and_call(stream, [&]() -> int
25 {
26 __acrt_stdio_temporary_buffering_guard const buffering(stream, ptd);
27
28 size_t const bytes_written = _fwrite_nolock_internal(string, 1, length, stream, ptd);
29 if (bytes_written == length)
30 {
31 return 0;
32 }
33
34 return EOF;
35 });
36}
#define EINVAL
Definition: acclib.h:90
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define _UCRT_VALIDATE_STREAM_ANSI_RETURN(ptd, stream, errorcode, retexpr)
#define _UCRT_VALIDATE_RETURN(ptd, expr, errorcode, retexpr)
auto __acrt_lock_stream_and_call(FILE *const stream, Action &&action) -> decltype(action())
_Check_return_opt_ size_t __cdecl _fwrite_nolock_internal(_In_reads_bytes_(_ElementSize *_ElementCount) void const *_Buffer, _In_ size_t _ElementSize, _In_ size_t _ElementCount, _Inout_ FILE *_Stream, _Inout_ __crt_cached_ptd_host &_Ptd)
_In_ size_t const _In_ int _In_ bool const _In_ unsigned const _In_ __acrt_rounding_mode const _Inout_ __crt_cached_ptd_host & ptd
Definition: cvt.cpp:355
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
#define EOF
Definition: stdio.h:24
Definition: parse.h:23

Referenced by fputs().

◆ fputs()

int __cdecl fputs ( char const *const  string,
FILE *const  stream 
)

Definition at line 38 of file fputs.cpp.

39{
40 __crt_cached_ptd_host ptd;
41 return _fputs_internal(string, stream, ptd);
42}
static int __cdecl _fputs_internal(char const *const string, FILE *const stream, __crt_cached_ptd_host &ptd)
Definition: fputs.cpp:16