哪位大神能详细分析下stdio.h
飘逸的虚空 2012-05-15 11:51:38 /***
*stdio.h - definitions/declarations for standard I/O routines
*
* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
*
*Purpose:
* This file defines the structures, values, macros, and functions
* used by the level 2 I/O ("standard I/O") routines.
* [ANSI/System V]
*
* [Public]
*
****/
#if _MSC_VER > 1000
#pragma once
#endif
#ifndef _INC_STDIO
#define _INC_STDIO
#if !defined(_WIN32) && !defined(_MAC)
#error ERROR: Only Mac or Win32 targets supported!
#endif
#ifdef _MSC_VER
/*
* Currently, all MS C compilers for Win32 platforms default to 8 byte
* alignment.
*/
#pragma pack(push,8)
#endif /* _MSC_VER */
#ifdef __cplusplus
extern "C" {
#endif
/* Define _CRTIMP */
#ifndef _CRTIMP
#ifdef _DLL
#define _CRTIMP __declspec(dllimport)
#else /* ndef _DLL */
#define _CRTIMP
#endif /* _DLL */
#endif /* _CRTIMP */
/* Define __cdecl for non-Microsoft compilers */
#if ( !defined(_MSC_VER) && !defined(__cdecl) )
#define __cdecl
#endif
/* Define _CRTAPI1 (for compatibility with the NT SDK) */
#ifndef _CRTAPI1
#if _MSC_VER >= 800 && _M_IX86 >= 300
#define _CRTAPI1 __cdecl
#else
#define _CRTAPI1
#endif
#endif
#ifndef _SIZE_T_DEFINED
typedef unsigned int size_t;
#define _SIZE_T_DEFINED
#endif
#ifndef _MAC
#ifndef _WCHAR_T_DEFINED
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
#endif /* ndef _MAC */
#ifndef _VA_LIST_DEFINED
#ifdef _M_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
/* Buffered I/O macros */
#if defined(_M_MPPC)
#define BUFSIZ 4096
#else /* defined (_M_MPPC) */
#define BUFSIZ 512
#endif /* defined (_M_MPPC) */
/*
* Default number of supported streams. _NFILE is confusing and obsolete, but
* supported anyway for backwards compatibility.
*/
#define _NFILE _NSTREAM_
#ifdef _WIN32
#define _NSTREAM_ 512
/*
* Number of entries in _iob[] (declared below). Note that _NSTREAM_ must be
* greater than or equal to _IOB_ENTRIES.
*/
#define _IOB_ENTRIES 20
#else /* ndef _WIN32 */
#ifdef _DLL
#define _NSTREAM_ 128
#else
#ifdef _MT
#define _NSTREAM_ 40
#else
#define _NSTREAM_ 20
#endif
#endif /* _DLL */
#endif /* ndef _MAC */
#define EOF (-1)
#ifndef _FILE_DEFINED
struct _iobuf {
char *_ptr;
int _cnt;
char *_base;
int _flag;
int _file;
int _charbuf;
int _bufsiz;
char *_tmpfname;
};
typedef struct _iobuf FILE;
#define _FILE_DEFINED
#endif
#ifndef _MAC
/* Directory where temporary files may be created. */
#ifdef _POSIX_
#define _P_tmpdir "/"
#define _wP_tmpdir L"/"
#else
#define _P_tmpdir "\\"
#define _wP_tmpdir L"\\"
#endif
/* L_tmpnam = size of P_tmpdir
* + 1 (in case P_tmpdir does not end in "/")
* + 12 (for the filename string)
* + 1 (for the null terminator)
*/
#define L_tmpnam sizeof(_P_tmpdir)+12
#else /* def _MAC */
#define L_tmpnam 255
#endif /* _MAC */
#ifdef _POSIX_
#define L_ctermid 9
#define L_cuserid 32
#endif
/* Seek method constants */
#define SEEK_CUR 1
#define SEEK_END 2
#define SEEK_SET 0
#define FILENAME_MAX 260
#define FOPEN_MAX 20
#define _SYS_OPEN 20
#define TMP_MAX 32767
/* Define NULL pointer value */
#ifndef NULL
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#endif
我们老师叫我们自己写头文件、 参照自带的include的文件格式,哪位高手能分析下上面代码的具体含义,有多少是多少。或者写头文件的格式也行呀、感激不尽、