diff options
author | Gwenolé Beauchesne <gbeauchesne@mandriva.org> | 2003-06-04 18:31:57 +0000 |
---|---|---|
committer | Gwenolé Beauchesne <gbeauchesne@mandriva.org> | 2003-06-04 18:31:57 +0000 |
commit | 09e967c2d732783b2579e4e120cd9b608404cb00 (patch) | |
tree | 8d2783a6a7e33608c6012efd6a88b8f5694df81d /mdk-stage1/dietlibc/dietstdio.h | |
parent | 18fcff49d3c836697d3b75a3d01d31c700e69974 (diff) | |
download | drakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar drakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar.gz drakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar.bz2 drakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar.xz drakx-09e967c2d732783b2579e4e120cd9b608404cb00.zip |
Merge from R9_0-AMD64, most notably:
- AMD64 support to insmod-busybox, minilibc, et al.
- Sync with insmod-modutils 2.4.19 something but everyone should use
dietlibc nowadays
- Factor out compilation and prefix with $(DIET) for dietlibc builds
- 64-bit & varargs fixes
Diffstat (limited to 'mdk-stage1/dietlibc/dietstdio.h')
-rw-r--r-- | mdk-stage1/dietlibc/dietstdio.h | 84 |
1 files changed, 40 insertions, 44 deletions
diff --git a/mdk-stage1/dietlibc/dietstdio.h b/mdk-stage1/dietlibc/dietstdio.h index a1cbeba83..2e0e93601 100644 --- a/mdk-stage1/dietlibc/dietstdio.h +++ b/mdk-stage1/dietlibc/dietstdio.h @@ -1,81 +1,77 @@ -/* diet stdio -- no buffering ;-} */ +/* diet stdio */ -#include "dietfeatures.h" +#include <sys/cdefs.h> #include <sys/types.h> -#ifdef WANT_THREAD_SAVE +#include "dietfeatures.h" +#ifdef WANT_THREAD_SAFE #include <pthread.h> #endif +#include <stdarg.h> +#ifdef WANT_SMALL_STDIO_BUFS #define BUFSIZE 128 +#else +#define BUFSIZE 2048 +#endif -typedef struct __file { +struct __stdio_file { int fd; int flags; -#ifdef WANT_BUFFERED_STDIO unsigned int bs; /* read: bytes in buffer */ unsigned int bm; /* position in buffer */ - char buf[BUFSIZE]; - struct __file *next; /* for fflush */ -#endif + unsigned int buflen; /* length of buf */ + char *buf; + struct __stdio_file *next; /* for fflush */ pid_t popen_kludge; -#ifdef WANT_UNGETC - char ungetbuf; + unsigned char ungetbuf; char ungotten; -#endif -#ifdef WANT_THREAD_SAVE +#ifdef WANT_THREAD_SAFE pthread_mutex_t m; #endif -} FILE; - -extern FILE *__stdio_root; +}; #define ERRORINDICATOR 1 #define EOFINDICATOR 2 #define BUFINPUT 4 #define BUFLINEWISE 8 #define NOBUF 16 -#define UNSEEKABLE 32 +#define STATICBUF 32 +#define FDPIPE 64 #define _IONBF 0 #define _IOLBF 1 #define _IOFBF 2 +#include <stdio.h> + /* internal function to flush buffer. * However, if next is BUFINPUT and the buffer is an input buffer, it * will not be flushed. Vice versa for output */ extern int __fflush4(FILE *stream,int next); +extern int __buffered_outs(const char *s,size_t len); -FILE *fopen (const char *path, const char *mode); -FILE *fdopen (int fildes, const char *mode); -FILE *freopen (const char *path, const char *mode, FILE *stream); - -int fgetc(FILE *stream); -char *fgets(char *s, int size, FILE *stream); -int getc(FILE *stream); -int getchar(void); -char *gets(char *s); -int ungetc(int c, FILE *stream); +/* ..scanf */ +struct arg_scanf { + void *data; + int (*getch)(void*); + int (*putch)(int,void*); +}; -int fputc(int c, FILE *stream); -int fputs(const char *s, FILE *stream); -int putc(int c, FILE *stream); -int putchar(int c); -int puts(const char *s); +int __v_scanf(struct arg_scanf* fn, const unsigned char *format, va_list arg_ptr); -long fseek( FILE *stream, long offset, int whence); -long ftell( FILE *stream); -void rewind( FILE *stream); -int fgetpos( FILE *stream, fpos_t *pos); -int fsetpos( FILE *stream, fpos_t *pos); +struct arg_printf { + void *data; + int (*put)(void*,size_t,void*); +}; -size_t fread( void *ptr, size_t size, size_t nmemb, FILE *stream); +int __v_printf(struct arg_printf* fn, const unsigned char *format, va_list arg_ptr); -size_t fwrite( const void *ptr, size_t size, size_t nmemb, FILE *stream); - -int fflush(FILE *stream); - -int fclose(FILE *stream); +extern FILE *__stdio_root; -extern FILE *stdout, *stderr, *stdin; +int __fflush_stdin(void); +int __fflush_stdout(void); +int __fflush_stderr(void); -#define EOF (int)(-1) +FILE* __stdio_init_file(int fd,int closeonerror); +int __stdio_parse_mode(const char *mode); +void __stdio_flushall(void); |