stdio.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:5k
- /* stdio.h: ANSI X3.159 1989 library header, section 4.9 */
- /* Copyright (C) Codemist Ltd. */
- /* Copyright (C) SGS-THOMSON Microelectronics Ltd. 1998 */
- #ifndef __stdio_h
- #define __stdio_h
- #ifdef __cplusplus
- extern "C" {
- #endif
- #ifndef __size_t
- #define __size_t 1
- typedef unsigned int size_t; /* from <stddef.h> */
- #endif
- #ifndef NULL
- # ifdef __cplusplus
- # define NULL 0
- # else
- # define NULL (void *)0
- # endif
- #endif
- typedef char *__va_list[1];
- typedef struct __fpos_t_struct
- { unsigned long __lo;
- } fpos_t;
- /* FILE flags */
- #define _IOINUSE 0x00000001
- #define _IOREAD 0x00000002
- #define _IOWRITE 0x00000004
- #define _IOAPPEND 0x00000008
- #define _IOBINARY 0x00000010
- #define _IOFBF 0x00000020 /* fully buffered IO */
- #define _IOLBF 0x00000040 /* line buffered IO */
- #define _IONBF 0x00000080 /* unbuffered IO */
- #define _IOSYSBF 0x00000100 /* system buffer */
- #define _IOERR 0x00000200 /* error indicator*/
- #define _IOEOF 0x00000400 /* end-of-file indicator*/
- #define _IOUNGET 0x00000800 /* last op was unget*/
- #define _IOLWRITE 0x00001000 /* Last op was a write*/
- #define _IOLREAD 0x00002000 /* Last op was a read*/
- #define BUFSIZ 4096 /* system buffer size */
- #define EOF (-1)
- #define FOPEN_MAX 8
- #define FILENAME_MAX 64
- #define L_tmpnam 20
- #define SEEK_SET 0 /* start of stream (see fseek) */
- #define SEEK_CUR 1 /* current position in stream (see fseek) */
- #define SEEK_END 2 /* end of stream (see fseek) */
- #define TMP_MAX 0x7fff
-
- typedef struct _ST_FILE
- {
- int __flag; /* r/w etc */
- long int __file; /* file discriptor*/
- unsigned char *__base; /* buffer for file*/
- unsigned char *__ptr; /* current buf pos*/
- int __bufsiz; /* buf size */
- int __incount; /* chars in buf to r*/
- int __outcount; /* number to write*/
- int __saveout; /* used in unget*/
- int __savein; /* used in unget*/
- int __count; /* local w/buffer count*/
- long int __store; /* local r/buffer count*/
- unsigned char __lilbuf; /* unget buffer*/
- unsigned char __lilbuf2; /* a one char buffer*/
- char * __tmpname; /* temporary file name*/
- void * __filesem; /* usr defined */
- } FILE;
- extern FILE _ST_FILE_table[];
- #define stdin (&(_ST_FILE_table[0]))
- #define stdout (&(_ST_FILE_table[1]))
- #define stderr (&(_ST_FILE_table[2]))
- extern FILE* fopen(const char * /* filename */, const char * /* mode */);
- extern FILE* fdopen(const int /* file descriptor*/, const char * /* mode */);
- extern int fclose(FILE * /* stream */);
- extern size_t fread(void * /* ptr */, size_t /* size */, size_t /* nmemb */, FILE * /* stream */);
- extern size_t fwrite(const void * /* ptr */, size_t /* size */, size_t /* nmemb */, FILE * /* stream */);
- extern int getc(FILE * /* stream */);
- extern int putc(int /* c */, FILE * /* stream */);
- extern int remove(const char * /* filename */);
- extern int rename(const char */* oldname */, const char * /* newname */);
- extern int fseek(FILE * /* stream */, long /* offset */, int /* origin */);
- extern long ftell(FILE * /* stream */);
- extern int vprintf(const char *, __va_list);
- extern int getchar(void);
- extern int putchar(int /* c */);
- extern int fgetc(FILE * /* stream */);
- extern int fputc(int /* c */, FILE * /* stream */);
- extern char *fgets(char * /* s */, int /* n */, FILE */* stream */);
- extern char *gets(char * /* s */);
- extern int fputs(const char * /* s */, FILE * /* stream */);
- extern int puts(const char * /* s */);
- extern int fsetpos(FILE * /* stream */, const fpos_t * /* pos */);
- extern int fgetpos(FILE * /* stream */, fpos_t * /* pos */);
- extern void clearerr(FILE * /* stream */);
- extern int ferror(FILE * /* stream */);
- extern int feof(FILE * /* stream */);
- extern int fflush(FILE * /* stream */);
- extern char *tmpnam(char * /* s */);
- extern FILE *tmpfile (void);
- extern void rewind(FILE * /* stream */);
- extern void perror(const char *);
- extern void setbuf(FILE *, char *);
- extern int setvbuf(FILE * /* stream */, char * /* buf */, int /* type */, size_t /* size */);
- extern int vsprintf(char * /* buff */, const char * /* fmt */, __va_list /* a */);
- extern int vsnprintf(char * /* buff */, size_t /* count */, const char * /* fmt */, __va_list /* a */);
- extern int ungetc(int /* c */,FILE * /* stream */);
- extern FILE *freopen(const char * /* name */, const char * /* mode */, FILE * /* stream */);
- extern int vfprintf(FILE * /* fp */, const char * /* fmt */, __va_list /* a */);
- extern int fileno(FILE* /*stream*/) ;
- #pragma ST_on(printf_checking)
- extern int printf(const char *, ...);
- extern int sprintf(char *, const char *, ...);
- extern int snprintf(char *, size_t, const char *, ...);
- extern int fprintf(FILE *, const char *, ...);
- #pragma ST_off(printf_checking)
- #pragma ST_on(scanf_checking)
- extern int fscanf(FILE */* fp */, const char */* fmt*/, ...);
- extern int scanf(const char * /* fmt */, ...);
- extern int sscanf(const char * /* buff */, const char * /* fmt */, ...);
- #pragma ST_off(scanf_checking)
- #ifdef __cplusplus
- }
- #endif
- #endif