home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / GNU_1OF3.ZIP / HEADERS.ZIP / g++-include / stdio.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-22  |  6.0 KB  |  235 lines

  1. // This may look like C code, but it is really -*- C++ -*-
  2. /* 
  3. Copyright (C) 1988 Free Software Foundation
  4.     written by Doug Lea (dl@rocky.oswego.edu)
  5.  
  6. This file is part of the GNU C++ Library.  This library is free
  7. software; you can redistribute it and/or modify it under the terms of
  8. the GNU Library General Public License as published by the Free
  9. Software Foundation; either version 2 of the License, or (at your
  10. option) any later version.  This library is distributed in the hope
  11. that it will be useful, but WITHOUT ANY WARRANTY; without even the
  12. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  13. PURPOSE.  See the GNU Library General Public License for more details.
  14. You should have received a copy of the GNU Library General Public
  15. License along with this library; if not, write to the Free Software
  16. Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  17. */
  18.  
  19. /*
  20.  *  Please check the following before installing this file:
  21.  *
  22.  *  Make sure USG is #defined if you are on a USG system!
  23.  *
  24.  *  Check whether your libc.a sprintf function returns
  25.  *  an int (as do most) versus a char* (BSD), and (un)comment
  26.  *  the corresponding SPRINTF_RETURNS_INT line.
  27.  *
  28.  *  Check the value of BUFSIZ against the one in your /usr/include/stdio.h.
  29.  *
  30.  *  Carefully check the fields and order of _iobuf declaration against
  31.  *  the one in your /usr/include/stdio.h. Xenix-based systems
  32.  *  may need some re-ordering of _iobuf. fields.
  33.  *
  34.  *  Note that some _IOXXX #defines may not be present in your 
  35.  *  /usr/include/stdio.h. This is ok, so long as the ones that
  36.  *  are present in both are set to the same values.
  37.  *
  38.  *  Some of the prototypes refer to functions that may not be
  39.  *  present in your libc.a. This is ok so long as you do not
  40.  *  actually call such functions.
  41.  *
  42.  */
  43.  
  44. #ifndef _stdio_h
  45. #ifdef __GNUC__
  46. #pragma interface
  47. #endif
  48.  
  49. #ifdef __stdio_h_recursive
  50. #include_next <stdio.h>
  51. #else
  52. #define __stdio_h_recursive
  53.  
  54. // Note:  The #define _stdio_h is at the end of this file,
  55. // in case #include_next <stdio.h> finds an installed version of this
  56. // same file -- we want it to continue until it finds the C version.
  57.  
  58. #ifdef SYSTEM_FIVE
  59. //#define USG
  60. #endif
  61.  
  62. #if defined(IBM6000)
  63. #define NO_LIBGXX_MALLOC
  64. #endif    // IBM6000
  65.  
  66. #if defined(USG)
  67.  
  68. #elif defined(VMS)
  69. #define NO_LIBGXX_MALLOC
  70.  
  71. #elif masscomp
  72. #ifdef _ATT
  73. //#define USG
  74. #endif
  75.  
  76. #elif defined(DGUX)
  77. #define SPRINTF_RETURNS_INT
  78. //#define USG
  79.  
  80. #elif defined(TEKTRONIX_SYSV) || defined(hp9000s300) || defined(i386)
  81. //#define  USG
  82. #endif
  83.  
  84. extern "C" {
  85.  
  86. #undef NULL
  87.  
  88. #define fdopen __hide_fdopen
  89. #define fopen __hide_fopen
  90. #define fprintf __hide_fprintf
  91. #define fputs __hide_fputs
  92. #define freopen __hide_freopen
  93. #define fscanf __hide_fscanf
  94. #define fwrite __hide_fwrite
  95. #define new __hide_new /* In case 'new' is used as a parameter name. */
  96. #define perror __hide_perror
  97. #define popen __hide_popen
  98. #define printf __hide_printf
  99. #define puts __hide_puts
  100. #define putw __hide_putw
  101. #define rewind __hide_rewind
  102. #define tempnam __hide_tempnam
  103. #define scanf __hide_scanf
  104. #define setbuf __hide_setbuf
  105. #define setlinebuf __hide_setlinebuf
  106. #define setvbuf __hide_setvbuf
  107. #define sprintf __hide_sprintf
  108. #define sscanf __hide_sscanf
  109. #define tempnam __hide_tempnam
  110. #define vfprintf __hide_vfprintf
  111. #define vprintf __hide_vprintf
  112. #define vsprintf __hide_vsprintf
  113.  
  114. #include_next <stdio.h>
  115.  
  116. #undef fdopen
  117. #undef fopen
  118. #undef fprintf
  119. #undef fputs
  120. #undef freopen
  121. #undef fscanf
  122. #undef fwrite
  123. #undef new
  124. #undef perror
  125. #undef popen
  126. #undef printf
  127. #undef puts
  128. #undef putw
  129. #undef rewind
  130. #undef tempnam
  131. #undef scanf
  132. #undef setbuf
  133. #undef setlinebuf
  134. #undef setvbuf
  135. #undef sprintf
  136. #undef sscanf
  137. #undef tempnam
  138. #undef vprintf
  139. #undef vfprintf
  140. #undef vsprintf
  141.  
  142. #ifndef NULL
  143. #define NULL ((void*)0)
  144. #endif
  145. }
  146.  
  147. #ifndef __SIZE_TYPE__ /* Defined by gcc-2. */
  148. #define __SIZE_TYPE__ long unsigned int
  149. #endif
  150.  
  151. extern "C" {
  152.  
  153. #ifdef VMS
  154. int     c$$doprint(const char*, void*, FILE*);
  155. int     c$$doscan(FILE*, const char*, ...);
  156. int    c$$filbuf(FILE*);
  157. int    c$$flsbuf(unsigned, FILE*);
  158. #elif ! defined(ultrix)
  159. int    _doprnt(const char*, void*, FILE*);
  160. int    _doscan(FILE*, const char*, ...);
  161. int    _filbuf(FILE*);
  162. int    _flsbuf(unsigned, FILE*);
  163. #endif
  164.  
  165. int    fclose(FILE*);
  166. FILE*  fdopen(int, const char*);
  167. int    fflush(FILE*);
  168. int    fgetc(FILE*);
  169. char*  fgets(char*, long unsigned int, FILE *);
  170. FILE*  fopen(const char*, const char*);
  171. int    fprintf(FILE*, const char* ...);
  172. int    fputc(int, FILE*);
  173. int    fputs(const char*, FILE*);
  174. int    fread(void*, __SIZE_TYPE__, __SIZE_TYPE__, FILE*);
  175. #ifdef VMS
  176. FILE*  freopen(const char*, const char*, FILE* ...);
  177. #else
  178. FILE*  freopen(const char*, const char*, FILE*);
  179. #endif
  180. int    fscanf(FILE*, const char* ...);
  181. int    fseek(FILE*, long, int);
  182. long   ftell(const FILE *);
  183. __SIZE_TYPE__ fwrite(const void*, __SIZE_TYPE__, __SIZE_TYPE__, FILE*);
  184. char*  gets(char*);
  185. int    getw(FILE*);
  186. int    pclose(FILE*);
  187. void   perror(const char*);
  188. FILE*  popen(const char*, const char*);
  189. int    printf(const char* ...);
  190. int    puts(const char*);
  191. int    putw(int, FILE*);
  192. int    rewind(FILE*);
  193. int    scanf(const char* ...);
  194. int    setbuf(FILE*, char*);
  195. void   setbuffer(FILE*, char*, int);
  196. int    setlinebuf(FILE*);
  197. int    setvbuf(FILE*, char*, int, __SIZE_TYPE__);
  198. int    sscanf(char*, const char* ...);
  199. FILE*  tmpfile();
  200. int    ungetc(int, FILE*);
  201. int    vfprintf(FILE*, const char*, ...);
  202.  
  203. // Third arg to vprintf must be '...' for some machines, & doesn't
  204. // hurt for others.
  205.  
  206. int    vprintf(const char*, ... );
  207.  
  208. #ifdef SPRINTF_RETURNS_INT
  209. int    sprintf(char*, const char* ...);
  210. int    vsprintf(char*, const char*, ...);
  211. #else
  212. char*  sprintf(char*, const char*, ...);
  213. char*  vsprintf(char*, const char*, ...);
  214. #endif
  215.  
  216. }
  217.  
  218. #ifndef L_ctermid
  219. #define L_ctermid    9 
  220. #endif
  221. #ifndef L_cuserid
  222. #define L_cuserid    9
  223. #endif
  224. #ifndef P_tmpdir
  225. #define    P_tmpdir    "/tmp/"
  226. #endif
  227. #ifndef L_tmpnam
  228. #define    L_tmpnam    (sizeof(P_tmpdir) + 15)
  229. #endif
  230.  
  231. #define _stdio_h 1
  232.  
  233. #endif
  234. #endif // _stdio_h
  235.