stdio.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 1988 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
/* from S5R2 2.7 */
#ifdef comment /* ======================================================= */
/* sccs id stuff */
#ifndef __dir_filename_h
#define __dir_filename_h
/*#include */ /* all includes come first */
#define /* all defines other than function like macros */
/*
* macros that are supplied as C functions have to be defined after
* the C prototype.
*/
#define /* all function like macros */
extern variables
#endif __dir_filename_h
#endif /* comment ======================================================= */
#ifndef __stdio_h
#define __stdio_h
#if pdp11
#define BUFSIZ 512
#define BUFSIZ 4096
#else /* just about every other UNIX system in existence */
#define BUFSIZ 1024
#endif
#ifndef EOF
#define EOF (-1)
#endif
#define L_ctermid 9
#define L_cuserid 9
#define FILENAME_MAX 1025
#define TMP_MAX 17576
/*
* ANSI C requires definitions of SEEK_CUR, SEEK_END, and SEEK_SET here.
*/
#ifndef SEEK_SET
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#endif
#define FOPEN_MAX 16
#ifndef _POSIX_SOURCE
#endif
#ifndef NULL
#define NULL 0
#endif
/*
* _IOLBF means that a file's output will be buffered line by line
* In addition to being flags, _IONBF, _IOLBF and _IOFBF are possible
* values for "type" in setvbuf.
*/
#define _IOFBF 0000
#define _IOREAD 0001
#define _IOWRT 0002
#define _IONBF 0004
#define _IOMYBUF 0010
#define _IOEOF 0020
#define _IOERR 0040
#define _IOSTRG 0100
#define _IOLBF 0200
#define _IORW 0400
/*
* buffer size for multi-character output to unbuffered files
*/
#define _SBFSIZ 8
typedef struct {
unsigned char *_ptr;
int _cnt;
#else /* just about every other UNIX system in existence */
int _cnt;
unsigned char *_ptr;
#endif
unsigned char *_base;
int _bufsiz;
short _flag;
unsigned char _file; /* should be short */
} FILE;
#ifndef _POSIX_SOURCE
extern char *tempnam(/* char *d, char *s */);
#endif
extern void clearerr(/* FILE *stream */);
extern int fclose(/* FILE *f */);
extern int feof(/* FILE *f */);
extern int ferror(/* FILE *f */);
extern int fflush(/* FILE *f */);
extern int fgetc(/* FILE *f */);
extern int fileno(/* FILE *f */);
extern char *fgets(/* char *s, int n, FILE *f */);
extern int fprintf(/* FILE *f, const char *fmt, ... */);
extern int fputc(/* int c, FILE *f */);
extern int fputs(/* const char *s, FILE *f */);
extern int fscanf(/* FILE *f, const char *format, ... */);
extern int fseek(/* FILE *f, long int offset, int whence */);
extern long ftell(/* FILE *f */);
extern int getc(/* FILE *f */);
extern int getchar(/* void */);
extern char *gets(/* char *s */);
extern void perror(/* const char *s */);
extern int printf(/* const char *fmt, ... */);
extern int putc(/* int c, FILE *f */);
extern int putchar(/* int c */);
extern int puts(/* const char *s */);
extern int remove(/* const char *filename */);
extern int rename(/* char *old, char *new */);
extern void rewind(/* FILE *f */);
extern int scanf(/* const char *format, ... */);
extern void setbuf(/* FILE *f, char *b */);
extern int sprintf(/* char *s, const char *fmt, ... */);
extern int sscanf(/* const char *s, const char *format, ... */);
extern char *tmpnam(/* char *s */);
extern int ungetc(/* int c, FILE *f */);
#ifndef lint
(int)(*(p)->_ptr++ = (unsigned char)(x)) :\
((*(p)->_ptr = (unsigned char)(x)) != '\n' ?\
(int)(*(p)->_ptr++) :\
_flsbuf((unsigned char)(x), p)))
#endif
#endif /* !__stdio_h */