[klibc] Change stdio prefix from _io_ to _IO_
_io_ isn't actually implementation namespace, so use _IO_ instead.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
diff --git a/usr/include/stdio.h b/usr/include/stdio.h
index d6aec62..bfc7b4b 100644
--- a/usr/include/stdio.h
+++ b/usr/include/stdio.h
@@ -12,10 +12,10 @@
#include <unistd.h>
struct _IO_file {
- off_t _io_filepos; /* File position */
- int _io_fileno; /* Underlying file descriptor */
- _Bool _io_eof; /* End of file flag */
- _Bool _io_error; /* Error flag */
+ off_t _IO_filepos; /* File position */
+ int _IO_fileno; /* Underlying file descriptor */
+ _Bool _IO_eof; /* End of file flag */
+ _Bool _IO_error; /* Error flag */
};
typedef struct _IO_file FILE;
@@ -113,28 +113,28 @@
__extern_inline off_t ftell(FILE *__f)
{
- return __f->_io_filepos;
+ return __f->_IO_filepos;
}
__extern_inline int fileno(FILE *__f)
{
- return __f->_io_fileno;
+ return __f->_IO_fileno;
}
__extern_inline int ferror(FILE *__f)
{
- return __f->_io_error;
+ return __f->_IO_error;
}
__extern_inline int feof(FILE *__f)
{
- return __f->_io_eof;
+ return __f->_IO_eof;
}
__extern_inline void clearerr(FILE *__f)
{
- __f->_io_error = 0;
- __f->_io_eof = 0;
+ __f->_IO_error = 0;
+ __f->_IO_eof = 0;
}
#endif
diff --git a/usr/klibc/stdio/fclose.c b/usr/klibc/stdio/fclose.c
index 288b1b8..756de43 100644
--- a/usr/klibc/stdio/fclose.c
+++ b/usr/klibc/stdio/fclose.c
@@ -11,7 +11,7 @@
fflush(file);
- rv = close(f->pub._io_fileno);
+ rv = close(f->pub._IO_fileno);
/* Remove from linked list */
f->next->prev = f->prev;
diff --git a/usr/klibc/stdio/fdopen.c b/usr/klibc/stdio/fdopen.c
index e4226e9..2536eb7 100644
--- a/usr/klibc/stdio/fdopen.c
+++ b/usr/klibc/stdio/fdopen.c
@@ -30,9 +30,9 @@
goto err;
f->data = f->buf = (char *)f + bufoffs;
- f->pub._io_fileno = fd;
+ f->pub._IO_fileno = fd;
pos = lseek(fd, 0, SEEK_CUR);
- f->pub._io_filepos = (pos >= 0) ? pos : 0;
+ f->pub._IO_filepos = (pos >= 0) ? pos : 0;
f->bufsiz = BUFSIZ;
f->bufmode = isatty(fd) ? _IOLBF : _IOFBF;
diff --git a/usr/klibc/stdio/feof.c b/usr/klibc/stdio/feof.c
index 6762c08..590b1c5 100644
--- a/usr/klibc/stdio/feof.c
+++ b/usr/klibc/stdio/feof.c
@@ -3,5 +3,5 @@
int feof(FILE *__f)
{
- return __f->_io_eof;
+ return __f->_IO_eof;
}
diff --git a/usr/klibc/stdio/ferror.c b/usr/klibc/stdio/ferror.c
index 6b4502a..8b36e44 100644
--- a/usr/klibc/stdio/ferror.c
+++ b/usr/klibc/stdio/ferror.c
@@ -3,5 +3,5 @@
int ferror(FILE *__f)
{
- return __f->_io_error;
+ return __f->_IO_error;
}
diff --git a/usr/klibc/stdio/fflush.c b/usr/klibc/stdio/fflush.c
index 56f4771..dfccd24 100644
--- a/usr/klibc/stdio/fflush.c
+++ b/usr/klibc/stdio/fflush.c
@@ -18,15 +18,15 @@
p = f->buf;
while (f->obytes) {
- rv = write(f->pub._io_fileno, p, f->obytes);
+ rv = write(f->pub._IO_fileno, p, f->obytes);
if (rv == -1) {
if (errno == EINTR || errno == EAGAIN)
continue;
- f->pub._io_error = true;
+ f->pub._IO_error = true;
return EOF;
} else if (rv == 0) {
/* EOF on output? */
- f->pub._io_eof = true;
+ f->pub._IO_eof = true;
return EOF;
}
diff --git a/usr/klibc/stdio/fgetc.c b/usr/klibc/stdio/fgetc.c
index 1d6e599..04d9ce0 100644
--- a/usr/klibc/stdio/fgetc.c
+++ b/usr/klibc/stdio/fgetc.c
@@ -11,7 +11,7 @@
if (__likely(f->ibytes)) {
f->ibytes--;
- f->pub._io_filepos++;
+ f->pub._IO_filepos++;
return (unsigned char) *f->data++;
} else {
return _fread(&ch, 1, file) == 1 ? ch : EOF;
diff --git a/usr/klibc/stdio/fileno.c b/usr/klibc/stdio/fileno.c
index 2750f2e..b5a1016 100644
--- a/usr/klibc/stdio/fileno.c
+++ b/usr/klibc/stdio/fileno.c
@@ -3,5 +3,5 @@
int fileno(FILE *__f)
{
- return __f->_io_fileno;
+ return __f->_IO_fileno;
}
diff --git a/usr/klibc/stdio/fread.c b/usr/klibc/stdio/fread.c
index 1cb8a0c..caad20b 100644
--- a/usr/klibc/stdio/fread.c
+++ b/usr/klibc/stdio/fread.c
@@ -37,14 +37,14 @@
nb = f->bufsiz;
}
- rv = read(f->pub._io_fileno, rdptr, nb);
+ rv = read(f->pub._IO_fileno, rdptr, nb);
if (rv == -1) {
if (errno == EINTR || errno == EAGAIN)
continue;
- f->pub._io_error = true;
+ f->pub._IO_error = true;
return bytes;
} else if (rv == 0) {
- f->pub._io_eof = true;
+ f->pub._IO_eof = true;
return bytes;
@@ -54,7 +54,7 @@
p += rv;
bytes += rv;
count -= rv;
- f->pub._io_filepos += rv;
+ f->pub._IO_filepos += rv;
} else {
f->ibytes = rv;
f->data = rdptr;
@@ -74,7 +74,7 @@
count -= nb;
f->data += nb;
f->ibytes -= nb;
- f->pub._io_filepos += nb;
+ f->pub._IO_filepos += nb;
}
}
return bytes;
diff --git a/usr/klibc/stdio/fseek.c b/usr/klibc/stdio/fseek.c
index f848844..d352aa0 100644
--- a/usr/klibc/stdio/fseek.c
+++ b/usr/klibc/stdio/fseek.c
@@ -14,19 +14,19 @@
return -1;
if (whence == SEEK_CUR) {
- where += f->pub._io_filepos;
+ where += f->pub._IO_filepos;
whence = SEEK_SET;
}
- rv = lseek(f->pub._io_fileno, where, whence);
+ rv = lseek(f->pub._IO_fileno, where, whence);
if (__likely(rv != (off_t)-1)) {
- f->pub._io_filepos = rv;
- f->pub._io_eof = false;
+ f->pub._IO_filepos = rv;
+ f->pub._IO_eof = false;
f->ibytes = 0;
f->obytes = 0;
return 0;
} else {
- f->pub._io_error = true;
+ f->pub._IO_error = true;
return -1;
}
}
diff --git a/usr/klibc/stdio/ftell.c b/usr/klibc/stdio/ftell.c
index 2dba32d..f3133d8 100644
--- a/usr/klibc/stdio/ftell.c
+++ b/usr/klibc/stdio/ftell.c
@@ -3,5 +3,5 @@
off_t ftell(FILE *f)
{
- return f->_io_filepos;
+ return f->_IO_filepos;
}
diff --git a/usr/klibc/stdio/fwrite.c b/usr/klibc/stdio/fwrite.c
index 5931906..86eb3d4 100644
--- a/usr/klibc/stdio/fwrite.c
+++ b/usr/klibc/stdio/fwrite.c
@@ -23,22 +23,22 @@
* The buffer is empty and the write is large,
* so bypass the buffering entirely.
*/
- rv = write(f->pub._io_fileno, p, count);
+ rv = write(f->pub._IO_fileno, p, count);
if (rv == -1) {
if (errno == EINTR || errno == EAGAIN)
continue;
- f->pub._io_error = true;
+ f->pub._IO_error = true;
break;
} else if (rv == 0) {
/* EOF on output? */
- f->pub._io_eof = true;
+ f->pub._IO_eof = true;
break;
}
p += rv;
bytes += rv;
count -= rv;
- f->pub._io_filepos += rv;
+ f->pub._IO_filepos += rv;
} else {
nb = f->bufsiz - f->obytes;
nb = (count < nb) ? count : nb;
@@ -48,7 +48,7 @@
f->obytes += nb;
count -= nb;
bytes += nb;
- f->pub._io_filepos += nb;
+ f->pub._IO_filepos += nb;
}
}
}
diff --git a/usr/klibc/stdio/rewind.c b/usr/klibc/stdio/rewind.c
index 67bd357..fb7cd5a 100644
--- a/usr/klibc/stdio/rewind.c
+++ b/usr/klibc/stdio/rewind.c
@@ -4,5 +4,5 @@
void rewind(FILE *f)
{
if (!fseek(f, 0, SEEK_SET))
- f->_io_error = false;
+ f->_IO_error = false;
}