Commit 1913affb authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Remove MSVCRT_ prefix from file.c functions.

parent 41fa6e4b
......@@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <io.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
......@@ -340,11 +341,11 @@ void CDECL perror(const char* str)
if (str && *str)
{
MSVCRT__write( 2, str, strlen(str) );
MSVCRT__write( 2, ": ", 2 );
_write( 2, str, strlen(str) );
_write( 2, ": ", 2 );
}
MSVCRT__write( 2, MSVCRT__sys_errlist[err], strlen(MSVCRT__sys_errlist[err]) );
MSVCRT__write( 2, "\n", 1 );
_write( 2, MSVCRT__sys_errlist[err], strlen(MSVCRT__sys_errlist[err]) );
_write( 2, "\n", 1 );
}
/*********************************************************************
......
......@@ -296,7 +296,7 @@ void CDECL _wassert(const wchar_t* str, const wchar_t* file, unsigned int line)
DoMessageBoxW(L"Assertion failed!", text);
}
else
MSVCRT_fwprintf(MSVCRT_stderr, L"Assertion failed: %ls, file %ls, line %d\n\n", str, file, line);
fwprintf(MSVCRT_stderr, L"Assertion failed: %ls, file %ls, line %d\n\n", str, file, line);
raise(SIGABRT);
_exit(3);
......
......@@ -604,17 +604,11 @@ struct MSVCRT__stat64 {
int __cdecl MSVCRT_iswdigit(wint_t);
void __cdecl MSVCRT__lock_file(FILE*);
void __cdecl MSVCRT__unlock_file(FILE*);
int __cdecl MSVCRT_fgetc(FILE*);
int __cdecl MSVCRT__fgetc_nolock(FILE*);
int __cdecl MSVCRT__fputc_nolock(int,FILE*);
int __cdecl MSVCRT_ungetc(int,FILE*);
int __cdecl MSVCRT__ungetc_nolock(int,FILE*);
wint_t __cdecl MSVCRT_fgetwc(FILE*);
wint_t __cdecl MSVCRT__fgetwc_nolock(FILE*);
wint_t __cdecl MSVCRT__fputwc_nolock(wint_t,FILE*);
wint_t __cdecl MSVCRT_ungetwc(wint_t,FILE*);
wint_t __cdecl MSVCRT__ungetwc_nolock(wint_t, FILE*);
int __cdecl MSVCRT__fseeki64_nolock(FILE*,__int64,int);
__int64 __cdecl MSVCRT__ftelli64(FILE* file);
......@@ -622,15 +616,12 @@ __int64 __cdecl MSVCRT__ftelli64_nolock(FILE*);
size_t __cdecl MSVCRT__fread_nolock(void*,size_t,size_t,FILE*);
size_t __cdecl MSVCRT__fread_nolock_s(void*,size_t,size_t,size_t,FILE*);
size_t __cdecl MSVCRT__fwrite_nolock(const void*,size_t,size_t,FILE*);
int __cdecl MSVCRT_fclose(FILE*);
int __cdecl MSVCRT__fclose_nolock(FILE*);
int __cdecl MSVCRT__fflush_nolock(FILE*);
FILE* __cdecl MSVCRT__iob_func(void);
__time32_t __cdecl MSVCRT__time32(__time32_t*);
__time64_t __cdecl MSVCRT__time64(__time64_t*);
FILE* __cdecl MSVCRT__fdopen(int, const char *);
FILE* __cdecl MSVCRT__wfdopen(int, const wchar_t *);
int WINAPIV MSVCRT_fwprintf(FILE *file, const wchar_t *format, ...);
#define MSVCRT__ENABLE_PER_THREAD_LOCALE 1
#define MSVCRT__DISABLE_PER_THREAD_LOCALE 2
......@@ -644,7 +635,6 @@ void free_locinfo(pthreadlocinfo) DECLSPEC_HIDDEN;
void free_mbcinfo(pthreadmbcinfo) DECLSPEC_HIDDEN;
int __cdecl __crtLCMapStringA(LCID, DWORD, const char*, int, char*, int, unsigned int, int) DECLSPEC_HIDDEN;
int __cdecl MSVCRT__write(int,const void*,unsigned int);
int __cdecl _getch(void);
int __cdecl _ismbblead(unsigned int);
int __cdecl _ismbblead_l(unsigned int, _locale_t);
......@@ -662,10 +652,6 @@ wchar_t*** __cdecl MSVCRT___p__wenviron(void);
char* __cdecl MSVCRT__strdate(char* date);
char* __cdecl MSVCRT__strtime(char* date);
int __cdecl _setmbcp(int);
int __cdecl MSVCRT__close(int);
int __cdecl MSVCRT__dup(int);
int __cdecl MSVCRT__dup2(int, int);
int __cdecl MSVCRT__pipe(int *, unsigned int, int);
void __cdecl MSVCRT__wsearchenv(const wchar_t*, const wchar_t*, wchar_t*);
int __cdecl MSVCRT__towupper_l(wint_t,_locale_t);
int __cdecl MSVCRT__towlower_l(wint_t,_locale_t);
......
......@@ -27,6 +27,7 @@
* -No check for maximum path/argument/environment size is done
*/
#include <io.h>
#include <process.h>
#include <stdarg.h>
......@@ -1074,7 +1075,7 @@ FILE* CDECL _wpopen(const wchar_t* command, const wchar_t* mode)
break;
}
}
if (MSVCRT__pipe(fds, 0, textmode) == -1)
if (_pipe(fds, 0, textmode) == -1)
return NULL;
fdToDup = readPipe ? 1 : 0;
......@@ -1099,12 +1100,12 @@ FILE* CDECL _wpopen(const wchar_t* command, const wchar_t* mode)
}
else container = popen_handles+i;
if ((fdStdHandle = MSVCRT__dup(fdToDup)) == -1)
if ((fdStdHandle = _dup(fdToDup)) == -1)
goto error;
if (MSVCRT__dup2(fds[fdToDup], fdToDup) != 0)
if (_dup2(fds[fdToDup], fdToDup) != 0)
goto error;
MSVCRT__close(fds[fdToDup]);
_close(fds[fdToDup]);
if (!(comspec = msvcrt_get_comspec())) goto error;
len = wcslen(comspec) + wcslen(command) + 5;
......@@ -1122,28 +1123,28 @@ FILE* CDECL _wpopen(const wchar_t* command, const wchar_t* mode)
if ((container->proc = (HANDLE)msvcrt_spawn(MSVCRT__P_NOWAIT, comspec, fullcmd, NULL, 1))
== INVALID_HANDLE_VALUE)
{
MSVCRT__close(fds[fdToOpen]);
_close(fds[fdToOpen]);
ret = NULL;
}
else
{
ret = MSVCRT__wfdopen(fds[fdToOpen], mode);
ret = _wfdopen(fds[fdToOpen], mode);
if (!ret)
MSVCRT__close(fds[fdToOpen]);
_close(fds[fdToOpen]);
container->f = ret;
}
_unlock(_POPEN_LOCK);
HeapFree(GetProcessHeap(), 0, comspec);
HeapFree(GetProcessHeap(), 0, fullcmd);
MSVCRT__dup2(fdStdHandle, fdToDup);
MSVCRT__close(fdStdHandle);
_dup2(fdStdHandle, fdToDup);
_close(fdStdHandle);
return ret;
error:
_unlock(_POPEN_LOCK);
if (fdStdHandle != -1) MSVCRT__close(fdStdHandle);
MSVCRT__close(fds[0]);
MSVCRT__close(fds[1]);
if (fdStdHandle != -1) _close(fdStdHandle);
_close(fds[0]);
_close(fds[1]);
return NULL;
}
......@@ -1201,7 +1202,7 @@ int CDECL _pclose(FILE* file)
popen_handles[i].f = NULL;
_unlock(_POPEN_LOCK);
MSVCRT_fclose(file);
fclose(file);
if(WaitForSingleObject(h, INFINITE)==WAIT_FAILED || !GetExitCodeProcess(h, &i))
{
msvcrt_set_errno(GetLastError());
......
......@@ -48,8 +48,8 @@
#define _STRTOD_NAME_(func) console_ ## func
#define _GETC_(file) (consumed++, _getch())
#define _UNGETC_(nch, file) do { _ungetch(nch); consumed--; } while(0)
#define _LOCK_FILE_(file) MSVCRT__lock_file(MSVCRT_stdin)
#define _UNLOCK_FILE_(file) MSVCRT__unlock_file(MSVCRT_stdin)
#define _LOCK_FILE_(file) _lock_file(MSVCRT_stdin)
#define _UNLOCK_FILE_(file) _unlock_file(MSVCRT_stdin)
#ifdef WIDE_SCANF
#ifdef SECURE
#define _FUNCTION_ static int vcwscanf_s_l(const wchar_t *format, _locale_t locale, __ms_va_list ap)
......@@ -120,24 +120,24 @@
#endif /* STRING_LEN */
#else /* STRING */
#ifdef WIDE_SCANF
#define _GETC_FUNC_(file) MSVCRT_fgetwc(file)
#define _GETC_FUNC_(file) fgetwc(file)
#define _STRTOD_NAME_(func) filew_ ## func
#define _GETC_(file) (consumed++, MSVCRT_fgetwc(file))
#define _UNGETC_(nch, file) do { MSVCRT_ungetwc(nch, file); consumed--; } while(0)
#define _LOCK_FILE_(file) MSVCRT__lock_file(file)
#define _UNLOCK_FILE_(file) MSVCRT__unlock_file(file)
#define _GETC_(file) (consumed++, fgetwc(file))
#define _UNGETC_(nch, file) do { ungetwc(nch, file); consumed--; } while(0)
#define _LOCK_FILE_(file) _lock_file(file)
#define _UNLOCK_FILE_(file) _unlock_file(file)
#ifdef SECURE
#define _FUNCTION_ static int vfwscanf_s_l(FILE* file, const wchar_t *format, _locale_t locale, __ms_va_list ap)
#else /* SECURE */
#define _FUNCTION_ static int vfwscanf_l(FILE* file, const wchar_t *format, _locale_t locale, __ms_va_list ap)
#endif /* SECURE */
#else /* WIDE_SCANF */
#define _GETC_FUNC_(file) MSVCRT_fgetc(file)
#define _GETC_FUNC_(file) fgetc(file)
#define _STRTOD_NAME_(func) file_ ## func
#define _GETC_(file) (consumed++, MSVCRT_fgetc(file))
#define _UNGETC_(nch, file) do { MSVCRT_ungetc(nch, file); consumed--; } while(0)
#define _LOCK_FILE_(file) MSVCRT__lock_file(file)
#define _UNLOCK_FILE_(file) MSVCRT__unlock_file(file)
#define _GETC_(file) (consumed++, fgetc(file))
#define _UNGETC_(nch, file) do { ungetc(nch, file); consumed--; } while(0)
#define _LOCK_FILE_(file) _lock_file(file)
#define _UNLOCK_FILE_(file) _unlock_file(file)
#ifdef SECURE
#define _FUNCTION_ static int vfscanf_s_l(FILE* file, const char *format, _locale_t locale, __ms_va_list ap)
#else /* SECURE */
......
......@@ -61,7 +61,7 @@ extern "C" {
_ACRTIMP int __cdecl _access(const char*,int);
_ACRTIMP int __cdecl _chmod(const char*,int);
_ACRTIMP int __cdecl _chsize(int,__msvcrt_ulong);
_ACRTIMP int __cdecl _chsize(int,__msvcrt_long);
_ACRTIMP int __cdecl _chsize_s(int,__int64);
_ACRTIMP int __cdecl _close(int);
_ACRTIMP int __cdecl _commit(int);
......
......@@ -88,6 +88,8 @@ _ACRTIMP int __cdecl _setmaxstdio(int);
_ACRTIMP char* __cdecl _tempnam(const char*,const char*);
_ACRTIMP int __cdecl _unlink(const char*);
_ACRTIMP void __cdecl _lock_file(FILE*);
_ACRTIMP void __cdecl _unlock_file(FILE*);
_ACRTIMP size_t __cdecl _fread_nolock(void*,size_t,size_t,FILE*);
_ACRTIMP size_t __cdecl _fread_nolock_s(void*,size_t,size_t,size_t,FILE*);
_ACRTIMP size_t __cdecl _fwrite_nolock(const void*,size_t,size_t,FILE*);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment