home *** CD-ROM | disk | FTP | other *** search
/ Serving the Web / ServingTheWeb1995.disc1of1.iso / linux / slacksrce / d / libc / libc-4.6 / libc-4 / libc-linux / libio-4.6.26 / stdio / stdio.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-08  |  5.9 KB  |  203 lines

  1. /* This is part of the iostream/stdio library, providing -*- C -*- I/O.
  2.    Define ANSI C stdio on top of C++ iostreams.
  3.    Copyright (C) 1991 Per Bothner.
  4.  
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Library General Public
  7. License as published by the Free Software Foundation; either
  8. version 2 of the License, or (at your option) any later version.
  9.  
  10.  
  11. This library is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14. Library General Public License for more details.
  15.  
  16. You should have received a copy of the GNU Library General Public
  17. License along with this library; if not, write to the Free
  18. Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20.  
  21. /*
  22.  *    ANSI Standard: 4.9 INPUT/OUTPUT <stdio.h>
  23.  */
  24.  
  25. #ifndef _STDIO_H
  26. #define _STDIO_H
  27. #undef _STDIO_USES_IOSTREAM
  28. #define _STDIO_USES_IOSTREAM 1
  29.  
  30. #ifdef __linux__
  31. #include <features.h>
  32. #endif
  33.  
  34. #include <libio.h>
  35.  
  36. #ifndef NULL
  37. #ifdef __cplusplus
  38. #define NULL 0
  39. #else
  40. #define NULL (void*)0
  41. #endif
  42. #endif
  43.  
  44. #ifndef EOF
  45. #define EOF (-1)
  46. #endif
  47. #ifndef BUFSIZ
  48. #define BUFSIZ 1024
  49. #endif
  50.  
  51. #define _IOFBF 0 /* Fully buffered. */
  52. #define _IOLBF 1 /* Line buffered. */
  53. #define _IONBF 2 /* No buffering. */
  54.  
  55. #define SEEK_SET 0
  56. #define SEEK_CUR 1
  57. #define SEEK_END 2
  58.  
  59.  /* define size_t.  Crud in case <sys/types.h> has defined it. */
  60. #if !defined(_SIZE_T) && !defined(_T_SIZE_) && !defined(_T_SIZE)
  61. #if !defined(__SIZE_T) && !defined(_SIZE_T_) && !defined(___int_size_t_h)
  62. #if !defined(_GCC_SIZE_T) && !defined(_SIZET_)
  63. #define _SIZE_T
  64. #define _T_SIZE_
  65. #define _T_SIZE
  66. #define __SIZE_T
  67. #define _SIZE_T_
  68. #define ___int_size_t_h
  69. #define _GCC_SIZE_T
  70. #define _SIZET_
  71. typedef _IO_size_t size_t;
  72. #endif
  73. #endif
  74. #endif
  75.  
  76. typedef struct _IO_FILE FILE;
  77. typedef _IO_fpos_t fpos_t;
  78.  
  79. #define FOPEN_MAX     _G_FOPEN_MAX
  80. #define FILENAME_MAX _G_FILENAME_MAX
  81.  
  82. /* limited by the number of possible unique combinations. see
  83.  * libio/iotempname.c for details. */
  84. #define TMP_MAX 238328
  85.  
  86. #define L_ctermid     9
  87. #define L_cuserid     9
  88. #define P_tmpdir      "/tmp"
  89. #define L_tmpnam      20
  90.  
  91. /* For use by debuggers. These are linked in if printf or fprintf are used. */
  92. extern FILE *stdin, *stdout, *stderr; /* TODO */
  93.  
  94. #define stdin _IO_stdin
  95. #define stdout _IO_stdout
  96. #define stderr _IO_stderr
  97.  
  98. __BEGIN_DECLS
  99.  
  100. extern void clearerr __P((FILE*));
  101. extern int fclose __P((FILE*));
  102. extern int feof __P((FILE*));
  103. extern int ferror __P((FILE*));
  104. extern int fflush __P((FILE*));
  105. extern int fgetc __P((FILE *));
  106. extern int fgetpos __P((FILE* fp, fpos_t *pos));
  107. extern char* fgets __P((char*, int, FILE*));
  108. extern FILE* fopen __P((__const char*, __const char*));
  109. extern int fprintf __P((FILE*, __const char* format, ...));
  110. extern int fputc __P((int, FILE*));
  111. extern int fputs __P((__const char *str, FILE *fp));
  112. extern size_t fread __P((void*, size_t, size_t, FILE*));
  113. extern FILE* freopen __P((__const char*, __const char*, FILE*));
  114. extern int fscanf __P((FILE *fp, __const char* format, ...));
  115. extern int fseek __P((FILE* fp, long int offset, int whence));
  116. extern int fsetpos __P((FILE* fp, __const fpos_t *pos));
  117. extern long int ftell __P((FILE* fp));
  118. extern size_t fwrite __P((__const void*, size_t, size_t, FILE*));
  119. extern int getc __P((FILE *));
  120. extern int getchar __P((void));
  121. extern char* gets __P((char*));
  122. extern void perror __P((__const char *));
  123. extern int printf __P((__const char* format, ...));
  124. extern int putc __P((int, FILE *));
  125. extern int putchar __P((int));
  126. extern int puts __P((__const char *str));
  127. extern int remove __P((__const char*));
  128. extern int rename __P((__const char* _old, __const char* _new));
  129. extern void rewind __P((FILE*));
  130. extern int scanf __P((__const char* format, ...));
  131. extern void setbuf __P((FILE*, char*));
  132. extern void setlinebuf __P((FILE*));
  133. extern void setbuffer __P((FILE*, char*, int));
  134. extern int setvbuf __P((FILE*, char*, int mode, size_t size));
  135. extern int sprintf __P((char*, __const char* format, ...));
  136. extern int sscanf __P((__const char* string, __const char* format, ...));
  137. extern FILE* tmpfile __P((void));
  138. extern char* tmpnam __P((char*));
  139. extern int ungetc __P((int c, FILE* fp));
  140. extern int vfprintf __P((FILE *fp, char __const *fmt0, _G_va_list));
  141. extern int vprintf __P((char __const *fmt, _G_va_list));
  142. extern int vsprintf __P((char* string, __const char* format, _G_va_list));
  143.  
  144. #if !defined(__STRICT_ANSI__)
  145. extern int vfscanf __P((FILE*, __const char *, _G_va_list));
  146. extern int vscanf __P((__const char *, _G_va_list));
  147. extern int vsscanf __P((__const char *, __const char *, _G_va_list));
  148.  
  149. extern int getw __P((FILE*));
  150. extern int putw __P((int, FILE*));
  151.  
  152. extern char* tempnam __P((__const char *__dir, __const char *__pfx));
  153.  
  154.  
  155. #ifdef __GNU_LIBRARY__
  156.  
  157. #ifdef  __USE_BSD
  158. extern int sys_nerr;
  159. extern char *sys_errlist[];
  160. #endif
  161. #ifdef  __USE_GNU
  162. extern int _sys_nerr;
  163. extern char *_sys_errlist[];
  164. #endif
  165.  
  166. #ifdef  __USE_MISC
  167. /* Print a message describing the meaning of the given signal number. */
  168. extern void psignal __P ((int __sig, __const char *__s));
  169. #endif /* Non strict ANSI and not POSIX only.  */
  170.  
  171. #endif /* __GNU_LIBRARY__ */
  172.  
  173. #endif /* __STRICT_ANSI__ */
  174.  
  175. #ifdef __USE_GNU
  176. extern _IO_ssize_t getdelim __P ((char **, size_t *, int, FILE*));
  177. #if 0
  178. extern _IO_ssize_t getline __P ((char **, size_t *, FILE *));
  179. #endif
  180.  
  181. extern int snprintf __P ((char *, size_t, const char *, ...));
  182. extern int vsnprintf __P ((char *, size_t, const char *, _G_va_list));
  183. #endif
  184.  
  185. #if !defined(__STRICT_ANSI__) || defined(_POSIX_SOURCE)
  186. extern FILE *fdopen __P((int, __const char *));
  187. extern int fileno __P((FILE*));
  188. extern FILE* popen __P((__const char*, __const char*));
  189. extern int pclose __P((FILE*));
  190. #endif
  191.  
  192. extern int __underflow __P((struct _IO_FILE*));
  193. extern int __overflow __P((struct _IO_FILE*, int));
  194.  
  195. #define getc(fp) _IO_getc(fp)
  196. #define putc(c, fp) _IO_putc(c, fp)
  197. #define putchar(c) putc(c, stdout)
  198. #define getchar() getc(stdin)
  199.  
  200. __END_DECLS
  201.  
  202. #endif /*!_STDIO_H*/
  203.