00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __wcecompat__STDIO_H__
00023 #define __wcecompat__STDIO_H__
00024
00025 #include "stddef.h"
00026
00027 #include "stdarg.h"
00028
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032
00033
00034 #define _MAX_PATH MAX_PATH
00035
00036
00037 #define EOF (-1)
00038 #define WEOF (wint_t)(0xFFFF)
00039
00040
00041 #define SEEK_CUR 1
00042 #define SEEK_END 2
00043 #define SEEK_SET 0
00044
00045
00046 #define _O_TEXT 0x4000
00047 #define _O_BINARY 0x8000
00048
00049
00050 #ifndef _FILE_DEFINED
00051 typedef void FILE;
00052 #define _FILE_DEFINED
00053 #endif
00054
00055 #if _INTEGRAL_MAX_BITS >= 64
00056 typedef __int64 fpos_t;
00057 #else
00058 typedef long fpos_t;
00059 #endif
00060
00061
00062 #define stdin _getstdfilex(0)
00063 #define stdout _getstdfilex(1)
00064 #define stderr _getstdfilex(2)
00065
00066
00067 _CRTIMP int __cdecl sscanf(const char *, const char *, ...);
00068 _CRTIMP int __cdecl sprintf(char *, const char *, ...);
00069 _CRTIMP int __cdecl vsprintf(char *, const char *, va_list);
00070 _CRTIMP int __cdecl _snprintf(char *, size_t, const char *, ...);
00071 _CRTIMP int __cdecl _vsnprintf(char *, size_t, const char *, va_list);
00072
00073
00074 _CRTIMP int __cdecl swprintf(wchar_t *, const wchar_t *, ...);
00075 _CRTIMP int __cdecl vswprintf(wchar_t *, const wchar_t *, va_list);
00076 _CRTIMP int __cdecl _snwprintf(wchar_t *, size_t, const wchar_t *, ...);
00077 _CRTIMP int __cdecl _vsnwprintf(wchar_t *, size_t, const wchar_t *, va_list);
00078
00079
00080 _CRTIMP int __cdecl swscanf(const wchar_t *, const wchar_t *, ...);
00081
00082
00083 _CRTIMP int __cdecl scanf(const char *, ...);
00084 _CRTIMP int __cdecl printf(const char *, ...);
00085 _CRTIMP int __cdecl vprintf(const char *, va_list);
00086 _CRTIMP int __cdecl getchar(void);
00087 _CRTIMP char * __cdecl gets(char *);
00088 _CRTIMP int __cdecl putchar(int);
00089 _CRTIMP int __cdecl puts(const char *);
00090
00091
00092 _CRTIMP int __cdecl fgetc(FILE *);
00093 _CRTIMP char * __cdecl fgets(char *, int, FILE *);
00094 _CRTIMP int __cdecl fputc(int, FILE *);
00095 _CRTIMP int __cdecl fputs(const char *, FILE *);
00096 _CRTIMP int __cdecl ungetc(int, FILE *);
00097
00098
00099 _CRTIMP FILE * __cdecl fopen(const char *, const char *);
00100 _CRTIMP int __cdecl fscanf(FILE *, const char *, ...);
00101 _CRTIMP int __cdecl fprintf(FILE *, const char *, ...);
00102 _CRTIMP int __cdecl vfprintf(FILE *, const char *, va_list);
00103
00104 #define getc(_stream) fgetc(_stream)
00105 #define putc(_i, _stream) fputc(_i, _stream)
00106
00107
00108 _CRTIMP FILE* __cdecl _getstdfilex(int);
00109 _CRTIMP int __cdecl fclose(FILE *);
00110 _CRTIMP int __cdecl _fcloseall(void);
00111 _CRTIMP size_t __cdecl fread(void *, size_t, size_t, FILE *);
00112 _CRTIMP size_t __cdecl fwrite(const void *, size_t, size_t, FILE *);
00113 _CRTIMP int __cdecl fflush(FILE *);
00114 _CRTIMP int __cdecl _flushall(void);
00115 _CRTIMP int __cdecl feof(FILE *);
00116 _CRTIMP int __cdecl ferror(FILE *);
00117 _CRTIMP void __cdecl clearerr(FILE *);
00118 _CRTIMP int __cdecl fgetpos(FILE *, fpos_t *);
00119 _CRTIMP int __cdecl fsetpos(FILE *, const fpos_t *);
00120 _CRTIMP int __cdecl fseek(FILE *, long, int);
00121 _CRTIMP long __cdecl ftell(FILE *);
00122 _CRTIMP int __cdecl _fileno(FILE *);
00123 _CRTIMP int __cdecl _setmode(int fd, int mode);
00124 _CRTIMP FILE* __cdecl _wfdopen(void*, const wchar_t*);
00125 _CRTIMP FILE* __cdecl _wfreopen(const wchar_t *path, const wchar_t *mode, FILE *stream);
00126
00127 #define fcloseall _fcloseall
00128 #define fileno _fileno
00129 #define flushall _flushall
00130
00131
00132 _CRTIMP int __cdecl wscanf(const wchar_t *, ...);
00133 _CRTIMP int __cdecl wprintf(const wchar_t *, ...);
00134 _CRTIMP int __cdecl vwprintf(const wchar_t *, va_list);
00135 _CRTIMP wint_t __cdecl getwchar(void);
00136 _CRTIMP wint_t __cdecl putwchar(wint_t);
00137 _CRTIMP wchar_t * __cdecl _getws(wchar_t *);
00138 _CRTIMP int __cdecl _putws(const wchar_t *);
00139
00140
00141 _CRTIMP wint_t __cdecl fgetwc(FILE *);
00142 _CRTIMP wint_t __cdecl fputwc(wint_t, FILE *);
00143 _CRTIMP wint_t __cdecl ungetwc(wint_t, FILE *);
00144 _CRTIMP wchar_t * __cdecl fgetws(wchar_t *, int, FILE *);
00145 _CRTIMP int __cdecl fputws(const wchar_t *, FILE *);
00146
00147 #define getwc(_stm) fgetwc(_stm)
00148 #define putwc(_c,_stm) fputwc(_c,_stm)
00149
00150
00151 _CRTIMP FILE * __cdecl _wfopen(const wchar_t *, const wchar_t *);
00152 _CRTIMP int __cdecl fwscanf(FILE *, const wchar_t *, ...);
00153 _CRTIMP int __cdecl fwprintf(FILE *, const wchar_t *, ...);
00154 _CRTIMP int __cdecl vfwprintf(FILE *, const wchar_t *, va_list);
00155
00156 #define BUFSIZ (512)
00157
00158 void perror(const char *prefix);
00159
00160 #define _IOFBF 0
00161 #define _IOLBF 1
00162 #define _IONBF 2
00163 int setvbuf(FILE* stream, char* buffer, int mode, size_t size);
00164
00165 #ifdef __cplusplus
00166 }
00167 #endif
00168
00169 #endif