this header evolved to facilitate the extremely lazy practice of
omitting explicit includes of the necessary headers in individual
stdio source files; not only was this sloppy, but it also increased
build time.
now, stdio_impl.h is only including the headers it needs for its own
use; any further headers needed by source files are included directly
where needed.
41 files changed:
#include <float.h>
#include <limits.h>
#include <errno.h>
#include <float.h>
#include <limits.h>
#include <errno.h>
#include "shgetc.h"
#include "floatscan.h"
#include "shgetc.h"
#include "floatscan.h"
#include <limits.h>
#include <errno.h>
#include <limits.h>
#include <errno.h>
#include "shgetc.h"
/* Lookup table for digit values. -1==255>=36 -> invalid */
#include "shgetc.h"
/* Lookup table for digit values. -1==255>=36 -> invalid */
#define _STDIO_IMPL_H
#include <stdio.h>
#define _STDIO_IMPL_H
#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <stdarg.h>
-#include <string.h>
-#include <inttypes.h>
-#include <wchar.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <errno.h>
-#include <termios.h>
-#include <sys/ioctl.h>
-#include <ctype.h>
-#include <sys/wait.h>
-#include <math.h>
-#include <float.h>
-#include <sys/uio.h>
#include "syscall.h"
#include "libc.h"
#include "syscall.h"
#include "libc.h"
+#include <stdlib.h>
+#include <termios.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
FILE *__fdopen(int fd, const char *mode)
{
FILE *__fdopen(int fd, const char *mode)
{
+#include <fcntl.h>
+#include <string.h>
FILE *__fopen_rb_ca(const char *filename, FILE *f, unsigned char *buf, size_t len)
{
FILE *__fopen_rb_ca(const char *filename, FILE *f, unsigned char *buf, size_t len)
{
#include <pthread.h>
static void cleanup(void *p)
#include <pthread.h>
static void cleanup(void *p)
#include <pthread.h>
static void cleanup(void *p)
#include <pthread.h>
static void cleanup(void *p)
+#include <termios.h>
+#include <sys/ioctl.h>
size_t __stdout_write(FILE *f, const unsigned char *buf, size_t len)
{
size_t __stdout_write(FILE *f, const unsigned char *buf, size_t len)
{
size_t __string_read(FILE *f, unsigned char *buf, size_t len)
{
size_t __string_read(FILE *f, unsigned char *buf, size_t len)
{
char *fgetln(FILE *f, size_t *plen)
{
char *fgetln(FILE *f, size_t *plen)
{
#define MIN(a,b) ((a)<(b) ? (a) : (b))
#define MIN(a,b) ((a)<(b) ? (a) : (b))
+#include <wchar.h>
+#include <errno.h>
wint_t __fgetwc_unlocked(FILE *f)
{
wint_t __fgetwc_unlocked(FILE *f)
{
wint_t __fgetwc_unlocked(FILE *);
wint_t __fgetwc_unlocked(FILE *);
+#include <errno.h>
+#include <string.h>
+#include <inttypes.h>
struct cookie {
size_t pos, len, size;
struct cookie {
size_t pos, len, size;
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
FILE *fopen(const char *restrict filename, const char *restrict mode)
{
FILE *fopen(const char *restrict filename, const char *restrict mode)
{
int fputs(const char *restrict s, FILE *restrict f)
{
int fputs(const char *restrict s, FILE *restrict f)
{
+#include <wchar.h>
+#include <limits.h>
+#include <ctype.h>
wint_t __fputwc_unlocked(wchar_t c, FILE *f)
{
wint_t __fputwc_unlocked(wchar_t c, FILE *f)
{
int fputws(const wchar_t *restrict ws, FILE *restrict f)
{
int fputws(const wchar_t *restrict ws, FILE *restrict f)
{
#define MIN(a,b) ((a)<(b) ? (a) : (b))
#define MIN(a,b) ((a)<(b) ? (a) : (b))
/* The basic idea of this implementation is to open a new FILE,
* hack the necessary parts of the new FILE into the old one, then
/* The basic idea of this implementation is to open a new FILE,
* hack the necessary parts of the new FILE into the old one, then
+#include <limits.h>
+#include <errno.h>
off_t __ftello_unlocked(FILE *f)
{
off_t __ftello_unlocked(FILE *f)
{
size_t __fwritex(const unsigned char *restrict s, size_t l, FILE *restrict f)
{
size_t __fwritex(const unsigned char *restrict s, size_t l, FILE *restrict f)
{
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
#define MIN(a,b) ((a)<(b) ? (a) : (b))
#define MIN(a,b) ((a)<(b) ? (a) : (b))
+#include <limits.h>
+#include <string.h>
+#include <errno.h>
+#include <limits.h>
+#include <string.h>
struct cookie {
char **bufp;
struct cookie {
char **bufp;
+#include <wchar.h>
+#include <errno.h>
+#include <limits.h>
+#include <string.h>
struct cookie {
wchar_t **bufp;
struct cookie {
wchar_t **bufp;
+#include <errno.h>
+#include <unistd.h>
wint_t putwc(wchar_t c, FILE *f)
{
wint_t putwc(wchar_t c, FILE *f)
{
wint_t putwchar(wchar_t c)
{
wint_t putwchar(wchar_t c)
{
+#include <wchar.h>
+#include <limits.h>
+#include <ctype.h>
+#include <string.h>
wint_t ungetwc(wint_t c, FILE *f)
{
wint_t ungetwc(wint_t c, FILE *f)
{
+#include <errno.h>
+#include <ctype.h>
+#include <limits.h>
+#include <string.h>
+#include <stdarg.h>
+#include <wchar.h>
+#include <inttypes.h>
+#include <math.h>
+#include <float.h>
#include <stdlib.h>
#include <stdarg.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdarg.h>
#include <ctype.h>
#include <errno.h>
#include <math.h>
#include <float.h>
#include <errno.h>
#include <math.h>
#include <float.h>
#include "stdio_impl.h"
#include "shgetc.h"
#include "stdio_impl.h"
#include "shgetc.h"
+#include <errno.h>
+#include <ctype.h>
+#include <limits.h>
+#include <string.h>
+#include <stdarg.h>
+#include <wchar.h>
+#include <inttypes.h>
/* Convenient bit representation for modifier flags, which all fall
* within 31 codepoints of the space character. */
/* Convenient bit representation for modifier flags, which all fall
* within 31 codepoints of the space character. */
+#include <limits.h>
+#include <string.h>
+#include <errno.h>
+#include <stdint.h>
static size_t sn_write(FILE *f, const unsigned char *s, size_t l)
{
static size_t sn_write(FILE *f, const unsigned char *s, size_t l)
{
+#include <limits.h>
+#include <string.h>
+#include <errno.h>
+#include <stdint.h>
+#include <wchar.h>
struct cookie {
wchar_t *ws;
struct cookie {
wchar_t *ws;
static size_t wstring_read(FILE *f, unsigned char *buf, size_t len)
{
static size_t wstring_read(FILE *f, unsigned char *buf, size_t len)
{
#include "stdio_impl.h"
#include "intscan.h"
#include "shgetc.h"
#include "stdio_impl.h"
#include "intscan.h"
#include "shgetc.h"
+#include <inttypes.h>
+#include <limits.h>
+#include <ctype.h>
static unsigned long long strtox(const char *s, char **p, int base, unsigned long long lim)
{
static unsigned long long strtox(const char *s, char **p, int base, unsigned long long lim)
{
#include "shgetc.h"
#include "floatscan.h"
#include "stdio_impl.h"
#include "shgetc.h"
#include "floatscan.h"
#include "stdio_impl.h"
/* This read function heavily cheats. It knows:
* (1) len will always be 1
/* This read function heavily cheats. It knows:
* (1) len will always be 1
#include "stdio_impl.h"
#include "intscan.h"
#include "shgetc.h"
#include "stdio_impl.h"
#include "intscan.h"
#include "shgetc.h"
+#include <inttypes.h>
+#include <limits.h>
+#include <wctype.h>
+#include <wchar.h>
/* This read function heavily cheats. It knows:
* (1) len will always be 1
/* This read function heavily cheats. It knows:
* (1) len will always be 1