summaryrefslogtreecommitdiff
path: root/libio/genops.c
diff options
context:
space:
mode:
authorGreg McGary <greg@mcgary.org>2000-06-29 07:16:42 +0000
committerGreg McGary <greg@mcgary.org>2000-06-29 07:16:42 +0000
commit2ca8b1eef9c8b5ee2083bfbd8fd055353ab206ba (patch)
tree67d524af4cf749ac76e443a42123eaf2d14ca0dd /libio/genops.c
parent2e23c3cc3fede8cc080af74f1b4f124b12955138 (diff)
downloadglibc-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/genops.c')
-rw-r--r--libio/genops.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/libio/genops.c b/libio/genops.c
index bdbde0ce4b..bffc355fa5 100644
--- a/libio/genops.c
+++ b/libio/genops.c
@@ -37,40 +37,40 @@ static _IO_lock_t list_all_lock = _IO_lock_initializer;
void
_IO_un_link (fp)
- _IO_FILE *fp;
+ struct _IO_FILE_plus *fp;
{
- if (fp->_flags & _IO_LINKED)
+ if (fp->file._flags & _IO_LINKED)
{
- _IO_FILE **f;
+ struct _IO_FILE_plus **f;
#ifdef _IO_MTSAFE_IO
_IO_lock_lock (list_all_lock);
#endif
- for (f = &_IO_list_all; *f != NULL; f = &(*f)->_chain)
+ for (f = &_IO_list_all; *f != NULL; f = &(*f)->file._chain)
{
if (*f == fp)
{
- *f = fp->_chain;
+ *f = fp->file._chain;
break;
}
}
#ifdef _IO_MTSAFE_IO
_IO_lock_unlock (list_all_lock);
#endif
- fp->_flags &= ~_IO_LINKED;
+ fp->file._flags &= ~_IO_LINKED;
}
}
void
_IO_link_in (fp)
- _IO_FILE *fp;
+ struct _IO_FILE_plus *fp;
{
- if ((fp->_flags & _IO_LINKED) == 0)
+ if ((fp->file._flags & _IO_LINKED) == 0)
{
- fp->_flags |= _IO_LINKED;
+ fp->file._flags |= _IO_LINKED;
#ifdef _IO_MTSAFE_IO
_IO_lock_lock (list_all_lock);
#endif
- fp->_chain = _IO_list_all;
+ fp->file._chain = _IO_list_all;
_IO_list_all = fp;
#ifdef _IO_MTSAFE_IO
_IO_lock_unlock (list_all_lock);
@@ -627,7 +627,7 @@ _IO_default_finish (fp, dummy)
_IO_lock_fini (*fp->_lock);
#endif
- _IO_un_link (fp);
+ _IO_un_link ((struct _IO_FILE_plus *) fp);
}
_IO_off64_t
@@ -739,13 +739,13 @@ int
_IO_flush_all ()
{
int result = 0;
- _IO_FILE *fp;
- for (fp = _IO_list_all; fp != NULL; fp = fp->_chain)
- if (((fp->_mode < 0 && fp->_IO_write_ptr > fp->_IO_write_base)
- || (fp->_vtable_offset == 0
- && fp->_mode > 0 && (fp->_wide_data->_IO_write_ptr
- > fp->_wide_data->_IO_write_base)))
- && _IO_OVERFLOW (fp, EOF) == EOF)
+ struct _IO_FILE_plus *fp;
+ for (fp = _IO_list_all; fp != NULL; fp = fp->file._chain)
+ if (((fp->file._mode < 0 && fp->file._IO_write_ptr > fp->file._IO_write_base)
+ || (fp->file._vtable_offset == 0
+ && fp->file._mode > 0 && (fp->file._wide_data->_IO_write_ptr
+ > fp->file._wide_data->_IO_write_base)))
+ && _IO_OVERFLOW (&fp->file, EOF) == EOF)
result = EOF;
return result;
}
@@ -753,10 +753,10 @@ _IO_flush_all ()
void
_IO_flush_all_linebuffered ()
{
- _IO_FILE *fp;
- for (fp = _IO_list_all; fp != NULL; fp = fp->_chain)
- if ((fp->_flags & _IO_NO_WRITES) == 0 && fp->_flags & _IO_LINE_BUF)
- _IO_OVERFLOW (fp, EOF);
+ struct _IO_FILE_plus *fp;
+ for (fp = _IO_list_all; fp != NULL; fp = fp->file._chain)
+ if ((fp->file._flags & _IO_NO_WRITES) == 0 && fp->file._flags & _IO_LINE_BUF)
+ _IO_OVERFLOW (&fp->file, EOF);
}
static void _IO_unbuffer_write __P ((void));
@@ -764,12 +764,12 @@ static void _IO_unbuffer_write __P ((void));
static void
_IO_unbuffer_write ()
{
- _IO_FILE *fp;
- for (fp = _IO_list_all; fp != NULL; fp = fp->_chain)
- if (! (fp->_flags & _IO_UNBUFFERED)
- && (! (fp->_flags & _IO_NO_WRITES)
- || (fp->_flags & _IO_IS_APPENDING)))
- _IO_SETBUF (fp, NULL, 0);
+ struct _IO_FILE_plus *fp;
+ for (fp = _IO_list_all; fp != NULL; fp = fp->file._chain)
+ if (! (fp->file._flags & _IO_UNBUFFERED)
+ && (! (fp->file._flags & _IO_NO_WRITES)
+ || (fp->file._flags & _IO_IS_APPENDING)))
+ _IO_SETBUF (&fp->file, NULL, 0);
}
int
@@ -1037,21 +1037,21 @@ _IO_iter_begin()
_IO_ITER
_IO_iter_end()
{
- return NULL;
+ return NULL;
}
_IO_ITER
_IO_iter_next(iter)
_IO_ITER iter;
{
- return iter->_chain;
+ return iter->file._chain;
}
_IO_FILE *
_IO_iter_file(iter)
_IO_ITER iter;
{
- return iter;
+ return (_IO_FILE *) iter;
}
void