This is p-stdio.h in view mode; [Download] [Up]
/*+++*
* RCS $Id: p-stdio.h,v 1.2 1993/02/02 21:00:42 gerben Exp $
* title: p-stdio.h
* abstract: portable Posix-compliant <stdio.h>.
* author: T.R.Hageman, Groningen, The Netherlands
* created: December 1992
* modified: (see RCS Log at end)
* copyleft:
*
* Copyright (C) 1992 Tom R. Hageman.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* description:
*
* This is a Posix-compatible version of <stdio.h> for both Posix
* and non-Posix systems.
*
* Notes:
* o The presence of a prototype here does not guarantee the existence
* of the corresponding function in the library.
*
* o `fpos_t' is not declared here since it is too system-dependent;
* hence fgetpos() and fsetpos() are not declared either.
*
* o The constants `L_ctermid', `L_cuserid', `L_tmpnam' and TMP_MAX
* are not defined here; thus these can be used as ``feature test''
* macros for the existence of the corresponding functions.
*
* o some implementations do not have `setvbuf'; some others (System V)
* implement it with `buf' and `mode' parameters interchanged.
* Currently there is no workaround to accommodate this.
*
* o some implementations have sprintf return `char *' instead of `int'.
* The macro _P_SPRINTF_RETURN_TYPE can be defined to accommodate this.
*---*/
#ifndef _P_STDIO_H_
#define _P_STDIO_H_ 0x100
#ifndef _PORTDEFS_H_
# include "portdefs.h"
#endif
#include <stdio.h>
/* Constants. */
#ifndef SEEK_SET
# define SEEK_SET 0
# define SEEK_END 1
# define SEEK_CUR 2
#endif
#ifndef FOPEN_MAX
# if _NFILE
# define FOPEN_MAX _NFILE
# else
# if NFILES
# define FOPEN_MAX NFILES
# else /* {{Should we do this?}} */
# define FOPEN_MAX 20
# endif
# endif
#endif
#ifndef FILENAME_MAX
# if PATH_MAX /* (possibly defined in portdefs.h...) */
# define FILENAME_MAX PATH_MAX
# else
# if _MAX_PATH
# define FILENAME_MAX _MAX_PATH
# else /* (be rather generous) */
# define FILENAME_MAX 1024
# endif
# endif
#endif
#if !_ANSI_LIBRARY_
#if !__NO_PROTO__
# if !__NO_TRIV_PROTO__
# ifndef clearerr
extern void clearerr __(( FILE *_(stream) ));
# endif
extern int fclose __(( FILE *_(stream) ));
# ifndef feof
extern int feof __(( FILE *_(stream) ));
# endif
# endif
# if !__STRICT_ANSI__
extern FILE * fdopen __(( int _(fd), const char *_(mode) ));
# endif
# if !__NO_TRIV_PROTO__
# ifndef ferror
extern int ferror __(( FILE *_(stream) ));
# endif
extern int fflush __(( FILE *_(stream) ));
# ifndef fgetc
extern int fgetc __(( FILE *_(stream) ));
# endif
# if 0
extern int fgetpos __(( FILE *_(stream), fpos_t *_(pos) ));
# endif
# endif
extern char * fgets __(( char *_(buffer), int _(n), FILE *_(stream) ));
# if !__NO_TRIV_PROTO__ && !__STRICT_ANSI__
# ifndef fileno
extern int fileno __(( FILE *_(stream) ));
# endif
# endif
extern FILE * fopen __(( const char *_(filename), const char *_(mode) ));
# if !__NO_TRIV_PROTO__
extern int fprintf __(( FILE *_(stream), const char *_(format) ___ ));
# ifndef fputc
extern int fputc __(( int _(c), FILE *_(stream) ));
# endif
extern int fputs __(( const char *_(s), FILE *_(stream) ));
extern size_t fread __(( void_*_(buf), size_t _(size), size_t _(n),
FILE *_(stream) ));
# endif
extern FILE * freopen __(( const char *_(filename), const char *_(mode),
FILE *_(stream) ));
# if !__NO_TRIV_PROTO__
extern int fscanf __(( FILE *_(stream), const char *_(format) ___ ));
extern int fseek __(( FILE *_(stream), long _(offset), int _(whence) ));
# if 0
extern int fsetpos __(( FILE *_(stream), const fpos_t *_(pos) ));
# endif
# endif
extern long ftell __(( FILE *_(stream) ));
# if !__NO_TRIV_PROTO__
extern size_t fwrite __(( const void_*_(buf), size_t _(size), size_t _(n),
FILE *_(stream) ));
# ifndef getc
extern int getc __(( FILE *_(stream) ));
# endif
# ifndef getchar
extern int getchar __(( void ));
# endif
# endif
# ifndef gets
extern char * gets __(( char *_(buf) ));
# endif
# if !__NO_TRIV_PROTO__
extern void perror __(( const char *_(s) ));
extern int printf __(( const char *_(format) ___ ));
# ifndef putc
extern int putc __(( int _(c), FILE *_(stream) ));
# endif
# ifndef putchar
extern int putchar __(( int _(c) ));
# endif
# ifndef puts
extern int puts __(( const char *_(s) ));
# endif
extern int remove __(( const char *_(filename) ));
extern int rename __(( const char *_(oldname), const char *_(newname) ));
# ifndef rewind
extern void rewind __(( FILE *_(stream) ));
# endif
extern int scanf __(( const char *_(format) ___ ));
extern void setbuf __(( FILE *_(stream), char *_(buf) ));
extern int setvbuf __(( FILE *_(stream), char *_(buf), int _(mode),
size_t _(size) ));
# ifdef _P_SPRINTF_RETURN_TYPE
extern _P_SPRINTF_RETURN_TYPE /* kludg-O-rama */
# else
extern int
# endif
sprintf __(( char *_(buf), const char *_(format) ___ ));
extern int sscanf __(( const char *_(s), const char *_(format) ___ ));
# endif
extern FILE * tmpfile __(( void ));
extern char * tmpnam __(( char *_(buf) ));
# if !__NO_TRIV_PROTO__
# ifndef ungetc
extern int ungetc __(( int _(c), FILE *_(stream) ));
# endif
# if !__STRICT_POSIX__
# ifndef va_arg
# include "p-stdarg.h"
# endif
extern int vfprintf __(( FILE *_(stream), const char *_(format), va_list _(ap) ));
extern int vprintf __(( const char *_(format), va_list _(ap) ));
extern int vsprintf __(( char *_(buf), const char *_(format), va_list _(ap) ));
# endif /* !__STRICT_POSIX__ */
# endif
# ifdef _POSIX2_SOURCE
extern FILE * popen __(( const char *_(command), const char *_(mode) ));
# if !__NO_TRIV_PROTO__
extern int pclose __(( FILE *_(stream) ));
# endif
# endif /* _POSIX2_SOURCE */
#endif /* !__NO_PROTO__ */
#endif /* !_ANSI_LIBRARY_ */
#endif /* _P_STDIO_H_ */
/*======================================================================*
* $Log: p-stdio.h,v $
* Revision 1.2 1993/02/02 21:00:42 gerben
* *** empty log message ***
*
* Revision 1.1 1992/12/31 00:55:15 tom
* remove generation of warning for FOPEN_MAX since I found it confusing.
*
* Revision 1.0 1992/12/22 00:16:00 tom
* Initial revision
*
*======================================================================*/
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.