msvcrt: Added _fgetc_nolock implementation.

This commit is contained in:
Iván Matellanes 2014-10-28 14:43:43 +01:00 committed by Alexandre Julliard
parent f896cd3dc9
commit 878b4a9280
7 changed files with 20 additions and 2 deletions

View File

@ -800,6 +800,7 @@
@ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s
@ cdecl _fdopen(long str) MSVCRT__fdopen
@ cdecl _fflush_nolock(ptr) MSVCRT__fflush_nolock
@ cdecl _fgetc_nolock(ptr) MSVCRT__fgetc_nolock
@ cdecl _fgetchar() MSVCRT__fgetchar
@ stub _fgetwc_nolock
@ cdecl _fgetwchar() MSVCRT__fgetwchar

View File

@ -1148,6 +1148,7 @@
@ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s
@ cdecl _fdopen(long str) MSVCRT__fdopen
@ cdecl _fflush_nolock(ptr) MSVCRT__fflush_nolock
@ cdecl _fgetc_nolock(ptr) MSVCRT__fgetc_nolock
@ cdecl _fgetchar() MSVCRT__fgetchar
@ stub _fgetwc_nolock
@ cdecl _fgetwchar() MSVCRT__fgetwchar

View File

@ -467,6 +467,7 @@
@ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s
@ cdecl _fdopen(long str) MSVCRT__fdopen
@ cdecl _fflush_nolock(ptr) MSVCRT__fflush_nolock
@ cdecl _fgetc_nolock(ptr) MSVCRT__fgetc_nolock
@ cdecl _fgetchar() MSVCRT__fgetchar
@ stub _fgetwc_nolock
@ cdecl _fgetwchar() MSVCRT__fgetwchar

View File

@ -449,6 +449,7 @@
@ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s
@ cdecl _fdopen(long str) MSVCRT__fdopen
@ cdecl _fflush_nolock(ptr) MSVCRT__fflush_nolock
@ cdecl _fgetc_nolock(ptr) MSVCRT__fgetc_nolock
@ cdecl _fgetchar() MSVCRT__fgetchar
@ stub _fgetwc_nolock
@ cdecl _fgetwchar() MSVCRT__fgetwchar

View File

@ -3502,11 +3502,24 @@ int CDECL MSVCRT__filbuf(MSVCRT_FILE* file)
* fgetc (MSVCRT.@)
*/
int CDECL MSVCRT_fgetc(MSVCRT_FILE* file)
{
int ret;
MSVCRT__lock_file(file);
ret = MSVCRT__fgetc_nolock(file);
MSVCRT__unlock_file(file);
return ret;
}
/*********************************************************************
* _fgetc_nolock (MSVCRT.@)
*/
int CDECL MSVCRT__fgetc_nolock(MSVCRT_FILE* file)
{
unsigned char *i;
unsigned int j;
MSVCRT__lock_file(file);
if (file->_cnt>0) {
file->_cnt--;
i = (unsigned char *)file->_ptr++;
@ -3514,7 +3527,6 @@ int CDECL MSVCRT_fgetc(MSVCRT_FILE* file)
} else
j = MSVCRT__filbuf(file);
MSVCRT__unlock_file(file);
return j;
}

View File

@ -916,6 +916,7 @@ int __cdecl MSVCRT__isleadbyte_l(int, MSVCRT__locale_t);
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_ungetc(int,MSVCRT_FILE*);
MSVCRT_wint_t __cdecl MSVCRT_fgetwc(MSVCRT_FILE*);
MSVCRT_wint_t __cdecl MSVCRT_ungetwc(MSVCRT_wint_t,MSVCRT_FILE*);

View File

@ -131,6 +131,7 @@ size_t __cdecl _fread_nolock(void*,size_t,size_t,FILE*);
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 _fseek_nolock(FILE*,__msvcrt_long,int);
int __cdecl _fseeki64_nolock(FILE*,__int64,int);
__msvcrt_long __cdecl _ftell_nolock(FILE*);