diff options
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, f |
