msvcrt: Added _fputc_nolock implementation.
This commit is contained in:
parent
9e4590ff67
commit
975a95a25b
|
@ -830,6 +830,7 @@
|
|||
@ stub _fprintf_p
|
||||
@ stub _fprintf_p_l
|
||||
@ stub _fprintf_s_l
|
||||
@ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock
|
||||
@ cdecl _fputchar(long) MSVCRT__fputchar
|
||||
@ stub _fputwc_nolock
|
||||
@ cdecl _fputwchar(long) MSVCRT__fputwchar
|
||||
|
|
|
@ -1178,6 +1178,7 @@
|
|||
@ stub _fprintf_p
|
||||
@ stub _fprintf_p_l
|
||||
@ stub _fprintf_s_l
|
||||
@ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock
|
||||
@ cdecl _fputchar(long) MSVCRT__fputchar
|
||||
@ stub _fputwc_nolock
|
||||
@ cdecl _fputwchar(long) MSVCRT__fputwchar
|
||||
|
|
|
@ -1176,6 +1176,7 @@
|
|||
@ stub _fprintf_p
|
||||
@ stub _fprintf_p_l
|
||||
@ stub _fprintf_s_l
|
||||
@ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock
|
||||
@ cdecl _fputchar(long) MSVCRT__fputchar
|
||||
@ stub _fputwc_nolock
|
||||
@ cdecl _fputwchar(long) MSVCRT__fputwchar
|
||||
|
|
|
@ -497,6 +497,7 @@
|
|||
@ stub _fprintf_p
|
||||
@ stub _fprintf_p_l
|
||||
@ stub _fprintf_s_l
|
||||
@ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock
|
||||
@ cdecl _fputchar(long) MSVCRT__fputchar
|
||||
@ stub _fputwc_nolock
|
||||
@ cdecl _fputwchar(long) MSVCRT__fputwchar
|
||||
|
|
|
@ -479,6 +479,7 @@
|
|||
@ stub _fprintf_p
|
||||
@ stub _fprintf_p_l
|
||||
@ stub _fprintf_s_l
|
||||
@ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock
|
||||
@ cdecl _fputchar(long) MSVCRT__fputchar
|
||||
@ stub _fputwc_nolock
|
||||
@ cdecl _fputwchar(long) MSVCRT__fputwchar
|
||||
|
|
|
@ -3980,25 +3980,35 @@ int CDECL MSVCRT__wfopen_s(MSVCRT_FILE** pFile, const MSVCRT_wchar_t *filename,
|
|||
*/
|
||||
int CDECL MSVCRT_fputc(int c, MSVCRT_FILE* file)
|
||||
{
|
||||
int res;
|
||||
int ret;
|
||||
|
||||
MSVCRT__lock_file(file);
|
||||
ret = MSVCRT__fputc_nolock(c, file);
|
||||
MSVCRT__unlock_file(file);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _fputc_nolock (MSVCRT.@)
|
||||
*/
|
||||
int CDECL MSVCRT__fputc_nolock(int c, MSVCRT_FILE* file)
|
||||
{
|
||||
int res;
|
||||
|
||||
if(file->_cnt>0) {
|
||||
*file->_ptr++=c;
|
||||
file->_cnt--;
|
||||
if (c == '\n')
|
||||
{
|
||||
res = msvcrt_flush_buffer(file);
|
||||
MSVCRT__unlock_file(file);
|
||||
return res ? res : c;
|
||||
}
|
||||
else {
|
||||
MSVCRT__unlock_file(file);
|
||||
return c & 0xff;
|
||||
}
|
||||
} else {
|
||||
res = MSVCRT__flsbuf(c, file);
|
||||
MSVCRT__unlock_file(file);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -917,6 +917,7 @@ void __cdecl MSVCRT__lock_file(MSVCRT_FILE*);
|
|||
void __cdecl MSVCRT__unlock_file(MSVCRT_FILE*);
|
||||
int __cdecl MSVCRT_fgetc(MSVCRT_FILE*);
|
||||
int __cdecl MSVCRT__fgetc_nolock(MSVCRT_FILE*);
|
||||
int __cdecl MSVCRT__fputc_nolock(int,MSVCRT_FILE*);
|
||||
int __cdecl MSVCRT_ungetc(int,MSVCRT_FILE*);
|
||||
MSVCRT_wint_t __cdecl MSVCRT_fgetwc(MSVCRT_FILE*);
|
||||
MSVCRT_wint_t __cdecl MSVCRT__fgetwc_nolock(MSVCRT_FILE*);
|
||||
|
|
|
@ -132,6 +132,7 @@ size_t __cdecl _fwrite_nolock(const void*,size_t,size_t,FILE*);
|
|||
int __cdecl _fclose_nolock(FILE*);
|
||||
int __cdecl _fflush_nolock(FILE*);
|
||||
int __cdecl _fgetc_nolock(FILE*);
|
||||
int __cdecl _fputc_nolock(int,FILE*);
|
||||
int __cdecl _fseek_nolock(FILE*,__msvcrt_long,int);
|
||||
int __cdecl _fseeki64_nolock(FILE*,__int64,int);
|
||||
__msvcrt_long __cdecl _ftell_nolock(FILE*);
|
||||
|
|
Loading…
Reference in New Issue