📄 stdio.h
字号:
* which are required by C99. Note in particular that the corresponding * Microsoft implementations of _snprintf() and _vsnprintf() are *not* * compatible with C99, but the following are; if you want the MSVCRT * behaviour, you *must* use the Microsoft uglified names. */int __cdecl __MINGW_NOTHROW snprintf (char *, size_t, const char *, ...);int __cdecl __MINGW_NOTHROW vsnprintf (char *, size_t, const char *, __VALIST);int __cdecl __MINGW_NOTHROW vscanf (const char * __restrict__, __VALIST);int __cdecl __MINGW_NOTHROW vfscanf (FILE * __restrict__, const char * __restrict__, __VALIST);int __cdecl __MINGW_NOTHROW vsscanf (const char * __restrict__, const char * __restrict__, __VALIST);#endif /* !__NO_ISOCEXT *//* * Formatted Input */_CRTIMP int __cdecl __MINGW_NOTHROW fscanf (FILE*, const char*, ...);_CRTIMP int __cdecl __MINGW_NOTHROW scanf (const char*, ...);_CRTIMP int __cdecl __MINGW_NOTHROW sscanf (const char*, const char*, ...);/* * Character Input and Output Functions */_CRTIMP int __cdecl __MINGW_NOTHROW fgetc (FILE*);_CRTIMP char* __cdecl __MINGW_NOTHROW fgets (char*, int, FILE*);_CRTIMP int __cdecl __MINGW_NOTHROW fputc (int, FILE*);_CRTIMP int __cdecl __MINGW_NOTHROW fputs (const char*, FILE*);_CRTIMP char* __cdecl __MINGW_NOTHROW gets (char*);_CRTIMP int __cdecl __MINGW_NOTHROW puts (const char*);_CRTIMP int __cdecl __MINGW_NOTHROW ungetc (int, FILE*);/* Traditionally, getc and putc are defined as macros. but the standard doesn't say that they must be macros. We use inline functions here to allow the fast versions to be used in C++ with namespace qualification, eg., ::getc. _filbuf and _flsbuf are not thread-safe. */_CRTIMP int __cdecl __MINGW_NOTHROW _filbuf (FILE*);_CRTIMP int __cdecl __MINGW_NOTHROW _flsbuf (int, FILE*);#if !defined _MT__CRT_INLINE int __cdecl __MINGW_NOTHROW getc (FILE* __F){ return (--__F->_cnt >= 0) ? (int) (unsigned char) *__F->_ptr++ : _filbuf (__F);}__CRT_INLINE int __cdecl __MINGW_NOTHROW putc (int __c, FILE* __F){ return (--__F->_cnt >= 0) ? (int) (unsigned char) (*__F->_ptr++ = (char)__c) : _flsbuf (__c, __F);}__CRT_INLINE int __cdecl __MINGW_NOTHROW getchar (void){ return (--stdin->_cnt >= 0) ? (int) (unsigned char) *stdin->_ptr++ : _filbuf (stdin);}__CRT_INLINE int __cdecl __MINGW_NOTHROW putchar(int __c){ return (--stdout->_cnt >= 0) ? (int) (unsigned char) (*stdout->_ptr++ = (char)__c) : _flsbuf (__c, stdout);}#else /* Use library functions. */_CRTIMP int __cdecl __MINGW_NOTHROW getc (FILE*);_CRTIMP int __cdecl __MINGW_NOTHROW putc (int, FILE*);_CRTIMP int __cdecl __MINGW_NOTHROW getchar (void);_CRTIMP int __cdecl __MINGW_NOTHROW putchar (int);#endif/* * Direct Input and Output Functions */_CRTIMP size_t __cdecl __MINGW_NOTHROW fread (void*, size_t, size_t, FILE*);_CRTIMP size_t __cdecl __MINGW_NOTHROW fwrite (const void*, size_t, size_t, FILE*);/* * File Positioning Functions */_CRTIMP int __cdecl __MINGW_NOTHROW fseek (FILE*, long, int);_CRTIMP long __cdecl __MINGW_NOTHROW ftell (FILE*);_CRTIMP void __cdecl __MINGW_NOTHROW rewind (FILE*);#if __MSVCRT_VERSION__ >= 0x800_CRTIMP int __cdecl __MINGW_NOTHROW _fseek_nolock (FILE*, long, int);_CRTIMP long __cdecl __MINGW_NOTHROW _ftell_nolock (FILE*);_CRTIMP int __cdecl __MINGW_NOTHROW _fseeki64 (FILE*, __int64, int);_CRTIMP __int64 __cdecl __MINGW_NOTHROW _ftelli64 (FILE*);_CRTIMP int __cdecl __MINGW_NOTHROW _fseeki64_nolock (FILE*, __int64, int);_CRTIMP __int64 __cdecl __MINGW_NOTHROW _ftelli64_nolock (FILE*);#endif#ifdef __USE_MINGW_FSEEK /* These are in libmingwex.a *//* * Workaround for limitations on win9x where a file contents are * not zero'd out if you seek past the end and then write. */int __cdecl __MINGW_NOTHROW __mingw_fseek (FILE *, long, int);size_t __cdecl __MINGW_NOTHROW __mingw_fwrite (const void*, size_t, size_t, 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 *//* * An opaque data type used for storing file positions... The contents of * this type are unknown, but we (the compiler) need to know the size * because the programmer using fgetpos and fsetpos will be setting aside * storage for fpos_t structres. Actually I tested using a byte array and * it is fairly evident that the fpos_t type is a long (in CRTDLL.DLL). * Perhaps an unsigned long? TODO? It's definitely a 64-bit number in * MSVCRT however, and for now `long long' will do. */#ifdef __MSVCRT__typedef long long fpos_t;#elsetypedef long fpos_t;#endif_CRTIMP int __cdecl __MINGW_NOTHROW fgetpos (FILE*, fpos_t*);_CRTIMP int __cdecl __MINGW_NOTHROW fsetpos (FILE*, const fpos_t*);/* * Error Functions */_CRTIMP int __cdecl __MINGW_NOTHROW feof (FILE*);_CRTIMP int __cdecl __MINGW_NOTHROW ferror (FILE*);#ifdef __cplusplusinline int __cdecl __MINGW_NOTHROW feof (FILE* __F) { return __F->_flag & _IOEOF; }inline int __cdecl __MINGW_NOTHROW ferror (FILE* __F) { return __F->_flag & _IOERR; }#else#define feof(__F) ((__F)->_flag & _IOEOF)#define ferror(__F) ((__F)->_flag & _IOERR)#endif_CRTIMP void __cdecl __MINGW_NOTHROW clearerr (FILE*);_CRTIMP void __cdecl __MINGW_NOTHROW perror (const char*);#ifndef __STRICT_ANSI__/* * Pipes */_CRTIMP FILE* __cdecl __MINGW_NOTHROW _popen (const char*, const char*);_CRTIMP int __cdecl __MINGW_NOTHROW _pclose (FILE*);#ifndef NO_OLDNAMES_CRTIMP FILE* __cdecl __MINGW_NOTHROW popen (const char*, const char*);_CRTIMP int __cdecl __MINGW_NOTHROW pclose (FILE*);#endif/* * Other Non ANSI functions */_CRTIMP int __cdecl __MINGW_NOTHROW _flushall (void);_CRTIMP int __cdecl __MINGW_NOTHROW _fgetchar (void);_CRTIMP int __cdecl __MINGW_NOTHROW _fputchar (int);_CRTIMP FILE* __cdecl __MINGW_NOTHROW _fdopen (int, const char*);_CRTIMP int __cdecl __MINGW_NOTHROW _fileno (FILE*);_CRTIMP int __cdecl __MINGW_NOTHROW _fcloseall (void);_CRTIMP FILE* __cdecl __MINGW_NOTHROW _fsopen (const char*, const char*, int);#ifdef __MSVCRT___CRTIMP int __cdecl __MINGW_NOTHROW _getmaxstdio (void);_CRTIMP int __cdecl __MINGW_NOTHROW _setmaxstdio (int);#endif#if __MSVCRT_VERSION__ >= 0x800_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _get_output_format (void);_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _set_output_format (unsigned int);#define _TWO_DIGIT_EXPONENT 1_CRTIMP int __cdecl __MINGW_NOTHROW _get_printf_count_output (void);_CRTIMP int __cdecl __MINGW_NOTHROW _set_printf_count_output (int);#endif#ifndef _NO_OLDNAMES_CRTIMP int __cdecl __MINGW_NOTHROW fgetchar (void);_CRTIMP int __cdecl __MINGW_NOTHROW fputchar (int);_CRTIMP FILE* __cdecl __MINGW_NOTHROW fdopen (int, const char*);_CRTIMP int __cdecl __MINGW_NOTHROW fileno (FILE*);#endif /* Not _NO_OLDNAMES */#define _fileno(__F) ((__F)->_file)#ifndef _NO_OLDNAMES#define fileno(__F) ((__F)->_file)#endif#if defined (__MSVCRT__) && !defined (__NO_MINGW_LFS)#include <sys/types.h>__CRT_INLINE FILE* __cdecl __MINGW_NOTHROW fopen64 (const char* filename, const char* mode){ return fopen (filename, mode); }int __cdecl __MINGW_NOTHROW fseeko64 (FILE*, off64_t, int);#ifdef __USE_MINGW_FSEEKint __cdecl __MINGW_NOTHROW __mingw_fseeko64 (FILE *, off64_t, int);#define fseeko64(fp, offset, whence) __mingw_fseeko64(fp, offset, whence)#endif__CRT_INLINE off64_t __cdecl __MINGW_NOTHROW ftello64 (FILE * stream){ fpos_t pos; if (fgetpos(stream, &pos)) return -1LL; else return ((off64_t) pos);}#endif /* __NO_MINGW_LFS */#endif /* Not __STRICT_ANSI__ *//* Wide versions */#ifndef _WSTDIO_DEFINED/* also in wchar.h - keep in sync */_CRTIMP int __cdecl __MINGW_NOTHROW fwprintf (FILE*, const wchar_t*, ...);_CRTIMP int __cdecl __MINGW_NOTHROW wprintf (const wchar_t*, ...);_CRTIMP int __cdecl __MINGW_NOTHROW _snwprintf (wchar_t*, size_t, const wchar_t*, ...);_CRTIMP int __cdecl __MINGW_NOTHROW vfwprintf (FILE*, const wchar_t*, __VALIST);_CRTIMP int __cdecl __MINGW_NOTHROW vwprintf (const wchar_t*, __VALIST);_CRTIMP int __cdecl __MINGW_NOTHROW _vsnwprintf (wchar_t*, size_t, const wchar_t*, __VALIST);_CRTIMP int __cdecl __MINGW_NOTHROW fwscanf (FILE*, const wchar_t*, ...);_CRTIMP int __cdecl __MINGW_NOTHROW wscanf (const wchar_t*, ...);_CRTIMP int __cdecl __MINGW_NOTHROW swscanf (const wchar_t*, const wchar_t*, ...);_CRTIMP wint_t __cdecl __MINGW_NOTHROW fgetwc (FILE*);_CRTIMP wint_t __cdecl __MINGW_NOTHROW fputwc (wchar_t, FILE*);_CRTIMP wint_t __cdecl __MINGW_NOTHROW ungetwc (wchar_t, FILE*);/* These differ from the ISO C prototypes, which have a maxlen parameter (like snprintf). */#ifndef __STRICT_ANSI___CRTIMP int __cdecl __MINGW_NOTHROW swprintf (wchar_t*, const wchar_t*, ...);_CRTIMP int __cdecl __MINGW_NOTHROW vswprintf (wchar_t*, const wchar_t*, __VALIST);#endif#ifdef __MSVCRT__ _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW fgetws (wchar_t*, int, FILE*);_CRTIMP int __cdecl __MINGW_NOTHROW fputws (const wchar_t*, FILE*);_CRTIMP wint_t __cdecl __MINGW_NOTHROW getwc (FILE*);_CRTIMP wint_t __cdecl __MINGW_NOTHROW getwchar (void);_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _getws (wchar_t*);_CRTIMP wint_t __cdecl __MINGW_NOTHROW putwc (wint_t, FILE*);_CRTIMP int __cdecl __MINGW_NOTHROW _putws (const wchar_t*);_CRTIMP wint_t __cdecl __MINGW_NOTHROW putwchar (wint_t);_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfdopen(int, const wchar_t *);_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfopen (const wchar_t*, const wchar_t*);_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfreopen (const wchar_t*, const wchar_t*, FILE*);_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfsopen (const wchar_t*, const wchar_t*, int);_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wtmpnam (wchar_t*);_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wtempnam (const wchar_t*, const wchar_t*);_CRTIMP int __cdecl __MINGW_NOTHROW _wrename (const wchar_t*, const wchar_t*);_CRTIMP int __cdecl __MINGW_NOTHROW _wremove (const wchar_t*);_CRTIMP void __cdecl __MINGW_NOTHROW _wperror (const wchar_t*);_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wpopen (const wchar_t*, const wchar_t*);#endif /* __MSVCRT__ */#ifndef __NO_ISOCEXT /* externs in libmingwex.a */int __cdecl __MINGW_NOTHROW snwprintf (wchar_t* s, size_t n, const wchar_t* format, ...);__CRT_INLINE int __cdecl __MINGW_NOTHROWvsnwprintf (wchar_t* s, size_t n, const wchar_t* format, __VALIST arg) { return _vsnwprintf ( s, n, format, arg);}int __cdecl __MINGW_NOTHROW vwscanf (const wchar_t * __restrict__, __VALIST);int __cdecl __MINGW_NOTHROW vfwscanf (FILE * __restrict__, const wchar_t * __restrict__, __VALIST);int __cdecl __MINGW_NOTHROW vswscanf (const wchar_t * __restrict__, const wchar_t * __restrict__, __VALIST);#endif#define _WSTDIO_DEFINED#endif /* _WSTDIO_DEFINED */#ifndef __STRICT_ANSI__#ifdef __MSVCRT__#ifndef NO_OLDNAMES_CRTIMP FILE* __cdecl __MINGW_NOTHROW wpopen (const wchar_t*, const wchar_t*);#endif /* not NO_OLDNAMES */#endif /* MSVCRT runtime *//* * Other Non ANSI wide functions */_CRTIMP wint_t __cdecl __MINGW_NOTHROW _fgetwchar (void);_CRTIMP wint_t __cdecl __MINGW_NOTHROW _fputwchar (wint_t);_CRTIMP int __cdecl __MINGW_NOTHROW _getw (FILE*);_CRTIMP int __cdecl __MINGW_NOTHROW _putw (int, FILE*);#ifndef _NO_OLDNAMES_CRTIMP wint_t __cdecl __MINGW_NOTHROW fgetwchar (void);_CRTIMP wint_t __cdecl __MINGW_NOTHROW fputwchar (wint_t);_CRTIMP int __cdecl __MINGW_NOTHROW getw (FILE*);_CRTIMP int __cdecl __MINGW_NOTHROW putw (int, FILE*);#endif /* Not _NO_OLDNAMES */#endif /* __STRICT_ANSI */#ifdef __cplusplus}#endif#endif /* Not RC_INVOKED */#endif /* _STDIO_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -