ReactOS 0.4.16-dev-1067-ge98bba2
fputc.cpp File Reference
Include dependency graph for fputc.cpp:

Go to the source code of this file.

Functions

int __cdecl _fputc_nolock_internal (int const c, FILE *const public_stream, __crt_cached_ptd_host &ptd)
 
int __cdecl _fputc_nolock (int const c, FILE *const public_stream)
 
int __cdecl _putc_nolock (int const c, FILE *const stream)
 
static int __cdecl _fputc_internal (int const c, FILE *const stream, __crt_cached_ptd_host &ptd)
 
int __cdecl fputc (int const c, FILE *const stream)
 
int __cdecl putc (int const c, FILE *const stream)
 
int __cdecl _fputchar (int const c)
 
int __cdecl putchar (int const c)
 

Function Documentation

◆ _fputc_internal()

static int __cdecl _fputc_internal ( int const  c,
FILE *const  stream,
__crt_cached_ptd_host &  ptd 
)
static

Definition at line 46 of file fputc.cpp.

47{
49
50 int return_value = 0;
51
53 __try
54 {
56
57 return_value = _fputc_nolock_internal(c, stream, ptd);
58 }
60 {
62 }
64
65 return return_value;
66}
#define EINVAL
Definition: acclib.h:90
#define _UCRT_VALIDATE_STREAM_ANSI_RETURN(ptd, stream, errorcode, retexpr)
#define _UCRT_VALIDATE_RETURN(ptd, expr, errorcode, retexpr)
_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
int __cdecl _fputc_nolock_internal(int const c, FILE *const public_stream, __crt_cached_ptd_host &ptd)
Definition: fputc.cpp:12
const GLubyte * c
Definition: glext.h:8905
#define EOF
Definition: stdio.h:24
_CRTIMP void __cdecl _unlock_file(_Inout_ FILE *_File)
_CRTIMP void __cdecl _lock_file(_Inout_ FILE *_File)
#define __try
Definition: pseh2_64.h:188
#define __endtry
Definition: pseh2_64.h:191
#define __finally
Definition: pseh2_64.h:190
Definition: parse.h:23

Referenced by fputc().

◆ _fputc_nolock()

int __cdecl _fputc_nolock ( int const  c,
FILE *const  public_stream 
)

Definition at line 31 of file fputc.cpp.

32{
33 __crt_cached_ptd_host ptd;
34 return _fputc_nolock_internal(c, public_stream, ptd);
35}

◆ _fputc_nolock_internal()

int __cdecl _fputc_nolock_internal ( int const  c,
FILE *const  public_stream,
__crt_cached_ptd_host &  ptd 
)

Definition at line 12 of file fputc.cpp.

13{
14 __crt_stdio_stream const stream(public_stream);
15
16 --stream->_cnt;
17
18 // If there is no room for the character in the buffer, flush the buffer and
19 // write the character:
20 if (stream->_cnt < 0)
21 {
23 }
24
25 // Otherwise, there is sufficient room, so we can write directly to the buffer:
26 char const char_value = static_cast<char>(c);
27 *stream->_ptr++ = char_value;
28 return char_value & 0xff;
29}
int __cdecl __acrt_stdio_flush_and_write_narrow_nolock(int const c, FILE *const stream, __crt_cached_ptd_host &ptd)
Definition: _flsbuf.cpp:195
#define c
Definition: ke_i.h:80

Referenced by _fputc_internal(), _fputc_nolock(), _fputwc_nolock_internal(), and _puts_internal().

◆ _fputchar()

int __cdecl _fputchar ( int const  c)

Definition at line 87 of file fputc.cpp.

88{
89 return fputc(c, stdout);
90}
int __cdecl fputc(int const c, FILE *const stream)
Definition: fputc.cpp:70
#define stdout
Definition: stdio.h:99

Referenced by putchar().

◆ _putc_nolock()

int __cdecl _putc_nolock ( int const  c,
FILE *const  stream 
)

Definition at line 37 of file fputc.cpp.

38{
39 return _fputc_nolock(c, stream);
40}
#define _fputc_nolock(_c, _stream)
Definition: stdio.h:1143

◆ fputc()

int __cdecl fputc ( int const  c,
FILE *const  stream 
)

Definition at line 70 of file fputc.cpp.

71{
72 __crt_cached_ptd_host ptd;
73 return _fputc_internal(c, stream, ptd);
74}
static int __cdecl _fputc_internal(int const c, FILE *const stream, __crt_cached_ptd_host &ptd)
Definition: fputc.cpp:46

Referenced by _fputchar(), and putc().

◆ putc()

int __cdecl putc ( int const  c,
FILE *const  stream 
)

Definition at line 79 of file fputc.cpp.

80{
81 return fputc(c, stream);
82}

◆ putchar()

int __cdecl putchar ( int const  c)

Definition at line 95 of file fputc.cpp.

96{
97 return _fputchar(c);
98}
int __cdecl _fputchar(int const c)
Definition: fputc.cpp:87