4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 1998 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef __include_stdio_h
28 #define __include_stdio_h
30 #pragma ident "%Z%%M% %I% %E% SMI"
34 extern struct _iobuf
{
40 char _file
; /* should be short */
54 #define FILE struct _iobuf
57 #define stdin (&_iob[0])
58 #define stdout (&_iob[1])
59 #define stderr (&_iob[2])
61 #if defined(__lint) /* so that lint likes (void)putc(a,b) */
62 extern int putc(int, FILE *);
63 extern int getc(FILE *);
65 #define getc(p) (--(p)->_cnt>=0? ((int)*(p)->_ptr++):_filbuf(p))
66 #define putc(x, p) (--(p)->_cnt >= 0 ?\
67 (int)(*(p)->_ptr++ = (unsigned char)(x)) :\
68 (((p)->_flag & _IOLBF) && -(p)->_cnt < (p)->_bufsiz ?\
69 ((*(p)->_ptr = (unsigned char)(x)) != '\n' ?\
70 (int)(*(p)->_ptr++) :\
71 _flsbuf(*(unsigned char *)(p)->_ptr, p)) :\
72 _flsbuf((unsigned char)(x), p)))
75 #define getchar() getc(stdin)
76 #define putchar(x) putc((x),stdout)
77 #define feof(p) (((p)->_flag&_IOEOF)!=0)
78 #define ferror(p) (((p)->_flag&_IOERR)!=0)
79 #define clearerr(p) (void) ((p)->_flag &= ~(_IOERR|_IOEOF))
81 extern FILE *fopen(char *, char *);
82 extern FILE *fdopen(int, char *);
83 extern FILE *freopen(char *, char *, FILE *);
84 extern FILE *popen(char *, char *);
85 extern FILE *tmpfile(void);
86 extern long ftell(FILE *);
87 extern char *fgets(char *, int, FILE *);
88 extern char *gets(char *);
89 extern char *sprintf(char *, char *, ...);
90 extern char *ctermid(char *);
91 extern char *cuserid(char *);
92 extern char *tempnam(char *, char *);
93 extern char *tmpnam(char *);
94 extern int fileno(FILE *);
98 #define P_tmpdir "/usr/tmp/"
99 #define L_tmpnam 25 /* (sizeof(P_tmpdir) + 15) */
101 #endif /* !__include_stdio_h */