diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-06-05 22:39:10 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-06-05 22:39:10 -0700 |
commit | 9bc7cb70ae8d216f90f11ba66e202e941c469a91 (patch) | |
tree | 8f64edba42b9d2074604a4970b134fd90ac9e8df /stream.h | |
parent | fa2318f5fb705f106bf251e2dd52f22c5c6bc5f4 (diff) | |
download | txr-9bc7cb70ae8d216f90f11ba66e202e941c469a91.tar.gz txr-9bc7cb70ae8d216f90f11ba66e202e941c469a91.tar.bz2 txr-9bc7cb70ae8d216f90f11ba66e202e941c469a91.zip |
buffers: improve put-buf and fill-buf.
* stream.h (struct strm_ops): put_buf and fill_buf function
pointers get third argument to indicate starting position
of read and write.
(put_buf, fill_buf): Declarations updated.
* stream.c (unimpl_put_buf, unimpl_fill_buf): Third argument
added.
(generic_put_buf, generic_fill_buf, stdio_put_buf,
stdio_fill_buf): Implement position
argument.
(delegate_put_buf, delegate_fill_buf): Take third argument,
pass it down.
(put_buf, fill_buf): New position argument in second position.
Defaulted to zero. Passed down.
(stream_init): Updated registration of put-buf and fill-buf.
* txr.1: Updated documentation.
Diffstat (limited to 'stream.h')
-rw-r--r-- | stream.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -63,8 +63,8 @@ struct strm_ops { val (*get_byte)(val); val (*unget_char)(val, val); val (*unget_byte)(val, int); - val (*put_buf)(val, val); - val (*fill_buf)(val, val); + val (*put_buf)(val, val, cnum); + val (*fill_buf)(val, val, cnum); val (*close)(val, val); val (*flush)(val); val (*seek)(val, val, enum strm_whence); @@ -180,8 +180,8 @@ val get_char(val); val get_byte(val); val unget_char(val ch, val stream); val unget_byte(val byte, val stream); -val put_buf(val buf, val stream); -val fill_buf(val buf, val stream); +val put_buf(val buf, val pos, val stream); +val fill_buf(val buf, val pos, val stream); val vformat(val stream, val string, va_list); val vformat_to_string(val string, va_list); val format(val stream, val string, ...); |