stdio.h

00001 /*  wcecompat: Windows CE C Runtime Library "compatibility" library.
00002  *
00003  *  Copyright (C) 2001-2002 Essemer Pty Ltd.  All rights reserved.
00004  *  http://www.essemer.com.au/
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Lesser General Public
00008  *  License as published by the Free Software Foundation; either
00009  *  version 2.1 of the License, or (at your option) any later version.
00010  *
00011  *  This library is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  *  Lesser General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU Lesser General Public
00017  *  License along with this library; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00021 
00022 #ifndef __wcecompat__STDIO_H__
00023 #define __wcecompat__STDIO_H__
00024 
00025 #include "stddef.h"
00026 //#include "sys/types.h"        /* size_t */
00027 #include "stdarg.h"
00028 
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032 
00033 // STDIO constant defns
00034 #define _MAX_PATH    MAX_PATH
00035 
00036 // EOF constants
00037 #define EOF  (-1)
00038 #define WEOF (wint_t)(0xFFFF)
00039 
00040 // Seek method constants
00041 #define SEEK_CUR    1
00042 #define SEEK_END    2
00043 #define SEEK_SET    0
00044 
00045 // mode constants for _setmode()
00046 #define _O_TEXT     0x4000  /* file mode is text (translated) */
00047 #define _O_BINARY   0x8000  /* file mode is binary (untranslated) */
00048 
00049 // FILE is an opaque handle in Win CE. Users have no access to the internals
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 // Std handle defns
00062 #define stdin  _getstdfilex(0)
00063 #define stdout _getstdfilex(1)
00064 #define stderr _getstdfilex(2)
00065 
00066 // ANSI String formatting functions
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 // Always present since wsprintfW (used by kernel) redirects to these
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 // WIDE String formatting functions
00080 _CRTIMP int __cdecl swscanf(const wchar_t *, const wchar_t *, ...);
00081 
00082 // ANSI Stdin/Out functions & macros
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 // ANSI functions for Stdin/out and/or general buffered file handling
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 // ANSI functions for general buffered file handling
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 // functions for general buffered file handling in either ANSI or Wide
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 // old names
00127 #define fcloseall _fcloseall
00128 #define fileno    _fileno
00129 #define flushall  _flushall
00130 
00131 // WIDE Stdin/Out functions & macros
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 // WIDE functions for Stdin/out and/or general buffered file handling
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 // WIDE functions for general buffered file handling
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 /* __wcecompat__STDIO_H__ */

Generated on Mon Jun 5 10:20:45 2006 for Intelligence.kdevelop by  doxygen 1.4.6