Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/mingw/include/stdio.h')
-rw-r--r--winsup/mingw/include/stdio.h223
1 files changed, 117 insertions, 106 deletions
diff --git a/winsup/mingw/include/stdio.h b/winsup/mingw/include/stdio.h
index 65c4a4b7a..95f61ecb8 100644
--- a/winsup/mingw/include/stdio.h
+++ b/winsup/mingw/include/stdio.h
@@ -197,42 +197,47 @@ __BEGIN_CSTD_NAMESPACE
/*
* File Operations
*/
-FILE* fopen (const char*, const char*);
-FILE* freopen (const char*, const char*, FILE*);
-int fflush (FILE*);
-int fclose (FILE*);
+_CRTIMP FILE* __cdecl fopen (const char*, const char*);
+_CRTIMP FILE* __cdecl freopen (const char*, const char*, FILE*);
+_CRTIMP int __cdecl fflush (FILE*);
+_CRTIMP int __cdecl fclose (FILE*);
/* MS puts remove & rename (but not wide versions) in io.h also */
-int remove (const char*);
-int rename (const char*, const char*);
-FILE* tmpfile (void);
-char* tmpnam (char*);
+_CRTIMP int __cdecl remove (const char*);
+_CRTIMP int __cdecl rename (const char*, const char*);
+_CRTIMP FILE* __cdecl tmpfile (void);
+_CRTIMP char* __cdecl tmpnam (char*);
-int setvbuf (FILE*, char*, int, size_t);
+_CRTIMP int __cdecl setvbuf (FILE*, char*, int, size_t);
-void setbuf (FILE*, char*);
+_CRTIMP void __cdecl setbuf (FILE*, char*);
/*
* Formatted Output
*/
-int fprintf (FILE*, const char*, ...);
-int printf (const char*, ...);
-int sprintf (char*, const char*, ...);
-int vfprintf (FILE*, const char*, __VALIST);
-int vprintf (const char*, __VALIST);
-int vsprintf (char*, const char*, __VALIST);
+_CRTIMP int __cdecl fprintf (FILE*, const char*, ...);
+_CRTIMP int __cdecl printf (const char*, ...);
+_CRTIMP int __cdecl sprintf (char*, const char*, ...);
+_CRTIMP int __cdecl vfprintf (FILE*, const char*, __VALIST);
+_CRTIMP int __cdecl vprintf (const char*, __VALIST);
+_CRTIMP int __cdecl vsprintf (char*, const char*, __VALIST);
__END_CSTD_NAMESPACE
__BEGIN_CGLOBAL_NAMESPACE
-int _snprintf (char*, __CSTD size_t, const char*, ...);
-int _vsnprintf (char*, __CSTD size_t, const char*, __VALIST);
+_CRTIMP int __cdecl _snprintf (char*, __CSTD size_t, const char*, ...);
+_CRTIMP int __cdecl _vsnprintf (char*, __CSTD size_t, const char*, __VALIST);
#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
int snprintf(char* s, __CSTD size_t, const char*, ...);
extern __inline__ int
vsnprintf (char* __s, __CSTD size_t __n, const char* __format, __VALIST __arg)
{ return _vsnprintf ( __s, __n, __format, __arg); }
+int __cdecl vscanf (const char * __restrict__, __VALIST);
+int __cdecl vfscanf (__CSTD FILE * __restrict__, const char * __restrict__,
+ __VALIST);
+int __cdecl vsscanf (const char * __restrict__,
+ const char * __restrict__, __VALIST);
#endif
__END_CGLOBAL_NAMESPACE
@@ -242,91 +247,91 @@ __BEGIN_CSTD_NAMESPACE
* Formatted Input
*/
-int fscanf (FILE*, const char*, ...);
-int scanf (const char*, ...);
-int sscanf (const char*, const char*, ...);
+_CRTIMP int __cdecl fscanf (FILE*, const char*, ...);
+_CRTIMP int __cdecl scanf (const char*, ...);
+_CRTIMP int __cdecl sscanf (const char*, const char*, ...);
/*
* Character Input and Output Functions
*/
-int fgetc (FILE*);
-char* fgets (char*, int, FILE*);
-int fputc (int, FILE*);
-int fputs (const char*, FILE*);
-int getc (FILE*);
-int getchar (void);
-char* gets (char*);
-int putc (int, FILE*);
-int putchar (int);
-int puts (const char*);
-int ungetc (int, FILE*);
+_CRTIMP int __cdecl fgetc (FILE*);
+_CRTIMP char* __cdecl fgets (char*, int, FILE*);
+_CRTIMP int __cdecl fputc (int, FILE*);
+_CRTIMP int __cdecl fputs (const char*, FILE*);
+_CRTIMP int __cdecl getc (FILE*);
+_CRTIMP int __cdecl getchar (void);
+_CRTIMP char* __cdecl gets (char*);
+_CRTIMP int __cdecl putc (int, FILE*);
+_CRTIMP int __cdecl putchar (int);
+_CRTIMP int __cdecl puts (const char*);
+_CRTIMP int __cdecl ungetc (int, FILE*);
/*
* Direct Input and Output Functions
*/
-size_t fread (void*, size_t, size_t, FILE*);
-size_t fwrite (const void*, size_t, size_t, FILE*);
+_CRTIMP size_t __cdecl fread (void*, size_t, size_t, FILE*);
+_CRTIMP size_t __cdecl fwrite (const void*, size_t, size_t, FILE*);
/*
* File Positioning Functions
*/
-int fseek (FILE*, long, int);
-long ftell (FILE*);
-void rewind (FILE*);
+_CRTIMP int __cdecl fseek (FILE*, long, int);
+_CRTIMP long __cdecl ftell (FILE*);
+_CRTIMP void __cdecl rewind (FILE*);
-int fgetpos (FILE*, fpos_t*);
-int fsetpos (FILE*, const fpos_t*);
+_CRTIMP int __cdecl fgetpos (FILE*, fpos_t*);
+_CRTIMP int __cdecl fsetpos (FILE*, const fpos_t*);
/*
* Error Functions
*/
-void clearerr (FILE*);
-int feof (FILE*);
-int ferror (FILE*);
-void perror (const char*);
+_CRTIMP void __cdecl clearerr (FILE*);
+_CRTIMP int __cdecl feof (FILE*);
+_CRTIMP int __cdecl ferror (FILE*);
+_CRTIMP void __cdecl perror (const char*);
__END_CSTD_NAMESPACE
__BEGIN_CGLOBAL_NAMESPACE
#ifndef __STRICT_ANSI__
-char* _tempnam (const char*, const char*);
+_CRTIMP char* __cdecl _tempnam (const char*, const char*);
#ifndef NO_OLDNAMES
-char* tempnam (const char*, const char*);
+_CRTIMP char* __cdecl tempnam (const char*, const char*);
#endif
/*
* Pipes
*/
-__CSTD FILE* _popen (const char*, const char*);
-int _pclose (__CSTD FILE*);
+_CRTIMP __CSTD FILE* __cdecl _popen (const char*, const char*);
+_CRTIMP int __cdecl _pclose (__CSTD FILE*);
#ifndef NO_OLDNAMES
-__CSTD FILE* popen (const char*, const char*);
-int pclose (__CSTD FILE*);
+_CRTIMP __CSTD FILE* __cdecl popen (const char*, const char*);
+_CRTIMP int __cdecl pclose (__CSTD FILE*);
#endif
/*
* Other Non ANSI functions
*/
-int _flushall (void);
-int _fgetchar (void);
-int _fputchar (int);
-__CSTD FILE* _fdopen (int, const char*);
-int _fileno (__CSTD FILE*);
-int _fcloseall(void);
+_CRTIMP int __cdecl _flushall (void);
+_CRTIMP int __cdecl _fgetchar (void);
+_CRTIMP int __cdecl _fputchar (int);
+_CRTIMP __CSTD FILE* __cdecl _fdopen (int, const char*);
+_CRTIMP int __cdecl _fileno (__CSTD FILE*);
+_CRTIMP int __cdecl _fcloseall(void);
#ifdef __MSVCRT__
-int _getmaxstdio(void);
-int _setmaxstdio(int);
+_CRTIMP int __cdecl _getmaxstdio(void);
+_CRTIMP int __cdecl _setmaxstdio(int);
#endif
#ifndef _NO_OLDNAMES
-int fgetchar (void);
-int fputchar (int);
-__CSTD FILE* fdopen (int, const char*);
-int fileno (__CSTD FILE*);
+_CRTIMP int __cdecl fgetchar (void);
+_CRTIMP int __cdecl fputchar (int);
+_CRTIMP __CSTD FILE* __cdecl fdopen (int, const char*);
+_CRTIMP int __cdecl fileno (__CSTD FILE*);
#endif /* Not _NO_OLDNAMES */
#endif /* Not __STRICT_ANSI__ */
@@ -339,25 +344,25 @@ __END_CGLOBAL_NAMESPACE
__BEGIN_CSTD_NAMESPACE
/* also in wchar.h - keep in sync */
-int fwprintf (FILE*, const wchar_t*, ...);
-int wprintf (const wchar_t*, ...);
-int swprintf (wchar_t*, const wchar_t*, ...);
-int vfwprintf (FILE*, const wchar_t*, __VALIST);
-int vwprintf (const wchar_t*, __VALIST);
-int vswprintf (wchar_t*, const wchar_t*, __VALIST);
-int fwscanf (FILE*, const wchar_t*, ...);
-int wscanf (const wchar_t*, ...);
-int swscanf (const wchar_t*, const wchar_t*, ...);
-wint_t fgetwc (FILE*);
-wint_t fputwc (wchar_t, FILE*);
-wint_t ungetwc (wchar_t, FILE*);
+_CRTIMP int __cdecl fwprintf (FILE*, const wchar_t*, ...);
+_CRTIMP int __cdecl wprintf (const wchar_t*, ...);
+_CRTIMP int __cdecl swprintf (wchar_t*, const wchar_t*, ...);
+_CRTIMP int __cdecl vfwprintf (FILE*, const wchar_t*, __VALIST);
+_CRTIMP int __cdecl vwprintf (const wchar_t*, __VALIST);
+_CRTIMP int __cdecl vswprintf (wchar_t*, const wchar_t*, __VALIST);
+_CRTIMP int __cdecl fwscanf (FILE*, const wchar_t*, ...);
+_CRTIMP int __cdecl wscanf (const wchar_t*, ...);
+_CRTIMP int __cdecl swscanf (const wchar_t*, const wchar_t*, ...);
+_CRTIMP wint_t __cdecl fgetwc (FILE*);
+_CRTIMP wint_t __cdecl fputwc (wchar_t, FILE*);
+_CRTIMP wint_t __cdecl ungetwc (wchar_t, FILE*);
#ifdef __MSVCRT__
-wchar_t* fgetws (wchar_t*, int, FILE*);
-int fputws (const wchar_t*, FILE*);
-wint_t getwc (FILE*);
-wint_t getwchar (void);
-wint_t putwc (wint_t, FILE*);
-wint_t putwchar (wint_t);
+_CRTIMP wchar_t* __cdecl fgetws (wchar_t*, int, FILE*);
+_CRTIMP int __cdecl fputws (const wchar_t*, FILE*);
+_CRTIMP wint_t __cdecl getwc (FILE*);
+_CRTIMP wint_t __cdecl getwchar (void);
+_CRTIMP wint_t __cdecl putwc (wint_t, FILE*);
+_CRTIMP wint_t __cdecl putwchar (wint_t);
#endif
__END_CSTD_NAMESPACE
@@ -365,30 +370,36 @@ __BEGIN_CGLOBAL_NAMESPACE
#ifdef __MSVCRT__
#ifndef __STRICT_ANSI__
-wchar_t* _getws (wchar_t*);
-int _putws (const wchar_t*);
-__CSTD FILE* _wfdopen(int, wchar_t *);
-__CSTD FILE* _wfopen (const wchar_t*, const wchar_t*);
-__CSTD FILE* _wfreopen (const wchar_t*, const wchar_t*, __CSTD FILE*);
-__CSTD FILE* _wfsopen (const wchar_t*, const wchar_t*, int);
-wchar_t* _wtmpnam (wchar_t*);
-wchar_t* _wtempnam (const wchar_t*, const wchar_t*);
-int _wrename (const wchar_t*, const wchar_t*);
-int _wremove (const wchar_t*);
-void _wperror (const wchar_t*);
-__CSTD FILE* _wpopen (const wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl _getws (wchar_t*);
+_CRTIMP int __cdecl _putws (const wchar_t*);
+_CRTIMP __CSTD FILE* __cdecl __cdecl _wfdopen(int, wchar_t *);
+_CRTIMP __CSTD FILE* __cdecl _wfopen (const wchar_t*, const wchar_t*);
+_CRTIMP __CSTD FILE* __cdecl _wfreopen (const wchar_t*, const wchar_t*, __CSTD FILE*);
+_CRTIMP __CSTD FILE* __cdecl _wfsopen (const wchar_t*, const wchar_t*, int);
+_CRTIMP wchar_t* __cdecl _wtmpnam (wchar_t*);
+_CRTIMP wchar_t* __cdecl _wtempnam (const wchar_t*, const wchar_t*);
+_CRTIMP int __cdecl _wrename (const wchar_t*, const wchar_t*);
+_CRTIMP int __cdecl _wremove (const wchar_t*);
+_CRTIMP void __cdecl _wperror (const wchar_t*);
+_CRTIMP __CSTD FILE* __cdecl _wpopen (const wchar_t*, const wchar_t*);
#endif /* Not __STRICT_ANSI__ */
#endif /* __MSVCRT__ */
/* C99 names, but non-standard behaviour */
-int _snwprintf (wchar_t*, __CSTD size_t, const wchar_t*, ...);
-int _vsnwprintf (wchar_t*, __CSTD size_t, const wchar_t*, __VALIST);
+_CRTIMP int __cdecl _snwprintf (wchar_t*, __CSTD size_t, const wchar_t*, ...);
+_CRTIMP int __cdecl _vsnwprintf (wchar_t*, __CSTD size_t, const wchar_t*, __VALIST);
#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
-int snwprintf(wchar_t* s, __CSTD size_t n, const wchar_t* format, ...);
-extern __inline__ int
+int __cdecl snwprintf (wchar_t* s, __CSTD size_t n, const wchar_t* format, ...);
+extern __inline__ int __cdecl
vsnwprintf (wchar_t* __s, __CSTD size_t __n, const wchar_t* __format,
__VALIST __arg)
{ return _vsnwprintf ( __s, __n, __format, __arg);}
+
+int __cdecl vwscanf (const wchar_t * __restrict__, __VALIST);
+int __cdecl vfwscanf (__CSTD FILE * __restrict__,
+ const wchar_t * __restrict__, __VALIST);
+int __cdecl vswscanf (const wchar_t * __restrict__,
+ const wchar_t * __restrict__, __VALIST);
#endif
__END_CGLOBAL_NAMESPACE
@@ -401,23 +412,23 @@ __BEGIN_CGLOBAL_NAMESPACE
#ifndef __STRICT_ANSI__
#ifdef __MSVCRT__
#ifndef NO_OLDNAMES
-__CSTD FILE* wpopen (const wchar_t*, const wchar_t*);
+_CRTIMP __CSTD FILE* __cdecl wpopen (const wchar_t*, const wchar_t*);
#endif /* not NO_OLDNAMES */
#endif /* MSVCRT runtime */
/*
* Other Non ANSI wide functions
*/
-__CSTD wint_t _fgetwchar (void);
-__CSTD wint_t _fputwchar (__CSTD wint_t);
-int _getw (__CSTD FILE*);
-int _putw (int, __CSTD FILE*);
+_CRTIMP __CSTD wint_t __cdecl _fgetwchar (void);
+_CRTIMP __CSTD wint_t __cdecl _fputwchar (__CSTD wint_t);
+_CRTIMP int __cdecl _getw (__CSTD FILE*);
+_CRTIMP int __cdecl _putw (int, __CSTD FILE*);
#ifndef _NO_OLDNAMES
-__CSTD wint_t fgetwchar (void);
-__CSTD wint_t fputwchar (__CSTD wint_t);
-int getw (__CSTD FILE*);
-int putw (int, __CSTD FILE*);
+_CRTIMP __CSTD wint_t __cdecl fgetwchar (void);
+_CRTIMP __CSTD wint_t __cdecl fputwchar (__CSTD wint_t);
+_CRTIMP int __cdecl getw (__CSTD FILE*);
+_CRTIMP int __cdecl putw (int, __CSTD FILE*);
#endif /* Not _NO_OLDNAMES */
#ifdef __USE_MINGW_FSEEK /* These are in libmingwex.a */
@@ -425,8 +436,8 @@ int putw (int, __CSTD FILE*);
* Workaround for limitations on win9x where a file contents are
* not zero'd out if you seek past the end and then write.
*/
-int __mingw_fseek (__CSTD FILE *, long, int);
-int __mingw_fwrite (const void*, __CSTD size_t, __CSTD size_t, __CSTD FILE*);
+int __cdecl __mingw_fseek (__CSTD FILE *, long, int);
+int __cdecl __mingw_fwrite (const void*, __CSTD size_t, __CSTD size_t, __CSTD FILE*);
#define fseek(fp, offset, whence) __mingw_fseek(fp, offset, whence)
#define fwrite(buffer, size, count, fp) __mingw_fwrite(buffer, size, count, fp)
#endif /* __USE_MINGW_FSEEK */