/* * stdio.h * * Copyright (c) 1992 Symantec Corporation. All rights reserved. * */ #pragma once #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus #define NULL 0 #else #define NULL ((void *) 0) #endif #include "size_t.h" typedef unsigned long fpos_t; typedef struct __FILE FILE; struct __FILE { unsigned std : 1; unsigned binary : 1; unsigned eof : 1; unsigned err : 1; unsigned dirty : 1; unsigned mybuf : 1; unsigned append : 1; unsigned remove : 1; unsigned pushed : 1; char one; unsigned char pushc; short refnum; char *buf; size_t size; unsigned char *ptr; size_t cnt; fpos_t pos; fpos_t len; void *window; int (*proc)(FILE *, int); }; #define _IOFBF 0 #define _IOLBF 1 #define _IONBF 2 #define BUFSIZ 512 #define EOF (-1) #define FOPEN_MAX 15 #define FILENAME_MAX 256 #define L_tmpnam 20 #define TMP_MAX 9999 #define SEEK_SET 0 #define SEEK_CUR 1 #define SEEK_END 2 #define stdin (&__file[0]) #define stdout (&__file[1]) #define stderr (&__file[2]) extern FILE __file[FOPEN_MAX]; int remove(const char *); int rename(const char *, const char *); FILE *tmpfile(void); char *tmpnam(char *); int fclose(FILE *); int fflush(FILE *); FILE *fopen(const char *, const char *); FILE *freopen(const char *, const char *, FILE *); void setbuf(FILE *, char *); int setvbuf(FILE *, char *, int, size_t); int fprintf(FILE *, const char *, ...); int fscanf(FILE *, const char *, ...); int printf(const char *, ...); int scanf(const char *, ...); int sprintf(char *, const char *, ...); int sscanf(const char *, const char *, ...); int vfprintf(FILE *, const char *, void *); int vprintf(const char *, void *); int vsprintf(char *, const char *, void *); int _vscanf(const char *, void *); int _vsscanf(const char *, const char *, void *); int _vfscanf(FILE *, const char *, void *); int fgetc(FILE *); char *fgets(char *, int, FILE *); int fputc(int, FILE *); int fputs(const char *, FILE *); int getc(FILE *); int getchar(void); char *gets(char *); int putc(int, FILE *); int putchar(int); int puts(const char *); int ungetc(int, FILE *); size_t fread(void *, size_t, size_t, FILE *); size_t fwrite(const void *, size_t, size_t, FILE *); int fgetpos(FILE *, fpos_t *); int fseek(FILE *, long, int); int fsetpos(FILE *, const fpos_t *); long ftell(FILE *); void rewind(FILE *); void clearerr(FILE *); int feof(FILE *); int ferror(FILE *); void perror(const char *); int __getc(FILE *); int __putc(int, FILE *); #define getc(fp) ((fp)->cnt-- ? (int) *(fp)->ptr++ : __getc(fp)) #define getchar() getc(stdin) #define putc(c, fp) ((fp)->cnt-- > 1 ? (int) (*(fp)->ptr++ = (c)) : __putc(c, fp)) #define putchar(c) putc(c, stdout) #define ferror(fp) ((int) (fp)->err) #define feof(fp) ((int) (fp)->eof) extern long _ftype, _fcreator; #ifdef __cplusplus } #endif