diff options
author | Greg McGary <greg@mcgary.org> | 2000-06-29 07:16:42 +0000 |
---|---|---|
committer | Greg McGary <greg@mcgary.org> | 2000-06-29 07:16:42 +0000 |
commit | 2ca8b1eef9c8b5ee2083bfbd8fd055353ab206ba (patch) | |
tree | 67d524af4cf749ac76e443a42123eaf2d14ca0dd /libio/libioP.h | |
parent | 2e23c3cc3fede8cc080af74f1b4f124b12955138 (diff) | |
download | glibc-2ca8b1eef9c8b5ee2083bfbd8fd055353ab206ba.tar.gz |
2000-06-28 Greg McGary <greg@mcgary.org>
* libio/libio.h (struct _IO_cookie_file): Move struct type defintion out.
(_IO_FILE): Declare chain as (struct _IO_FILE_plus *).
* libio/libioP.h (struct _IO_cookie_file): Move struct type defintion in.
(_IO_JUMPS): Don't cast THIS--expect arg to be a (struct _IO_FILE_plus *).
(_IO_JUMPS_FUNC): Express in terms of _IO_JUMPS, and add cast to
THIS, since _IO_JUMPS no longer does it implicitly.
(_IO_file_init, _IO_old_file_init, _IO_new_file_init): Declare
arg type as (struct _IO_FILE_plus *).
(_IO_str_init_static, _IO_str_init_readonly): Declare 1st
arg as (_IO_strfile *).
* libio/strops.c (_IO_str_init_static, _IO_str_init_readonly):
Declare 1st arg as (_IO_strfile *).
* libio/fileops.c (_IO_new_file_init): Declare
arg type as (struct _IO_FILE_plus *).
* libio/oldfileops.c (_IO_old_file_init): Likewise.
* libio/genops.c (_IO_link_in, _IO_un_link): Likewise.
(_IO_flush_all, _IO_flush_all_linebuffered, _IO_unbuffer_write):
Declare iteration pointer as (struct _IO_FILE_plus *).
(_IO_iter_next, _IO_iter_file): _IO_ITER is now (struct _IO_FILE_plus *).
* libio/stdfiles.c (_IO_list_all): Declare as (struct _IO_FILE_plus *).
* libio/oldstdfiles.c (_IO_list_all): Likewise.
(_IO_check_libio): Set user-visible handles to (struct _IO_FILE_plus *).
* libio/stdio.c (stdin, stdout, stderr): Set user-visible handles
to (struct _IO_FILE_plus *).
* libio/iofdopen.c (_IO_new_fdopen): Pass FILE handle pointer
whose high bound includes vtable to all functions that will use
vtable. For streambufs, pass pointer whose bounds include struct
_IO_strfile.
* libio/wgenops.c (_IO_wdefault_finish): Likewise.
* libio/oldiofdopen.c (_IO_old_fdopen): Likewise.
* libio/iofopen.c (_IO_new_fopen): Likewise.
* libio/oldiofopen.c (_IO_old_fopen): Likewise.
* libio/iofopen64.c (_IO_fopen64): Likewise.
* libio/iopopen.c (_IO_new_popen): Likewise.
* libio/oldiopopen.c (_IO_old_popen): Likewise.
* libio/memstream.c (open_memstream): Likewise.
* libio/iovsscanf.c (_IO_vsscanf): Likewise.
* libio/iovsprintf.c (_IO_vsprintf): Likewise.
* libio/iovdprintf.c (_IO_vdprintf): Likewise.
* libio/iofopncook.c (_IO_cookie_init): Likewise.
* libio/obprintf.c (_IO_obstack_vprintf): Likewise.
* libio/vasprintf.c (_IO_vasprintf): Likewise.
* libio/vsnprintf.c (_IO_vsnprintf): Likewise.
* libio/stdfiles.c (_IO_stdout_, _IO_stderr_): Likewise.
* libio/oldstdfiles.c (_IO_stdout_, _IO_stderr_): Likewise.
* stdlib/strfmon.c (__strfmon_l): Likewise.
* stdio-common/vfprintf.c (buffered_vfprintf): Likewise.
(vfprintf): Qualify computed-goto targets as unbounded.
2000-06-28 Greg McGary <greg@mcgary.org>
* libio/libio.h (struct _IO_cookie_file): Move struct type defintion out.
(_IO_FILE): Declare chain as (struct _IO_FILE_plus *).
* libio/libioP.h (struct _IO_cookie_file): Move struct type defintion in.
(_IO_JUMPS): Don't cast THIS--expect arg to be a (struct _IO_FILE_plus *).
(_IO_JUMPS_FUNC): Express in terms of _IO_JUMPS, and add cast to
THIS, since _IO_JUMPS no longer does it implicitly.
(_IO_file_init, _IO_old_file_init, _IO_new_file_init): Declare
arg type as (struct _IO_FILE_plus *).
(_IO_str_init_static, _IO_str_init_readonly): Declare 1st
arg as (_IO_strfile *).
* libio/strops.c (_IO_str_init_static, _IO_str_init_readonly):
Declare 1st arg as (_IO_strfile *).
* libio/fileops.c (_IO_new_file_init): Declare
arg type as (struct _IO_FILE_plus *).
* libio/oldfileops.c (_IO_old_file_init): Likewise.
* libio/genops.c (_IO_link_in, _IO_un_link): Likewise.
(_IO_flush_all, _IO_flush_all_linebuffered, _IO_unbuffer_write):
Declare iteration pointer as (struct _IO_FILE_plus *).
(_IO_iter_next, _IO_iter_file): _IO_ITER is now (struct _IO_FILE_plus *).
* libio/stdfiles.c (_IO_list_all): Declare as (struct _IO_FILE_plus *).
* libio/oldstdfiles.c (_IO_list_all): Likewise.
(_IO_check_libio): Set user-visible handles to (struct _IO_FILE_plus *).
* libio/stdio.c (stdin, stdout, stderr): Set user-visible handles
to (struct _IO_FILE_plus *).
* libio/iofdopen.c (_IO_new_fdopen): Pass FILE handle pointer
whose high bound includes vtable to all functions that will use
vtable. For streambufs, pass pointer whose bounds include struct
_IO_strfile.
* libio/wgenops.c (_IO_wdefault_finish): Likewise.
* libio/oldiofdopen.c (_IO_old_fdopen): Likewise.
* libio/iofopen.c (_IO_new_fopen): Likewise.
* libio/oldiofopen.c (_IO_old_fopen): Likewise.
* libio/iofopen64.c (_IO_fopen64): Likewise.
* libio/iopopen.c (_IO_new_popen): Likewise.
* libio/oldiopopen.c (_IO_old_popen): Likewise.
* libio/memstream.c (open_memstream): Likewise.
* libio/iovsscanf.c (_IO_vsscanf): Likewise.
* libio/iovsprintf.c (_IO_vsprintf): Likewise.
* libio/iovdprintf.c (_IO_vdprintf): Likewise.
* libio/iofopncook.c (_IO_cookie_init): Likewise.
* libio/obprintf.c (_IO_obstack_vprintf): Likewise.
* libio/vasprintf.c (_IO_vasprintf): Likewise.
* libio/vsnprintf.c (_IO_vsnprintf): Likewise.
* libio/stdfiles.c (_IO_stdout_, _IO_stderr_): Likewise.
* libio/oldstdfiles.c (_IO_stdout_, _IO_stderr_): Likewise.
* stdlib/strfmon.c (__strfmon_l): Likewise.
* stdio-common/vfprintf.c (buffered_vfprintf): Likewise.
(vfprintf): Qualify computed-goto targets as unbounded.
Diffstat (limited to 'libio/libioP.h')
-rw-r--r-- | libio/libioP.h | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/libio/libioP.h b/libio/libioP.h index 090f98a02d..9fb418869c 100644 --- a/libio/libioP.h +++ b/libio/libioP.h @@ -69,16 +69,16 @@ extern "C" { # define _IO_JUMPS_OFFSET 1 #endif -#define _IO_JUMPS(THIS) ((struct _IO_FILE_plus *) (THIS))->vtable +#define _IO_JUMPS(THIS) (THIS)->vtable #define _IO_WIDE_JUMPS(THIS) ((struct _IO_FILE *) (THIS))->_wide_data->_wide_vtable #define _IO_CHECK_WIDE(THIS) (((struct _IO_FILE *) (THIS))->_wide_data != NULL) #if _IO_JUMPS_OFFSET # define _IO_JUMPS_FUNC(THIS) \ - (*(struct _IO_jump_t **) ((void *) &((struct _IO_FILE_plus *) (THIS))->vtable\ + (*(struct _IO_jump_t **) ((void *) &_IO_JUMPS ((struct _IO_FILE_plus *) (THIS)) \ + (THIS)->_vtable_offset)) #else -# define _IO_JUMPS_FUNC(THIS) _IO_JUMPS(THIS) +# define _IO_JUMPS_FUNC(THIS) _IO_JUMPS ((struct _IO_FILE_plus *) (THIS)) #endif #define _IO_WIDE_JUMPS_FUNC(THIS) _IO_WIDE_JUMPS(THIS) #ifdef _G_USING_THUNKS @@ -313,9 +313,17 @@ struct _IO_FILE_plus const struct _IO_jump_t *vtable; }; +/* Special file type for fopencookie function. */ +struct _IO_cookie_file +{ + struct _IO_FILE_plus __fp; + void *__cookie; + _IO_cookie_io_functions_t __io_functions; +}; + /* Iterator type for walking global linked list of _IO_FILE objects. */ -typedef _IO_FILE *_IO_ITER; +typedef struct _IO_FILE_plus *_IO_ITER; /* Generic functions */ @@ -325,8 +333,8 @@ extern int _IO_switch_to_get_mode __P ((_IO_FILE *)); extern void _IO_init __P ((_IO_FILE *, int)); extern int _IO_sputbackc __P ((_IO_FILE *, int)); extern int _IO_sungetc __P ((_IO_FILE *)); -extern void _IO_un_link __P ((_IO_FILE *)); -extern void _IO_link_in __P ((_IO_FILE *)); +extern void _IO_un_link __P ((struct _IO_FILE_plus *)); +extern void _IO_link_in __P ((struct _IO_FILE_plus *)); extern void _IO_doallocbuf __P ((_IO_FILE *)); extern void _IO_unsave_markers __P ((_IO_FILE *)); extern void _IO_setb __P ((_IO_FILE *, char *, char *, int)); @@ -470,7 +478,7 @@ extern int _IO_file_close __P ((_IO_FILE *)); extern int _IO_file_underflow __P ((_IO_FILE *)); extern int _IO_file_overflow __P ((_IO_FILE *, int)); #define _IO_file_is_open(__fp) ((__fp)->_fileno != -1) -extern void _IO_file_init __P ((_IO_FILE *)); +extern void _IO_file_init __P ((struct _IO_FILE_plus *)); extern _IO_FILE* _IO_file_attach __P ((_IO_FILE *, int)); extern _IO_FILE* _IO_file_open __P ((_IO_FILE *, const char *, int, int, int, int)); @@ -491,7 +499,7 @@ extern _IO_FILE* _IO_new_file_fopen __P ((_IO_FILE *, const char *, const char * int)); extern void _IO_no_init __P ((_IO_FILE *, int, int, struct _IO_wide_data *, struct _IO_jump_t *)); -extern void _IO_new_file_init __P ((_IO_FILE *)); +extern void _IO_new_file_init __P ((struct _IO_FILE_plus *)); extern _IO_FILE* _IO_new_file_setbuf __P ((_IO_FILE *, char *, _IO_ssize_t)); extern int _IO_new_file_sync __P ((_IO_FILE *)); extern int _IO_new_file_underflow __P ((_IO_FILE *)); @@ -508,7 +516,7 @@ extern _IO_size_t _IO_old_file_xsputn __P ((_IO_FILE *, const void *, _IO_size_t)); extern int _IO_old_file_underflow __P ((_IO_FILE *)); extern int _IO_old_file_overflow __P ((_IO_FILE *, int)); -extern void _IO_old_file_init __P ((_IO_FILE *)); +extern void _IO_old_file_init __P ((struct _IO_FILE_plus *)); extern _IO_FILE* _IO_old_file_attach __P ((_IO_FILE *, int)); extern _IO_FILE* _IO_old_file_fopen __P ((_IO_FILE *, const char *, const char *)); @@ -543,8 +551,9 @@ extern _IO_off64_t _IO_str_seekoff __P ((_IO_FILE *, _IO_off64_t, int, int)); extern void _IO_str_finish __P ((_IO_FILE *, int)); /* Other strfile functions */ -extern void _IO_str_init_static __P ((_IO_FILE *, char *, int, char *)); -extern void _IO_str_init_readonly __P ((_IO_FILE *, const char *, int)); +struct _IO_strfile_; +extern void _IO_str_init_static __P ((struct _IO_strfile_ *, char *, int, char *)); +extern void _IO_str_init_readonly __P ((struct _IO_strfile_ *, const char *, int)); extern _IO_ssize_t _IO_str_count __P ((_IO_FILE *)); /* And the wide character versions. */ @@ -579,7 +588,7 @@ extern int _IO_outfloat __P ((double __value, _IO_FILE *__sb, int __type, int __width, int __precision, int __flags, int __sign_mode, int __fill)); -extern _IO_FILE *_IO_list_all; +extern struct _IO_FILE_plus *_IO_list_all; extern void (*_IO_cleanup_registration_needed) __PMT ((void)); #ifndef EOF |