diff options
Diffstat (limited to 'newlib/libc/stdio')
-rw-r--r-- | newlib/libc/stdio/fopencookie.c | 23 | ||||
-rw-r--r-- | newlib/libc/stdio/siprintf.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/siscanf.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/sprintf.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/sscanf.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/stdio.tex | 3 | ||||
-rw-r--r-- | newlib/libc/stdio/vfprintf.c | 6 | ||||
-rw-r--r-- | newlib/libc/stdio/vfscanf.c | 6 |
8 files changed, 26 insertions, 20 deletions
diff --git a/newlib/libc/stdio/fopencookie.c b/newlib/libc/stdio/fopencookie.c index 581441be0..35afa3257 100644 --- a/newlib/libc/stdio/fopencookie.c +++ b/newlib/libc/stdio/fopencookie.c @@ -19,21 +19,24 @@ ANSI_SYNOPSIS typedef int (*cookie_seek_function_t)(void *_cookie, off_t *_off, int _whence); typedef int (*cookie_close_function_t)(void *_cookie); - typedef struct - { - cookie_read_function_t *read; - cookie_write_function_t *write; - cookie_seek_function_t *seek; - cookie_close_function_t *close; - } cookie_io_functions_t; FILE *fopencookie(const void *<[cookie]>, const char *<[mode]>, cookie_io_functions_t <[functions]>); DESCRIPTION <<fopencookie>> creates a <<FILE>> stream where I/O is performed using -custom callbacks. The stream is opened with <[mode]> treated as in -<<fopen>>. The callbacks <[functions.read]> and <[functions.write]> -may only be NULL when <[mode]> does not require them. +custom callbacks. The callbacks are registered via the structure: + +. typedef struct +. { +. cookie_read_function_t *read; +. cookie_write_function_t *write; +. cookie_seek_function_t *seek; +. cookie_close_function_t *close; +. } cookie_io_functions_t; + +The stream is opened with <[mode]> treated as in <<fopen>>. The +callbacks <[functions.read]> and <[functions.write]> may only be NULL +when <[mode]> does not require them. <[functions.read]> should return -1 on failure, or else the number of bytes read (0 on EOF). It is similar to <<read>>, except that diff --git a/newlib/libc/stdio/siprintf.c b/newlib/libc/stdio/siprintf.c index d2b4e76c9..296a16ee0 100644 --- a/newlib/libc/stdio/siprintf.c +++ b/newlib/libc/stdio/siprintf.c @@ -17,7 +17,7 @@ /* FUNCTION -<<iprintf>>, <<fiprintf>>, <<siprintf>>, <<sniprintf>>, <<asiprintf>>, <<asniprintf>>---format output (integer only) +<<siprintf>>, <<fiprintf>>, <<iprintf>>, <<sniprintf>>, <<asiprintf>>, <<asniprintf>>---format output (integer only) INDEX fiprintf diff --git a/newlib/libc/stdio/siscanf.c b/newlib/libc/stdio/siscanf.c index 2c69921ff..15b25c196 100644 --- a/newlib/libc/stdio/siscanf.c +++ b/newlib/libc/stdio/siscanf.c @@ -17,7 +17,7 @@ /* FUNCTION -<<iscanf>>, <<fiscanf>>, <<siscanf>>---scan and format non-floating input +<<siscanf>>, <<fiscanf>>, <<iscanf>>---scan and format non-floating input INDEX iscanf diff --git a/newlib/libc/stdio/sprintf.c b/newlib/libc/stdio/sprintf.c index d2203fb3c..bdff0797d 100644 --- a/newlib/libc/stdio/sprintf.c +++ b/newlib/libc/stdio/sprintf.c @@ -17,7 +17,7 @@ /* FUNCTION -<<printf>>, <<fprintf>>, <<sprintf>>, <<snprintf>>, <<asprintf>>, <<asnprintf>>---format output +<<sprintf>>, <<fprintf>>, <<printf>>, <<snprintf>>, <<asprintf>>, <<asnprintf>>---format output INDEX fprintf diff --git a/newlib/libc/stdio/sscanf.c b/newlib/libc/stdio/sscanf.c index a1987c58d..c0921e1e1 100644 --- a/newlib/libc/stdio/sscanf.c +++ b/newlib/libc/stdio/sscanf.c @@ -17,7 +17,7 @@ /* FUNCTION -<<scanf>>, <<fscanf>>, <<sscanf>>---scan and format input +<<sscanf>>, <<fscanf>>, <<scanf>>---scan and format input INDEX scanf diff --git a/newlib/libc/stdio/stdio.tex b/newlib/libc/stdio/stdio.tex index a3846eaed..f31271523 100644 --- a/newlib/libc/stdio/stdio.tex +++ b/newlib/libc/stdio/stdio.tex @@ -151,6 +151,9 @@ structure. @include stdio/ftell.def @page +@include stdio/funopen.def + +@page @include stdio/fwrite.def @page diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c index 5bbd7594f..491369012 100644 --- a/newlib/libc/stdio/vfprintf.c +++ b/newlib/libc/stdio/vfprintf.c @@ -36,13 +36,13 @@ /* FUNCTION -<<vprintf>>, <<vfprintf>>, <<vsprintf>>, <<vsnprintf>>, <<vasprintf>>, <<vasnprintf>>---format argument list +<<vfprintf>>, <<vprintf>>, <<vsprintf>>, <<vsnprintf>>, <<vasprintf>>, <<vasnprintf>>---format argument list INDEX - vprintf -INDEX vfprintf INDEX + vprintf +INDEX vsprintf INDEX vsnprintf diff --git a/newlib/libc/stdio/vfscanf.c b/newlib/libc/stdio/vfscanf.c index 79a124330..68b55f426 100644 --- a/newlib/libc/stdio/vfscanf.c +++ b/newlib/libc/stdio/vfscanf.c @@ -17,13 +17,13 @@ /* FUNCTION -<<vscanf>>, <<vfscanf>>, <<vsscanf>>---format argument list +<<vfscanf>>, <<vscanf>>, <<vsscanf>>---format argument list INDEX - vscanf -INDEX vfscanf INDEX + vscanf +INDEX vsscanf ANSI_SYNOPSIS |