aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2017-02-02 08:50:47 +0000
committerWerner Koch <[email protected]>2017-02-02 08:53:48 +0000
commitd19bea52afe6efb66a46af6aa4d09928c5d05ee5 (patch)
treeda8bdaad7cc38590a9815a0c8791a3df1c6ddf59 /src/data.c
parentcore: Move all deprecated stuff to the end of gpgme.h. (diff)
downloadgpgme-d19bea52afe6efb66a46af6aa4d09928c5d05ee5.tar.gz
gpgme-d19bea52afe6efb66a46af6aa4d09928c5d05ee5.zip
core: Un-deprecate gpgme_data_rewind.
* src/gpgme.h.in (gpgme_data_rewind): Un-deprecate. * src/data-compat.c (gpgme_data_rewind): Move to ... * src/data.c (gpgme_data_rewind): here. -- That function is very convenient because it is required a lot with memory streams. It also documents the intention of the caller better than gpgme_data_seek with its addition parameters and the need to map system errors. Thus it does not make sense to make it a first class citizen again. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/data.c b/src/data.c
index 6964246a..e4e9ee3f 100644
--- a/src/data.c
+++ b/src/data.c
@@ -158,6 +158,20 @@ gpgme_data_seek (gpgme_data_t dh, gpgme_off_t offset, int whence)
}
+/* Convenience function to do a gpgme_data_seek (dh, 0, SEEK_SET). */
+gpgme_error_t
+gpgme_data_rewind (gpgme_data_t dh)
+{
+ gpgme_error_t err;
+ TRACE_BEG (DEBUG_DATA, "gpgme_data_rewind", dh);
+
+ err = ((gpgme_data_seek (dh, 0, SEEK_SET) == -1)
+ ? gpg_error_from_syserror () : 0);
+
+ return TRACE_ERR (err);
+}
+
+
/* Release the data object with the handle DH. */
void
gpgme_data_release (gpgme_data_t dh)