Last active
March 2, 2022 09:56
-
-
Save EinsteinUnicorn/803b2a08e248a1681ca0 to your computer and use it in GitHub Desktop.
C Tutorial
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdlib.h> | |
| #include <stdio.h> | |
| int main() | |
| { | |
| printf("Unicorns are cool \n"); | |
| printf("Einstein is old \a"); | |
| return 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @file stdio.h | |
| * @copy 2012 MinGW.org project | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a | |
| * copy of this software and associated documentation files (the "Software"), | |
| * to deal in the Software without restriction, including without limitation | |
| * the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
| * and/or sell copies of the Software, and to permit persons to whom the | |
| * Software is furnished to do so, subject to the following conditions: | |
| * | |
| * The above copyright notice and this permission notice (including the next | |
| * paragraph) shall be included in all copies or substantial portions of the | |
| * Software. | |
| * | |
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
| * DEALINGS IN THE SOFTWARE. | |
| */ | |
| #ifndef _STDIO_H | |
| #define _STDIO_H | |
| #pragma GCC system_header | |
| #include <_mingw.h> | |
| #ifndef RC_INVOKED | |
| #define __need_size_t | |
| #define __need_NULL | |
| #define __need_wchar_t | |
| #define __need_wint_t | |
| #include <stddef.h> | |
| #define __need___va_list | |
| #include <stdarg.h> | |
| #endif /* Not RC_INVOKED */ | |
| /* Flags for the iobuf structure */ | |
| #define _IOREAD 1 /* currently reading */ | |
| #define _IOWRT 2 /* currently writing */ | |
| #define _IORW 0x0080 /* opened as "r+w" */ | |
| /* | |
| * The three standard file pointers provided by the run time library. | |
| * NOTE: These will go to the bit-bucket silently in GUI applications! | |
| */ | |
| #define STDIN_FILENO 0 | |
| #define STDOUT_FILENO 1 | |
| #define STDERR_FILENO 2 | |
| /* Returned by various functions on end of file condition or error. */ | |
| #define EOF (-1) | |
| /* | |
| * The maximum length of a file name. You should use GetVolumeInformation | |
| * instead of this constant. But hey, this works. | |
| * Also defined in io.h. | |
| */ | |
| #ifndef FILENAME_MAX | |
| #define FILENAME_MAX (260) | |
| #endif | |
| /* | |
| * The maximum number of files that may be open at once. I have set this to | |
| * a conservative number. The actual value may be higher. | |
| */ | |
| #define FOPEN_MAX (20) | |
| /* After creating this many names, tmpnam and tmpfile return NULL */ | |
| #define TMP_MAX 32767 | |
| /* | |
| * Tmpnam, tmpfile and, sometimes, _tempnam try to create | |
| * temp files in the root directory of the current drive | |
| * (not in pwd, as suggested by some older MS doc's). | |
| * Redefining these macros does not effect the CRT functions. | |
| */ | |
| #define _P_tmpdir "\\" | |
| #ifndef __STRICT_ANSI__ | |
| #define P_tmpdir _P_tmpdir | |
| #endif | |
| #define _wP_tmpdir L"\\" | |
| /* | |
| * The maximum size of name (including NUL) that will be put in the user | |
| * supplied buffer caName for tmpnam. | |
| * Inferred from the size of the static buffer returned by tmpnam | |
| * when passed a NULL argument. May actually be smaller. | |
| */ | |
| #define L_tmpnam (16) | |
| #define _IOFBF 0x0000 /* full buffered */ | |
| #define _IOLBF 0x0040 /* line buffered */ | |
| #define _IONBF 0x0004 /* not buffered */ | |
| #define _IOMYBUF 0x0008 /* stdio malloc()'d buffer */ | |
| #define _IOEOF 0x0010 /* EOF reached on read */ | |
| #define _IOERR 0x0020 /* I/O error from system */ | |
| #define _IOSTRG 0x0040 /* Strange or no file descriptor */ | |
| #ifdef _POSIX_SOURCE | |
| # define _IOAPPEND 0x0200 | |
| #endif | |
| /* | |
| * The buffer size as used by setbuf such that it is equivalent to | |
| * (void) setvbuf(fileSetBuffer, caBuffer, _IOFBF, BUFSIZ). | |
| */ | |
| #define BUFSIZ 512 | |
| /* Constants for nOrigin indicating the position relative to which fseek | |
| * sets the file position. Defined unconditionally since ISO and POSIX | |
| * say they are defined here. */ | |
| #define SEEK_SET 0 | |
| #define SEEK_CUR 1 | |
| #define SEEK_END 2 | |
| #ifndef RC_INVOKED | |
| #ifndef __VALIST | |
| #define __VALIST __gnuc_va_list | |
| #endif /* defined __VALIST */ | |
| /* | |
| * The structure underlying the FILE type. | |
| * | |
| * Some believe that nobody in their right mind should make use of the | |
| * internals of this structure. Provided by Pedro A. Aranda Gutiirrez | |
| * <paag@tid.es>. | |
| */ | |
| #ifndef _FILE_DEFINED | |
| #define _FILE_DEFINED | |
| typedef struct _iobuf | |
| { | |
| char* _ptr; | |
| int _cnt; | |
| char* _base; | |
| int _flag; | |
| int _file; | |
| int _charbuf; | |
| int _bufsiz; | |
| char* _tmpfname; | |
| } FILE; | |
| #endif /* Not _FILE_DEFINED */ | |
| /* | |
| * The standard file handles | |
| */ | |
| __MINGW_IMPORT FILE _iob[]; /* An array of FILE imported from DLL. */ | |
| #define stdin (&_iob[STDIN_FILENO]) | |
| #define stdout (&_iob[STDOUT_FILENO]) | |
| #define stderr (&_iob[STDERR_FILENO]) | |
| #ifdef __cplusplus | |
| extern "C" { | |
| #endif | |
| /* | |
| * File Operations | |
| */ | |
| _CRTIMP FILE* __cdecl __MINGW_NOTHROW fopen (const char*, const char*); | |
| _CRTIMP FILE* __cdecl __MINGW_NOTHROW freopen (const char*, const char*, FILE*); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW fflush (FILE*); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW fclose (FILE*); | |
| /* MS puts remove & rename (but not wide versions) in io.h also */ | |
| _CRTIMP int __cdecl __MINGW_NOTHROW remove (const char*); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW rename (const char*, const char*); | |
| _CRTIMP FILE* __cdecl __MINGW_NOTHROW tmpfile (void); | |
| _CRTIMP char* __cdecl __MINGW_NOTHROW tmpnam (char*); | |
| #ifndef __STRICT_ANSI__ | |
| _CRTIMP char* __cdecl __MINGW_NOTHROW _tempnam (const char*, const char*); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW _rmtmp(void); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW _unlink (const char*); | |
| #ifndef NO_OLDNAMES | |
| _CRTIMP char* __cdecl __MINGW_NOTHROW tempnam (const char*, const char*); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW rmtmp(void); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW unlink (const char*); | |
| #endif | |
| #endif /* __STRICT_ANSI__ */ | |
| _CRTIMP int __cdecl __MINGW_NOTHROW setvbuf (FILE*, char*, int, size_t); | |
| _CRTIMP void __cdecl __MINGW_NOTHROW setbuf (FILE*, char*); | |
| /* | |
| * Formatted Output | |
| * | |
| * MSVCRT implementations are not ANSI C99 conformant... | |
| * we offer these conforming alternatives from libmingwex.a | |
| */ | |
| #undef __mingw_stdio_redirect__ | |
| #define __mingw_stdio_redirect__(F) __cdecl __MINGW_NOTHROW __mingw_##F | |
| extern int __mingw_stdio_redirect__(fprintf)(FILE*, const char*, ...); | |
| extern int __mingw_stdio_redirect__(printf)(const char*, ...); | |
| extern int __mingw_stdio_redirect__(sprintf)(char*, const char*, ...); | |
| extern int __mingw_stdio_redirect__(snprintf)(char*, size_t, const char*, ...); | |
| extern int __mingw_stdio_redirect__(vfprintf)(FILE*, const char*, __VALIST); | |
| extern int __mingw_stdio_redirect__(vprintf)(const char*, __VALIST); | |
| extern int __mingw_stdio_redirect__(vsprintf)(char*, const char*, __VALIST); | |
| extern int __mingw_stdio_redirect__(vsnprintf)(char*, size_t, const char*, __VALIST); | |
| #if __USE_MINGW_ANSI_STDIO | |
| /* | |
| * User has expressed a preference for C99 conformance... | |
| */ | |
| # undef __mingw_stdio_redirect__ | |
| # ifdef __cplusplus | |
| /* | |
| * For C++ we use inline implementations, to avoid interference | |
| * with namespace qualification, which may result from using #defines. | |
| */ | |
| # define __mingw_stdio_redirect__ inline __cdecl __MINGW_NOTHROW | |
| # else /* !__cplusplus */ | |
| # define __mingw_stdio_redirect__ static __inline__ __cdecl __MINGW_NOTHROW | |
| # endif /* __cplusplus */ | |
| __mingw_stdio_redirect__ | |
| int fprintf (FILE *__stream, const char *__format, ...) | |
| { | |
| register int __retval; | |
| __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); | |
| __retval = __mingw_vfprintf( __stream, __format, __local_argv ); | |
| __builtin_va_end( __local_argv ); | |
| return __retval; | |
| } | |
| __mingw_stdio_redirect__ | |
| int printf (const char *__format, ...) | |
| { | |
| register int __retval; | |
| __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); | |
| __retval = __mingw_vprintf( __format, __local_argv ); | |
| __builtin_va_end( __local_argv ); | |
| return __retval; | |
| } | |
| __mingw_stdio_redirect__ | |
| int sprintf (char *__stream, const char *__format, ...) | |
| { | |
| register int __retval; | |
| __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); | |
| __retval = __mingw_vsprintf( __stream, __format, __local_argv ); | |
| __builtin_va_end( __local_argv ); | |
| return __retval; | |
| } | |
| __mingw_stdio_redirect__ | |
| int vfprintf (FILE *__stream, const char *__format, __VALIST __local_argv) | |
| { | |
| return __mingw_vfprintf( __stream, __format, __local_argv ); | |
| } | |
| __mingw_stdio_redirect__ | |
| int vprintf (const char *__format, __VALIST __local_argv) | |
| { | |
| return __mingw_vprintf( __format, __local_argv ); | |
| } | |
| __mingw_stdio_redirect__ | |
| int vsprintf (char *__stream, const char *__format, __VALIST __local_argv) | |
| { | |
| return __mingw_vsprintf( __stream, __format, __local_argv ); | |
| } | |
| #else /* __USE_MINGW_ANSI_STDIO */ | |
| /* | |
| * Default configuration: simply direct all calls to MSVCRT... | |
| */ | |
| _CRTIMP int __cdecl __MINGW_NOTHROW fprintf (FILE*, const char*, ...); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW printf (const char*, ...); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW sprintf (char*, const char*, ...); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW vfprintf (FILE*, const char*, __VALIST); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW vprintf (const char*, __VALIST); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW vsprintf (char*, const char*, __VALIST); | |
| #endif /* __USE_MINGW_ANSI_STDIO */ | |
| /* | |
| * Regardless of user preference, always offer these alternative | |
| * entry points, for direct access to the MSVCRT implementations. | |
| */ | |
| #undef __mingw_stdio_redirect__ | |
| #define __mingw_stdio_redirect__(F) __cdecl __MINGW_NOTHROW __msvcrt_##F | |
| _CRTIMP int __mingw_stdio_redirect__(fprintf)(FILE*, const char*, ...); | |
| _CRTIMP int __mingw_stdio_redirect__(printf)(const char*, ...); | |
| _CRTIMP int __mingw_stdio_redirect__(sprintf)(char*, const char*, ...); | |
| _CRTIMP int __mingw_stdio_redirect__(vfprintf)(FILE*, const char*, __VALIST); | |
| _CRTIMP int __mingw_stdio_redirect__(vprintf)(const char*, __VALIST); | |
| _CRTIMP int __mingw_stdio_redirect__(vsprintf)(char*, const char*, __VALIST); | |
| #undef __mingw_stdio_redirect__ | |
| /* The following pair ALWAYS refer to the MSVCRT implementations... | |
| */ | |
| _CRTIMP int __cdecl __MINGW_NOTHROW _snprintf (char*, size_t, const char*, ...); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW _vsnprintf (char*, size_t, const char*, __VALIST); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW _vscprintf (const char*, __VALIST); | |
| #ifndef __NO_ISOCEXT /* externs in libmingwex.a */ | |
| /* | |
| * Microsoft does not provide implementations for the following, | |
| * 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*); | |
| __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, FILE*); | |
| __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); | |
| __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); | |
| __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*); | |
| _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*); | |
| #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 it's a 64-bit number in | |
| * MSVCRT however, and for now `long long' will do. | |
| */ | |
| typedef long long fpos_t; | |
| _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 __cplusplus | |
| inline 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); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW _getmaxstdio (void); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW _setmaxstdio (int); | |
| #if (_WIN32_WINNT >= _WIN32_WINNT_VISTA) || defined(HAVE_GET_OUTPUT_FORMAT) | |
| _CRTIMP unsigned int __cdecl __MINGW_NOTHROW _get_output_format (void); | |
| _CRTIMP unsigned int __cdecl __MINGW_NOTHROW _set_output_format (unsigned int); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW _get_printf_count_output (void); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW _set_printf_count_output (int); | |
| #else | |
| #define _get_output_format() 0 | |
| #define _set_output_format(x) 0 | |
| #define _get_printf_count_output() 0 | |
| #define _set_printf_count_output(x) 0 | |
| #endif /* (_WIN32_WINNT >= _WIN32_WINNT_VISTA) || defined(HAVE_GET_OUTPUT_FORMAT) */ | |
| #define _TWO_DIGIT_EXPONENT 1 | |
| #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 (__NO_MINGW_LFS) | |
| #include <sys/types.h> | |
| __CRT_INLINE FILE* __cdecl __MINGW_NOTHROW fopen64 (const char*, const char*); | |
| __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_FSEEK | |
| int __cdecl __MINGW_NOTHROW __mingw_fseeko64 (FILE *, off64_t, int); | |
| #define fseeko64(fp, offset, whence) __mingw_fseeko64(fp, offset, whence) | |
| #endif /* __USER_MINGW_FSEEK */ | |
| __CRT_INLINE off64_t __cdecl __MINGW_NOTHROW ftello64 (FILE *); | |
| __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 _vscwprintf (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 | |
| _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 wint_t __cdecl __MINGW_NOTHROW putwc (wint_t, FILE*); | |
| _CRTIMP wint_t __cdecl __MINGW_NOTHROW putwchar (wint_t); | |
| #ifndef __STRICT_ANSI__ | |
| _CRTIMP void __cdecl __MINGW_NOTHROW _lock_file(FILE*); | |
| _CRTIMP void __cdecl __MINGW_NOTHROW _unlock_file(FILE*); | |
| _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _getws (wchar_t*); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW _putws (const wchar_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 /* __STRICT_ANSI__ */ | |
| #ifndef __NO_ISOCEXT /* externs in libmingwex.a */ | |
| int __cdecl __MINGW_NOTHROW snwprintf (wchar_t* s, size_t n, const wchar_t* format, ...); | |
| int __cdecl __MINGW_NOTHROW vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, __VALIST arg); | |
| #ifndef __NO_INLINE__ | |
| __CRT_INLINE int __cdecl __MINGW_NOTHROW | |
| vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, __VALIST arg) | |
| { return _vsnwprintf ( s, n, format, arg);} | |
| #endif | |
| 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__ | |
| #ifndef NO_OLDNAMES | |
| _CRTIMP FILE* __cdecl __MINGW_NOTHROW wpopen (const wchar_t*, const wchar_t*); | |
| #endif /* not NO_OLDNAMES */ | |
| /* | |
| * 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 */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @file stdlib.h | |
| * @copy 2012 MinGW.org project | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a | |
| * copy of this software and associated documentation files (the "Software"), | |
| * to deal in the Software without restriction, including without limitation | |
| * the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
| * and/or sell copies of the Software, and to permit persons to whom the | |
| * Software is furnished to do so, subject to the following conditions: | |
| * | |
| * The above copyright notice and this permission notice (including the next | |
| * paragraph) shall be included in all copies or substantial portions of the | |
| * Software. | |
| * | |
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
| * DEALINGS IN THE SOFTWARE. | |
| */ | |
| #ifndef _STDLIB_H | |
| #define _STDLIB_H | |
| #pragma GCC system_header | |
| #include <_mingw.h> | |
| #define __need_size_t | |
| #define __need_wchar_t | |
| #define __need_NULL | |
| #ifndef RC_INVOKED | |
| #include <stddef.h> | |
| #endif /* RC_INVOKED */ | |
| /* | |
| * RAND_MAX is the maximum value that may be returned by rand. | |
| * The minimum is zero. | |
| */ | |
| #define RAND_MAX 0x7FFF | |
| /* | |
| * These values may be used as exit status codes. | |
| */ | |
| #define EXIT_SUCCESS 0 | |
| #define EXIT_FAILURE 1 | |
| /* | |
| * Definitions for path name functions. | |
| * NOTE: All of these values have simply been chosen to be conservatively high. | |
| * Remember that with long file names we can no longer depend on | |
| * extensions being short. | |
| */ | |
| #ifndef __STRICT_ANSI__ | |
| #ifndef MAX_PATH | |
| #define MAX_PATH (260) | |
| #endif | |
| #define _MAX_PATH MAX_PATH | |
| #define _MAX_DRIVE (3) | |
| #define _MAX_DIR 256 | |
| #define _MAX_FNAME 256 | |
| #define _MAX_EXT 256 | |
| #endif /* Not __STRICT_ANSI__ */ | |
| #ifndef RC_INVOKED | |
| #ifdef __cplusplus | |
| extern "C" { | |
| #endif | |
| #if !defined (__STRICT_ANSI__) | |
| /* | |
| * This seems like a convenient place to declare these variables, which | |
| * give programs using WinMain (or main for that matter) access to main-ish | |
| * argc and argv. environ is a pointer to a table of environment variables. | |
| * NOTE: Strings in _argv and environ are ANSI strings. | |
| */ | |
| extern int _argc; | |
| extern char** _argv; | |
| /* imports from runtime dll of the above variables */ | |
| extern int* __cdecl __MINGW_NOTHROW __p___argc(void); | |
| extern char*** __cdecl __MINGW_NOTHROW __p___argv(void); | |
| extern wchar_t*** __cdecl __MINGW_NOTHROW __p___wargv(void); | |
| #define __argc (*__p___argc()) | |
| #define __argv (*__p___argv()) | |
| #define __wargv (*__p___wargv()) | |
| #endif /* __STRICT_ANSI__ */ | |
| /* | |
| * Also defined in ctype.h. | |
| */ | |
| #ifndef MB_CUR_MAX | |
| # define MB_CUR_MAX __mb_cur_max | |
| __MINGW_IMPORT int __mb_cur_max; | |
| #endif /* MB_CUR_MAX */ | |
| /* | |
| * MS likes to declare errno in stdlib.h as well. | |
| */ | |
| _CRTIMP int* __cdecl __MINGW_NOTHROW _errno(void); | |
| #define errno (*_errno()) | |
| _CRTIMP int* __cdecl __MINGW_NOTHROW __doserrno(void); | |
| #define _doserrno (*__doserrno()) | |
| #if !defined (__STRICT_ANSI__) | |
| /* | |
| * Use environ from the DLL, not as a global. | |
| */ | |
| extern _CRTIMP char *** __cdecl __MINGW_NOTHROW __p__environ(void); | |
| extern _CRTIMP wchar_t *** __cdecl __MINGW_NOTHROW __p__wenviron(void); | |
| # define _environ (*__p__environ()) | |
| # define _wenviron (*__p__wenviron()) | |
| #define environ _environ | |
| __MINGW_IMPORT int _sys_nerr; | |
| #define sys_nerr _sys_nerr | |
| __MINGW_IMPORT char* _sys_errlist[]; | |
| #define sys_errlist _sys_errlist | |
| /* | |
| * OS version and such constants. | |
| */ | |
| extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__osver(void); | |
| extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__winver(void); | |
| extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__winmajor(void); | |
| extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__winminor(void); | |
| __MINGW_IMPORT unsigned int _osver; | |
| __MINGW_IMPORT unsigned int _winver; | |
| __MINGW_IMPORT unsigned int _winmajor; | |
| __MINGW_IMPORT unsigned int _winminor; | |
| /* although the _pgmptr is exported as DATA, | |
| * be safe and use the access function __p__pgmptr() to get it. */ | |
| _CRTIMP char** __cdecl __MINGW_NOTHROW __p__pgmptr(void); | |
| #define _pgmptr (*__p__pgmptr()) | |
| _CRTIMP wchar_t** __cdecl __MINGW_NOTHROW __p__wpgmptr(void); | |
| #define _wpgmptr (*__p__wpgmptr()) | |
| /* | |
| * This variable determines the default file mode. | |
| * TODO: Which flags work? | |
| */ | |
| #if defined (__IN_MINGW_RUNTIME) | |
| extern int* _imp___fmode; | |
| #define _fmode (*_imp___fmode) | |
| #else /* ! __IN_MINGW_RUNTIME */ | |
| __MINGW_IMPORT int _fmode; | |
| #endif /* ! __IN_MINGW_RUNTIME */ | |
| #endif /* Not __STRICT_ANSI__ */ | |
| _CRTIMP __int64 __cdecl _strtoi64(const char*, char **, int); | |
| _CRTIMP __int64 __cdecl _strtoi64_l(const char *, char **, int, _locale_t); | |
| _CRTIMP unsigned __int64 __cdecl _strtoui64(const char*, char **, int); | |
| _CRTIMP unsigned __int64 __cdecl _strtoui64_l(const char *, char **, int, _locale_t); | |
| _CRTIMP double __cdecl __MINGW_NOTHROW atof (const char*); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW atoi (const char*); | |
| _CRTIMP long __cdecl __MINGW_NOTHROW atol (const char*); | |
| #if !defined (__STRICT_ANSI__) | |
| _CRTIMP double __cdecl __MINGW_NOTHROW _wtof (const wchar_t *); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW _wtoi (const wchar_t *); | |
| _CRTIMP long __cdecl __MINGW_NOTHROW _wtol (const wchar_t *); | |
| #endif | |
| #if !defined __NO_ISOCEXT /* in libmingwex.a */ | |
| double __cdecl __MINGW_NOTHROW __strtod (const char*, char**); | |
| extern double __cdecl __MINGW_NOTHROW | |
| strtod (const char* __restrict__ __nptr, char** __restrict__ __endptr); | |
| float __cdecl __MINGW_NOTHROW strtof (const char * __restrict__, char ** __restrict__); | |
| long double __cdecl __MINGW_NOTHROW strtold (const char * __restrict__, char ** __restrict__); | |
| #else | |
| _CRTIMP double __cdecl __MINGW_NOTHROW strtod (const char*, char**); | |
| #endif /* __NO_ISOCEXT */ | |
| _CRTIMP long __cdecl __MINGW_NOTHROW strtol (const char*, char**, int); | |
| _CRTIMP unsigned long __cdecl __MINGW_NOTHROW strtoul (const char*, char**, int); | |
| #ifndef _WSTDLIB_DEFINED | |
| /* also declared in wchar.h */ | |
| _CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *, wchar_t **, int); | |
| _CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *, wchar_t **, int, _locale_t); | |
| _CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *, wchar_t **, int); | |
| _CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *, wchar_t **, int, _locale_t); | |
| _CRTIMP long __cdecl __MINGW_NOTHROW wcstol (const wchar_t*, wchar_t**, int); | |
| _CRTIMP unsigned long __cdecl __MINGW_NOTHROW wcstoul (const wchar_t*, wchar_t**, int); | |
| _CRTIMP double __cdecl __MINGW_NOTHROW wcstod (const wchar_t*, wchar_t**); | |
| #if !defined __NO_ISOCEXT /* in libmingwex.a */ | |
| float __cdecl __MINGW_NOTHROW wcstof( const wchar_t * __restrict__, wchar_t ** __restrict__); | |
| long double __cdecl __MINGW_NOTHROW wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__); | |
| #endif /* __NO_ISOCEXT */ | |
| _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetenv(const wchar_t*); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW _wputenv(const wchar_t*); | |
| _CRTIMP void __cdecl __MINGW_NOTHROW _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW _wsystem(const wchar_t*); | |
| _CRTIMP void __cdecl __MINGW_NOTHROW _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*); | |
| _CRTIMP void __cdecl __MINGW_NOTHROW _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*); | |
| _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wfullpath (wchar_t*, const wchar_t*, size_t); | |
| #define _WSTDLIB_DEFINED | |
| #endif /* !_WSTDLIB_DEFINED */ | |
| _CRTIMP size_t __cdecl __MINGW_NOTHROW wcstombs (char*, const wchar_t*, size_t); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW wctomb (char*, wchar_t); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW mblen (const char*, size_t); | |
| _CRTIMP size_t __cdecl __MINGW_NOTHROW mbstowcs (wchar_t*, const char*, size_t); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW mbtowc (wchar_t*, const char*, size_t); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW rand (void); | |
| _CRTIMP void __cdecl __MINGW_NOTHROW srand (unsigned int); | |
| _CRTIMP void* __cdecl __MINGW_NOTHROW calloc (size_t, size_t) __MINGW_ATTRIB_MALLOC; | |
| _CRTIMP void* __cdecl __MINGW_NOTHROW malloc (size_t) __MINGW_ATTRIB_MALLOC; | |
| _CRTIMP void* __cdecl __MINGW_NOTHROW realloc (void*, size_t); | |
| _CRTIMP void __cdecl __MINGW_NOTHROW free (void*); | |
| _CRTIMP void __cdecl __MINGW_NOTHROW abort (void) __MINGW_ATTRIB_NORETURN; | |
| _CRTIMP void __cdecl __MINGW_NOTHROW exit (int) __MINGW_ATTRIB_NORETURN; | |
| /* Note: This is in startup code, not imported directly from dll */ | |
| int __cdecl __MINGW_NOTHROW atexit (void (*)(void)); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW system (const char*); | |
| _CRTIMP char* __cdecl __MINGW_NOTHROW getenv (const char*); | |
| /* bsearch and qsort are also in non-ANSI header search.h */ | |
| _CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t, | |
| int (*)(const void*, const void*)); | |
| _CRTIMP void __cdecl qsort(void*, size_t, size_t, | |
| int (*)(const void*, const void*)); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW abs (int) __MINGW_ATTRIB_CONST; | |
| _CRTIMP long __cdecl __MINGW_NOTHROW labs (long) __MINGW_ATTRIB_CONST; | |
| /* | |
| * div_t and ldiv_t are structures used to return the results of div and | |
| * ldiv. | |
| * | |
| * NOTE: div and ldiv appear not to work correctly unless | |
| * -fno-pcc-struct-return is specified. This is included in the | |
| * mingw32 specs file. | |
| */ | |
| typedef struct { int quot, rem; } div_t; | |
| typedef struct { long quot, rem; } ldiv_t; | |
| _CRTIMP div_t __cdecl __MINGW_NOTHROW div (int, int) __MINGW_ATTRIB_CONST; | |
| _CRTIMP ldiv_t __cdecl __MINGW_NOTHROW ldiv (long, long) __MINGW_ATTRIB_CONST; | |
| #if !defined (__STRICT_ANSI__) | |
| /* | |
| * NOTE: Officially the three following functions are obsolete. The Win32 API | |
| * functions SetErrorMode, Beep and Sleep are their replacements. | |
| */ | |
| _CRTIMP void __cdecl __MINGW_NOTHROW _beep (unsigned int, unsigned int) __MINGW_ATTRIB_DEPRECATED; | |
| /* Not to be confused with _set_error_mode (int). */ | |
| _CRTIMP void __cdecl __MINGW_NOTHROW _seterrormode (int) __MINGW_ATTRIB_DEPRECATED; | |
| _CRTIMP void __cdecl __MINGW_NOTHROW _sleep (unsigned long) __MINGW_ATTRIB_DEPRECATED; | |
| _CRTIMP void __cdecl __MINGW_NOTHROW _exit (int) __MINGW_ATTRIB_NORETURN; | |
| /* _onexit is MS extension. Use atexit for portability. */ | |
| /* Note: This is in startup code, not imported directly from dll */ | |
| typedef int (* _onexit_t)(void); | |
| _onexit_t __cdecl __MINGW_NOTHROW _onexit( _onexit_t ); | |
| _CRTIMP int __cdecl __MINGW_NOTHROW _putenv (const char*); | |
| _CRTIMP void __cdecl __MINGW_NOTHROW _searchenv (const char*, const char*, char*); | |
| _CRTIMP char* __cdecl __MINGW_NOTHROW _ecvt (double, int, int*, int*); | |
| _CRTIMP char* __cdecl __MINGW_NOTHROW _fcvt (double, int, int*, int*); | |
| _CRTIMP char* __cdecl __MINGW_NOTHROW _gcvt (double, int, char*); | |
| _CRTIMP void __cdecl __MINGW_NOTHROW _makepath (char*, const char*, const char*, const char*, const char*); | |
| _CRTIMP void __cdecl __MINGW_NOTHROW _splitpath (const char*, char*, char*, char*, char*); | |
| _CRTIMP char* __cdecl __MINGW_NOTHROW _fullpath (char*, const char*, size_t); | |
| _CRTIMP char* __cdecl __MINGW_NOTHROW _itoa (int, char*, int); | |
| _CRTIMP char* __cdecl __MINGW_NOTHROW _ltoa (long, char*, int); | |
| _CRTIMP char* __cdecl __MINGW_NOTHROW _ultoa(unsigned long, char*, int); | |
| _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _itow (int, wchar_t*, int); | |
| _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ltow (long, wchar_t*, int); | |
| _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ultow (unsigned long, wchar_t*, int); | |
| _CRTIMP __int64 __cdecl __MINGW_NOTHROW _atoi64(const char *); | |
| _CRTIMP char* __cdecl __MINGW_NOTHROW _i64toa(__int64, char *, int); | |
| _CRTIMP char* __cdecl __MINGW_NOTHROW _ui64toa(unsigned __int64, char *, int); | |
| _CRTIMP __int64 __cdecl __MINGW_NOTHROW _wtoi64(const wchar_t *); | |
| _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _i64tow(__int64, wchar_t *, int); | |
| _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ui64tow(unsigned __int64, wchar_t *, int); | |
| _CRTIMP unsigned int __cdecl __MINGW_NOTHROW (_rotl)(unsigned int, int) __MINGW_ATTRIB_CONST; | |
| _CRTIMP unsigned int __cdecl __MINGW_NOTHROW (_rotr)(unsigned int, int) __MINGW_ATTRIB_CONST; | |
| _CRTIMP unsigned long __cdecl __MINGW_NOTHROW (_lrotl)(unsigned long, int) __MINGW_ATTRIB_CONST; | |
| _CRTIMP unsigned long __cdecl __MINGW_NOTHROW (_lrotr)(unsigned long, int) __MINGW_ATTRIB_CONST; | |
| _CRTIMP int __cdecl __MINGW_NOTHROW _set_error_mode (int); | |
| # define _OUT_TO_DEFAULT 0 | |
| # define _OUT_TO_STDERR 1 | |
| # define _OUT_TO_MSGBOX 2 | |
| # define _REPORT_ERRMODE 3 | |
| # ifndef _UINTPTR_T_DEFINED | |
| # define _UINTPTR_T_DEFINED | |
| # ifdef _WIN64 | |
| typedef unsigned __int64 uintptr_t; | |
| # else | |
| typedef unsigned int uintptr_t; | |
| # endif | |
| # endif | |
| _CRTIMP unsigned int __cdecl __MINGW_NOTHROW _set_abort_behavior (unsigned int, unsigned int); | |
| /* These masks work with msvcr80.dll version 8.0.50215.44 (a beta release). */ | |
| # define _WRITE_ABORT_MSG 1 | |
| # define _CALL_REPORTFAULT 2 | |
| typedef void | |
| (* _invalid_parameter_handler) ( | |
| const wchar_t *, | |
| const wchar_t *, | |
| const wchar_t *, | |
| unsigned int, | |
| uintptr_t); | |
| _invalid_parameter_handler _set_invalid_parameter_handler (_invalid_parameter_handler); | |
| #ifndef _NO_OLDNAMES | |
| _CRTIMP int __cdecl __MINGW_NOTHROW putenv (const char*); | |
| _CRTIMP void __cdecl __MINGW_NOTHROW searchenv (const char*, const char*, char*); | |
| _CRTIMP char* __cdecl __MINGW_NOTHROW itoa (int, char*, int); | |
| _CRTIMP char* __cdecl __MINGW_NOTHROW ltoa (long, char*, int); | |
| _CRTIMP char* __cdecl __MINGW_NOTHROW ecvt (double, int, int*, int*); | |
| _CRTIMP char* __cdecl __MINGW_NOTHROW fcvt (double, int, int*, int*); | |
| _CRTIMP char* __cdecl __MINGW_NOTHROW gcvt (double, int, char*); | |
| #endif /* Not _NO_OLDNAMES */ | |
| #endif /* Not __STRICT_ANSI__ */ | |
| /* C99 names */ | |
| #if !defined __NO_ISOCEXT /* externs in static libmingwex.a */ | |
| /* C99 name for _exit */ | |
| void __cdecl __MINGW_NOTHROW _Exit(int) __MINGW_ATTRIB_NORETURN; | |
| #if !defined __NO_INLINE__ && !defined __STRICT_ANSI__ | |
| __CRT_INLINE void __cdecl __MINGW_NOTHROW _Exit(int __status) | |
| { _exit (__status); } | |
| #endif | |
| typedef struct { long long quot, rem; } lldiv_t; | |
| lldiv_t __cdecl __MINGW_NOTHROW lldiv (long long, long long) __MINGW_ATTRIB_CONST; | |
| long long __cdecl __MINGW_NOTHROW llabs(long long); | |
| #ifndef __NO_INLINE__ | |
| __CRT_INLINE long long __cdecl __MINGW_NOTHROW llabs(long long _j) | |
| {return (_j >= 0 ? _j : -_j);} | |
| #endif | |
| long long __cdecl __MINGW_NOTHROW strtoll (const char* __restrict__, char** __restrict, int); | |
| unsigned long long __cdecl __MINGW_NOTHROW strtoull (const char* __restrict__, char** __restrict__, int); | |
| long long __cdecl __MINGW_NOTHROW atoll (const char *); | |
| #if !defined (__STRICT_ANSI__) | |
| long long __cdecl __MINGW_NOTHROW wtoll (const wchar_t *); | |
| char* __cdecl __MINGW_NOTHROW lltoa (long long, char *, int); | |
| char* __cdecl __MINGW_NOTHROW ulltoa (unsigned long long , char *, int); | |
| wchar_t* __cdecl __MINGW_NOTHROW lltow (long long, wchar_t *, int); | |
| wchar_t* __cdecl __MINGW_NOTHROW ulltow (unsigned long long, wchar_t *, int); | |
| /* inline using non-ansi functions */ | |
| #ifndef __NO_INLINE__ | |
| __CRT_INLINE long long __cdecl __MINGW_NOTHROW atoll (const char * _c) | |
| { return _atoi64 (_c); } | |
| __CRT_INLINE char* __cdecl __MINGW_NOTHROW lltoa (long long _n, char * _c, int _i) | |
| { return _i64toa (_n, _c, _i); } | |
| __CRT_INLINE char* __cdecl __MINGW_NOTHROW ulltoa (unsigned long long _n, char * _c, int _i) | |
| { return _ui64toa (_n, _c, _i); } | |
| __CRT_INLINE long long __cdecl __MINGW_NOTHROW wtoll (const wchar_t * _w) | |
| { return _wtoi64 (_w); } | |
| __CRT_INLINE wchar_t* __cdecl __MINGW_NOTHROW lltow (long long _n, wchar_t * _w, int _i) | |
| { return _i64tow (_n, _w, _i); } | |
| __CRT_INLINE wchar_t* __cdecl __MINGW_NOTHROW ulltow (unsigned long long _n, wchar_t * _w, int _i) | |
| { return _ui64tow (_n, _w, _i); } | |
| #endif /* (__NO_INLINE__) */ | |
| #endif /* (__STRICT_ANSI__) */ | |
| #endif /* !__NO_ISOCEXT */ | |
| #ifdef __cplusplus | |
| } | |
| #endif | |
| #endif /* Not RC_INVOKED */ | |
| #endif /* Not _STDLIB_H */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment