|
|
1.1 root 1: /* (-lgl
2: * COHERENT Version 3.2
3: * Copyright (c) 1982, 1991 by Mark Williams Company.
4: * All rights reserved. May not be copied without permission.
5: -lgl) */
6: /*
7: * stdio.h
8: * COHERENT Standard I/O library.
9: */
10:
11: #ifndef STDIO_H
12: #define STDIO_H
13:
14: /* The FILE structure. */
15: typedef struct FILE {
16: unsigned char *_cp, /* current character ptr */
17: *_dp, /* ptr to start of data in buffer */
18: *_bp; /* buffer pointer */
19: int _cc; /* character count */
20: int (*_gt)(), /* getc function */
21: (*_pt)(); /* putc function */
22: char _ff; /* flags; see below */
23: char _fd; /* file descriptor (reqd by reopen) */
24: int _uc; /* ungot char */
25: } FILE;
26:
27: /* Manifest constants. */
28: #define _NFILE 60
29: #define BUFSIZ (1<<9)
30: #define EOF (-1)
31: #ifndef NULL
32: #define NULL ((char *)0)
33: #endif
34:
35: /* Definitions for System V-style tmpnam() and tempnam(). */
36: #define L_tmpnam 64 /* Maximum length of temp file name */
37: #define P_tmpdir "/tmp" /* Default temporary directory */
38:
39: /* Origin arguments for fseek() and lseek(). */
40: #define SEEK_SET 0 /* from beginning */
41: #define SEEK_CUR 1 /* from current position */
42: #define SEEK_END 2 /* from end */
43:
44: /* Standard FILEs. */
45: extern FILE _stdin, _stdout, _stderr, *_fp[_NFILE];
46: #define stdin (&_stdin)
47: #define stdout (&_stdout)
48: #define stderr (&_stderr)
49:
50: /* Flags in _ff. */
51: #define _FINUSE 0x01
52: #define _FSTBUF 0x02 /* setbuf was called */
53: #define _FUNGOT 0x04 /* ungotten char present */
54: #define _FEOF 0x40
55: #define _FERR 0x80
56:
57: /* Functions. */
58: FILE *_stropen();
59: FILE *fdopen();
60: char *fgets();
61: FILE *fopen();
62: FILE *freopen();
63: long ftell();
64: char *gets();
65: char *malloc();
66: FILE *popen();
67: char *sbrk();
68: void setbuf();
69:
70: /* Macros. */
71: #define _ep(fp) ((fp)->_bp+BUFSIZ)
72: #define clearerr(fp) ((fp)->_ff &= ~(_FERR|_FEOF))
73: #define feof(fp) ((fp)->_ff&_FEOF)
74: #define ferror(fp) ((fp)->_ff&_FERR)
75: #define fileno(fp) ((fp)->_fd)
76: #define getc(fp) (++(fp)->_cc>0 ? --(fp)->_cc,(*(fp)->_gt)((fp)) \
77: : *(fp)->_cp++)
78: #define getchar() getc(stdin)
79: #define putc(c,fp) (--(fp)->_cc<0 ? ++(fp)->_cc,(*(fp)->_pt)((c),(fp)) \
80: : (*(fp)->_cp++=(c)))
81: #define putchar(c) putc(c, stdout)
82: #define wdleng() (16)
83:
84: #endif
85:
86: /* end of stdio.h */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.