DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T s

⟦45bf29d98⟧ TextFile

    Length: 6811 (0x1a9b)
    Types: TextFile
    Names: »stdio.h«

Derivation

└─⟦a05ed705a⟧ Bits:30007078 DKUUG GNU 2/12/89
    └─⟦cc8755de2⟧ »./libg++-1.36.1.tar.Z« 
        └─⟦23757c458⟧ 
            └─⟦this⟧ »libg++/g++-include/stdio.h« 

TextFile

// This may look like C code, but it is really -*- C++ -*-
/* 
Copyright (C) 1988 Free Software Foundation
    written by Doug Lea (dl@rocky.oswego.edu)

This file is part of GNU CC.

GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.  No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing.  Refer to the GNU CC General Public
License for full details.

Everyone is granted permission to copy, modify and redistribute
GNU CC, but only under the conditions described in the
GNU CC General Public License.   A copy of this license is
supposed to have been given to you along with GNU CC so you
can know your rights and responsibilities.  It should be in a
file named COPYING.  Among other things, the copyright notice
and this notice must be preserved on all copies.  
*/

/*
 *  Please check the following before installing this file:
 *
 *  Make sure USG is #defined if you are on a USG system!
 *
 *  Check the value of _NFILE against the one in your /usr/include/stdio.h.
 *  (USG only)
 *
 *  Check whether your libc.a sprintf function returns
 *  an int (as do most) versus a char* (BSD), and (un)comment
 *  the corresponding SPRINTF_RETURNS_INT line.
 *
 *  Check the value of BUFSIZ against the one in your /usr/include/stdio.h.
 *
 *  Carefully check the fields and order of _iobuf declaration against
 *  the one in your /usr/include/stdio.h. Xenix-based systems
 *  may need some re-ordering of _iobuf. fields.
 *
 *  Note that some _IOXXX #defines may not be present in your 
 *  /usr/include/stdio.h. This is ok, so long as the ones that
 *  are present in both are set to the same values.
 *
 *  Some of the prototypes refer to functions that may not be
 *  present in your libc.a. This is ok so long as you do not
 *  actually call such functions.
 *
 */

#ifndef FILE
#pragma once


/*
   HAVE_VPRINTF should be set if vprintf is in libc.a
   HAVE_SETVBUF should be set if setvbuf is in libc.a
   HAVE_SETLINEBUF should be set if setlinebuf in libc.a

   The following are probably correct for the listed systems

*/

#ifdef SYSTEM_FIVE
#define USG
#endif

#if defined(USG)
#define  HAVE_VPRINTF
#define  HAVE_SETVBUF  
//#define  HAVE_SETLINEBUF

#elif defined(vax) || defined(sony)
//#define HAVE_VPRINTF
//#define  HAVE_SETVBUF  
#define HAVE_SETLINEBUF

#elif defined(sun)
#define  HAVE_VPRINTF
#define  HAVE_SETVBUF  
#define  HAVE_SETLINEBUF

#elif defined(sequent)
//#define  HAVE_VPRINTF
//#define  HAVE_SETVBUF  
#define  HAVE_SETLINEBUF

#elif defined(DGUX)
#define HAVE_VPRINTF
#define HAVE_SETVBUF
#define HAVE_SETLINEBUF
#define USG

#elif defined(TEKTRONIX_SYSV) || defined(hp9000s300) || defined(i386)
#define  HAVE_VPRINTF
#define  HAVE_SETVBUF  
// #define  HAVE_SETLINEBUF
#define  USG

#elif defined(convex)
//#define HAVE_VPRINTF
//#define HAVE_SETVBUF
#define HAVE_SETLINEBUF
#define HAVE_UNSIGNED_FILENO
#define HAVE_VOID_DOPRNT

#endif


#ifdef USG
#define _NFILE 20
#define _bufend(p) _bufendtab[(p)->_file]
#define _bufsiz(p) (_bufend(p) - (p)->_base)
extern "C" {
char *_bufendtab[];
}
#else
#define HAVE_BUFSIZ 
#endif

/* check this -- hardly any systems need this these days */
//#define SPRINTF_RETURNS_INT

/* check and possibly redefine the following */
#define BUFSIZ  1024            

extern  struct  _iobuf {
    int      _cnt;
    char*    _ptr;
    char*    _base;
#   ifdef HAVE_BUFSIZ
    int     _bufsiz;
    short   _flag;
#   else
#    ifndef hpux
    char    _flag;
#    else
    short   _flag;
#    endif
#   endif
#ifndef HAVE_UNSIGNED_FILENO
    char    _file;
#else
    unsigned char _file;
#endif
#ifdef DGUX
    int     _reserve[27];
#endif
} _iob[];

#define FILE     struct _iobuf

#define _IOFBF    00000
#define _IOREAD   00001
#define _IOWRT    00002
#define _IONBF    00004
#define _IOMYBUF  00010
#define _IOEOF    00020
#define _IOERR    00040
#if defined(USG) && !defined(hpux)
#define _IOSTRG   00000  /* faked out for USG */
#define _IOLBF    00100
#define _IORW     00200
#define _IOAPPEND 00000 /* faked out for USG */
#elif defined(hpux)
#define _IOSTRG   00000  /* faked out for USG */
#define _IOLBF    00200
#define _IORW     00400
#define _IOAPPEND 00000 /* faked out for USG */
#else
#define _IOSTRG   00100
#define _IOLBF    00200
#define _IORW     00400
#define _IOAPPEND 01000
#endif
#ifdef DGUX
#define _IOPBF    00400
#else
#define _IOPBF    00000
#endif

#define EOF       (-1)

#ifndef NULL
#define NULL      0
#endif

#define stdin     (&_iob[0])
#define stdout    (&_iob[1])
#define stderr    (&_iob[2])

#define getc(p) (--(p)->_cnt>=0?(int)(*(unsigned char*)(p)->_ptr++):_filbuf(p))
#define putc(x,p) (--(p)->_cnt>=0? ((int)((unsigned char)((*(p)->_ptr++=(unsigned)(x))))):_flsbuf((unsigned)(x),p))

#define clearerr(p) ((p)->_flag &= ~(_IOERR|_IOEOF))
#define getchar()   getc(stdin)
#define putchar(x)  putc(x,stdout)
#define feof(p)     (((p)->_flag&_IOEOF)!=0)
#define ferror(p)   (((p)->_flag&_IOERR)!=0)
#define fileno(p)   ((p)->_file)

extern "C" {

int    _doprnt(const char*, void*, FILE*);
int    _doscan(FILE*, const char*, ...);
int    _filbuf(FILE*);
int    _flsbuf(unsigned, FILE*);
int    fclose(FILE*);
FILE*  fdopen(int, const char*);
int    fflush(FILE*);
int    fgetc(FILE*);
char*  fgets(char*, int, FILE *);
FILE*  fopen(const char*, const char*);
int    fprintf(FILE*, const char* ...);
int    fputc(int, FILE*);
int    fputs(const char*, FILE*);
int    fread(void*, int, int, FILE*);
FILE*  freopen(const char*, const char*, FILE*);
int    fscanf(FILE*, const char* ...);
int    fseek(FILE*, long, int);
long   ftell(FILE *);
int    fwrite(const void*, int, int, FILE*);
char*  gets(char*);
int    getw(FILE*);
int    pclose(FILE*);
FILE*  popen(const char*, const char*);
int    printf(const char* ...);
void   puts(const char*);
int    putw(int, FILE*);
int    rewind(FILE*);
int    scanf(const char* ...);
void   setbuf(FILE*, char*);
void   setbuffer(FILE*, char*, int);
void   setlinebuf(FILE*);
void   setvbuf(FILE*, char*, int, int);
int    sscanf(char*, const char* ...);
FILE*  tmpfile();
int    ungetc(int, FILE*);
int    vfprintf(FILE*, const char*, ...);

// Third arg to vprintf must be '...' for some machines, & doesn't
// hurt for others.

int    vprintf(const char*, ... );

#ifdef SPRINTF_RETURNS_INT
int    sprintf(char*, const char* ...);
int    vsprintf(char*, const char*, ...);
#else
char*  sprintf(char*, const char* ...);
char*  vsprintf(char*, const char*, ...);
#endif

}

#ifndef L_ctermid
#define L_ctermid	9 
#endif
#ifndef L_cuserid
#define L_cuserid	9
#endif
#ifndef P_tmpdir
#define	P_tmpdir    "/tmp/"
#endif
#ifndef L_tmpnam
#define	L_tmpnam    (sizeof(P_tmpdir) + 15)
#endif


#endif // FILE