xref: /openbsd-src/gnu/lib/libstdc++/libstdc++/libio/iolibio.h (revision 19731d4f8b8a37c0f0786969cd7fb2f87d5c0b74)
1*19731d4fSespie /* Copyright (C) 1999, 2000, 2004 Free Software Foundation, Inc.
2*19731d4fSespie    This file is part of the GNU IO Library.
3*19731d4fSespie 
4*19731d4fSespie    This library is free software; you can redistribute it and/or
5*19731d4fSespie    modify it under the terms of the GNU General Public License as
6*19731d4fSespie    published by the Free Software Foundation; either version 2, or (at
7*19731d4fSespie    your option) any later version.
8*19731d4fSespie 
9*19731d4fSespie    This library is distributed in the hope that it will be useful, but
10*19731d4fSespie    WITHOUT ANY WARRANTY; without even the implied warranty of
11*19731d4fSespie    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12*19731d4fSespie    General Public License for more details.
13*19731d4fSespie 
14*19731d4fSespie    You should have received a copy of the GNU General Public License
15*19731d4fSespie    along with this library; see the file COPYING.  If not, write to
16*19731d4fSespie    the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
17*19731d4fSespie    MA 02111-1307, USA.
18*19731d4fSespie 
19*19731d4fSespie    As a special exception, if you link this library with files
20*19731d4fSespie    compiled with a GNU compiler to produce an executable, this does
21*19731d4fSespie    not cause the resulting executable to be covered by the GNU General
22*19731d4fSespie    Public License.  This exception does not however invalidate any
23*19731d4fSespie    other reasons why the executable file might be covered by the GNU
24*19731d4fSespie    General Public License.  */
25*19731d4fSespie 
2603a78d15Sespie #include "libio.h"
2703a78d15Sespie 
2803a78d15Sespie /* These emulate stdio functionality, but with a different name
2903a78d15Sespie    (_IO_ungetc instead of ungetc), and using _IO_FILE instead of FILE. */
3003a78d15Sespie 
3103a78d15Sespie #ifdef __cplusplus
3203a78d15Sespie extern "C" {
3303a78d15Sespie #endif
3403a78d15Sespie 
3503a78d15Sespie extern int _IO_fclose __P((_IO_FILE*));
3603a78d15Sespie extern int _IO_new_fclose __P((_IO_FILE*));
3703a78d15Sespie extern int _IO_old_fclose __P((_IO_FILE*));
3803a78d15Sespie extern _IO_FILE *_IO_fdopen __P((int, const char*));
3903a78d15Sespie extern _IO_FILE *_IO_old_fdopen __P((int, const char*));
4003a78d15Sespie extern _IO_FILE *_IO_new_fdopen __P((int, const char*));
4103a78d15Sespie extern int _IO_fflush __P((_IO_FILE*));
4203a78d15Sespie extern int _IO_fgetpos __P((_IO_FILE*, _IO_fpos_t*));
4303a78d15Sespie extern int _IO_fgetpos64 __P((_IO_FILE*, _IO_fpos64_t*));
4403a78d15Sespie extern char* _IO_fgets __P((char*, int, _IO_FILE*));
4503a78d15Sespie extern _IO_FILE *_IO_fopen __P((const char*, const char*));
4603a78d15Sespie extern _IO_FILE *_IO_old_fopen __P((const char*, const char*));
4703a78d15Sespie extern _IO_FILE *_IO_new_fopen __P((const char*, const char*));
4803a78d15Sespie extern _IO_FILE *_IO_fopen64 __P((const char*, const char*));
4903a78d15Sespie extern int _IO_fprintf __P((_IO_FILE*, const char*, ...));
5003a78d15Sespie extern int _IO_fputs __P((const char*, _IO_FILE*));
5103a78d15Sespie extern int _IO_fsetpos __P((_IO_FILE*, const _IO_fpos_t *));
5203a78d15Sespie extern int _IO_fsetpos64 __P((_IO_FILE*, const _IO_fpos64_t *));
5303a78d15Sespie extern long int _IO_ftell __P((_IO_FILE*));
5403a78d15Sespie extern _IO_size_t _IO_fread __P((void*, _IO_size_t, _IO_size_t, _IO_FILE*));
5503a78d15Sespie extern _IO_size_t _IO_fwrite __P((const void*,
5603a78d15Sespie 				      _IO_size_t, _IO_size_t, _IO_FILE*));
5703a78d15Sespie extern char* _IO_gets __P((char*));
5803a78d15Sespie extern void _IO_perror __P((const char*));
5903a78d15Sespie extern int _IO_printf __P((const char*, ...));
6003a78d15Sespie extern int _IO_puts __P((const char*));
6103a78d15Sespie extern int _IO_scanf __P((const char*, ...));
6203a78d15Sespie extern void _IO_setbuffer __P((_IO_FILE *, char*, _IO_size_t));
6303a78d15Sespie extern int _IO_setvbuf __P((_IO_FILE*, char*, int, _IO_size_t));
6403a78d15Sespie extern int _IO_sscanf __P((const char*, const char*, ...));
6503a78d15Sespie extern int _IO_sprintf __P((char *, const char*, ...));
6603a78d15Sespie extern int _IO_ungetc __P((int, _IO_FILE*));
6703a78d15Sespie extern int _IO_vsscanf __P((const char *, const char *, _IO_va_list));
6803a78d15Sespie extern int _IO_vsprintf __P((char*, const char*, _IO_va_list));
6903a78d15Sespie extern int _IO_vswprintf __P((wchar_t*, _IO_size_t, const wchar_t*,
7003a78d15Sespie 			      _IO_va_list));
7103a78d15Sespie 
7203a78d15Sespie struct obstack;
7303a78d15Sespie extern int _IO_obstack_vprintf __P ((struct obstack *, const char *,
7403a78d15Sespie 				     _IO_va_list));
7503a78d15Sespie extern int _IO_obstack_printf __P ((struct obstack *, const char *, ...));
7603a78d15Sespie #ifndef _IO_pos_BAD
7703a78d15Sespie #define _IO_pos_BAD ((_IO_off64_t)(-1))
7803a78d15Sespie #endif
7903a78d15Sespie #define _IO_clearerr(FP) ((FP)->_flags &= ~(_IO_ERR_SEEN|_IO_EOF_SEEN))
8003a78d15Sespie #define _IO_fseek(__fp, __offset, __whence) \
8103a78d15Sespie   (_IO_seekoff(__fp, __offset, __whence, _IOS_INPUT|_IOS_OUTPUT) == _IO_pos_BAD ? EOF : 0)
8203a78d15Sespie #define _IO_rewind(FILE) (void)_IO_seekoff(FILE, 0, 0, _IOS_INPUT|_IOS_OUTPUT)
8303a78d15Sespie #define _IO_vprintf(FORMAT, ARGS) _IO_vfprintf(_IO_stdout, FORMAT, ARGS)
8403a78d15Sespie #define _IO_freopen(FILENAME, MODE, FP) \
8503a78d15Sespie   (_IO_file_close_it(FP), _IO_file_fopen(FP, FILENAME, MODE, 0))
8603a78d15Sespie #define _IO_old_freopen(FILENAME, MODE, FP) \
8703a78d15Sespie   (_IO_old_file_close_it (FP), _IO_old_file_fopen(FP, FILENAME, MODE))
8803a78d15Sespie #define _IO_freopen64(FILENAME, MODE, FP) \
8903a78d15Sespie   (_IO_file_close_it(FP), _IO_file_fopen(FP, FILENAME, MODE, 1))
9003a78d15Sespie #define _IO_fileno(FP) ((FP)->_fileno)
9103a78d15Sespie extern _IO_FILE* _IO_popen __P((const char*, const char*));
9203a78d15Sespie extern _IO_FILE* _IO_new_popen __P((const char*, const char*));
9303a78d15Sespie extern _IO_FILE* _IO_old_popen __P((const char*, const char*));
9403a78d15Sespie extern int __new_pclose __P((_IO_FILE *));
9503a78d15Sespie extern int __old_pclose __P((_IO_FILE *));
9603a78d15Sespie #define _IO_pclose _IO_fclose
9703a78d15Sespie #define _IO_setbuf(_FP, _BUF) _IO_setbuffer(_FP, _BUF, _IO_BUFSIZ)
9803a78d15Sespie #define _IO_setlinebuf(_FP) _IO_setvbuf(_FP, NULL, 1, 0)
9903a78d15Sespie 
10003a78d15Sespie _IO_FILE *__new_freopen __P ((const char *, const char *, _IO_FILE *));
10103a78d15Sespie _IO_FILE *__old_freopen __P ((const char *, const char *, _IO_FILE *));
10203a78d15Sespie 
10303a78d15Sespie #ifdef __cplusplus
10403a78d15Sespie }
10503a78d15Sespie #endif
10603a78d15Sespie 
10703a78d15Sespie 
108