2000-04-21 22:33:34 +02:00
|
|
|
#include "libio.h"
|
|
|
|
|
|
|
|
/* These emulate stdio functionality, but with a different name
|
|
|
|
(_IO_ungetc instead of ungetc), and using _IO_FILE instead of FILE. */
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern int _IO_fclose __P((_IO_FILE*));
|
2000-07-02 04:16:35 +02:00
|
|
|
extern int _IO_new_fclose __P((_IO_FILE*));
|
|
|
|
extern int _IO_old_fclose __P((_IO_FILE*));
|
2000-04-21 22:33:34 +02:00
|
|
|
extern _IO_FILE *_IO_fdopen __P((int, const char*));
|
2000-07-02 04:16:35 +02:00
|
|
|
extern _IO_FILE *_IO_old_fdopen __P((int, const char*));
|
|
|
|
extern _IO_FILE *_IO_new_fdopen __P((int, const char*));
|
2000-04-21 22:33:34 +02:00
|
|
|
extern int _IO_fflush __P((_IO_FILE*));
|
|
|
|
extern int _IO_fgetpos __P((_IO_FILE*, _IO_fpos_t*));
|
2000-07-02 04:16:35 +02:00
|
|
|
extern int _IO_fgetpos64 __P((_IO_FILE*, _IO_fpos64_t*));
|
2000-04-21 22:33:34 +02:00
|
|
|
extern char* _IO_fgets __P((char*, int, _IO_FILE*));
|
|
|
|
extern _IO_FILE *_IO_fopen __P((const char*, const char*));
|
2000-07-02 04:16:35 +02:00
|
|
|
extern _IO_FILE *_IO_old_fopen __P((const char*, const char*));
|
|
|
|
extern _IO_FILE *_IO_new_fopen __P((const char*, const char*));
|
|
|
|
extern _IO_FILE *_IO_fopen64 __P((const char*, const char*));
|
2000-04-21 22:33:34 +02:00
|
|
|
extern int _IO_fprintf __P((_IO_FILE*, const char*, ...));
|
|
|
|
extern int _IO_fputs __P((const char*, _IO_FILE*));
|
|
|
|
extern int _IO_fsetpos __P((_IO_FILE*, const _IO_fpos_t *));
|
2000-07-02 04:16:35 +02:00
|
|
|
extern int _IO_fsetpos64 __P((_IO_FILE*, const _IO_fpos64_t *));
|
2000-04-21 22:33:34 +02:00
|
|
|
extern long int _IO_ftell __P((_IO_FILE*));
|
|
|
|
extern _IO_size_t _IO_fread __P((void*, _IO_size_t, _IO_size_t, _IO_FILE*));
|
|
|
|
extern _IO_size_t _IO_fwrite __P((const void*,
|
|
|
|
_IO_size_t, _IO_size_t, _IO_FILE*));
|
|
|
|
extern char* _IO_gets __P((char*));
|
|
|
|
extern void _IO_perror __P((const char*));
|
|
|
|
extern int _IO_printf __P((const char*, ...));
|
|
|
|
extern int _IO_puts __P((const char*));
|
|
|
|
extern int _IO_scanf __P((const char*, ...));
|
|
|
|
extern void _IO_setbuffer __P((_IO_FILE *, char*, _IO_size_t));
|
|
|
|
extern int _IO_setvbuf __P((_IO_FILE*, char*, int, _IO_size_t));
|
|
|
|
extern int _IO_sscanf __P((const char*, const char*, ...));
|
|
|
|
extern int _IO_sprintf __P((char *, const char*, ...));
|
|
|
|
extern int _IO_ungetc __P((int, _IO_FILE*));
|
|
|
|
extern int _IO_vsscanf __P((const char *, const char *, _IO_va_list));
|
|
|
|
extern int _IO_vsprintf __P((char*, const char*, _IO_va_list));
|
2000-07-02 04:16:35 +02:00
|
|
|
extern int _IO_vswprintf __P((wchar_t*, _IO_size_t, const wchar_t*,
|
|
|
|
_IO_va_list));
|
2000-04-21 22:33:34 +02:00
|
|
|
|
|
|
|
struct obstack;
|
|
|
|
extern int _IO_obstack_vprintf __P ((struct obstack *, const char *,
|
2000-07-02 04:16:35 +02:00
|
|
|
_IO_va_list));
|
2000-04-21 22:33:34 +02:00
|
|
|
extern int _IO_obstack_printf __P ((struct obstack *, const char *, ...));
|
|
|
|
#ifndef _IO_pos_BAD
|
2000-07-02 04:16:35 +02:00
|
|
|
#define _IO_pos_BAD ((_IO_off64_t)(-1))
|
2000-04-21 22:33:34 +02:00
|
|
|
#endif
|
|
|
|
#define _IO_clearerr(FP) ((FP)->_flags &= ~(_IO_ERR_SEEN|_IO_EOF_SEEN))
|
|
|
|
#define _IO_fseek(__fp, __offset, __whence) \
|
|
|
|
(_IO_seekoff(__fp, __offset, __whence, _IOS_INPUT|_IOS_OUTPUT) == _IO_pos_BAD ? EOF : 0)
|
|
|
|
#define _IO_rewind(FILE) (void)_IO_seekoff(FILE, 0, 0, _IOS_INPUT|_IOS_OUTPUT)
|
|
|
|
#define _IO_vprintf(FORMAT, ARGS) _IO_vfprintf(_IO_stdout, FORMAT, ARGS)
|
|
|
|
#define _IO_freopen(FILENAME, MODE, FP) \
|
|
|
|
(_IO_file_close_it(FP), _IO_file_fopen(FP, FILENAME, MODE, 0))
|
2000-07-02 04:16:35 +02:00
|
|
|
#define _IO_old_freopen(FILENAME, MODE, FP) \
|
|
|
|
(_IO_old_file_close_it (FP), _IO_old_file_fopen(FP, FILENAME, MODE))
|
|
|
|
#define _IO_freopen64(FILENAME, MODE, FP) \
|
|
|
|
(_IO_file_close_it(FP), _IO_file_fopen(FP, FILENAME, MODE, 1))
|
2000-04-21 22:33:34 +02:00
|
|
|
#define _IO_fileno(FP) ((FP)->_fileno)
|
|
|
|
extern _IO_FILE* _IO_popen __P((const char*, const char*));
|
2000-07-02 04:16:35 +02:00
|
|
|
extern _IO_FILE* _IO_new_popen __P((const char*, const char*));
|
|
|
|
extern _IO_FILE* _IO_old_popen __P((const char*, const char*));
|
|
|
|
extern int __new_pclose __P((_IO_FILE *));
|
|
|
|
extern int __old_pclose __P((_IO_FILE *));
|
2000-04-21 22:33:34 +02:00
|
|
|
#define _IO_pclose _IO_fclose
|
|
|
|
#define _IO_setbuf(_FP, _BUF) _IO_setbuffer(_FP, _BUF, _IO_BUFSIZ)
|
|
|
|
#define _IO_setlinebuf(_FP) _IO_setvbuf(_FP, NULL, 1, 0)
|
|
|
|
|
2000-07-02 04:16:35 +02:00
|
|
|
_IO_FILE *__new_freopen __P ((const char *, const char *, _IO_FILE *));
|
|
|
|
_IO_FILE *__old_freopen __P ((const char *, const char *, _IO_FILE *));
|
|
|
|
|
2000-04-21 22:33:34 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
[multiple changes]
2000-10-02 Steven King <sxking@uswest.net>
* mkcshadow: Fixed script to output proper include guard.
* bits/char_traits.h: Cleaned up types in char_traits<char> functions.
* libio/_G_config.h: Hacked to make work with shadow heraders.
* shadow/*: Hacked to make shadow headers work.
2000-10-02 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
Self-compile with shadow headers.
* acconfig.h (_GLIBCPP_USE_SHADOW_HEADERS): Define. Eventually,
like _GLIBCPP_USE_NAMESPACES before it, this macro will die when
it becomes the default way the library is built.
* acinclude.m4 (GLIBCPP_ENABLE_SHADOW): New macro.
* config/gnu-linux/bits/ctype_base.h (ctype_base): Use it.
* config/gnu-linux/ctype.cc (ctype): Use it.
* src/localename.cc (locale::_Impl::_M_replace_categories): Remove
call to assert.
* src/locale.cc: Explicitly cast mbstate_t to void* in calls to
memset. This should not be necessary, but an ambiguous overload
with it in.
* shadow/bits/std_cwchar.h: Fix.
* shadow/wchar.h: Fix.
* config/gnu-linux/bits/ctype_base.h (ctype_base): Inject ctype
enums into namespace std:: for ctype_base enum. Other OS types
will have to do this as well.
* config/gnu-linux/ctype.cc (ctype): Inject ctype data into
namespace std, in particular __ctype_toupper, __ctype_tolower,
__ctype_b.
* shadow/iolibio.h: New file.
* shadow/bits/wrap_iolibio.h: New file.
* shadow/libioP.h: New file.
* shadow/bits/wrap_libioP.h: New file.
* shadow/bits/wrap_fcntl.h: New file.
* shadow/fcntl.h: New file.
* shadow/iconv.h: New file. Inject iconv names into the global
namespace, unmangled for the moment.
* shadow/bits/wrap_iconv.h: New file.
* shadow/unistd.h: Remove. Useless.
* shadow/bits/wrap_unistd.h: Remove.
* src/Makefile.am: Take out machine-ansi.h, add fcntl.h unistd.h.
* src/Makefile.in: Regenerate.
* config/c_io_libio.h (_IO_codecvt): Change to normal C++ decl.
* shadow/libio.h: Fix.
* shadow/bits/wrap_libio.h: Fix.
* shadow/bits/std_clocale.h: Remove typedef struct construct,
which will not compile.
* shadow/bits/std_ctime.h: Same.
* shadow/pthread.h: New file. Put pthreads types and functions
into global scope, which is probably not the correct long-term
solution but has to be done at the moment before libio wrappers
can even be started.
* shadow/bits/wrap_pthread.h: New file.
* bits/std_ios.h: Formatting tweak.
* shadow/bits/std_cstdio.h: Format. Remove extraneous bits.
* acinclude.m4 (GLIBCPP_CHECK_COMPILER_FEATURES): Add -Werror to
tests for compiler features.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* config/c_io_libio.cc: Remove fcntl.h include, as SEEK_SET
redefined.
* libio/libioP.h: Comment out fcntl.h include.
* shadow/math.h: Add in float and long declarations, as per ISO C9X.
* bits/c++config: Define _ISOC99_SOURCE.
* acinclude.m4 (GLIBCPP_ENABLE_SHADOW): Add -fno-builtins to
CSHADOWFLAGS, as well as _ISOC99_SOURCE.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* src/Makefile.am (CSHADOW_INCLUDES): Enable, again.
(CSHADOW_INCLUDES): Add -I$(top_srcdir)/std before shadow include dir.
(CXXCOMPILE): Remove $(DEFS), which searches $(top_srcdir) before
std or shadow directories.
(LTCXXCOMPILE): Same.
(INCLUDES): Add $(top_builddir) before $(top_srcdir).
(AC_CXXFLAGS): Add CSHADOWFLAGS.
* src/Makefile.in: Regenerate.
* src/complex.cc (FCT): Change ::name to name.
* src/complexl.cc (FCT): Same. Use _GLIBCPP_USE_LONG_LONG here.
* src/complexf.cc (FCT): Same.
* src/complexf.cc: Remove FCT define, as things are properly
overloaded in the std namespace with the shadow headers.
* src/complexl.cc: Same.
* src/complex.cc: Same.
From-SVN: r36707
2000-10-04 07:06:32 +02:00
|
|
|
|
|
|
|
|