diff options
author | Eric Blake <eblake@redhat.com> | 2007-07-19 03:42:21 +0000 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2007-07-19 03:42:21 +0000 |
commit | 391b530a0507deda633337e724b5778c3b7a18df (patch) | |
tree | b3925bb14795af864acc7db554ad7122a23f0dbb /newlib/libc/stdio/fopencookie.c | |
parent | be52c4c7c805831590404baf4401184f51387721 (diff) | |
download | cygnal-391b530a0507deda633337e724b5778c3b7a18df.tar.gz cygnal-391b530a0507deda633337e724b5778c3b7a18df.tar.bz2 cygnal-391b530a0507deda633337e724b5778c3b7a18df.zip |
Fix 'make info'.
* libc/stdio/stdio.tex: Add missing include.
* libc/stdio/vfprintf.c: Use expected node name.
* libc/stdio/vfscanf.c: Likewise.
* libc/stdio/sscanf.c: Likewise.
* libc/stdio/sprintf.c: Likewise.
* libc/stdio/siscanf.c: Likewise.
* libc/stdio/siprintf.c: Likewise.
* libc/stdio/fopencookie.c: Quote raw {}.
Reported by DJ Delorie.
Diffstat (limited to 'newlib/libc/stdio/fopencookie.c')
-rw-r--r-- | newlib/libc/stdio/fopencookie.c | 23 |
1 files changed, 13 insertions, 10 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 |