diff options
author | Ulrich Drepper <drepper@redhat.com> | 2002-02-26 01:45:59 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2002-02-26 01:45:59 +0000 |
commit | 77fe0b9cd86ccba7349921082d886cbca613404c (patch) | |
tree | ef0d25d9dadd97d317a1c4e044385ccdde34bcc3 /libio | |
parent | d417e0ffc4d2707b0d684106f17554395e8be220 (diff) | |
download | glibc-77fe0b9cd86ccba7349921082d886cbca613404c.tar.gz |
Update.
2002-02-25 Ulrich Drepper <drepper@redhat.com>
* assert/assert-perr.c: Use INTUSE to reference functions and variables
inside libc itself. Ise INTDEF and INTDEF2 to define appropriate
aliases. Add prototypes for the new aliases.
* assert/assert.c: Likewise.
* include/libc-symbols.h: Likewise.
* include/stdio.h: Likewise.
* include/netinet/in.h: Likewise.
* include/rpc/auth.h: Likewise.
* include/rpc/auth_unix.h: Likewise.
* include/rpc/key_prot.h: Likewise.
* include/rpc/pmap_prot.h: Likewise.
* include/rpc/pmap_rmt.h: Likewise.
* include/rpc/rpc_msg.h: Likewise.
* include/rpc/xdr.h: Likewise.
* inet/gethstbyad_r.c: Likewise.
* inet/gethstbynm2_r.c: Likewise.
* inet/gethstbynm_r.c: Likewise.
* inet/gethstent_r.c: Likewise.
* inet/in6_addr.c: Likewise.
* libio/__fpurge.c: Likewise.
* libio/filedoalloc.c: Likewise.
* libio/fileops.c: Likewise.
* libio/ftello.c: Likewise.
* libio/ftello64.c: Likewise.
* libio/genops.c: Likewise.
* libio/iofclose.c: Likewise.
* libio/iofdopen.c: Likewise.
* libio/iofflush.c: Likewise.
* libio/iofflush_u.c: Likewise.
* libio/iofgetpos.c: Likewise.
* libio/iofgetpos64.c: Likewise.
* libio/iofgets.c: Likewise.
* libio/iofgets_u.c: Likewise.
* libio/iofopen.c: Likewise.
* libio/iofopncook.c: Likewise.
* libio/iofputs.c: Likewise.
* libio/iofread.c: Likewise.
* libio/iofread_u.c: Likewise.
* libio/iofsetpos.c: Likewise.
* libio/iofsetpos64.c: Likewise.
* libio/ioftell.c: Likewise.
* libio/iofwrite.c: Likewise.
* libio/iogetline.c: Likewise.
* libio/iogets.c: Likewise.
* libio/iogetwline.c: Likewise.
* libio/iolibio.h: Likewise.
* libio/iopadn.c: Likewise.
* libio/iopopen.c: Likewise.
* libio/ioseekoff.c: Likewise.
* libio/ioseekpos.c: Likewise.
* libio/iosetbuffer.c: Likewise.
* libio/iosetvbuf.c: Likewise.
* libio/ioungetc.c: Likewise.
* libio/ioungetwc.c: Likewise.
* libio/iovdprintf.c: Likewise.
* libio/iovsprintf.c: Likewise.
* libio/iovsscanf.c: Likewise.
* libio/libioP.h: Likewise.
* libio/memstream.c: Likewise.
* libio/obprintf.c: Likewise.
* libio/oldfileops.c: Likewise.
* libio/oldiofclose.c: Likewise.
* libio/oldiofdopen.c: Likewise.
* libio/oldiofgetpos.c: Likewise.
* libio/oldiofgetpos64.c: Likewise.
* libio/oldiofopen.c: Likewise.
* libio/oldiofsetpos.c: Likewise.
* libio/oldiofsetpos64.c: Likewise.
* libio/oldiopopen.c: Likewise.
* libio/oldstdfiles.c: Likewise.
* libio/putc.c: Likewise.
* libio/setbuf.c: Likewise.
* libio/setlinebuf.c: Likewise.
* libio/stdfiles.c: Likewise.
* libio/stdio.c: Likewise.
* libio/strops.c: Likewise.
* libio/vasprintf.c: Likewise.
* libio/vscanf.c: Likewise.
* libio/vsnprintf.c: Likewise.
* libio/vswprintf.c: Likewise.
* libio/wfiledoalloc.c: Likewise.
* libio/wfileops.c: Likewise.
* libio/wgenops.c: Likewise.
* libio/wstrops.c: Likewise.
* malloc/mtrace.c: Likewise.
* misc/error.c: Likewise.
* misc/syslog.c: Likewise.
* nss/getXXbyYY_r.c: Likewise.
* nss/getXXent_r.c: Likewise.
* nss/hosts-lookup.c: Likewise.
* stdio-common/getw.c
* stdio-common/printf-prs.c: Likewise.
* stdio-common/printf_fp.c: Likewise.
* stdio-common/printf_size.c: Likewise.
* stdio-common/putw.c: Likewise.
* stdio-common/scanf.c: Likewise.
* stdio-common/sprintf.c: Likewise.
* stdio-common/tmpfile64.c: Likewise.
* stdio-common/vfprintf.c: Likewise.
* stdio-common/vfscanf.c: Likewise.
* stdlib/strfmon.c: Likewise.
* sunrpc/auth_des.c: Likewise.
* sunrpc/auth_none.c: Likewise.
* sunrpc/auth_unix.c: Likewise.
* sunrpc/authdes_prot.c: Likewise.
* sunrpc/authuxprot.c: Likewise.
* sunrpc/clnt_perr.c: Likewise.
* sunrpc/clnt_raw.c: Likewise.
* sunrpc/clnt_tcp.c: Likewise.
* sunrpc/clnt_udp.c: Likewise.
* sunrpc/clnt_unix.c: Likewise.
* sunrpc/key_call.c: Likewise.
* sunrpc/key_prot.c: Likewise.
* sunrpc/openchild.c: Likewise.
* sunrpc/pm_getmaps.c: Likewise.
* sunrpc/pm_getport.c: Likewise.
* sunrpc/pmap_clnt.c: Likewise.
* sunrpc/pmap_prot.c: Likewise.
* sunrpc/pmap_prot2.c: Likewise.
* sunrpc/pmap_rmt.c: Likewise.
* sunrpc/rpc_cmsg.c: Likewise.
* sunrpc/rpc_prot.c: Likewise.
* sunrpc/svc_authux.c: Likewise.
* sunrpc/svc_raw.c: Likewise.
* sunrpc/svc_simple.c: Likewise.
* sunrpc/svc_tcp.c: Likewise.
* sunrpc/svc_udp.c: Likewise.
* sunrpc/svc_unix.c: Likewise.
* sunrpc/xdr.c: Likewise.
* sunrpc/xdr_array.c: Likewise.
* sunrpc/xdr_mem.c: Likewise.
* sunrpc/xdr_rec.c: Likewise.
* sunrpc/xdr_ref.c: Likewise.
* sunrpc/xdr_stdio.c: Likewise.
* sysdeps/generic/_strerror.c: Likewise.
* sysdeps/generic/printf_fphex.c: Likewise.
* sysdeps/generic/tmpfile.c: Likewise.
* sysdeps/gnu/errlist.awk: Likewise.
* sysdeps/gnu/errlist.c: Likewise.
* libio/Makefile (routines): Remove iosprint.
* libio/iosprintf.c: Removed
Diffstat (limited to 'libio')
67 files changed, 645 insertions, 456 deletions
diff --git a/libio/Makefile b/libio/Makefile index a10b7dfaa8..af91ef2a02 100644 --- a/libio/Makefile +++ b/libio/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1995,96,97,98,99,2000, 2001 Free Software Foundation, Inc. +# Copyright (C) 1995,96,97,98,99,2000,2001,2002 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -27,7 +27,7 @@ routines := \ filedoalloc iofclose iofdopen iofflush iofgetpos iofgets iofopen \ iofopncook iofputs iofread iofsetpos ioftell wfiledoalloc \ iofwrite iogetdelim iogetline iogets iopadn iopopen ioputs \ - ioseekoff ioseekpos iosetbuffer iosetvbuf iosprintf ioungetc \ + ioseekoff ioseekpos iosetbuffer iosetvbuf ioungetc \ iovsprintf iovsscanf \ iofgetpos64 iofopen64 iofsetpos64 \ fputwc fputwc_u getwc getwc_u getwchar getwchar_u iofgetws iofgetws_u \ diff --git a/libio/__fpurge.c b/libio/__fpurge.c index 09e5546b84..50ba2812ee 100644 --- a/libio/__fpurge.c +++ b/libio/__fpurge.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -35,7 +35,7 @@ __fpurge (FILE *fp) { /* Wide-char stream. */ if (_IO_in_backup (fp)) - _IO_free_wbackup_area (fp); + INTUSE(_IO_free_wbackup_area) (fp); fp->_wide_data->_IO_read_end = fp->_wide_data->_IO_read_ptr; fp->_wide_data->_IO_write_ptr = fp->_wide_data->_IO_write_base; @@ -44,7 +44,7 @@ __fpurge (FILE *fp) { /* Byte stream. */ if (_IO_in_backup (fp)) - _IO_free_backup_area (fp); + INTUSE(_IO_free_backup_area) (fp); fp->_IO_read_end = fp->_IO_read_ptr; fp->_IO_write_ptr = fp->_IO_write_base; diff --git a/libio/filedoalloc.c b/libio/filedoalloc.c index 3621e43073..e7a94ff65f 100644 --- a/libio/filedoalloc.c +++ b/libio/filedoalloc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1997, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -106,6 +106,7 @@ _IO_file_doallocate (fp) #endif } ALLOC_BUF (p, size, EOF); - _IO_setb (fp, p, p + size, 1); + INTUSE(_IO_setb) (fp, p, p + size, 1); return 1; } +INTDEF(_IO_file_doallocate) diff --git a/libio/fileops.c b/libio/fileops.c index 0d02fca93e..92f1be49e7 100644 --- a/libio/fileops.c +++ b/libio/fileops.c @@ -148,9 +148,10 @@ _IO_new_file_init (fp) fp->file._offset = _IO_pos_BAD; fp->file._IO_file_flags |= CLOSED_FILEBUF_FLAGS; - _IO_link_in (fp); + INTUSE(_IO_link_in) (fp); fp->file._fileno = -1; } +INTDEF2(_IO_new_file_init, _IO_file_init) int _IO_new_file_close_it (fp) @@ -162,33 +163,34 @@ _IO_new_file_close_it (fp) write_status = _IO_do_flush (fp); - _IO_unsave_markers(fp); + INTUSE(_IO_unsave_markers) (fp); close_status = _IO_SYSCLOSE (fp); /* Free buffer. */ if (fp->_mode <= 0) { - _IO_setb (fp, NULL, NULL, 0); + INTUSE(_IO_setb) (fp, NULL, NULL, 0); _IO_setg (fp, NULL, NULL, NULL); _IO_setp (fp, NULL, NULL); } #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T else { - _IO_wsetb (fp, NULL, NULL, 0); + INTUSE(_IO_wsetb) (fp, NULL, NULL, 0); _IO_wsetg (fp, NULL, NULL, NULL); _IO_wsetp (fp, NULL, NULL); } #endif - _IO_un_link ((struct _IO_FILE_plus *) fp); + INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp); fp->_flags = _IO_MAGIC|CLOSED_FILEBUF_FLAGS; fp->_fileno = -1; fp->_offset = _IO_pos_BAD; return close_status ? close_status : write_status; } +INTDEF2(_IO_new_file_close_it, _IO_file_close_it) void _IO_new_file_finish (fp, dummy) @@ -201,8 +203,9 @@ _IO_new_file_finish (fp, dummy) if (!(fp->_flags & _IO_DELETE_DONT_CLOSE)) _IO_SYSCLOSE (fp); } - _IO_default_finish (fp, 0); + INTUSE(_IO_default_finish) (fp, 0); } +INTDEF2(_IO_new_file_finish, _IO_file_finish) #if defined __GNUC__ && __GNUC__ >= 2 __inline__ @@ -232,7 +235,7 @@ _IO_file_open (fp, filename, posix_mode, prot, read_write, is32not64) if (_IO_SEEKOFF (fp, (_IO_off64_t)0, _IO_seek_end, _IOS_INPUT|_IOS_OUTPUT) == _IO_pos_BAD && errno != ESPIPE) return NULL; - _IO_link_in ((struct _IO_FILE_plus *) fp); + INTUSE(_IO_link_in) ((struct _IO_FILE_plus *) fp); return fp; } @@ -389,6 +392,7 @@ _IO_new_file_fopen (fp, filename, mode, is32not64) return result; } +INTDEF2(_IO_new_file_fopen, _IO_file_fopen) _IO_FILE * _IO_new_file_attach (fp, fd) @@ -408,6 +412,7 @@ _IO_new_file_attach (fp, fd) return NULL; return fp; } +INTDEF2(_IO_new_file_attach, _IO_file_attach) _IO_FILE * _IO_new_file_setbuf (fp, p, len) @@ -424,6 +429,7 @@ _IO_new_file_setbuf (fp, p, len) return fp; } +INTDEF2(_IO_new_file_setbuf, _IO_file_setbuf) static int new_do_write __P ((_IO_FILE *, const char *, _IO_size_t)); @@ -438,6 +444,7 @@ _IO_new_do_write (fp, data, to_do) { return (to_do == 0 || new_do_write (fp, data, to_do) == to_do) ? 0 : EOF; } +INTDEF2(_IO_new_do_write, _IO_do_write) static int @@ -464,7 +471,8 @@ new_do_write (fp, data, to_do) } count = _IO_SYSWRITE (fp, data, to_do); if (fp->_cur_column && count) - fp->_cur_column = _IO_adjust_column (fp->_cur_column - 1, data, count) + 1; + fp->_cur_column = INTUSE(_IO_adjust_column) (fp->_cur_column - 1, data, + count) + 1; _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base); fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_buf_base; fp->_IO_write_end = (fp->_mode <= 0 @@ -501,7 +509,7 @@ _IO_new_file_underflow (fp) free (fp->_IO_save_base); fp->_flags &= ~_IO_IN_BACKUP; } - _IO_doallocbuf (fp); + INTUSE(_IO_doallocbuf) (fp); } /* Flush all line buffered files before reading. */ @@ -509,7 +517,7 @@ _IO_new_file_underflow (fp) if (fp->_flags & (_IO_LINE_BUF|_IO_UNBUFFERED)) { #if 0 - _IO_flush_all_linebuffered (); + INTUSE(_IO_flush_all_linebuffered) (); #else /* We used to flush all line-buffered stream. This really isn't required by any standard. My recollection is that @@ -529,7 +537,7 @@ _IO_new_file_underflow (fp) #endif } - _IO_switch_to_get_mode (fp); + INTUSE(_IO_switch_to_get_mode) (fp); /* This is very tricky. We have to adjust those pointers before we call _IO_SYSREAD () since @@ -556,6 +564,7 @@ _IO_new_file_underflow (fp) _IO_pos_adjust (fp->_offset, count); return *(unsigned char *) fp->_IO_read_ptr; } +INTDEF2(_IO_new_file_underflow, _IO_file_underflow) /* Special callback replacing the underflow callbacks if we mmap the file. */ @@ -603,7 +612,7 @@ _IO_new_file_overflow (f, ch) /* Allocate a buffer if needed. */ if (f->_IO_write_base == 0) { - _IO_doallocbuf (f); + INTUSE(_IO_doallocbuf) (f); _IO_setg (f, f->_IO_buf_base, f->_IO_buf_base, f->_IO_buf_base); } /* Otherwise must be currently reading. @@ -638,6 +647,7 @@ _IO_new_file_overflow (f, ch) return EOF; return (unsigned char) ch; } +INTDEF2(_IO_new_file_overflow, _IO_file_overflow) int _IO_new_file_sync (fp) @@ -672,6 +682,7 @@ _IO_new_file_sync (fp) /* setg(base(), ptr, ptr); */ return retval; } +INTDEF2(_IO_new_file_sync, _IO_file_sync) _IO_off64_t _IO_new_file_seekoff (fp, offset, dir, mode) @@ -700,7 +711,7 @@ _IO_new_file_seekoff (fp, offset, dir, mode) FIXME: simulate mem-papped files. */ if (fp->_IO_write_ptr > fp->_IO_write_base || _IO_in_put_mode (fp)) - if (_IO_switch_to_get_mode (fp)) + if (INTUSE(_IO_switch_to_get_mode) (fp)) return EOF; if (fp->_IO_buf_base == NULL) @@ -711,7 +722,7 @@ _IO_new_file_seekoff (fp, offset, dir, mode) free (fp->_IO_read_base); fp->_flags &= ~_IO_IN_BACKUP; } - _IO_doallocbuf (fp); + INTUSE(_IO_doallocbuf) (fp); _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base); _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base); } @@ -797,7 +808,7 @@ _IO_new_file_seekoff (fp, offset, dir, mode) } #ifdef TODO - _IO_unsave_markers (fp); + INTUSE(_IO_unsave_markers) (fp); #endif if (fp->_flags & _IO_NO_READS) @@ -837,7 +848,7 @@ _IO_new_file_seekoff (fp, offset, dir, mode) return offset; dumb: - _IO_unsave_markers (fp); + INTUSE(_IO_unsave_markers) (fp); result = _IO_SYSSEEK (fp, offset, dir); if (result != EOF) { @@ -858,6 +869,7 @@ resync: return offset; } +INTDEF2(_IO_new_file_seekoff, _IO_file_seekoff) _IO_off64_t _IO_file_seekoff_mmap (fp, offset, dir, mode) @@ -913,6 +925,7 @@ _IO_file_read (fp, buf, size) { return read (fp->_fileno, buf, size); } +INTDEF(_IO_file_read) _IO_off64_t _IO_file_seek (fp, offset, dir) @@ -926,6 +939,7 @@ _IO_file_seek (fp, offset, dir) return lseek (fp->_fileno, offset, dir); #endif } +INTDEF(_IO_file_seek) int _IO_file_stat (fp, st) @@ -938,6 +952,7 @@ _IO_file_stat (fp, st) return fstat (fp->_fileno, (struct stat *) st); #endif } +INTDEF(_IO_file_stat) int _IO_file_close_mmap (fp) @@ -956,6 +971,7 @@ _IO_file_close (fp) { return close (fp->_fileno); } +INTDEF(_IO_file_close) _IO_ssize_t _IO_new_file_write (f, data, n) @@ -1066,10 +1082,11 @@ _IO_new_file_xsputn (f, data, n) buffer, but it's somewhat messier for line-buffered files, so we let _IO_default_xsputn handle the general case. */ if (to_do) - to_do -= _IO_default_xsputn (f, s+do_write, to_do); + to_do -= INTUSE(_IO_default_xsputn) (f, s+do_write, to_do); } return n - to_do; } +INTDEF2(_IO_new_file_xsputn, _IO_file_xsputn) _IO_size_t _IO_file_xsgetn (fp, data, n) @@ -1091,7 +1108,7 @@ _IO_file_xsgetn (fp, data, n) free (fp->_IO_save_base); fp->_flags &= ~_IO_IN_BACKUP; } - _IO_doallocbuf (fp); + INTUSE(_IO_doallocbuf) (fp); } while (want > 0) @@ -1169,6 +1186,7 @@ _IO_file_xsgetn (fp, data, n) return n - want; } +INTDEF(_IO_file_xsgetn) static _IO_size_t _IO_file_xsgetn_mmap __P ((_IO_FILE *, void *, _IO_size_t)); static _IO_size_t @@ -1206,47 +1224,48 @@ _IO_file_xsgetn_mmap (fp, data, n) struct _IO_jump_t _IO_file_jumps = { JUMP_INIT_DUMMY, - JUMP_INIT(finish, _IO_new_file_finish), - JUMP_INIT(overflow, _IO_new_file_overflow), - JUMP_INIT(underflow, _IO_new_file_underflow), - JUMP_INIT(uflow, _IO_default_uflow), - JUMP_INIT(pbackfail, _IO_default_pbackfail), - JUMP_INIT(xsputn, _IO_new_file_xsputn), - JUMP_INIT(xsgetn, _IO_file_xsgetn), + JUMP_INIT(finish, INTUSE(_IO_file_finish)), + JUMP_INIT(overflow, INTUSE(_IO_file_overflow)), + JUMP_INIT(underflow, INTUSE(_IO_file_underflow)), + JUMP_INIT(uflow, INTUSE(_IO_default_uflow)), + JUMP_INIT(pbackfail, INTUSE(_IO_default_pbackfail)), + JUMP_INIT(xsputn, INTUSE(_IO_file_xsputn)), + JUMP_INIT(xsgetn, INTUSE(_IO_file_xsgetn)), JUMP_INIT(seekoff, _IO_new_file_seekoff), JUMP_INIT(seekpos, _IO_default_seekpos), JUMP_INIT(setbuf, _IO_new_file_setbuf), JUMP_INIT(sync, _IO_new_file_sync), - JUMP_INIT(doallocate, _IO_file_doallocate), - JUMP_INIT(read, _IO_file_read), + JUMP_INIT(doallocate, INTUSE(_IO_file_doallocate)), + JUMP_INIT(read, INTUSE(_IO_file_read)), JUMP_INIT(write, _IO_new_file_write), - JUMP_INIT(seek, _IO_file_seek), - JUMP_INIT(close, _IO_file_close), - JUMP_INIT(stat, _IO_file_stat), + JUMP_INIT(seek, INTUSE(_IO_file_seek)), + JUMP_INIT(close, INTUSE(_IO_file_close)), + JUMP_INIT(stat, INTUSE(_IO_file_stat)), JUMP_INIT(showmanyc, _IO_default_showmanyc), JUMP_INIT(imbue, _IO_default_imbue) }; +INTDEF(_IO_file_jumps) struct _IO_jump_t _IO_file_jumps_mmap = { JUMP_INIT_DUMMY, - JUMP_INIT(finish, _IO_new_file_finish), - JUMP_INIT(overflow, _IO_new_file_overflow), + JUMP_INIT(finish, INTUSE(_IO_file_finish)), + JUMP_INIT(overflow, INTUSE(_IO_file_overflow)), JUMP_INIT(underflow, _IO_file_underflow_mmap), - JUMP_INIT(uflow, _IO_default_uflow), - JUMP_INIT(pbackfail, _IO_default_pbackfail), + JUMP_INIT(uflow, INTUSE(_IO_default_uflow)), + JUMP_INIT(pbackfail, INTUSE(_IO_default_pbackfail)), JUMP_INIT(xsputn, _IO_new_file_xsputn), JUMP_INIT(xsgetn, _IO_file_xsgetn_mmap), JUMP_INIT(seekoff, _IO_file_seekoff_mmap), JUMP_INIT(seekpos, _IO_default_seekpos), JUMP_INIT(setbuf, _IO_new_file_setbuf), JUMP_INIT(sync, _IO_new_file_sync), - JUMP_INIT(doallocate, _IO_file_doallocate), - JUMP_INIT(read, _IO_file_read), + JUMP_INIT(doallocate, INTUSE(_IO_file_doallocate)), + JUMP_INIT(read, INTUSE(_IO_file_read)), JUMP_INIT(write, _IO_new_file_write), - JUMP_INIT(seek, _IO_file_seek), + JUMP_INIT(seek, INTUSE(_IO_file_seek)), JUMP_INIT(close, _IO_file_close_mmap), - JUMP_INIT(stat, _IO_file_stat), + JUMP_INIT(stat, INTUSE(_IO_file_stat)), JUMP_INIT(showmanyc, _IO_default_showmanyc), JUMP_INIT(imbue, _IO_default_imbue) }; diff --git a/libio/ftello.c b/libio/ftello.c index 6c1f1a670f..dcecf5ee50 100644 --- a/libio/ftello.c +++ b/libio/ftello.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995-2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995-2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -39,7 +39,7 @@ ftello (fp) CHECK_FILE (fp, -1L); _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, fp); _IO_flockfile (fp); - pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0); + pos = INTUSE(_IO_seekoff) (fp, 0, _IO_seek_cur, 0); if (_IO_in_backup (fp)) { if (fp->_mode <= 0) diff --git a/libio/ftello64.c b/libio/ftello64.c index cd0670f1f4..bbf77679f3 100644 --- a/libio/ftello64.c +++ b/libio/ftello64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995-2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995-2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -40,7 +40,7 @@ ftello64 (fp) CHECK_FILE (fp, -1L); _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, fp); _IO_flockfile (fp); - pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0); + pos = INTUSE(_IO_seekoff) (fp, 0, _IO_seek_cur, 0); if (_IO_in_backup (fp)) { if (fp->_mode <= 0) diff --git a/libio/genops.c b/libio/genops.c index 2398cff684..5f16894505 100644 --- a/libio/genops.c +++ b/libio/genops.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,1995,1997-1999,2000,2001 Free Software Foundation, Inc. +/* Copyright (C) 1993,1995,1997-2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -66,7 +66,8 @@ _IO_un_link (fp) run_fp = (_IO_FILE *) fp; _IO_flockfile ((_IO_FILE *) fp); #endif - for (f = &_IO_list_all; *f; f = (struct _IO_FILE_plus **) &(*f)->file._chain) + for (f = &INTUSE(_IO_list_all); *f; + f = (struct _IO_FILE_plus **) &(*f)->file._chain) { if (*f == fp) { @@ -84,6 +85,7 @@ _IO_un_link (fp) #endif } } +INTDEF(_IO_un_link) void _IO_link_in (fp) @@ -98,8 +100,8 @@ _IO_link_in (fp) run_fp = (_IO_FILE *) fp; _IO_flockfile ((_IO_FILE *) fp); #endif - fp->file._chain = (_IO_FILE *) _IO_list_all; - _IO_list_all = fp; + fp->file._chain = (_IO_FILE *) INTUSE(_IO_list_all); + INTUSE(_IO_list_all) = fp; ++_IO_list_all_stamp; #ifdef _IO_MTSAFE_IO _IO_funlockfile ((_IO_FILE *) fp); @@ -109,6 +111,7 @@ _IO_link_in (fp) #endif } } +INTDEF(_IO_link_in) /* Return minimum _pos markers Assumes the current get area is the main get area. */ @@ -189,6 +192,7 @@ _IO_switch_to_get_mode (fp) fp->_flags &= ~_IO_CURRENTLY_PUTTING; return 0; } +INTDEF(_IO_switch_to_get_mode) void _IO_free_backup_area (fp) @@ -201,6 +205,7 @@ _IO_free_backup_area (fp) fp->_IO_save_end = NULL; fp->_IO_backup_base = NULL; } +INTDEF(_IO_free_backup_area) #if 0 int @@ -325,7 +330,7 @@ __underflow (fp) if (fp->_mode == 0) _IO_fwide (fp, -1); if (_IO_in_put_mode (fp)) - if (_IO_switch_to_get_mode (fp) == EOF) + if (INTUSE(_IO_switch_to_get_mode) (fp) == EOF) return EOF; if (fp->_IO_read_ptr < fp->_IO_read_end) return *(unsigned char *) fp->_IO_read_ptr; @@ -341,7 +346,7 @@ __underflow (fp) return EOF; } else if (_IO_have_backup (fp)) - _IO_free_backup_area (fp); + INTUSE(_IO_free_backup_area) (fp); return _IO_UNDERFLOW (fp); } @@ -357,7 +362,7 @@ __uflow (fp) if (fp->_mode == 0) _IO_fwide (fp, -11); if (_IO_in_put_mode (fp)) - if (_IO_switch_to_get_mode (fp) == EOF) + if (INTUSE(_IO_switch_to_get_mode) (fp) == EOF) return EOF; if (fp->_IO_read_ptr < fp->_IO_read_end) return *(unsigned char *) fp->_IO_read_ptr++; @@ -373,7 +378,7 @@ __uflow (fp) return EOF; } else if (_IO_have_backup (fp)) - _IO_free_backup_area (fp); + INTUSE(_IO_free_backup_area) (fp); return _IO_UFLOW (fp); } @@ -393,6 +398,7 @@ _IO_setb (f, b, eb, a) else f->_flags |= _IO_USER_BUF; } +INTDEF(_IO_setb) void _IO_doallocbuf (fp) @@ -403,8 +409,9 @@ _IO_doallocbuf (fp) if (!(fp->_flags & _IO_UNBUFFERED) || fp->_mode > 0) if (_IO_DOALLOCATE (fp) != EOF) return; - _IO_setb (fp, fp->_shortbuf, fp->_shortbuf+1, 0); + INTUSE(_IO_setb) (fp, fp->_shortbuf, fp->_shortbuf+1, 0); } +INTDEF(_IO_doallocbuf) int _IO_default_underflow (fp) @@ -422,6 +429,7 @@ _IO_default_uflow (fp) return EOF; return *(unsigned char *) fp->_IO_read_ptr++; } +INTDEF(_IO_default_uflow) _IO_size_t _IO_default_xsputn (f, data, n) @@ -469,6 +477,7 @@ _IO_default_xsputn (f, data, n) } return n - more; } +INTDEF(_IO_default_xsputn) _IO_size_t _IO_sgetn (fp, data, n) @@ -479,6 +488,7 @@ _IO_sgetn (fp, data, n) /* FIXME handle putback buffer here! */ return _IO_XSGETN (fp, data, n); } +INTDEF(_IO_sgetn) _IO_size_t _IO_default_xsgetn (fp, data, n) @@ -523,6 +533,7 @@ _IO_default_xsgetn (fp, data, n) } return n - more; } +INTDEF(_IO_default_xsgetn) #if 0 /* Seems not to be needed. --drepper */ @@ -545,12 +556,12 @@ _IO_default_setbuf (fp, p, len) if (p == NULL || len == 0) { fp->_flags |= _IO_UNBUFFERED; - _IO_setb (fp, fp->_shortbuf, fp->_shortbuf+1, 0); + INTUSE(_IO_setb) (fp, fp->_shortbuf, fp->_shortbuf+1, 0); } else { fp->_flags &= ~_IO_UNBUFFERED; - _IO_setb (fp, p, p+len, 0); + INTUSE(_IO_setb) (fp, p, p+len, 0); } fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end = 0; fp->_IO_read_base = fp->_IO_read_ptr = fp->_IO_read_end = 0; @@ -573,9 +584,10 @@ _IO_default_doallocate (fp) char *buf; ALLOC_BUF (buf, _IO_BUFSIZ, EOF); - _IO_setb (fp, buf, buf+_IO_BUFSIZ, 1); + INTUSE(_IO_setb) (fp, buf, buf+_IO_BUFSIZ, 1); return 1; } +INTDEF(_IO_default_doallocate) void _IO_init (fp, flags) @@ -584,6 +596,7 @@ _IO_init (fp, flags) { _IO_no_init (fp, flags, -1, NULL, NULL); } +INTDEF(_IO_init) void _IO_no_init (fp, flags, orientation, wd, jmp) @@ -674,8 +687,9 @@ _IO_default_finish (fp, dummy) _IO_lock_fini (*fp->_lock); #endif - _IO_un_link ((struct _IO_FILE_plus *) fp); + INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp); } +INTDEF(_IO_default_finish) _IO_off64_t _IO_default_seekoff (fp, offset, dir, mode) @@ -708,6 +722,7 @@ _IO_sputbackc (fp, c) return result; } +INTDEF(_IO_sputbackc) int _IO_sungetc (fp) @@ -767,6 +782,7 @@ _IO_adjust_column (start, line, count) return line + count - ptr - 1; return start + count; } +INTDEF(_IO_adjust_column) #if 0 /* Seems not to be needed. --drepper */ @@ -797,7 +813,7 @@ _IO_flush_all_lockp (int do_lock) #endif last_stamp = _IO_list_all_stamp; - fp = (_IO_FILE *) _IO_list_all; + fp = (_IO_FILE *) INTUSE(_IO_list_all); while (fp != NULL) { run_fp = fp; @@ -821,7 +837,7 @@ _IO_flush_all_lockp (int do_lock) if (last_stamp != _IO_list_all_stamp) { /* Something was added to the list. Start all over again. */ - fp = (_IO_FILE *) _IO_list_all; + fp = (_IO_FILE *) INTUSE(_IO_list_all); last_stamp = _IO_list_all_stamp; } else @@ -844,6 +860,7 @@ _IO_flush_all () /* We want locking. */ return _IO_flush_all_lockp (1); } +INTDEF(_IO_flush_all) void _IO_flush_all_linebuffered () @@ -857,7 +874,7 @@ _IO_flush_all_linebuffered () #endif last_stamp = _IO_list_all_stamp; - fp = (_IO_FILE *) _IO_list_all; + fp = (_IO_FILE *) INTUSE(_IO_list_all); while (fp != NULL) { run_fp = fp; @@ -872,7 +889,7 @@ _IO_flush_all_linebuffered () if (last_stamp != _IO_list_all_stamp) { /* Something was added to the list. Start all over again. */ - fp = (_IO_FILE *) _IO_list_all; + fp = (_IO_FILE *) INTUSE(_IO_list_all); last_stamp = _IO_list_all_stamp; } else @@ -884,6 +901,7 @@ _IO_flush_all_linebuffered () _IO_cleanup_region_end (0); #endif } +INTDEF(_IO_flush_all_linebuffered) #ifdef _LIBC weak_alias (_IO_flush_all_linebuffered, _flushlbf) #endif @@ -894,7 +912,7 @@ static void _IO_unbuffer_write () { struct _IO_FILE *fp; - for (fp = (_IO_FILE *) _IO_list_all; fp; fp = fp->_chain) + for (fp = (_IO_FILE *) INTUSE(_IO_list_all); fp; fp = fp->_chain) { if (! (fp->_flags & _IO_UNBUFFERED) && (! (fp->_flags & _IO_NO_WRITES) @@ -912,7 +930,7 @@ _IO_unbuffer_write () int _IO_cleanup () { - int result = _IO_flush_all (); + int result = INTUSE(_IO_flush_all) (); /* We currently don't have a reliable mechanism for making sure that C++ static destructors are executed in the correct order. @@ -934,7 +952,7 @@ _IO_init_marker (marker, fp) { marker->_sbuf = fp; if (_IO_in_put_mode (fp)) - _IO_switch_to_get_mode (fp); + INTUSE(_IO_switch_to_get_mode) (fp); if (_IO_in_backup (fp)) marker->_pos = fp->_IO_read_ptr - fp->_IO_read_end; else @@ -1040,8 +1058,9 @@ _IO_unsave_markers (fp) } if (_IO_have_backup (fp)) - _IO_free_backup_area (fp); + INTUSE(_IO_free_backup_area) (fp); } +INTDEF(_IO_unsave_markers) #if 0 /* Seems not to be needed. --drepper */ @@ -1115,6 +1134,7 @@ _IO_default_pbackfail (fp, c) } return (unsigned char) c; } +INTDEF(_IO_default_pbackfail) _IO_off64_t _IO_default_seek (fp, offset, dir) @@ -1168,7 +1188,7 @@ _IO_default_imbue (fp, locale) _IO_ITER _IO_iter_begin() { - return (_IO_ITER) _IO_list_all; + return (_IO_ITER) INTUSE(_IO_list_all); } _IO_ITER diff --git a/libio/iofclose.c b/libio/iofclose.c index 45bd0afa7d..fb0f7ce19e 100644 --- a/libio/iofclose.c +++ b/libio/iofclose.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,1995,1997-1999,2000,2001 Free Software Foundation, Inc. +/* Copyright (C) 1993,1995,1997-2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -55,16 +55,17 @@ _IO_new_fclose (fp) /* First unlink the stream. */ if (fp->_IO_file_flags & _IO_IS_FILEBUF) - _IO_un_link ((struct _IO_FILE_plus *) fp); + INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp); _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp); _IO_flockfile (fp); if (fp->_IO_file_flags & _IO_IS_FILEBUF) - status = _IO_file_close_it (fp); + status = INTUSE(_IO_file_close_it) (fp); else status = fp->_flags & _IO_ERR_SEEN ? -1 : 0; _IO_FINISH (fp); _IO_funlockfile (fp); + _IO_cleanup_region_end (0); if (fp->_mode > 0) { #if _LIBC @@ -75,10 +76,15 @@ _IO_new_fclose (fp) __gconv_release_step (cc->__cd_in.__cd.__steps); __gconv_release_step (cc->__cd_out.__cd.__steps); #endif + + if (_IO_have_wbackup (fp)) + INTUSE(_IO_free_wbackup_area) (fp); + } + else + { + if (_IO_have_backup (fp)) + INTUSE(_IO_free_backup_area) (fp); } - _IO_cleanup_region_end (0); - if (_IO_have_backup (fp)) - _IO_free_backup_area (fp); if (fp != _IO_stdin && fp != _IO_stdout && fp != _IO_stderr) { fp->_IO_file_flags = 0; diff --git a/libio/iofdopen.c b/libio/iofdopen.c index 2c73bdabab..a4ac03fe5d 100644 --- a/libio/iofdopen.c +++ b/libio/iofdopen.c @@ -124,15 +124,15 @@ _IO_new_fdopen (fd, mode) #ifdef _IO_MTSAFE_IO new_f->fp.file._lock = &new_f->lock; #endif - _IO_no_init (&new_f->fp.file, 0, 0, &new_f->wd, &_IO_wfile_jumps); - _IO_JUMPS (&new_f->fp) = &_IO_file_jumps; - _IO_file_init (&new_f->fp); + _IO_no_init (&new_f->fp.file, 0, 0, &new_f->wd, &INTUSE(_IO_wfile_jumps)); + _IO_JUMPS (&new_f->fp) = &INTUSE(_IO_file_jumps); + INTUSE(_IO_file_init) (&new_f->fp); #if !_IO_UNIFIED_JUMPTABLES new_f->fp.vtable = NULL; #endif - if (_IO_file_attach ((_IO_FILE *) &new_f->fp, fd) == NULL) + if (INTUSE(_IO_file_attach) ((_IO_FILE *) &new_f->fp, fd) == NULL) { - _IO_un_link (&new_f->fp); + INTUSE(_IO_un_link) (&new_f->fp); free (new_f); return NULL; } @@ -144,6 +144,7 @@ _IO_new_fdopen (fd, mode) return __fopen_maybe_mmap (&new_f->fp.file); } +INTDEF2(_IO_new_fdopen, _IO_fdopen) strong_alias (_IO_new_fdopen, __new_fdopen) versioned_symbol (libc, _IO_new_fdopen, _IO_fdopen, GLIBC_2_1); diff --git a/libio/iofflush.c b/libio/iofflush.c index c45023c87a..6f12e9b79a 100644 --- a/libio/iofflush.c +++ b/libio/iofflush.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1993,1995,1996,1997,1998,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -33,7 +33,7 @@ _IO_fflush (fp) _IO_FILE *fp; { if (fp == NULL) - return _IO_flush_all (); + return INTUSE(_IO_flush_all) (); else { int result; @@ -46,6 +46,7 @@ _IO_fflush (fp) return result; } } +INTDEF(_IO_fflush) #ifdef weak_alias weak_alias (_IO_fflush, fflush) diff --git a/libio/iofflush_u.c b/libio/iofflush_u.c index 4576cf0a5e..4603ec388c 100644 --- a/libio/iofflush_u.c +++ b/libio/iofflush_u.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995, 1996, 1997, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -33,7 +33,7 @@ fflush_unlocked (fp) _IO_FILE *fp; { if (fp == NULL) - return _IO_flush_all (); + return INTUSE(_IO_flush_all) (); else { CHECK_FILE (fp, EOF); diff --git a/libio/iofgetpos.c b/libio/iofgetpos.c index cc7d9e9755..c8eea79e9b 100644 --- a/libio/iofgetpos.c +++ b/libio/iofgetpos.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995-1999, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995-2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -40,7 +40,7 @@ _IO_new_fgetpos (fp, posp) CHECK_FILE (fp, EOF); _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp); _IO_flockfile (fp); - pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0); + pos = INTUSE(_IO_seekoff) (fp, 0, _IO_seek_cur, 0); if (_IO_in_backup (fp)) { if (fp->_mode <= 0) diff --git a/libio/iofgetpos64.c b/libio/iofgetpos64.c index 179071894e..525a75c7ef 100644 --- a/libio/iofgetpos64.c +++ b/libio/iofgetpos64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995-2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995-2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -40,7 +40,7 @@ _IO_new_fgetpos64 (fp, posp) CHECK_FILE (fp, EOF); _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, fp); _IO_flockfile (fp); - pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0); + pos = INTUSE(_IO_seekoff) (fp, 0, _IO_seek_cur, 0); if (_IO_in_backup (fp)) { if (fp->_mode <= 0) diff --git a/libio/iofgets.c b/libio/iofgets.c index 69befc784b..d61dd066c4 100644 --- a/libio/iofgets.c +++ b/libio/iofgets.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 95, 96, 97, 98, 99 Free Software Foundation, Inc. +/* Copyright (C) 1993, 95, 96, 97, 98, 99, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -47,7 +47,7 @@ _IO_fgets (buf, n, fp) case. We return an error only when there is a new error. */ old_error = fp->_IO_file_flags & _IO_ERR_SEEN; fp->_IO_file_flags &= ~_IO_ERR_SEEN; - count = _IO_getline (fp, buf, n - 1, '\n', 1); + count = INTUSE(_IO_getline) (fp, buf, n - 1, '\n', 1); /* If we read in some bytes and errno is EAGAIN, that error will be reported for next read. */ if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN) diff --git a/libio/iofgets_u.c b/libio/iofgets_u.c index f62f6c60c0..bf5bb09681 100644 --- a/libio/iofgets_u.c +++ b/libio/iofgets_u.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1993,1995,1996,1997,1998,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -45,7 +45,7 @@ fgets_unlocked (buf, n, fp) case. We return an error only when there is a new error. */ old_error = fp->_IO_file_flags & _IO_ERR_SEEN; fp->_IO_file_flags &= ~_IO_ERR_SEEN; - count = _IO_getline (fp, buf, n - 1, '\n', 1); + count = INTUSE(_IO_getline) (fp, buf, n - 1, '\n', 1); /* If we read in some bytes and errno is EAGAIN, that error will be reported for next read. */ if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN) diff --git a/libio/iofopen.c b/libio/iofopen.c index e3b9838195..4bb780de13 100644 --- a/libio/iofopen.c +++ b/libio/iofopen.c @@ -71,7 +71,7 @@ __fopen_maybe_mmap (fp) and use a special jump table with simplified underflow functions which never tries to read anything from the file. */ - _IO_setb (fp, p, (char *) p + st.st_size, 0); + INTUSE(_IO_setb) (fp, p, (char *) p + st.st_size, 0); _IO_setg (fp, p, p, p); if (fp->_mode <= 0) @@ -110,19 +110,20 @@ __fopen_internal (filename, mode, is32) new_f->fp.file._lock = &new_f->lock; #endif #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T - _IO_no_init (&new_f->fp.file, 0, 0, &new_f->wd, &_IO_wfile_jumps); + _IO_no_init (&new_f->fp.file, 0, 0, &new_f->wd, &INTUSE(_IO_wfile_jumps)); #else _IO_no_init (&new_f->fp.file, 1, 0, NULL, NULL); #endif - _IO_JUMPS (&new_f->fp) = &_IO_file_jumps; - _IO_file_init (&new_f->fp); + _IO_JUMPS (&new_f->fp) = &INTUSE(_IO_file_jumps); + INTUSE(_IO_file_init) (&new_f->fp); #if !_IO_UNIFIED_JUMPTABLES new_f->fp.vtable = NULL; #endif - if (_IO_file_fopen ((_IO_FILE *) new_f, filename, mode, is32) != NULL) + if (INTUSE(_IO_file_fopen) ((_IO_FILE *) new_f, filename, mode, is32) + != NULL) return __fopen_maybe_mmap (&new_f->fp.file); - _IO_un_link (&new_f->fp); + INTUSE(_IO_un_link) (&new_f->fp); free (new_f); return NULL; } diff --git a/libio/iofopncook.c b/libio/iofopncook.c index 39f83dbe4e..b35b56d24b 100644 --- a/libio/iofopncook.c +++ b/libio/iofopncook.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,95,97,99,2000 Free Software Foundation, Inc. +/* Copyright (C) 1993,95,97,99,2000,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -96,18 +96,18 @@ _IO_cookie_close (fp) static struct _IO_jump_t _IO_cookie_jumps = { JUMP_INIT_DUMMY, - JUMP_INIT(finish, _IO_file_finish), - JUMP_INIT(overflow, _IO_file_overflow), - JUMP_INIT(underflow, _IO_file_underflow), - JUMP_INIT(uflow, _IO_default_uflow), - JUMP_INIT(pbackfail, _IO_default_pbackfail), - JUMP_INIT(xsputn, _IO_file_xsputn), - JUMP_INIT(xsgetn, _IO_default_xsgetn), - JUMP_INIT(seekoff, _IO_file_seekoff), + JUMP_INIT(finish, INTUSE(_IO_file_finish)), + JUMP_INIT(overflow, INTUSE(_IO_file_overflow)), + JUMP_INIT(underflow, INTUSE(_IO_file_underflow)), + JUMP_INIT(uflow, INTUSE(_IO_default_uflow)), + JUMP_INIT(pbackfail, INTUSE(_IO_default_pbackfail)), + JUMP_INIT(xsputn, INTUSE(_IO_file_xsputn)), + JUMP_INIT(xsgetn, INTUSE(_IO_default_xsgetn)), + JUMP_INIT(seekoff, INTUSE(_IO_file_seekoff)), JUMP_INIT(seekpos, _IO_default_seekpos), - JUMP_INIT(setbuf, _IO_file_setbuf), - JUMP_INIT(sync, _IO_file_sync), - JUMP_INIT(doallocate, _IO_file_doallocate), + JUMP_INIT(setbuf, INTUSE(_IO_file_setbuf)), + JUMP_INIT(sync, INTUSE(_IO_file_sync)), + JUMP_INIT(doallocate, INTUSE(_IO_file_doallocate)), JUMP_INIT(read, _IO_cookie_read), JUMP_INIT(write, _IO_cookie_write), JUMP_INIT(seek, _IO_cookie_seek), @@ -122,13 +122,13 @@ void _IO_cookie_init (struct _IO_cookie_file *cfile, int read_write, void *cookie, _IO_cookie_io_functions_t io_functions) { - _IO_init (&cfile->__fp.file, 0); + INTUSE(_IO_init) (&cfile->__fp.file, 0); _IO_JUMPS (&cfile->__fp) = &_IO_cookie_jumps; cfile->__cookie = cookie; cfile->__io_functions = io_functions; - _IO_file_init(&cfile->__fp); + INTUSE(_IO_file_init) (&cfile->__fp); cfile->__fp.file._IO_file_flags = _IO_mask_flags (&cfile->__fp.file, read_write, @@ -215,18 +215,18 @@ _IO_old_cookie_seek (fp, offset, dir) static struct _IO_jump_t _IO_old_cookie_jumps = { JUMP_INIT_DUMMY, - JUMP_INIT(finish, _IO_file_finish), - JUMP_INIT(overflow, _IO_file_overflow), - JUMP_INIT(underflow, _IO_file_underflow), - JUMP_INIT(uflow, _IO_default_uflow), - JUMP_INIT(pbackfail, _IO_default_pbackfail), - JUMP_INIT(xsputn, _IO_file_xsputn), - JUMP_INIT(xsgetn, _IO_default_xsgetn), - JUMP_INIT(seekoff, _IO_file_seekoff), + JUMP_INIT(finish, INTUSE(_IO_file_finish)), + JUMP_INIT(overflow, INTUSE(_IO_file_overflow)), + JUMP_INIT(underflow, INTUSE(_IO_file_underflow)), + JUMP_INIT(uflow, INTUSE(_IO_default_uflow)), + JUMP_INIT(pbackfail, INTUSE(_IO_default_pbackfail)), + JUMP_INIT(xsputn, INTUSE(_IO_file_xsputn)), + JUMP_INIT(xsgetn, INTUSE(_IO_default_xsgetn)), + JUMP_INIT(seekoff, INTUSE(_IO_file_seekoff)), JUMP_INIT(seekpos, _IO_default_seekpos), - JUMP_INIT(setbuf, _IO_file_setbuf), - JUMP_INIT(sync, _IO_file_sync), - JUMP_INIT(doallocate, _IO_file_doallocate), + JUMP_INIT(setbuf, INTUSE(_IO_file_setbuf)), + JUMP_INIT(sync, INTUSE(_IO_file_sync)), + JUMP_INIT(doallocate, INTUSE(_IO_file_doallocate)), JUMP_INIT(read, _IO_cookie_read), JUMP_INIT(write, _IO_cookie_write), JUMP_INIT(seek, _IO_old_cookie_seek), diff --git a/libio/iofputs.c b/libio/iofputs.c index 9187d30e2f..0835e8417f 100644 --- a/libio/iofputs.c +++ b/libio/iofputs.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1993,1996,1997,1998,1999,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -45,6 +45,7 @@ _IO_fputs (str, fp) _IO_cleanup_region_end (0); return result; } +INTDEF(_IO_fputs) #ifdef weak_alias weak_alias (_IO_fputs, fputs) diff --git a/libio/iofread.c b/libio/iofread.c index 66b80c16ca..08f6ab0b59 100644 --- a/libio/iofread.c +++ b/libio/iofread.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995, 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1993,1995,1997,1998,1999,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -41,11 +41,12 @@ _IO_fread (buf, size, count, fp) return 0; _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp); _IO_flockfile (fp); - bytes_read = _IO_sgetn (fp, (char *) buf, bytes_requested); + bytes_read = INTUSE(_IO_sgetn) (fp, (char *) buf, bytes_requested); _IO_funlockfile (fp); _IO_cleanup_region_end (0); return bytes_requested == bytes_read ? count : bytes_read / size; } +INTDEF(_IO_fread) #ifdef weak_alias weak_alias (_IO_fread, fread) diff --git a/libio/iofread_u.c b/libio/iofread_u.c index d6c348430d..527af10de2 100644 --- a/libio/iofread_u.c +++ b/libio/iofread_u.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995, 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995, 1997, 1998, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -42,6 +42,6 @@ fread_unlocked (buf, size, count, fp) CHECK_FILE (fp, 0); if (bytes_requested == 0) return 0; - bytes_read = _IO_sgetn (fp, (char *) buf, bytes_requested); + bytes_read = INTUSE(_IO_sgetn) (fp, (char *) buf, bytes_requested); return bytes_requested == bytes_read ? count : bytes_read / size; } diff --git a/libio/iofsetpos.c b/libio/iofsetpos.c index 7cf82a3a48..3c3e61db57 100644 --- a/libio/iofsetpos.c +++ b/libio/iofsetpos.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995, 1997-1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995, 1997-2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -38,7 +38,8 @@ _IO_new_fsetpos (fp, posp) CHECK_FILE (fp, EOF); _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp); _IO_flockfile (fp); - if (_IO_seekpos (fp, posp->__pos, _IOS_INPUT|_IOS_OUTPUT) == _IO_pos_BAD) + if (INTUSE(_IO_seekpos) (fp, posp->__pos, _IOS_INPUT|_IOS_OUTPUT) + == _IO_pos_BAD) { /* ANSI explicitly requires setting errno to a positive value on failure. */ diff --git a/libio/iofsetpos64.c b/libio/iofsetpos64.c index c3eec375f5..f8c5374d17 100644 --- a/libio/iofsetpos64.c +++ b/libio/iofsetpos64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995, 1997-1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995, 1997-2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -39,7 +39,8 @@ _IO_new_fsetpos64 (fp, posp) CHECK_FILE (fp, EOF); _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp); _IO_flockfile (fp); - if (_IO_seekpos (fp, posp->__pos, _IOS_INPUT|_IOS_OUTPUT) == _IO_pos_BAD) + if (INTUSE(_IO_seekpos) (fp, posp->__pos, _IOS_INPUT|_IOS_OUTPUT) + == _IO_pos_BAD) { /* ANSI explicitly requires setting errno to a positive value on failure. */ diff --git a/libio/ioftell.c b/libio/ioftell.c index f2abd62ad8..8328c5b042 100644 --- a/libio/ioftell.c +++ b/libio/ioftell.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995-2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995-2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -38,7 +38,7 @@ _IO_ftell (fp) CHECK_FILE (fp, -1L); _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp); _IO_flockfile (fp); - pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0); + pos = INTUSE(_IO_seekoff) (fp, 0, _IO_seek_cur, 0); if (_IO_in_backup (fp)) { if (fp->_vtable_offset != 0 || fp->_mode <= 0) @@ -56,6 +56,7 @@ _IO_ftell (fp) } return pos; } +INTDEF(_IO_ftell) #ifdef weak_alias weak_alias (_IO_ftell, ftell) diff --git a/libio/iofwrite.c b/libio/iofwrite.c index b381882675..9a4016f06e 100644 --- a/libio/iofwrite.c +++ b/libio/iofwrite.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1993,96,97,98,99,2000,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -50,6 +50,7 @@ _IO_fwrite (buf, size, count, fp) else return written / size; } +INTDEF(_IO_fwrite) #ifdef weak_alias weak_alias (_IO_fwrite, fwrite) diff --git a/libio/iogetline.c b/libio/iogetline.c index 4b8ecd065a..eca38cf773 100644 --- a/libio/iogetline.c +++ b/libio/iogetline.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1993,1997,1998,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -38,8 +38,10 @@ _IO_getline (fp, buf, n, delim, extract_delim) int delim; int extract_delim; { - return _IO_getline_info (fp, buf, n, delim, extract_delim, (int *) 0); + return INTUSE(_IO_getline_info) (fp, buf, n, delim, extract_delim, + (int *) 0); } +INTDEF(_IO_getline) /* Algorithm based on that used by Berkeley pre-4.4 fgets implementation. @@ -79,7 +81,7 @@ _IO_getline_info (fp, buf, n, delim, extract_delim, eof) if (extract_delim > 0) *ptr++ = c; else if (extract_delim < 0) - _IO_sputbackc (fp, c); + INTUSE(_IO_sputbackc) (fp, c); if (extract_delim > 0) ++len; return ptr - buf; @@ -115,5 +117,6 @@ _IO_getline_info (fp, buf, n, delim, extract_delim, eof) } return ptr - buf; } +INTDEF(_IO_getline_info) #endif /* Defined _LIBC || !_G_HAVE_IO_GETLINE_INFO */ diff --git a/libio/iogets.c b/libio/iogets.c index eb89df3c35..95e8368dbb 100644 --- a/libio/iogets.c +++ b/libio/iogets.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1996, 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1996, 1997, 1998, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -55,7 +55,7 @@ _IO_gets (buf) int old_error = _IO_stdin->_IO_file_flags & _IO_ERR_SEEN; _IO_stdin->_IO_file_flags &= ~_IO_ERR_SEEN; buf[0] = (char) ch; - count = _IO_getline (_IO_stdin, buf + 1, INT_MAX, '\n', 0) + 1; + count = INTUSE(_IO_getline) (_IO_stdin, buf + 1, INT_MAX, '\n', 0) + 1; if (_IO_stdin->_IO_file_flags & _IO_ERR_SEEN) { retval = NULL; diff --git a/libio/iogetwline.c b/libio/iogetwline.c index 4092745001..e529b7d832 100644 --- a/libio/iogetwline.c +++ b/libio/iogetwline.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1993,1997,1998,1999,2000,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -86,7 +86,7 @@ _IO_getwline_info (fp, buf, n, delim, extract_delim, eof) if (extract_delim > 0) *ptr++ = wc; else if (extract_delim < 0) - _IO_sputbackc (fp, wc); + INTUSE(_IO_sputbackc) (fp, wc); return ptr - buf; if (extract_delim > 0) ++len; diff --git a/libio/iolibio.h b/libio/iolibio.h index 709760670b..e15523ec05 100644 --- a/libio/iolibio.h +++ b/libio/iolibio.h @@ -55,15 +55,20 @@ extern int _IO_obstack_printf __P ((struct obstack *, const char *, ...)); #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) + (INTUSE(_IO_seekoff)(__fp, __offset, __whence, _IOS_INPUT|_IOS_OUTPUT) \ + == _IO_pos_BAD ? EOF : 0) +#define _IO_rewind(FILE) \ + (void)INTUSE(_IO_seekoff)(FILE, 0, 0, _IOS_INPUT|_IOS_OUTPUT) +#define _IO_vprintf(FORMAT, ARGS) \ + INTUSE(_IO_vfprintf) (_IO_stdout, FORMAT, ARGS) #define _IO_freopen(FILENAME, MODE, FP) \ - (_IO_file_close_it(FP), _IO_file_fopen(FP, FILENAME, MODE, 1)) + (INTUSE(_IO_file_close_it)(FP), \ + INTUSE(_IO_file_fopen)(FP, FILENAME, MODE, 1)) #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, 0)) + (INTUSE(_IO_file_close_it)(FP), \ + INTUSE(_IO_file_fopen)(FP, FILENAME, MODE, 0)) #define _IO_fileno(FP) ((FP)->_fileno) extern _IO_FILE* _IO_popen __P((const char*, const char*)); extern _IO_FILE* _IO_new_popen __P((const char*, const char*)); @@ -71,12 +76,25 @@ 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 *)); #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) +#define _IO_setbuf(_FP, _BUF) INTUSE(_IO_setbuffer)(_FP, _BUF, _IO_BUFSIZ) +#define _IO_setlinebuf(_FP) INTUSE(_IO_setvbuf)(_FP, NULL, 1, 0) _IO_FILE *__new_freopen __P ((const char *, const char *, _IO_FILE *)); _IO_FILE *__old_freopen __P ((const char *, const char *, _IO_FILE *)); +/* Prototype for functions with alternative entry point. */ +extern void _IO_setbuffer_internal __P((_IO_FILE *, char*, _IO_size_t)); +extern _IO_size_t _IO_fread_internal __P((void*, _IO_size_t, _IO_size_t, + _IO_FILE*)); +extern _IO_FILE *_IO_fdopen_internal __P((int, const char*)); +extern int _IO_vsprintf_internal __P((char*, const char*, _IO_va_list)); +extern int _IO_fflush_internal __P((_IO_FILE*)); +extern _IO_size_t _IO_fwrite_internal __P((const void*, _IO_size_t, + _IO_size_t, _IO_FILE*)); +extern long int _IO_ftell_internal __P((_IO_FILE*)); +extern int _IO_fputs_internal __P((const char*, _IO_FILE*)); +extern int _IO_setvbuf_internal __P((_IO_FILE*, char*, int, _IO_size_t)); + #ifdef __cplusplus } #endif diff --git a/libio/iopadn.c b/libio/iopadn.c index f5c89d9e8a..b957394356 100644 --- a/libio/iopadn.c +++ b/libio/iopadn.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1997, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -70,3 +70,4 @@ _IO_padn (fp, pad, count) } return written; } +INTDEF(_IO_padn) diff --git a/libio/iopopen.c b/libio/iopopen.c index f4b65fd1de..d6a6f6aa47 100644 --- a/libio/iopopen.c +++ b/libio/iopopen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,1997,1998,1999,2000,2001 Free Software Foundation, Inc. +/* Copyright (C) 1993,1997-2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Per Bothner <bothner@cygnus.com>. @@ -230,7 +230,7 @@ _IO_new_popen (command, mode) #endif if (_IO_new_proc_open (fp, command, mode) != NULL) return (_IO_FILE *) &new_f->fpx.file; - _IO_un_link (&new_f->fpx.file); + INTUSE(_IO_un_link) (&new_f->fpx.file); free (new_f); return NULL; } @@ -289,20 +289,20 @@ struct _IO_jump_t _IO_proc_jumps = { JUMP_INIT(finish, _IO_new_file_finish), JUMP_INIT(overflow, _IO_new_file_overflow), JUMP_INIT(underflow, _IO_new_file_underflow), - JUMP_INIT(uflow, _IO_default_uflow), - JUMP_INIT(pbackfail, _IO_default_pbackfail), + JUMP_INIT(uflow, INTUSE(_IO_default_uflow)), + JUMP_INIT(pbackfail, INTUSE(_IO_default_pbackfail)), JUMP_INIT(xsputn, _IO_new_file_xsputn), - JUMP_INIT(xsgetn, _IO_default_xsgetn), + JUMP_INIT(xsgetn, INTUSE(_IO_default_xsgetn)), JUMP_INIT(seekoff, _IO_new_file_seekoff), JUMP_INIT(seekpos, _IO_default_seekpos), JUMP_INIT(setbuf, _IO_new_file_setbuf), JUMP_INIT(sync, _IO_new_file_sync), - JUMP_INIT(doallocate, _IO_file_doallocate), - JUMP_INIT(read, _IO_file_read), + JUMP_INIT(doallocate, INTUSE(_IO_file_doallocate)), + JUMP_INIT(read, INTUSE(_IO_file_read)), JUMP_INIT(write, _IO_new_file_write), - JUMP_INIT(seek, _IO_file_seek), + JUMP_INIT(seek, INTUSE(_IO_file_seek)), JUMP_INIT(close, _IO_new_proc_close), - JUMP_INIT(stat, _IO_file_stat), + JUMP_INIT(stat, INTUSE(_IO_file_stat)), JUMP_INIT(showmanyc, _IO_default_showmanyc), JUMP_INIT(imbue, _IO_default_imbue) }; @@ -312,20 +312,20 @@ static struct _IO_jump_t _IO_wproc_jumps = { JUMP_INIT(finish, _IO_new_file_finish), JUMP_INIT(overflow, _IO_new_file_overflow), JUMP_INIT(underflow, _IO_new_file_underflow), - JUMP_INIT(uflow, _IO_default_uflow), - JUMP_INIT(pbackfail, _IO_default_pbackfail), + JUMP_INIT(uflow, INTUSE(_IO_default_uflow)), + JUMP_INIT(pbackfail, INTUSE(_IO_default_pbackfail)), JUMP_INIT(xsputn, _IO_new_file_xsputn), - JUMP_INIT(xsgetn, _IO_default_xsgetn), + JUMP_INIT(xsgetn, INTUSE(_IO_default_xsgetn)), JUMP_INIT(seekoff, _IO_new_file_seekoff), JUMP_INIT(seekpos, _IO_default_seekpos), JUMP_INIT(setbuf, _IO_new_file_setbuf), JUMP_INIT(sync, _IO_new_file_sync), - JUMP_INIT(doallocate, _IO_file_doallocate), - JUMP_INIT(read, _IO_file_read), + JUMP_INIT(doallocate, INTUSE(_IO_file_doallocate)), + JUMP_INIT(read, INTUSE(_IO_file_read)), JUMP_INIT(write, _IO_new_file_write), - JUMP_INIT(seek, _IO_file_seek), + JUMP_INIT(seek, INTUSE(_IO_file_seek)), JUMP_INIT(close, _IO_new_proc_close), - JUMP_INIT(stat, _IO_file_stat), + JUMP_INIT(stat, INTUSE(_IO_file_stat)), JUMP_INIT(showmanyc, _IO_default_showmanyc), JUMP_INIT(imbue, _IO_default_imbue) }; diff --git a/libio/ioseekoff.c b/libio/ioseekoff.c index 2111bec745..eff6d3874d 100644 --- a/libio/ioseekoff.c +++ b/libio/ioseekoff.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997, 1998, 1999, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1993,1997,1998,1999,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -56,7 +56,8 @@ _IO_seekoff (fp, offset, dir, mode) _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp); _IO_flockfile (fp); - if (mode != 0 && _IO_have_backup (fp)) + if (mode != 0 && ((_IO_fwide (fp, 0) < 0 && _IO_have_backup (fp)) + || (_IO_fwide (fp, 0) > 0 && _IO_have_wbackup (fp)))) { if (dir == _IO_seek_cur && _IO_in_backup (fp)) { @@ -65,7 +66,10 @@ _IO_seekoff (fp, offset, dir, mode) else abort (); } - _IO_free_backup_area (fp); + if (_IO_fwide (fp, 0) < 0) + INTUSE(_IO_free_backup_area) (fp); + else + INTUSE(_IO_free_wbackup_area) (fp); } retval = _IO_SEEKOFF (fp, offset, dir, mode); @@ -74,3 +78,4 @@ _IO_seekoff (fp, offset, dir, mode) _IO_cleanup_region_end (0); return retval; } +INTDEF(_IO_seekoff) diff --git a/libio/ioseekpos.c b/libio/ioseekpos.c index 4799404ec9..8aa151a41e 100644 --- a/libio/ioseekpos.c +++ b/libio/ioseekpos.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -41,11 +41,21 @@ _IO_seekpos (fp, pos, mode) _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp); _IO_flockfile (fp); - if (_IO_have_backup (fp)) - _IO_free_backup_area (fp); + if (_IO_fwide (fp, 0) <= 0) + { + if (_IO_have_backup (fp)) + INTUSE(_IO_free_backup_area) (fp); + } + else + { + if (_IO_have_wbackup (fp)) + INTUSE(_IO_free_wbackup_area) (fp); + } + retval = _IO_SEEKPOS (fp, pos, mode); _IO_funlockfile (fp); _IO_cleanup_region_end (0); return retval; } +INTDEF(_IO_seekpos) diff --git a/libio/iosetbuffer.c b/libio/iosetbuffer.c index 49c0deff3c..785fcab4bd 100644 --- a/libio/iosetbuffer.c +++ b/libio/iosetbuffer.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1993,95,96,97,98,99,2000,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -46,6 +46,7 @@ _IO_setbuffer (fp, buf, size) _IO_funlockfile (fp); _IO_cleanup_region_end (0); } +INTDEF(_IO_setbuffer) #ifdef weak_alias weak_alias (_IO_setbuffer, setbuffer) diff --git a/libio/iosetvbuf.c b/libio/iosetvbuf.c index c7ee6effb0..addf4ed1c4 100644 --- a/libio/iosetvbuf.c +++ b/libio/iosetvbuf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,96,97,98,99,2000,2001 Free Software Foundation, Inc. +/* Copyright (C) 1993,96,97,98,99,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -104,6 +104,7 @@ unlock_return: _IO_cleanup_region_end (0); return result; } +INTDEF(_IO_setvbuf) #ifdef weak_alias weak_alias (_IO_setvbuf, setvbuf) diff --git a/libio/iosprintf.c b/libio/iosprintf.c deleted file mode 100644 index 21376a6e56..0000000000 --- a/libio/iosprintf.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright (C) 1993, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. - - As a special exception, if you link the code in this file with - files compiled with a GNU compiler to produce an executable, - that does not cause the resulting executable to be covered by - the GNU Lesser General Public License. This exception does not - however invalidate any other reasons why the executable file - might be covered by the GNU Lesser General Public License. - This exception applies to code released by its copyright holders - in files containing the exception. */ - -#include "libioP.h" - -#ifdef __STDC__ -#include <stdarg.h> -#else -#include <varargs.h> -#endif - -int -#ifdef __STDC__ -_IO_sprintf (char *string, const char* format, ...) -#else -_IO_sprintf (string, format, va_alist) - char *string; - char *format; - va_dcl -#endif -{ - int ret; - va_list args; - _IO_va_start (args, format); - ret = _IO_vsprintf (string, format, args); - va_end (args); - return ret; -} diff --git a/libio/ioungetc.c b/libio/ioungetc.c index 7c4e0e7d32..d32359bd40 100644 --- a/libio/ioungetc.c +++ b/libio/ioungetc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1996, 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1993,1996,1997,1998,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -38,7 +38,7 @@ _IO_ungetc (c, fp) return EOF; _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp); _IO_flockfile (fp); - result = _IO_sputbackc (fp, (unsigned char) c); + result = INTUSE(_IO_sputbackc) (fp, (unsigned char) c); _IO_funlockfile (fp); _IO_cleanup_region_end (0); return result; diff --git a/libio/ioungetwc.c b/libio/ioungetwc.c index 542b7b1e2b..1bff41256c 100644 --- a/libio/ioungetwc.c +++ b/libio/ioungetwc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1996-1999, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1996-1999, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -41,7 +41,7 @@ ungetwc (c, fp) if (c == WEOF) result = WEOF; else - result = _IO_sputbackwc (fp, c); + result = INTUSE(_IO_sputbackwc) (fp, c); _IO_funlockfile (fp); _IO_cleanup_region_end (0); return result; diff --git a/libio/iovdprintf.c b/libio/iovdprintf.c index 636259e382..dab9a17fca 100644 --- a/libio/iovdprintf.c +++ b/libio/iovdprintf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1997-2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1997-2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -42,15 +42,15 @@ _IO_vdprintf (d, format, arg) #ifdef _IO_MTSAFE_IO tmpfil.file._lock = NULL; #endif - _IO_no_init (&tmpfil.file, _IO_USER_LOCK, 0, &wd, &_IO_wfile_jumps); - _IO_JUMPS (&tmpfil) = &_IO_file_jumps; - _IO_file_init (&tmpfil); + _IO_no_init (&tmpfil.file, _IO_USER_LOCK, 0, &wd, &INTUSE(_IO_wfile_jumps)); + _IO_JUMPS (&tmpfil) = &INTUSE(_IO_file_jumps); + INTUSE(_IO_file_init) (&tmpfil); #if !_IO_UNIFIED_JUMPTABLES tmpfil.vtable = NULL; #endif - if (_IO_file_attach (&tmpfil.file, d) == NULL) + if (INTUSE(_IO_file_attach) (&tmpfil.file, d) == NULL) { - _IO_un_link (&tmpfil); + INTUSE(_IO_un_link) (&tmpfil); return EOF; } tmpfil.file._IO_file_flags = @@ -58,7 +58,7 @@ _IO_vdprintf (d, format, arg) _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING) | _IO_DELETE_DONT_CLOSE); - done = _IO_vfprintf (&tmpfil.file, format, arg); + done = INTUSE(_IO_vfprintf) (&tmpfil.file, format, arg); _IO_FINISH (&tmpfil.file); diff --git a/libio/iovsprintf.c b/libio/iovsprintf.c index ac1d9bd79e..dbaa53f7c8 100644 --- a/libio/iovsprintf.c +++ b/libio/iovsprintf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997-2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1997-2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -42,11 +42,12 @@ _IO_vsprintf (string, format, args) #endif _IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL); _IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps; - _IO_str_init_static (&sf, string, -1, string); - ret = _IO_vfprintf ((_IO_FILE *) &sf._sbf, format, args); + INTUSE(_IO_str_init_static) (&sf, string, -1, string); + ret = INTUSE(_IO_vfprintf) ((_IO_FILE *) &sf._sbf, format, args); _IO_putc_unlocked ('\0', (_IO_FILE *) &sf._sbf); return ret; } +INTDEF(_IO_vsprintf) #ifdef weak_alias weak_alias (_IO_vsprintf, vsprintf) diff --git a/libio/iovsscanf.c b/libio/iovsscanf.c index 2653b4794f..1bb475549c 100644 --- a/libio/iovsscanf.c +++ b/libio/iovsscanf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997-2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1997-2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -41,8 +41,8 @@ _IO_vsscanf (string, format, args) #endif _IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL); _IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps; - _IO_str_init_static (&sf, (char*)string, 0, NULL); - ret = _IO_vfscanf ((_IO_FILE *) &sf._sbf, format, args, NULL); + INTUSE(_IO_str_init_static) (&sf, (char*)string, 0, NULL); + ret = INTUSE(_IO_vfscanf) ((_IO_FILE *) &sf._sbf, format, args, NULL); return ret; } diff --git a/libio/libioP.h b/libio/libioP.h index e25a6e7ef1..b40e9e69eb 100644 --- a/libio/libioP.h +++ b/libio/libioP.h @@ -37,6 +37,18 @@ #include "iolibio.h" +/* Control of exported symbols. Used in glibc. By default we don't + do anything. */ +#ifndef INTUSE +# define INTUSE(name) name +#endif +#ifndef INTDEF +# define INTDEF(name) +#endif +#ifndef INTDEF2 +# define INTDEF2(name) +#endif + #ifdef __cplusplus extern "C" { #endif @@ -445,15 +457,15 @@ extern int _IO_old_fsetpos64 __P ((_IO_FILE *, const _IO_fpos64_t *)); #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T # define _IO_do_flush(_f) \ ((_f)->_mode <= 0 \ - ? _IO_do_write(_f, (_f)->_IO_write_base, \ - (_f)->_IO_write_ptr-(_f)->_IO_write_base) \ - : _IO_wdo_write(_f, (_f)->_wide_data->_IO_write_base, \ - ((_f)->_wide_data->_IO_write_ptr \ - - (_f)->_wide_data->_IO_write_base))) + ? INTUSE(_IO_do_write)(_f, (_f)->_IO_write_base, \ + (_f)->_IO_write_ptr-(_f)->_IO_write_base) \ + : INTUSE(_IO_wdo_write)(_f, (_f)->_wide_data->_IO_write_base, \ + ((_f)->_wide_data->_IO_write_ptr \ + - (_f)->_wide_data->_IO_write_base))) #else # define _IO_do_flush(_f) \ - _IO_do_write(_f, (_f)->_IO_write_base, \ - (_f)->_IO_write_ptr-(_f)->_IO_write_base) + INTUSE(_IO_do_write)(_f, (_f)->_IO_write_base, \ + (_f)->_IO_write_ptr-(_f)->_IO_write_base) #endif #define _IO_old_do_flush(_f) \ _IO_old_do_write(_f, (_f)->_IO_write_base, \ @@ -610,6 +622,109 @@ extern int _IO_outfloat __P ((double __value, _IO_FILE *__sb, int __type, extern struct _IO_FILE_plus *_IO_list_all; extern void (*_IO_cleanup_registration_needed) __PMT ((void)); +/* Prototype for functions with alternative entry point. */ +extern int _IO_flush_all_internal __P ((void)); +extern unsigned _IO_adjust_column_internal __P ((unsigned, const char *, int)); + +extern int _IO_default_uflow_internal __P ((_IO_FILE *)); +extern void _IO_default_finish_internal __P ((_IO_FILE *, int)); +extern int _IO_default_pbackfail_internal __P ((_IO_FILE *, int)); +extern _IO_size_t _IO_default_xsputn_internal __P ((_IO_FILE *, const void *, + _IO_size_t)); +extern _IO_size_t _IO_default_xsgetn_internal __P ((_IO_FILE *, void *, + _IO_size_t)); +extern int _IO_default_doallocate_internal __P ((_IO_FILE *)); +extern void _IO_wdefault_finish_internal __P ((_IO_FILE *, int)); +extern wint_t _IO_wdefault_pbackfail_internal __P ((_IO_FILE *, wint_t)); +extern _IO_size_t _IO_wdefault_xsputn_internal __P ((_IO_FILE *, const void *, + _IO_size_t)); +extern _IO_size_t _IO_wdefault_xsgetn_internal __P ((_IO_FILE *, void *, + _IO_size_t)); +extern _IO_FILE* _IO_wdefault_setbuf_internal __P ((_IO_FILE *, wchar_t *, + _IO_ssize_t)); +extern int _IO_wdefault_doallocate_internal __P ((_IO_FILE *)); +extern wint_t _IO_wdefault_uflow_internal __P ((_IO_FILE *)); + +extern int _IO_file_doallocate_internal __P ((_IO_FILE *)); +extern _IO_FILE* _IO_file_setbuf_internal __P ((_IO_FILE *, char *, + _IO_ssize_t)); +extern _IO_off64_t _IO_file_seekoff_internal __P ((_IO_FILE *, _IO_off64_t, + int, int)); +extern _IO_size_t _IO_file_xsputn_internal __P ((_IO_FILE *, const void *, + _IO_size_t)); +extern _IO_size_t _IO_file_xsgetn_internal __P ((_IO_FILE *, void *, + _IO_size_t)); +extern int _IO_file_stat_internal __P ((_IO_FILE *, void *)); +extern int _IO_file_close_internal __P ((_IO_FILE *)); +extern int _IO_file_close_it_internal __P ((_IO_FILE *)); +extern int _IO_file_underflow_internal __P ((_IO_FILE *)); +extern int _IO_file_overflow_internal __P ((_IO_FILE *, int)); +extern void _IO_file_init_internal __P ((struct _IO_FILE_plus *)); +extern _IO_FILE* _IO_file_attach_internal __P ((_IO_FILE *, int)); +extern _IO_FILE* _IO_file_fopen_internal __P ((_IO_FILE *, const char *, + const char *, int)); +extern _IO_ssize_t _IO_file_read_internal __P ((_IO_FILE *, void *, + _IO_ssize_t)); +extern int _IO_file_sync_internal __P ((_IO_FILE *)); +extern _IO_off64_t _IO_file_seek_internal __P ((_IO_FILE *, _IO_off64_t, int)); +extern void _IO_file_finish_internal __P ((_IO_FILE *, int)); + +extern _IO_size_t _IO_wfile_xsputn_internal __P ((_IO_FILE *, const void *, + _IO_size_t)); +extern _IO_off64_t _IO_wfile_seekoff_internal __P ((_IO_FILE *, _IO_off64_t, + int, int)); +extern wint_t _IO_wfile_sync_internal __P ((_IO_FILE *)); + +extern int _IO_str_underflow_internal __P ((_IO_FILE *)); +extern int _IO_str_overflow_internal __P ((_IO_FILE *, int)); +extern int _IO_str_pbackfail_internal __P ((_IO_FILE *, int)); +extern _IO_off64_t _IO_str_seekoff_internal __P ((_IO_FILE *, _IO_off64_t, + int, int)); +extern void _IO_str_init_static_internal __P ((struct _IO_strfile_ *, char *, + int, char *)); + +extern struct _IO_jump_t _IO_file_jumps_internal; +extern struct _IO_jump_t _IO_wfile_jumps_internal; + +extern struct _IO_FILE_plus *_IO_list_all_internal; + +extern void _IO_link_in_internal __P ((struct _IO_FILE_plus *)); +extern int _IO_sputbackc_internal __P ((_IO_FILE *, int)); +extern void _IO_wdoallocbuf_internal __P ((_IO_FILE *)); + +extern _IO_size_t _IO_sgetn_internal (_IO_FILE *, void *, _IO_size_t); +extern void _IO_flush_all_linebuffered_internal __P ((void)); +extern int _IO_switch_to_wget_mode_internal __P ((_IO_FILE *)); +extern void _IO_unsave_markers_internal __P ((_IO_FILE *)); +extern void _IO_switch_to_main_wget_area_internal __P ((_IO_FILE *)); +extern int _IO_wdo_write_internal __P ((_IO_FILE *, const wchar_t *, + _IO_size_t)); +extern int _IO_do_write_internal __P ((_IO_FILE *, const char *, _IO_size_t)); +extern _IO_ssize_t _IO_padn_internal (_IO_FILE *, int, _IO_ssize_t); +extern _IO_size_t _IO_getline_info_internal __P ((_IO_FILE *,char *, + _IO_size_t, int, int, + int *)); +extern _IO_size_t _IO_getline_internal __P ((_IO_FILE *, char *, _IO_size_t, + int, int)); +extern void _IO_free_wbackup_area_internal (_IO_FILE *); +extern void _IO_free_backup_area_internal (_IO_FILE *); +extern void _IO_switch_to_wbackup_area_internal __P ((_IO_FILE *)); +extern void _IO_setb_internal __P ((_IO_FILE *, char *, char *, int)); +extern wint_t _IO_sputbackwc_internal __P ((_IO_FILE *, wint_t)); +extern int _IO_switch_to_get_mode_internal __P ((_IO_FILE *)); +extern int _IO_vfscanf_internal (_IO_FILE * __restrict, + const char * __restrict, + _IO_va_list, int *__restrict); +extern int _IO_vfprintf_internal (_IO_FILE *__restrict, const char *__restrict, + _IO_va_list); +extern void _IO_doallocbuf_internal __P ((_IO_FILE *)); +extern void _IO_wsetb_internal __P ((_IO_FILE *, wchar_t *, wchar_t *, int)); +extern _IO_off64_t _IO_seekoff_internal (_IO_FILE *, _IO_off64_t, int, int); +extern _IO_off64_t _IO_seekpos_internal (_IO_FILE *, _IO_off64_t, int); +extern int _IO_putc_internal (int __c, _IO_FILE *__fp); +extern void _IO_init_internal __P ((_IO_FILE *, int)); +extern void _IO_un_link_internal __P ((struct _IO_FILE_plus *)); + #ifndef EOF # define EOF (-1) #endif diff --git a/libio/memstream.c b/libio/memstream.c index a6a54e19e2..2f7d834f55 100644 --- a/libio/memstream.c +++ b/libio/memstream.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1997,1999,2000,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -40,17 +40,17 @@ static struct _IO_jump_t _IO_mem_jumps = { JUMP_INIT_DUMMY, JUMP_INIT (finish, _IO_mem_finish), - JUMP_INIT (overflow, _IO_str_overflow), - JUMP_INIT (underflow, _IO_str_underflow), - JUMP_INIT (uflow, _IO_default_uflow), - JUMP_INIT (pbackfail, _IO_str_pbackfail), - JUMP_INIT (xsputn, _IO_default_xsputn), - JUMP_INIT (xsgetn, _IO_default_xsgetn), - JUMP_INIT (seekoff, _IO_str_seekoff), + JUMP_INIT (overflow, INTUSE(_IO_str_overflow)), + JUMP_INIT (underflow, INTUSE(_IO_str_underflow)), + JUMP_INIT (uflow, INTUSE(_IO_default_uflow)), + JUMP_INIT (pbackfail, INTUSE(_IO_str_pbackfail)), + JUMP_INIT (xsputn, INTUSE(_IO_default_xsputn)), + JUMP_INIT (xsgetn, INTUSE(_IO_default_xsgetn)), + JUMP_INIT (seekoff, INTUSE(_IO_str_seekoff)), JUMP_INIT (seekpos, _IO_default_seekpos), JUMP_INIT (setbuf, _IO_default_setbuf), JUMP_INIT (sync, _IO_mem_sync), - JUMP_INIT (doallocate, _IO_default_doallocate), + JUMP_INIT (doallocate, INTUSE(_IO_default_doallocate)), JUMP_INIT (read, _IO_default_read), JUMP_INIT (write, _IO_default_write), JUMP_INIT (seek, _IO_default_seek), @@ -66,15 +66,15 @@ static struct _IO_jump_t _IO_wmem_jumps = JUMP_INIT (finish, (_IO_finish_t) _IO_wmem_finish), JUMP_INIT (overflow, (_IO_overflow_t) _IO_wstr_overflow), JUMP_INIT (underflow, (_IO_underflow_t) _IO_wstr_underflow), - JUMP_INIT (uflow, (_IO_underflow_t) _IO_wdefault_uflow), + JUMP_INIT (uflow, (_IO_underflow_t) INTUSE(_IO_wdefault_uflow)), JUMP_INIT (pbackfail, (_IO_pbackfail_t) _IO_wstr_pbackfail), - JUMP_INIT (xsputn, (_IO_xsputn_t) _IO_wdefault_xsputn), - JUMP_INIT (xsgetn, (_IO_xsgetn_t) _IO_wdefault_xsgetn), + JUMP_INIT (xsputn, (_IO_xsputn_t) INTUSE(_IO_wdefault_xsputn)), + JUMP_INIT (xsgetn, (_IO_xsgetn_t) INTUSE(_IO_wdefault_xsgetn)), JUMP_INIT (seekoff, _IO_wstr_seekoff), JUMP_INIT (seekpos, _IO_default_seekpos), - JUMP_INIT (setbuf, (_IO_setbuf_t) _IO_wdefault_setbuf), + JUMP_INIT (setbuf, (_IO_setbuf_t) INTUSE(_IO_wdefault_setbuf)), JUMP_INIT (sync, (_IO_sync_t) _IO_wmem_sync), - JUMP_INIT (doallocate, _IO_wdefault_doallocate), + JUMP_INIT (doallocate, INTUSE(_IO_wdefault_doallocate)), JUMP_INIT (read, _IO_default_read), JUMP_INIT (write, _IO_default_write), JUMP_INIT (seek, _IO_default_seek), @@ -114,7 +114,7 @@ open_memstream (bufloc, sizeloc) return NULL; _IO_no_init (&new_f->fp._sf._sbf._f, 0, 0, &new_f->wd, &_IO_wmem_jumps); _IO_JUMPS ((struct _IO_FILE_plus *) &new_f->fp._sf._sbf) = &_IO_mem_jumps; - _IO_str_init_static (&new_f->fp._sf, buf, _IO_BUFSIZ, buf); + INTUSE(_IO_str_init_static) (&new_f->fp._sf, buf, _IO_BUFSIZ, buf); new_f->fp._sf._sbf._f._flags &= ~_IO_USER_BUF; new_f->fp._sf._s._allocate_buffer = (_IO_alloc_type) malloc; new_f->fp._sf._s._free_buffer = (_IO_free_type) free; @@ -139,7 +139,7 @@ _IO_mem_sync (fp) if (fp->_IO_write_ptr == fp->_IO_write_end) { - _IO_str_overflow (fp, '\0'); + INTUSE(_IO_str_overflow) (fp, '\0'); --fp->_IO_write_ptr; } else @@ -169,7 +169,7 @@ _IO_mem_finish (fp, dummy) fp->_IO_buf_base = NULL; - _IO_default_finish (fp, 0); + INTUSE(_IO_default_finish) (fp, 0); } @@ -221,5 +221,5 @@ _IO_wmem_finish (fp, dummy) fp->_wide_data->_IO_buf_base = NULL; - _IO_default_finish (fp, 0); + INTUSE(_IO_default_finish) (fp, 0); } diff --git a/libio/obprintf.c b/libio/obprintf.c index 9ef90bb5e3..aa59145daa 100644 --- a/libio/obprintf.c +++ b/libio/obprintf.c @@ -1,5 +1,5 @@ /* Print output of stream to given obstack. - Copyright (C) 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1996,1997,1999,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. @@ -153,9 +153,9 @@ _IO_obstack_vprintf (struct obstack *obstack, const char *format, va_list args) assert (size != 0); } - _IO_str_init_static ((struct _IO_strfile_ *) &new_f.ofile, - obstack_base (obstack), - size, obstack_next_free (obstack)); + INTUSE(_IO_str_init_static) ((struct _IO_strfile_ *) &new_f.ofile, + obstack_base (obstack), + size, obstack_next_free (obstack)); /* Now allocate the rest of the current chunk. */ assert (size == (new_f.ofile.file.file._IO_write_end - new_f.ofile.file.file._IO_write_base)); @@ -166,7 +166,7 @@ _IO_obstack_vprintf (struct obstack *obstack, const char *format, va_list args) new_f.ofile.obstack = obstack; - result = _IO_vfprintf (&new_f.ofile.file.file, format, args); + result = INTUSE(_IO_vfprintf) (&new_f.ofile.file.file, format, args); /* Shrink the buffer to the space we really currently need. */ obstack_blank_fast (obstack, (new_f.ofile.file.file._IO_write_ptr diff --git a/libio/oldfileops.c b/libio/oldfileops.c index 3d772fd4de..8998ee9b0d 100644 --- a/libio/oldfileops.c +++ b/libio/oldfileops.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,95,97,98,99,2000 Free Software Foundation, Inc. +/* Copyright (C) 1993,95,97,98,99,2000,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Per Bothner <bothner@cygnus.com>. @@ -124,7 +124,7 @@ _IO_old_file_init (fp) fp->file._old_offset = _IO_pos_BAD; fp->file._IO_file_flags |= CLOSED_FILEBUF_FLAGS; - _IO_link_in (fp); + INTUSE(_IO_link_in) (fp); fp->file._vtable_offset = ((int) sizeof (struct _IO_FILE) - (int) sizeof (struct _IO_FILE_complete)); fp->file._fileno = -1; @@ -140,16 +140,16 @@ _IO_old_file_close_it (fp) write_status = _IO_old_do_flush (fp); - _IO_unsave_markers(fp); + INTUSE(_IO_unsave_markers) (fp); close_status = _IO_SYSCLOSE (fp); /* Free buffer. */ - _IO_setb (fp, NULL, NULL, 0); + INTUSE(_IO_setb) (fp, NULL, NULL, 0); _IO_setg (fp, NULL, NULL, NULL); _IO_setp (fp, NULL, NULL); - _IO_un_link ((struct _IO_FILE_plus *) fp); + INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp); fp->_flags = _IO_MAGIC|CLOSED_FILEBUF_FLAGS; fp->_fileno = -1; fp->_old_offset = _IO_pos_BAD; @@ -168,7 +168,7 @@ _IO_old_file_finish (fp, dummy) if (!(fp->_flags & _IO_DELETE_DONT_CLOSE)) _IO_SYSCLOSE (fp); } - _IO_default_finish (fp, 0); + INTUSE(_IO_default_finish) (fp, 0); } _IO_FILE * @@ -216,7 +216,7 @@ _IO_old_file_fopen (fp, filename, mode) if (_IO_SEEKOFF (fp, (_IO_off_t)0, _IO_seek_end, _IOS_INPUT|_IOS_OUTPUT) == _IO_pos_BAD && errno != ESPIPE) return NULL; - _IO_link_in ((struct _IO_FILE_plus *) fp); + INTUSE(_IO_link_in) ((struct _IO_FILE_plus *) fp); return fp; } @@ -295,7 +295,8 @@ old_do_write (fp, data, to_do) } count = _IO_SYSWRITE (fp, data, to_do); if (fp->_cur_column && count) - fp->_cur_column = _IO_adjust_column (fp->_cur_column - 1, data, count) + 1; + fp->_cur_column = INTUSE(_IO_adjust_column) (fp->_cur_column - 1, data, + count) + 1; _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base); fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_buf_base; fp->_IO_write_end = ((fp->_flags & (_IO_LINE_BUF+_IO_UNBUFFERED)) @@ -331,15 +332,15 @@ _IO_old_file_underflow (fp) free (fp->_IO_save_base); fp->_flags &= ~_IO_IN_BACKUP; } - _IO_doallocbuf (fp); + INTUSE(_IO_doallocbuf) (fp); } /* Flush all line buffered files before reading. */ /* FIXME This can/should be moved to genops ?? */ if (fp->_flags & (_IO_LINE_BUF|_IO_UNBUFFERED)) - _IO_flush_all_linebuffered (); + INTUSE(_IO_flush_all_linebuffered) (); - _IO_switch_to_get_mode (fp); + INTUSE(_IO_switch_to_get_mode) (fp); /* This is very tricky. We have to adjust those pointers before we call _IO_SYSREAD () since @@ -384,7 +385,7 @@ _IO_old_file_overflow (f, ch) /* Allocate a buffer if needed. */ if (f->_IO_write_base == 0) { - _IO_doallocbuf (f); + INTUSE(_IO_doallocbuf) (f); _IO_setg (f, f->_IO_buf_base, f->_IO_buf_base, f->_IO_buf_base); } /* Otherwise must be currently reading. @@ -479,7 +480,7 @@ _IO_old_file_seekoff (fp, offset, dir, mode) FIXME: simulate mem-papped files. */ if (fp->_IO_write_ptr > fp->_IO_write_base || _IO_in_put_mode (fp)) - if (_IO_switch_to_get_mode (fp)) + if (INTUSE(_IO_switch_to_get_mode) (fp)) return EOF; if (fp->_IO_buf_base == NULL) @@ -490,7 +491,7 @@ _IO_old_file_seekoff (fp, offset, dir, mode) free (fp->_IO_read_base); fp->_flags &= ~_IO_IN_BACKUP; } - _IO_doallocbuf (fp); + INTUSE(_IO_doallocbuf) (fp); _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base); _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base); } @@ -576,7 +577,7 @@ _IO_old_file_seekoff (fp, offset, dir, mode) } #ifdef TODO - _IO_unsave_markers (fp); + INTUSE(_IO_unsave_markers) (fp); #endif if (fp->_flags & _IO_NO_READS) @@ -616,7 +617,7 @@ _IO_old_file_seekoff (fp, offset, dir, mode) return offset; dumb: - _IO_unsave_markers (fp); + INTUSE(_IO_unsave_markers) (fp); result = _IO_SYSSEEK (fp, offset, dir); if (result != EOF) { @@ -747,7 +748,7 @@ _IO_old_file_xsputn (f, data, n) buffer, but it's somewhat messier for line-buffered files, so we let _IO_default_xsputn handle the general case. */ if (to_do) - to_do -= _IO_default_xsputn (f, s+do_write, to_do); + to_do -= INTUSE(_IO_default_xsputn) (f, s+do_write, to_do); } return n - to_do; } @@ -759,20 +760,20 @@ struct _IO_jump_t _IO_old_file_jumps = JUMP_INIT(finish, _IO_old_file_finish), JUMP_INIT(overflow, _IO_old_file_overflow), JUMP_INIT(underflow, _IO_old_file_underflow), - JUMP_INIT(uflow, _IO_default_uflow), - JUMP_INIT(pbackfail, _IO_default_pbackfail), + JUMP_INIT(uflow, INTUSE(_IO_default_uflow)), + JUMP_INIT(pbackfail, INTUSE(_IO_default_pbackfail)), JUMP_INIT(xsputn, _IO_old_file_xsputn), - JUMP_INIT(xsgetn, _IO_default_xsgetn), + JUMP_INIT(xsgetn, INTUSE(_IO_default_xsgetn)), JUMP_INIT(seekoff, _IO_old_file_seekoff), JUMP_INIT(seekpos, _IO_default_seekpos), JUMP_INIT(setbuf, _IO_old_file_setbuf), JUMP_INIT(sync, _IO_old_file_sync), - JUMP_INIT(doallocate, _IO_file_doallocate), - JUMP_INIT(read, _IO_file_read), + JUMP_INIT(doallocate, INTUSE(_IO_file_doallocate)), + JUMP_INIT(read, INTUSE(_IO_file_read)), JUMP_INIT(write, _IO_old_file_write), - JUMP_INIT(seek, _IO_file_seek), - JUMP_INIT(close, _IO_file_close), - JUMP_INIT(stat, _IO_file_stat) + JUMP_INIT(seek, INTUSE(_IO_file_seek)), + JUMP_INIT(close, INTUSE(_IO_file_close)), + JUMP_INIT(stat, INTUSE(_IO_file_stat)) }; compat_symbol (libc, _IO_old_do_write, _IO_do_write, GLIBC_2_0); diff --git a/libio/oldiofclose.c b/libio/oldiofclose.c index c42e2f4eac..18db7b814f 100644 --- a/libio/oldiofclose.c +++ b/libio/oldiofclose.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995, 1997-2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995, 1997-2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -50,7 +50,7 @@ _IO_old_fclose (fp) /* First unlink the stream. */ if (fp->_IO_file_flags & _IO_IS_FILEBUF) - _IO_un_link ((struct _IO_FILE_plus *) fp); + INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp); _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, fp); _IO_flockfile (fp); @@ -62,7 +62,7 @@ _IO_old_fclose (fp) _IO_funlockfile (fp); _IO_cleanup_region_end (0); if (_IO_have_backup (fp)) - _IO_free_backup_area (fp); + INTUSE(_IO_free_backup_area) (fp); if (fp != _IO_stdin && fp != _IO_stdout && fp != _IO_stderr) { fp->_IO_file_flags = 0; diff --git a/libio/oldiofdopen.c b/libio/oldiofdopen.c index da8eaaf425..9015504970 100644 --- a/libio/oldiofdopen.c +++ b/libio/oldiofdopen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,94,97,99,2000 Free Software Foundation, Inc. +/* Copyright (C) 1993,94,97,99,2000,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -114,7 +114,7 @@ _IO_old_fdopen (fd, mode) #ifdef _IO_MTSAFE_IO new_f->fp.file._lock = &new_f->lock; #endif - _IO_init (&new_f->fp.file, 0); + INTUSE(_IO_init) (&new_f->fp.file, 0); _IO_JUMPS (&new_f->fp) = &_IO_old_file_jumps; _IO_old_file_init (&new_f->fp); #if !_IO_UNIFIED_JUMPTABLES @@ -122,7 +122,7 @@ _IO_old_fdopen (fd, mode) #endif if (_IO_old_file_attach (&new_f->fp.file, fd) == NULL) { - _IO_un_link (&new_f->fp); + INTUSE(_IO_un_link) (&new_f->fp); free (new_f); return NULL; } diff --git a/libio/oldiofgetpos.c b/libio/oldiofgetpos.c index b175b6ba02..0d6d1878fd 100644 --- a/libio/oldiofgetpos.c +++ b/libio/oldiofgetpos.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,95,96,97,98,99,2000 Free Software Foundation, Inc. +/* Copyright (C) 1993,95,96,97,98,99,2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -40,7 +40,7 @@ _IO_old_fgetpos (fp, posp) CHECK_FILE (fp, EOF); _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp); _IO_flockfile (fp); - pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0); + pos = INTUSE(_IO_seekoff) (fp, 0, _IO_seek_cur, 0); if (_IO_in_backup (fp)) pos -= fp->_IO_save_end - fp->_IO_save_base; _IO_funlockfile (fp); diff --git a/libio/oldiofgetpos64.c b/libio/oldiofgetpos64.c index a398fef188..b7fecbd426 100644 --- a/libio/oldiofgetpos64.c +++ b/libio/oldiofgetpos64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,95,96,97,98,99,2000 Free Software Foundation, Inc. +/* Copyright (C) 1993,95,96,97,98,99,2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -41,7 +41,7 @@ _IO_old_fgetpos64 (fp, posp) CHECK_FILE (fp, EOF); _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp); _IO_flockfile (fp); - pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0); + pos = INTUSE(_IO_seekoff) (fp, 0, _IO_seek_cur, 0); if (_IO_in_backup (fp)) pos -= fp->_IO_save_end - fp->_IO_save_base; _IO_funlockfile (fp); diff --git a/libio/oldiofopen.c b/libio/oldiofopen.c index 238f1d04f2..67a9eba6a6 100644 --- a/libio/oldiofopen.c +++ b/libio/oldiofopen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -53,7 +53,7 @@ _IO_old_fopen (filename, mode) #ifdef _IO_MTSAFE_IO new_f->fp.file._lock = &new_f->lock; #endif - _IO_init (&new_f->fp.file, 0); + INTUSE(_IO_init) (&new_f->fp.file, 0); _IO_JUMPS (&new_f->fp) = &_IO_old_file_jumps; _IO_old_file_init (&new_f->fp); #if !_IO_UNIFIED_JUMPTABLES @@ -61,7 +61,7 @@ _IO_old_fopen (filename, mode) #endif if (_IO_old_file_fopen ((_IO_FILE *) &new_f->fp, filename, mode) != NULL) return (_IO_FILE *) &new_f->fp; - _IO_un_link (&new_f->fp); + INTUSE(_IO_un_link) (&new_f->fp); free (new_f); return NULL; } diff --git a/libio/oldiofsetpos.c b/libio/oldiofsetpos.c index 66bece2b4e..39adc5f5a3 100644 --- a/libio/oldiofsetpos.c +++ b/libio/oldiofsetpos.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,95,97,98,99,2000 Free Software Foundation, Inc. +/* Copyright (C) 1993,95,97,98,99,2000,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -39,7 +39,8 @@ _IO_old_fsetpos (fp, posp) CHECK_FILE (fp, EOF); _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp); _IO_flockfile (fp); - if (_IO_seekpos (fp, posp->__pos, _IOS_INPUT|_IOS_OUTPUT) == _IO_pos_BAD) + if (INTUSE(_IO_seekpos) (fp, posp->__pos, _IOS_INPUT|_IOS_OUTPUT) + == _IO_pos_BAD) { /* ANSI explicitly requires setting errno to a positive value on failure. */ diff --git a/libio/oldiofsetpos64.c b/libio/oldiofsetpos64.c index 6a55d8c0e9..88071339e3 100644 --- a/libio/oldiofsetpos64.c +++ b/libio/oldiofsetpos64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,95,97,98,99,2000 Free Software Foundation, Inc. +/* Copyright (C) 1993,95,97,98,99,2000,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -41,7 +41,8 @@ _IO_old_fsetpos64 (fp, posp) CHECK_FILE (fp, EOF); _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp); _IO_flockfile (fp); - if (_IO_seekpos (fp, posp->__pos, _IOS_INPUT|_IOS_OUTPUT) == _IO_pos_BAD) + if (INTUSE(_IO_seekpos) (fp, posp->__pos, _IOS_INPUT|_IOS_OUTPUT) + == _IO_pos_BAD) { /* ANSI explicitly requires setting errno to a positive value on failure. */ diff --git a/libio/oldiopopen.c b/libio/oldiopopen.c index c00e942afd..878fdc0fcb 100644 --- a/libio/oldiopopen.c +++ b/libio/oldiopopen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Per Bothner <bothner@cygnus.com>. @@ -222,7 +222,7 @@ _IO_old_popen (command, mode) new_f->fpx.file.file._lock = &new_f->lock; #endif fp = &new_f->fpx.file.file; - _IO_init (fp, 0); + INTUSE(_IO_init) (fp, 0); _IO_JUMPS (&new_f->fpx.file) = &_IO_old_proc_jumps; _IO_old_file_init (&new_f->fpx.file); #if !_IO_UNIFIED_JUMPTABLES @@ -230,7 +230,7 @@ _IO_old_popen (command, mode) #endif if (_IO_old_proc_open (fp, command, mode) != NULL) return fp; - _IO_un_link (&new_f->fpx.file); + INTUSE(_IO_un_link) (&new_f->fpx.file); free (new_f); return NULL; } @@ -289,20 +289,20 @@ struct _IO_jump_t _IO_old_proc_jumps = { JUMP_INIT(finish, _IO_old_file_finish), JUMP_INIT(overflow, _IO_old_file_overflow), JUMP_INIT(underflow, _IO_old_file_underflow), - JUMP_INIT(uflow, _IO_default_uflow), - JUMP_INIT(pbackfail, _IO_default_pbackfail), + JUMP_INIT(uflow, INTUSE(_IO_default_uflow)), + JUMP_INIT(pbackfail, INTUSE(_IO_default_pbackfail)), JUMP_INIT(xsputn, _IO_old_file_xsputn), - JUMP_INIT(xsgetn, _IO_default_xsgetn), + JUMP_INIT(xsgetn, INTUSE(_IO_default_xsgetn)), JUMP_INIT(seekoff, _IO_old_file_seekoff), JUMP_INIT(seekpos, _IO_default_seekpos), JUMP_INIT(setbuf, _IO_old_file_setbuf), JUMP_INIT(sync, _IO_old_file_sync), - JUMP_INIT(doallocate, _IO_file_doallocate), - JUMP_INIT(read, _IO_file_read), + JUMP_INIT(doallocate, INTUSE(_IO_file_doallocate)), + JUMP_INIT(read, INTUSE(_IO_file_read)), JUMP_INIT(write, _IO_old_file_write), - JUMP_INIT(seek, _IO_file_seek), + JUMP_INIT(seek, INTUSE(_IO_file_seek)), JUMP_INIT(close, _IO_old_proc_close), - JUMP_INIT(stat, _IO_file_stat), + JUMP_INIT(stat, INTUSE(_IO_file_stat)), JUMP_INIT(showmanyc, _IO_default_showmanyc), JUMP_INIT(imbue, _IO_default_imbue) }; diff --git a/libio/oldstdfiles.c b/libio/oldstdfiles.c index 2c6ae183d9..d67ae27cbb 100644 --- a/libio/oldstdfiles.c +++ b/libio/oldstdfiles.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,94,96,97,99,2000 Free Software Foundation, Inc. +/* Copyright (C) 1993,94,96,97,99,2000,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -68,8 +68,6 @@ extern FILE *stdin; extern FILE *stdout; extern FILE *stderr; -extern struct _IO_FILE_plus *_IO_list_all; - static void _IO_check_libio __P ((void)) __attribute__ ((constructor)); /* This function determines which shared C library the application @@ -85,7 +83,7 @@ _IO_check_libio () _IO_stdin = stdin = (_IO_FILE *) &_IO_stdin_; _IO_stdout = stdout = (_IO_FILE *) &_IO_stdout_; _IO_stderr = stderr = (_IO_FILE *) &_IO_stderr_; - _IO_list_all = &_IO_stderr_; + INTUSE(_IO_list_all) = &_IO_stderr_; _IO_stdin->_vtable_offset = _IO_stdout->_vtable_offset = _IO_stderr->_vtable_offset = stdin->_vtable_offset = stdout->_vtable_offset = stderr->_vtable_offset = diff --git a/libio/putc.c b/libio/putc.c index 885964cd47..649574494f 100644 --- a/libio/putc.c +++ b/libio/putc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1991,1995,1996,1997,1998,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -35,6 +35,7 @@ _IO_putc (c, fp) _IO_cleanup_region_end (0); return result; } +INTDEF(_IO_putc) #undef putc diff --git a/libio/setbuf.c b/libio/setbuf.c index 7016e3a3f9..229cccb2df 100644 --- a/libio/setbuf.c +++ b/libio/setbuf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1997, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -33,5 +33,5 @@ setbuf (fp, buf) _IO_FILE *fp; char *buf; { - _IO_setbuffer (fp, buf, _IO_BUFSIZ); + INTUSE(_IO_setbuffer) (fp, buf, _IO_BUFSIZ); } diff --git a/libio/setlinebuf.c b/libio/setlinebuf.c index c15871f499..ded3c8f58c 100644 --- a/libio/setlinebuf.c +++ b/libio/setlinebuf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1997, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -34,5 +34,5 @@ void setlinebuf (stream) _IO_FILE *stream; { - _IO_setvbuf (stream, NULL, 1, 0); + INTUSE(_IO_setvbuf) (stream, NULL, 1, 0); } diff --git a/libio/stdfiles.c b/libio/stdfiles.c index cf8ce20b58..dd4be04207 100644 --- a/libio/stdfiles.c +++ b/libio/stdfiles.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1994, 1996, 1997, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1993-1997,1999,2000,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -39,30 +39,30 @@ # define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \ static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \ static struct _IO_wide_data _IO_wide_data_##FD \ - = { ._wide_vtable = &_IO_wfile_jumps }; \ + = { ._wide_vtable = &INTUSE(_IO_wfile_jumps) }; \ struct _IO_FILE_plus NAME \ = {FILEBUF_LITERAL(CHAIN, FLAGS, FD, &_IO_wide_data_##FD), \ - &_IO_file_jumps}; + &INTUSE(_IO_file_jumps)}; # else # define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \ static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \ struct _IO_FILE_plus NAME \ = {FILEBUF_LITERAL(CHAIN, FLAGS, FD, NULL), \ - &_IO_file_jumps}; + &INTUSE(_IO_file_jumps)}; # endif #else # if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T # define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \ static struct _IO_wide_data _IO_wide_data_##FD \ - = { ._wide_vtable = &_IO_wfile_jumps }; \ + = { ._wide_vtable = &INTUSE(_IO_wfile_jumps) }; \ struct _IO_FILE_plus NAME \ = {FILEBUF_LITERAL(CHAIN, FLAGS, FD, &_IO_wide_data_##FD), \ - &_IO_file_jumps}; + &INTUSE(_IO_file_jumps)}; # else # define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \ struct _IO_FILE_plus NAME \ = {FILEBUF_LITERAL(CHAIN, FLAGS, FD, NULL), \ - &_IO_file_jumps}; + &INTUSE(_IO_file_jumps)}; # endif #endif @@ -71,3 +71,4 @@ DEF_STDFILE(_IO_2_1_stdout_, 1, &_IO_2_1_stdin_, _IO_NO_READS); DEF_STDFILE(_IO_2_1_stderr_, 2, &_IO_2_1_stdout_, _IO_NO_READS+_IO_UNBUFFERED); struct _IO_FILE_plus *_IO_list_all = &_IO_2_1_stderr_; +INTDEF(_IO_list_all) diff --git a/libio/stdio.c b/libio/stdio.c index 7d9b062df3..9a594963e5 100644 --- a/libio/stdio.c +++ b/libio/stdio.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1994, 1996, 1997, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1993,1994,1996,1997,2000,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/libio/strops.c b/libio/strops.c index d679a0de63..d95f33c2e9 100644 --- a/libio/strops.c +++ b/libio/strops.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997-2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1997-2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -89,7 +89,7 @@ _IO_str_init_static (sf, ptr, size, pstart) size += s; } } - _IO_setb (fp, ptr, ptr + size, 0); + INTUSE(_IO_setb) (fp, ptr, ptr + size, 0); fp->_IO_write_base = ptr; fp->_IO_read_base = ptr; @@ -109,6 +109,7 @@ _IO_str_init_static (sf, ptr, size, pstart) /* A null _allocate_buffer function flags the strfile as being static. */ sf->_s._allocate_buffer = (_IO_alloc_type) 0; } +INTDEF(_IO_str_init_static) void _IO_str_init_readonly (sf, ptr, size) @@ -116,7 +117,7 @@ _IO_str_init_readonly (sf, ptr, size) const char *ptr; int size; { - _IO_str_init_static (sf, (char *) ptr, size, NULL); + INTUSE(_IO_str_init_static) (sf, (char *) ptr, size, NULL); sf->_sbf._f._IO_file_flags |= _IO_NO_WRITES; } @@ -163,7 +164,7 @@ _IO_str_overflow (fp, c) if (lenp == &LEN(fp)) /* use '\0'-filling */ memset (new_buf + pos, 0, blen() - pos); #endif - _IO_setb (fp, new_buf, new_buf + new_size, 1); + INTUSE(_IO_setb) (fp, new_buf, new_buf + new_size, 1); fp->_IO_read_base = new_buf + (fp->_IO_read_base - old_buf); fp->_IO_read_ptr = new_buf + (fp->_IO_read_ptr - old_buf); fp->_IO_read_end = new_buf + (fp->_IO_read_end - old_buf); @@ -180,6 +181,7 @@ _IO_str_overflow (fp, c) fp->_IO_read_end = fp->_IO_write_ptr; return c; } +INTDEF(_IO_str_overflow) int _IO_str_underflow (fp) @@ -198,6 +200,7 @@ _IO_str_underflow (fp) else return EOF; } +INTDEF(_IO_str_underflow) /* The size of the valid part of the buffer. */ @@ -279,6 +282,7 @@ _IO_str_seekoff (fp, offset, dir, mode) } return new_pos; } +INTDEF(_IO_str_seekoff) int _IO_str_pbackfail (fp, c) @@ -287,8 +291,9 @@ _IO_str_pbackfail (fp, c) { if ((fp->_flags & _IO_NO_WRITES) && c != EOF) return EOF; - return _IO_default_pbackfail (fp, c); + return INTUSE(_IO_default_pbackfail) (fp, c); } +INTDEF(_IO_str_pbackfail) void _IO_str_finish (fp, dummy) @@ -299,24 +304,24 @@ _IO_str_finish (fp, dummy) (((_IO_strfile *) fp)->_s._free_buffer) (fp->_IO_buf_base); fp->_IO_buf_base = NULL; - _IO_default_finish (fp, 0); + INTUSE(_IO_default_finish) (fp, 0); } struct _IO_jump_t _IO_str_jumps = { JUMP_INIT_DUMMY, JUMP_INIT(finish, _IO_str_finish), - JUMP_INIT(overflow, _IO_str_overflow), - JUMP_INIT(underflow, _IO_str_underflow), - JUMP_INIT(uflow, _IO_default_uflow), - JUMP_INIT(pbackfail, _IO_str_pbackfail), - JUMP_INIT(xsputn, _IO_default_xsputn), - JUMP_INIT(xsgetn, _IO_default_xsgetn), - JUMP_INIT(seekoff, _IO_str_seekoff), + JUMP_INIT(overflow, INTUSE(_IO_str_overflow)), + JUMP_INIT(underflow, INTUSE(_IO_str_underflow)), + JUMP_INIT(uflow, INTUSE(_IO_default_uflow)), + JUMP_INIT(pbackfail, INTUSE(_IO_str_pbackfail)), + JUMP_INIT(xsputn, INTUSE(_IO_default_xsputn)), + JUMP_INIT(xsgetn, INTUSE(_IO_default_xsgetn)), + JUMP_INIT(seekoff, INTUSE(_IO_str_seekoff)), JUMP_INIT(seekpos, _IO_default_seekpos), JUMP_INIT(setbuf, _IO_default_setbuf), JUMP_INIT(sync, _IO_default_sync), - JUMP_INIT(doallocate, _IO_default_doallocate), + JUMP_INIT(doallocate, INTUSE(_IO_default_doallocate)), JUMP_INIT(read, _IO_default_read), JUMP_INIT(write, _IO_default_write), JUMP_INIT(seek, _IO_default_seek), diff --git a/libio/vasprintf.c b/libio/vasprintf.c index 2e27e82687..fb7e00675a 100644 --- a/libio/vasprintf.c +++ b/libio/vasprintf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1997, 1999, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1995,1997,1999,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -54,11 +54,11 @@ _IO_vasprintf (result_ptr, format, args) #endif _IO_no_init ((_IO_FILE *) &sf._sbf, _IO_USER_LOCK, -1, NULL, NULL); _IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps; - _IO_str_init_static (&sf, string, init_string_size, string); + INTUSE(_IO_str_init_static) (&sf, string, init_string_size, string); sf._sbf._f._flags &= ~_IO_USER_BUF; sf._s._allocate_buffer = (_IO_alloc_type) malloc; sf._s._free_buffer = (_IO_free_type) free; - ret = _IO_vfprintf (&sf._sbf._f, format, args); + ret = INTUSE(_IO_vfprintf) (&sf._sbf._f, format, args); if (ret < 0) { free (sf._sbf._f._IO_buf_base); diff --git a/libio/vscanf.c b/libio/vscanf.c index bc1ddff7f7..477cbaee84 100644 --- a/libio/vscanf.c +++ b/libio/vscanf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1997, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -35,7 +35,7 @@ _IO_vscanf (format, args) const char *format; _IO_va_list args; { - return _IO_vfscanf (_IO_stdin, format, args, NULL); + return INTUSE(_IO_vfscanf) (_IO_stdin, format, args, NULL); } #ifdef weak_alias diff --git a/libio/vsnprintf.c b/libio/vsnprintf.c index f3569025ba..8a3afc46bd 100644 --- a/libio/vsnprintf.c +++ b/libio/vsnprintf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1997, 1999, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1994,1997,1999,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -59,8 +59,8 @@ _IO_strn_overflow (fp, c) a size to make this possible. */ *fp->_IO_write_ptr = '\0'; - _IO_setb (fp, snf->overflow_buf, - snf->overflow_buf + sizeof (snf->overflow_buf), 0); + INTUSE(_IO_setb) (fp, snf->overflow_buf, + snf->overflow_buf + sizeof (snf->overflow_buf), 0); fp->_IO_write_base = snf->overflow_buf; fp->_IO_read_base = snf->overflow_buf; @@ -82,16 +82,16 @@ static struct _IO_jump_t _IO_strn_jumps = JUMP_INIT_DUMMY, JUMP_INIT(finish, _IO_str_finish), JUMP_INIT(overflow, _IO_strn_overflow), - JUMP_INIT(underflow, _IO_str_underflow), - JUMP_INIT(uflow, _IO_default_uflow), - JUMP_INIT(pbackfail, _IO_str_pbackfail), - JUMP_INIT(xsputn, _IO_default_xsputn), - JUMP_INIT(xsgetn, _IO_default_xsgetn), - JUMP_INIT(seekoff, _IO_str_seekoff), + JUMP_INIT(underflow, INTUSE(_IO_str_underflow)), + JUMP_INIT(uflow, INTUSE(_IO_default_uflow)), + JUMP_INIT(pbackfail, INTUSE(_IO_str_pbackfail)), + JUMP_INIT(xsputn, INTUSE(_IO_default_xsputn)), + JUMP_INIT(xsgetn, INTUSE(_IO_default_xsgetn)), + JUMP_INIT(seekoff, INTUSE(_IO_str_seekoff)), JUMP_INIT(seekpos, _IO_default_seekpos), JUMP_INIT(setbuf, _IO_default_setbuf), JUMP_INIT(sync, _IO_default_sync), - JUMP_INIT(doallocate, _IO_default_doallocate), + JUMP_INIT(doallocate, INTUSE(_IO_default_doallocate)), JUMP_INIT(read, _IO_default_read), JUMP_INIT(write, _IO_default_write), JUMP_INIT(seek, _IO_default_seek), @@ -126,8 +126,8 @@ _IO_vsnprintf (string, maxlen, format, args) _IO_no_init (&sf.f._sbf._f, _IO_USER_LOCK, -1, NULL, NULL); _IO_JUMPS ((struct _IO_FILE_plus *) &sf.f._sbf) = &_IO_strn_jumps; string[0] = '\0'; - _IO_str_init_static (&sf.f, string, maxlen - 1, string); - ret = _IO_vfprintf ((_IO_FILE *) &sf.f._sbf, format, args); + INTUSE(_IO_str_init_static) (&sf.f, string, maxlen - 1, string); + ret = INTUSE(_IO_vfprintf) ((_IO_FILE *) &sf.f._sbf, format, args); if (sf.f._sbf._f._IO_buf_base != sf.overflow_buf) *sf.f._sbf._f._IO_write_ptr = '\0'; diff --git a/libio/vswprintf.c b/libio/vswprintf.c index 6f2cf79ca4..10d35a2e11 100644 --- a/libio/vswprintf.c +++ b/libio/vswprintf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1997, 1999, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1994,1997,1999,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -54,9 +54,9 @@ _IO_wstrn_overflow (fp, c) if (fp->_wide_data->_IO_buf_base != snf->overflow_buf) { - _IO_wsetb (fp, snf->overflow_buf, - snf->overflow_buf + (sizeof (snf->overflow_buf) - / sizeof (wchar_t)), 0); + INTUSE(_IO_wsetb) (fp, snf->overflow_buf, + snf->overflow_buf + (sizeof (snf->overflow_buf) + / sizeof (wchar_t)), 0); fp->_wide_data->_IO_write_base = snf->overflow_buf; fp->_wide_data->_IO_read_base = snf->overflow_buf; @@ -81,15 +81,15 @@ static struct _IO_jump_t _IO_wstrn_jumps = JUMP_INIT(finish, _IO_wstr_finish), JUMP_INIT(overflow, (_IO_overflow_t) _IO_wstrn_overflow), JUMP_INIT(underflow, (_IO_underflow_t) _IO_wstr_underflow), - JUMP_INIT(uflow, (_IO_underflow_t) _IO_wdefault_uflow), + JUMP_INIT(uflow, (_IO_underflow_t) INTUSE(_IO_wdefault_uflow)), JUMP_INIT(pbackfail, (_IO_pbackfail_t) _IO_wstr_pbackfail), - JUMP_INIT(xsputn, _IO_wdefault_xsputn), - JUMP_INIT(xsgetn, _IO_wdefault_xsgetn), + JUMP_INIT(xsputn, INTUSE(_IO_wdefault_xsputn)), + JUMP_INIT(xsgetn, INTUSE(_IO_wdefault_xsgetn)), JUMP_INIT(seekoff, _IO_wstr_seekoff), JUMP_INIT(seekpos, _IO_default_seekpos), - JUMP_INIT(setbuf, (_IO_setbuf_t) _IO_wdefault_setbuf), + JUMP_INIT(setbuf, (_IO_setbuf_t) INTUSE(_IO_wdefault_setbuf)), JUMP_INIT(sync, _IO_default_sync), - JUMP_INIT(doallocate, _IO_wdefault_doallocate), + JUMP_INIT(doallocate, INTUSE(_IO_wdefault_doallocate)), JUMP_INIT(read, _IO_default_read), JUMP_INIT(write, _IO_default_write), JUMP_INIT(seek, _IO_default_seek), diff --git a/libio/wfiledoalloc.c b/libio/wfiledoalloc.c index 3317fb7f67..1fddd45c90 100644 --- a/libio/wfiledoalloc.c +++ b/libio/wfiledoalloc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -79,7 +79,7 @@ _IO_wfile_doallocate (fp) /* Allocate room for the external buffer. */ if (fp->_IO_buf_base == NULL) - _IO_file_doallocate (fp); + INTUSE(_IO_file_doallocate) (fp); if (fp->_fileno < 0 || _IO_SYSSTAT (fp, &st) < 0) { @@ -100,7 +100,7 @@ _IO_wfile_doallocate (fp) #endif } ALLOC_WBUF (p, size * sizeof (wchar_t), EOF); - _IO_wsetb (fp, p, p + size, 1); + INTUSE(_IO_wsetb) (fp, p, p + size, 1); if (couldbetty && isatty (fp->_fileno)) fp->_flags |= _IO_LINE_BUF; return 1; diff --git a/libio/wfileops.c b/libio/wfileops.c index 54624f0a61..d0259b097e 100644 --- a/libio/wfileops.c +++ b/libio/wfileops.c @@ -58,7 +58,7 @@ _IO_wfile_setbuf (fp, p, len) wchar_t *p; _IO_ssize_t len; { - if (_IO_wdefault_setbuf (fp, p, len) == NULL) + if (INTUSE(_IO_wdefault_setbuf) (fp, p, len) == NULL) return NULL; fp->_wide_data->_IO_write_base = fp->_wide_data->_IO_write_ptr = @@ -131,6 +131,7 @@ _IO_wdo_write (fp, data, to_do) return to_do == 0 ? 0 : WEOF; } +INTDEF(_IO_wdo_write) wint_t @@ -202,7 +203,7 @@ _IO_wfile_underflow (fp) free (fp->_IO_save_base); fp->_flags &= ~_IO_IN_BACKUP; } - _IO_doallocbuf (fp); + INTUSE(_IO_doallocbuf) (fp); fp->_IO_read_base = fp->_IO_read_ptr = fp->_IO_read_end = fp->_IO_buf_base; @@ -219,7 +220,7 @@ _IO_wfile_underflow (fp) free (fp->_wide_data->_IO_save_base); fp->_flags &= ~_IO_IN_BACKUP; } - _IO_wdoallocbuf (fp); + INTUSE(_IO_wdoallocbuf) (fp); } /* Flush all line buffered files before reading. */ @@ -227,7 +228,7 @@ _IO_wfile_underflow (fp) if (fp->_flags & (_IO_LINE_BUF|_IO_UNBUFFERED)) { #if 0 - _IO_flush_all_linebuffered (); + INTUSE(_IO_flush_all_linebuffered) (); #else /* We used to flush all line-buffered stream. This really isn't required by any standard. My recollection is that @@ -247,7 +248,7 @@ _IO_wfile_underflow (fp) #endif } - _IO_switch_to_get_mode (fp); + INTUSE(_IO_switch_to_get_mode) (fp); fp->_wide_data->_IO_read_base = fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_buf_base; @@ -306,6 +307,7 @@ _IO_wfile_underflow (fp) return *fp->_wide_data->_IO_read_ptr; } +INTDEF(_IO_wfile_underflow) static wint_t @@ -347,7 +349,7 @@ _IO_wfile_underflow_mmap (_IO_FILE *fp) free (fp->_wide_data->_IO_save_base); fp->_flags &= ~_IO_IN_BACKUP; } - _IO_wdoallocbuf (fp); + INTUSE(_IO_wdoallocbuf) (fp); } fp->_wide_data->_IO_last_state = fp->_wide_data->_IO_state; @@ -390,13 +392,13 @@ _IO_wfile_overflow (f, wch) /* Allocate a buffer if needed. */ if (f->_wide_data->_IO_write_base == 0) { - _IO_wdoallocbuf (f); + INTUSE(_IO_wdoallocbuf) (f); _IO_wsetg (f, f->_wide_data->_IO_buf_base, f->_wide_data->_IO_buf_base, f->_wide_data->_IO_buf_base); if (f->_IO_write_base == NULL) { - _IO_doallocbuf (f); + INTUSE(_IO_doallocbuf) (f); _IO_setg (f, f->_IO_buf_base, f->_IO_buf_base, f->_IO_buf_base); } } @@ -445,6 +447,7 @@ _IO_wfile_overflow (f, wch) return WEOF; return wch; } +INTDEF(_IO_wfile_overflow) wint_t _IO_wfile_sync (fp) @@ -506,6 +509,7 @@ _IO_wfile_sync (fp) /* setg(base(), ptr, ptr); */ return retval; } +INTDEF(_IO_wfile_sync) _IO_off64_t _IO_wfile_seekoff (fp, offset, dir, mode) @@ -542,7 +546,7 @@ _IO_wfile_seekoff (fp, offset, dir, mode) /* There is no more data in the backup buffer. We can switch back. */ - _IO_switch_to_main_wget_area (fp); + INTUSE(_IO_switch_to_main_wget_area) (fp); } dir = _IO_seek_cur, offset = 0; /* Don't move any pointers. */ @@ -558,7 +562,7 @@ _IO_wfile_seekoff (fp, offset, dir, mode) if (fp->_wide_data->_IO_write_ptr > fp->_wide_data->_IO_write_base || _IO_in_put_mode (fp)) - if (_IO_switch_to_wget_mode (fp)) + if (INTUSE(_IO_switch_to_wget_mode) (fp)) return WEOF; if (fp->_wide_data->_IO_buf_base == NULL) @@ -569,7 +573,7 @@ _IO_wfile_seekoff (fp, offset, dir, mode) free (fp->_wide_data->_IO_read_base); fp->_flags &= ~_IO_IN_BACKUP; } - _IO_doallocbuf (fp); + INTUSE(_IO_doallocbuf) (fp); _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base); _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base); _IO_wsetp (fp, fp->_wide_data->_IO_buf_base, @@ -692,7 +696,7 @@ _IO_wfile_seekoff (fp, offset, dir, mode) } #ifdef TODO - _IO_unsave_markers (fp); + INTUSE(_IO_unsave_markers) (fp); #endif if (fp->_flags & _IO_NO_READS) @@ -732,7 +736,7 @@ _IO_wfile_seekoff (fp, offset, dir, mode) return offset; dumb: - _IO_unsave_markers (fp); + INTUSE(_IO_unsave_markers) (fp); result = _IO_SYSSEEK (fp, offset, dir); if (result != EOF) { @@ -757,6 +761,7 @@ resync: return offset; } +INTDEF(_IO_wfile_seekoff) _IO_size_t @@ -822,62 +827,64 @@ _IO_wfile_xsputn (f, data, n) to_do -= count; } if (to_do > 0) - to_do -= _IO_wdefault_xsputn (f, s, to_do); + to_do -= INTUSE(_IO_wdefault_xsputn) (f, s, to_do); if (must_flush && f->_wide_data->_IO_write_ptr != f->_wide_data->_IO_write_base) - _IO_wdo_write (f, f->_wide_data->_IO_write_base, - f->_wide_data->_IO_write_ptr - - f->_wide_data->_IO_write_base); + INTUSE(_IO_wdo_write) (f, f->_wide_data->_IO_write_base, + f->_wide_data->_IO_write_ptr + - f->_wide_data->_IO_write_base); return n - to_do; } +INTDEF(_IO_wfile_xsputn) struct _IO_jump_t _IO_wfile_jumps = { JUMP_INIT_DUMMY, JUMP_INIT(finish, _IO_new_file_finish), - JUMP_INIT(overflow, (_IO_overflow_t) _IO_wfile_overflow), - JUMP_INIT(underflow, (_IO_underflow_t) _IO_wfile_underflow), - JUMP_INIT(uflow, (_IO_underflow_t) _IO_wdefault_uflow), - JUMP_INIT(pbackfail, (_IO_pbackfail_t) _IO_wdefault_pbackfail), - JUMP_INIT(xsputn, _IO_wfile_xsputn), - JUMP_INIT(xsgetn, _IO_file_xsgetn), - JUMP_INIT(seekoff, _IO_wfile_seekoff), + JUMP_INIT(overflow, (_IO_overflow_t) INTUSE(_IO_wfile_overflow)), + JUMP_INIT(underflow, (_IO_underflow_t) INTUSE(_IO_wfile_underflow)), + JUMP_INIT(uflow, (_IO_underflow_t) INTUSE(_IO_wdefault_uflow)), + JUMP_INIT(pbackfail, (_IO_pbackfail_t) INTUSE(_IO_wdefault_pbackfail)), + JUMP_INIT(xsputn, INTUSE(_IO_wfile_xsputn)), + JUMP_INIT(xsgetn, INTUSE(_IO_file_xsgetn)), + JUMP_INIT(seekoff, INTUSE(_IO_wfile_seekoff)), JUMP_INIT(seekpos, _IO_default_seekpos), JUMP_INIT(setbuf, _IO_new_file_setbuf), - JUMP_INIT(sync, (_IO_sync_t) _IO_wfile_sync), + JUMP_INIT(sync, (_IO_sync_t) INTUSE(_IO_wfile_sync)), JUMP_INIT(doallocate, _IO_wfile_doallocate), - JUMP_INIT(read, _IO_file_read), + JUMP_INIT(read, INTUSE(_IO_file_read)), JUMP_INIT(write, _IO_new_file_write), - JUMP_INIT(seek, _IO_file_seek), - JUMP_INIT(close, _IO_file_close), - JUMP_INIT(stat, _IO_file_stat), + JUMP_INIT(seek, INTUSE(_IO_file_seek)), + JUMP_INIT(close, INTUSE(_IO_file_close)), + JUMP_INIT(stat, INTUSE(_IO_file_stat)), JUMP_INIT(showmanyc, _IO_default_showmanyc), JUMP_INIT(imbue, _IO_default_imbue) }; +INTDEF(_IO_wfile_jumps) struct _IO_jump_t _IO_wfile_jumps_mmap = { JUMP_INIT_DUMMY, JUMP_INIT(finish, _IO_new_file_finish), - JUMP_INIT(overflow, (_IO_overflow_t) _IO_wfile_overflow), + JUMP_INIT(overflow, (_IO_overflow_t) INTUSE(_IO_wfile_overflow)), JUMP_INIT(underflow, (_IO_underflow_t) _IO_wfile_underflow_mmap), - JUMP_INIT(uflow, (_IO_underflow_t) _IO_wdefault_uflow), - JUMP_INIT(pbackfail, (_IO_pbackfail_t) _IO_wdefault_pbackfail), - JUMP_INIT(xsputn, _IO_wfile_xsputn), - JUMP_INIT(xsgetn, _IO_file_xsgetn), - JUMP_INIT(seekoff, _IO_wfile_seekoff), + JUMP_INIT(uflow, (_IO_underflow_t) INTUSE(_IO_wdefault_uflow)), + JUMP_INIT(pbackfail, (_IO_pbackfail_t) INTUSE(_IO_wdefault_pbackfail)), + JUMP_INIT(xsputn, INTUSE(_IO_wfile_xsputn)), + JUMP_INIT(xsgetn, INTUSE(_IO_file_xsgetn)), + JUMP_INIT(seekoff, INTUSE(_IO_wfile_seekoff)), JUMP_INIT(seekpos, _IO_default_seekpos), JUMP_INIT(setbuf, _IO_new_file_setbuf), - JUMP_INIT(sync, (_IO_sync_t) _IO_wfile_sync), + JUMP_INIT(sync, (_IO_sync_t) INTUSE(_IO_wfile_sync)), JUMP_INIT(doallocate, _IO_wfile_doallocate), - JUMP_INIT(read, _IO_file_read), + JUMP_INIT(read, INTUSE(_IO_file_read)), JUMP_INIT(write, _IO_new_file_write), - JUMP_INIT(seek, _IO_file_seek), + JUMP_INIT(seek, INTUSE(_IO_file_seek)), JUMP_INIT(close, _IO_file_close_mmap), - JUMP_INIT(stat, _IO_file_stat), + JUMP_INIT(stat, INTUSE(_IO_file_stat)), JUMP_INIT(showmanyc, _IO_default_showmanyc), JUMP_INIT(imbue, _IO_default_imbue) }; diff --git a/libio/wgenops.c b/libio/wgenops.c index f021e8a3a2..b0580e5125 100644 --- a/libio/wgenops.c +++ b/libio/wgenops.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,1995,1997,1998,1999,2000,2001 Free Software Foundation, Inc. +/* Copyright (C) 1993,1995,1997-2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Ulrich Drepper <drepper@cygnus.com>. Based on the single byte version by Per Bothner <bothner@cygnus.com>. @@ -64,6 +64,7 @@ _IO_least_wmarker (fp, end_p) least_so_far = mark->_pos; return least_so_far; } +INTDEF(_IO_least_wmarker) /* Switch current get area from backup buffer to (start of) main get area. */ void @@ -83,6 +84,7 @@ _IO_switch_to_main_wget_area (fp) /* Set _IO_read_ptr. */ fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_read_base; } +INTDEF(_IO_switch_to_main_wget_area) /* Switch current get area from main get area to (end of) backup area. */ @@ -103,6 +105,7 @@ _IO_switch_to_wbackup_area (fp) /* Set _IO_read_ptr. */ fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_read_end; } +INTDEF(_IO_switch_to_wbackup_area) void @@ -121,6 +124,7 @@ _IO_wsetb (f, b, eb, a) else f->_flags |= _IO_USER_BUF; } +INTDEF(_IO_wsetb) wint_t @@ -160,7 +164,7 @@ _IO_wdefault_pbackfail (fp, c) fp->_wide_data->_IO_backup_base = fp->_wide_data->_IO_save_end; } fp->_wide_data->_IO_read_base = fp->_wide_data->_IO_read_ptr; - _IO_switch_to_wbackup_area (fp); + INTUSE(_IO_switch_to_wbackup_area) (fp); } else if (fp->_wide_data->_IO_read_ptr <= fp->_wide_data->_IO_read_base) { @@ -185,6 +189,7 @@ _IO_wdefault_pbackfail (fp, c) } return c; } +INTDEF(_IO_wdefault_pbackfail) void @@ -214,8 +219,9 @@ _IO_wdefault_finish (fp, dummy) _IO_lock_fini (*fp->_lock); #endif - _IO_un_link ((struct _IO_FILE_plus *) fp); + INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp); } +INTDEF(_IO_wdefault_finish) wint_t @@ -228,6 +234,7 @@ _IO_wdefault_uflow (fp) return WEOF; return *fp->_wide_data->_IO_read_ptr++; } +INTDEF(_IO_wdefault_uflow) wint_t @@ -251,13 +258,13 @@ __wuflow (fp) if (fp->_mode == 0) _IO_fwide (fp, 1); if (_IO_in_put_mode (fp)) - if (_IO_switch_to_wget_mode (fp) == EOF) + if (INTUSE(_IO_switch_to_wget_mode) (fp) == EOF) return WEOF; if (fp->_wide_data->_IO_read_ptr < fp->_wide_data->_IO_read_end) return *fp->_wide_data->_IO_read_ptr++; if (_IO_in_backup (fp)) { - _IO_switch_to_main_wget_area (fp); + INTUSE(_IO_switch_to_main_wget_area) (fp); if (fp->_wide_data->_IO_read_ptr < fp->_wide_data->_IO_read_end) return *fp->_wide_data->_IO_read_ptr++; } @@ -267,7 +274,7 @@ __wuflow (fp) return WEOF; } else if (_IO_have_wbackup (fp)) - _IO_free_wbackup_area (fp); + INTUSE(_IO_free_wbackup_area) (fp); return _IO_UFLOW (fp); } @@ -282,13 +289,13 @@ __wunderflow (fp) if (fp->_mode == 0) _IO_fwide (fp, 1); if (_IO_in_put_mode (fp)) - if (_IO_switch_to_wget_mode (fp) == EOF) + if (INTUSE(_IO_switch_to_wget_mode) (fp) == EOF) return WEOF; if (fp->_wide_data->_IO_read_ptr < fp->_wide_data->_IO_read_end) return *fp->_wide_data->_IO_read_ptr; if (_IO_in_backup (fp)) { - _IO_switch_to_main_wget_area (fp); + INTUSE(_IO_switch_to_main_wget_area) (fp); if (fp->_wide_data->_IO_read_ptr < fp->_wide_data->_IO_read_end) return *fp->_wide_data->_IO_read_ptr; } @@ -298,7 +305,7 @@ __wunderflow (fp) return WEOF; } else if (_IO_have_backup (fp)) - _IO_free_wbackup_area (fp); + INTUSE(_IO_free_wbackup_area) (fp); return _IO_UNDERFLOW (fp); } @@ -351,6 +358,7 @@ _IO_wdefault_xsputn (f, data, n) } return n - more; } +INTDEF(_IO_wdefault_xsputn) _IO_size_t @@ -397,6 +405,7 @@ _IO_wdefault_xsgetn (fp, data, n) } return n - more; } +INTDEF(_IO_wdefault_xsgetn) void @@ -408,8 +417,10 @@ _IO_wdoallocbuf (fp) if (!(fp->_flags & _IO_UNBUFFERED)) if ((wint_t)_IO_WDOALLOCATE (fp) != WEOF) return; - _IO_wsetb (fp, fp->_wide_data->_shortbuf, fp->_wide_data->_shortbuf + 1, 0); + INTUSE(_IO_wsetb) (fp, fp->_wide_data->_shortbuf, + fp->_wide_data->_shortbuf + 1, 0); } +INTDEF(_IO_wdoallocbuf) _IO_FILE * @@ -423,13 +434,13 @@ _IO_wdefault_setbuf (fp, p, len) if (p == NULL || len == 0) { fp->_flags |= _IO_UNBUFFERED; - _IO_wsetb (fp, fp->_wide_data->_shortbuf, fp->_wide_data->_shortbuf + 1, - 0); + INTUSE(_IO_wsetb) (fp, fp->_wide_data->_shortbuf, + fp->_wide_data->_shortbuf + 1, 0); } else { fp->_flags &= ~_IO_UNBUFFERED; - _IO_wsetb (fp, p, p + len, 0); + INTUSE(_IO_wsetb) (fp, p, p + len, 0); } fp->_wide_data->_IO_write_base = fp->_wide_data->_IO_write_ptr = fp->_wide_data->_IO_write_end = 0; @@ -437,6 +448,7 @@ _IO_wdefault_setbuf (fp, p, len) = fp->_wide_data->_IO_read_end = 0; return fp; } +INTDEF(_IO_wdefault_setbuf) int @@ -446,9 +458,10 @@ _IO_wdefault_doallocate (fp) wchar_t *buf; ALLOC_WBUF (buf, _IO_BUFSIZ, EOF); - _IO_wsetb (fp, buf, buf + _IO_BUFSIZ, 1); + INTUSE(_IO_wsetb) (fp, buf, buf + _IO_BUFSIZ, 1); return 1; } +INTDEF(_IO_wdefault_doallocate) int @@ -474,18 +487,20 @@ _IO_switch_to_wget_mode (fp) fp->_flags &= ~_IO_CURRENTLY_PUTTING; return 0; } +INTDEF(_IO_switch_to_wget_mode) void _IO_free_wbackup_area (fp) _IO_FILE *fp; { if (_IO_in_backup (fp)) - _IO_switch_to_main_wget_area (fp); /* Just in case. */ + INTUSE(_IO_switch_to_main_wget_area) (fp); /* Just in case. */ free (fp->_wide_data->_IO_save_base); fp->_wide_data->_IO_save_base = NULL; fp->_wide_data->_IO_save_end = NULL; fp->_wide_data->_IO_backup_base = NULL; } +INTDEF(_IO_free_wbackup_area) #if 0 int @@ -517,7 +532,7 @@ save_for_wbackup (fp, end_p) wchar_t *end_p; { /* Append [_IO_read_base..end_p] to backup area. */ - _IO_ssize_t least_mark = _IO_least_wmarker (fp, end_p); + _IO_ssize_t least_mark = INTUSE(_IO_least_wmarker) (fp, end_p); /* needed_size is how much space we need in the backup area. */ _IO_size_t needed_size = ((end_p - fp->_wide_data->_IO_read_base) - least_mark); @@ -630,6 +645,7 @@ _IO_sputbackwc (fp, c) return result; } +INTDEF(_IO_sputbackwc) wint_t _IO_sungetwc (fp) @@ -672,7 +688,7 @@ _IO_init_wmarker (marker, fp) { marker->_sbuf = fp; if (_IO_in_put_mode (fp)) - _IO_switch_to_wget_mode (fp); + INTUSE(_IO_switch_to_wget_mode) (fp); if (_IO_in_backup (fp)) marker->_pos = fp->_wide_data->_IO_read_ptr - fp->_wide_data->_IO_read_end; else @@ -714,14 +730,14 @@ _IO_seekwmark (fp, mark, delta) if (mark->_pos >= 0) { if (_IO_in_backup (fp)) - _IO_switch_to_main_wget_area (fp); + INTUSE(_IO_switch_to_main_wget_area) (fp); fp->_wide_data->_IO_read_ptr = (fp->_wide_data->_IO_read_base + mark->_pos); } else { if (!_IO_in_backup (fp)) - _IO_switch_to_wbackup_area (fp); + INTUSE(_IO_switch_to_wbackup_area) (fp); fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_read_end + mark->_pos; } return 0; @@ -752,5 +768,5 @@ _IO_unsave_wmarkers (fp) } if (_IO_have_backup (fp)) - _IO_free_wbackup_area (fp); + INTUSE(_IO_free_wbackup_area) (fp); } diff --git a/libio/wstrops.c b/libio/wstrops.c index 0e906132e3..797800dba2 100644 --- a/libio/wstrops.c +++ b/libio/wstrops.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997, 1998, 1999, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1993,1997,1998,1999,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -88,7 +88,7 @@ _IO_wstr_init_static (fp, ptr, size, pstart) size += s; } } - _IO_wsetb (fp, ptr, ptr + size, 0); + INTUSE(_IO_wsetb) (fp, ptr, ptr + size, 0); fp->_wide_data->_IO_write_base = ptr; fp->_wide_data->_IO_read_base = ptr; @@ -159,7 +159,7 @@ _IO_wstr_overflow (fp, c) /* Make sure _IO_setb won't try to delete _IO_buf_base. */ fp->_wide_data->_IO_buf_base = NULL; } - _IO_wsetb (fp, new_buf, new_buf + new_size, 1); + INTUSE(_IO_wsetb) (fp, new_buf, new_buf + new_size, 1); fp->_wide_data->_IO_read_base = new_buf + (fp->_wide_data->_IO_read_base - old_buf); fp->_wide_data->_IO_read_ptr = @@ -293,7 +293,7 @@ _IO_wstr_pbackfail (fp, c) { if ((fp->_flags & _IO_NO_WRITES) && c != EOF) return WEOF; - return _IO_wdefault_pbackfail (fp, c); + return INTUSE(_IO_wdefault_pbackfail) (fp, c); } void @@ -305,7 +305,7 @@ _IO_wstr_finish (fp, dummy) (((_IO_strfile *) fp)->_s._free_buffer) (fp->_wide_data->_IO_buf_base); fp->_wide_data->_IO_buf_base = NULL; - _IO_wdefault_finish (fp, 0); + INTUSE(_IO_wdefault_finish) (fp, 0); } struct _IO_jump_t _IO_wstr_jumps = @@ -314,15 +314,15 @@ struct _IO_jump_t _IO_wstr_jumps = JUMP_INIT(finish, _IO_wstr_finish), JUMP_INIT(overflow, (_IO_overflow_t) _IO_wstr_overflow), JUMP_INIT(underflow, (_IO_underflow_t) _IO_wstr_underflow), - JUMP_INIT(uflow, (_IO_underflow_t) _IO_wdefault_uflow), + JUMP_INIT(uflow, (_IO_underflow_t) INTUSE(_IO_wdefault_uflow)), JUMP_INIT(pbackfail, (_IO_pbackfail_t) _IO_wstr_pbackfail), - JUMP_INIT(xsputn, _IO_wdefault_xsputn), - JUMP_INIT(xsgetn, _IO_wdefault_xsgetn), + JUMP_INIT(xsputn, INTUSE(_IO_wdefault_xsputn)), + JUMP_INIT(xsgetn, INTUSE(_IO_wdefault_xsgetn)), JUMP_INIT(seekoff, _IO_wstr_seekoff), JUMP_INIT(seekpos, _IO_default_seekpos), - JUMP_INIT(setbuf, (_IO_setbuf_t) _IO_wdefault_setbuf), + JUMP_INIT(setbuf, (_IO_setbuf_t) INTUSE(_IO_wdefault_setbuf)), JUMP_INIT(sync, _IO_default_sync), - JUMP_INIT(doallocate, _IO_wdefault_doallocate), + JUMP_INIT(doallocate, INTUSE(_IO_wdefault_doallocate)), JUMP_INIT(read, _IO_default_read), JUMP_INIT(write, _IO_default_write), JUMP_INIT(seek, _IO_default_seek), |