aboutsummaryrefslogtreecommitdiffstats
path: root/common/iobuf.h
diff options
context:
space:
mode:
authorNeal H. Walfield <[email protected]>2015-11-05 11:19:45 +0000
committerNeal H. Walfield <[email protected]>2015-11-05 13:09:01 +0000
commitfd4b9e232805b2e30b29903568c95cc0aad8bbec (patch)
tree83f520893b5146e2b281b8ad9b791dfb9fdfd329 /common/iobuf.h
parentdoc: Note that gpgkey2ssh is deprecated. (diff)
downloadgnupg-fd4b9e232805b2e30b29903568c95cc0aad8bbec.tar.gz
gnupg-fd4b9e232805b2e30b29903568c95cc0aad8bbec.zip
common: Add a function for copying data from one iobuf to another.
* common/iobuf.c (iobuf_copy): New function. -- Signed-off-by: Neal H. Walfield <[email protected]>
Diffstat (limited to 'common/iobuf.h')
-rw-r--r--common/iobuf.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/iobuf.h b/common/iobuf.h
index bce6c3162..e106292c6 100644
--- a/common/iobuf.h
+++ b/common/iobuf.h
@@ -552,6 +552,14 @@ int iobuf_write_temp (iobuf_t dest, iobuf_t source);
BUFFER. Returns the number of bytes actually copied. */
size_t iobuf_temp_to_buffer (iobuf_t a, byte * buffer, size_t buflen);
+/* Copies the data from the input iobuf SOURCE to the output iobuf
+ DEST until either an error is encountered or EOF is reached.
+ Returns the number of bytes successfully written. If an error
+ occured, then any buffered bytes are not returned to SOURCE and are
+ effectively lost. To check if an error occured, use
+ iobuf_error. */
+size_t iobuf_copy (iobuf_t dest, iobuf_t source);
+
/* Return the size of any underlying file. This only works with
file_filter based pipelines.