--- mstools/h/stdio.h 2018/08/09 18:21:10 1.1.1.3 +++ mstools/h/stdio.h 2018/08/09 18:23:06 1.1.1.4 @@ -1,7 +1,7 @@ /*** *stdio.h - definitions/declarations for standard I/O routines * -* Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved. +* Copyright (c) 1985-1993, Microsoft Corporation. All rights reserved. * *Purpose: * This file defines the structures, values, macros, and functions @@ -29,15 +29,6 @@ extern "C" { #define _CRTAPI1 __cdecl #define _CRTAPI2 __cdecl -#elif ( _MSC_VER == 600 ) - -/* - * Definitions for old MS C6-386 compiler - */ -#define _CRTAPI1 _cdecl -#define _CRTAPI2 _cdecl -#define _M_IX86 300 - #else /* @@ -59,8 +50,21 @@ typedef unsigned short wchar_t; #define _WCHAR_T_DEFINED #endif +#ifndef _WCTYPE_T_DEFINED +typedef wchar_t wint_t; +typedef wchar_t wctype_t; +#define _WCTYPE_T_DEFINED +#endif + #ifndef _VA_LIST_DEFINED -typedef char * va_list; +#if defined(_ALPHA_) +typedef struct { + char *a0; /* pointer to first homed integer argument */ + int offset; /* byte offset of next parameter */ +} va_list; +#else +typedef char * va_list; +#endif #define _VA_LIST_DEFINED #endif @@ -99,9 +103,11 @@ typedef struct _iobuf FILE; #endif /* Directory where temporary files may be created. */ - +#ifdef _POSIX_ #define _P_tmpdir "/" - +#else +#define _P_tmpdir "\\" +#endif /* L_tmpnam = size of P_tmpdir * + 1 (in case P_tmpdir does not end in "/") @@ -113,16 +119,17 @@ typedef struct _iobuf FILE; #ifdef _POSIX_ #define L_ctermid 9 +#define L_cuserid 32 #endif #define SEEK_CUR 1 #define SEEK_END 2 #define SEEK_SET 0 -#define FILENAME_MAX 63 -#define FOPEN_MAX 20 -#define _SYS_OPEN 20 -#define TMP_MAX 32767 +#define FILENAME_MAX 260 +#define FOPEN_MAX 20 +#define _SYS_OPEN 20 +#define TMP_MAX 32767 /* define NULL pointer value */ @@ -173,7 +180,7 @@ typedef long fpos_t; #define _IOSTRG 0x0040 #define _IORW 0x0080 #ifdef _POSIX_ -#define _IOAPPEND 0x0100 +#define _IOAPPEND 0x0200 #endif /* function prototypes */ @@ -252,9 +259,21 @@ int _CRTAPI1 vfprintf(FILE *, const char int _CRTAPI1 vprintf(const char *, va_list); int _CRTAPI1 _vsnprintf(char *, size_t, const char *, va_list); int _CRTAPI1 vsprintf(char *, const char *, va_list); -#ifndef __STDC__ + +#if !__STDC__ #ifndef _WSTDIO_DEFINED + /* declared in wchar.h, officially */ +wint_t _CRTAPI1 fgetwc(FILE *); +wint_t _CRTAPI1 _fgetwchar(void); +wint_t _CRTAPI1 fputwc(wint_t, FILE *); +wint_t _CRTAPI1 _fputwchar(wint_t); +wint_t _CRTAPI1 getwc(FILE *); +wint_t _CRTAPI1 getwchar(void); +wint_t _CRTAPI1 putwc(wint_t, FILE *); +wint_t _CRTAPI1 putwchar(wint_t); +wint_t _CRTAPI1 ungetwc(wint_t, FILE *); + int _CRTAPI2 fwprintf(FILE *, const wchar_t *, ...); int _CRTAPI2 wprintf(const wchar_t *, ...); int _CRTAPI2 _snwprintf(wchar_t *, size_t, const wchar_t *, ...); @@ -266,6 +285,13 @@ int _CRTAPI1 vswprintf(wchar_t *, const int _CRTAPI2 fwscanf(FILE *, const wchar_t *, ...); int _CRTAPI2 swscanf(const wchar_t *, const wchar_t *, ...); int _CRTAPI2 wscanf(const wchar_t *, ...); + +#define getwchar() fgetwc(stdin) +#define putwchar(_c) fputwc((_c),stdout) +#define getwc(_stm) fgetwc(_stm) +#define putwc(_c,_stm) fputwc(_c,_stm) + + #define _WSTDIO_DEFINED #endif #endif /* !__STDC__ */ @@ -285,6 +311,7 @@ int _CRTAPI2 wscanf(const wchar_t *, ... #define getchar() getc(stdin) #define putchar(_c) putc((_c),stdout) + #ifdef _MT #undef getc #undef putc