Headers and library sources from all versions of Lightspeed C and THINK C
at main 137 lines 2.9 kB view raw
1 2/* 3 * stdio.h 4 * 5 * Copyright (c) 1992 Symantec Corporation. All rights reserved. 6 * 7 */ 8 9#pragma once 10 11#ifdef __cplusplus 12extern "C" { 13#endif 14 15#ifdef __cplusplus 16#define NULL 0 17#else 18#define NULL ((void *) 0) 19#endif 20 21#include "size_t.h" 22typedef unsigned long fpos_t; 23typedef struct __FILE FILE; 24 25struct __FILE { 26 unsigned std : 1; 27 unsigned binary : 1; 28 unsigned eof : 1; 29 unsigned err : 1; 30 unsigned dirty : 1; 31 unsigned mybuf : 1; 32 unsigned append : 1; 33 unsigned remove : 1; 34 unsigned pushed : 1; 35 char one; 36 unsigned char pushc; 37 short refnum; 38 char *buf; 39 size_t size; 40 unsigned char *ptr; 41 size_t cnt; 42 fpos_t pos; 43 fpos_t len; 44 void *window; 45 int (*proc)(FILE *, int); 46}; 47 48#define _IOFBF 0 49#define _IOLBF 1 50#define _IONBF 2 51 52#define BUFSIZ 512 53#define EOF (-1) 54#define FOPEN_MAX 15 55 56#define FILENAME_MAX 256 57#define L_tmpnam 20 58#define TMP_MAX 9999 59 60#define SEEK_SET 0 61#define SEEK_CUR 1 62#define SEEK_END 2 63 64#define stdin (&__file[0]) 65#define stdout (&__file[1]) 66#define stderr (&__file[2]) 67 68extern FILE __file[FOPEN_MAX]; 69 70int remove(const char *); 71int rename(const char *, const char *); 72FILE *tmpfile(void); 73char *tmpnam(char *); 74 75int fclose(FILE *); 76int fflush(FILE *); 77FILE *fopen(const char *, const char *); 78FILE *freopen(const char *, const char *, FILE *); 79void setbuf(FILE *, char *); 80int setvbuf(FILE *, char *, int, size_t); 81 82int fprintf(FILE *, const char *, ...); 83int fscanf(FILE *, const char *, ...); 84int printf(const char *, ...); 85int scanf(const char *, ...); 86int sprintf(char *, const char *, ...); 87int sscanf(const char *, const char *, ...); 88int vfprintf(FILE *, const char *, void *); 89int vprintf(const char *, void *); 90int vsprintf(char *, const char *, void *); 91int _vscanf(const char *, void *); 92int _vsscanf(const char *, const char *, void *); 93int _vfscanf(FILE *, const char *, void *); 94 95int fgetc(FILE *); 96char *fgets(char *, int, FILE *); 97int fputc(int, FILE *); 98int fputs(const char *, FILE *); 99int getc(FILE *); 100int getchar(void); 101char *gets(char *); 102int putc(int, FILE *); 103int putchar(int); 104int puts(const char *); 105int ungetc(int, FILE *); 106 107size_t fread(void *, size_t, size_t, FILE *); 108size_t fwrite(const void *, size_t, size_t, FILE *); 109 110int fgetpos(FILE *, fpos_t *); 111int fseek(FILE *, long, int); 112int fsetpos(FILE *, const fpos_t *); 113long ftell(FILE *); 114void rewind(FILE *); 115 116void clearerr(FILE *); 117int feof(FILE *); 118int ferror(FILE *); 119void perror(const char *); 120 121int __getc(FILE *); 122int __putc(int, FILE *); 123 124#define getc(fp) ((fp)->cnt-- ? (int) *(fp)->ptr++ : __getc(fp)) 125#define getchar() getc(stdin) 126 127#define putc(c, fp) ((fp)->cnt-- > 1 ? (int) (*(fp)->ptr++ = (c)) : __putc(c, fp)) 128#define putchar(c) putc(c, stdout) 129 130#define ferror(fp) ((int) (fp)->err) 131#define feof(fp) ((int) (fp)->eof) 132 133extern long _ftype, _fcreator; 134 135#ifdef __cplusplus 136} 137#endif