[Pkg-gnupg-commit] [gpgme] 47/132: core: Un-deprecate gpgme_data_rewind.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Wed Apr 26 01:01:21 UTC 2017
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch experimental
in repository gpgme.
commit d19bea52afe6efb66a46af6aa4d09928c5d05ee5
Author: Werner Koch <wk at gnupg.org>
Date: Thu Feb 2 09:50:47 2017 +0100
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 <wk at gnupg.org>
---
NEWS | 1 +
src/data-compat.c | 13 -------------
src/data.c | 14 ++++++++++++++
src/gpgme.h.in | 5 ++---
4 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/NEWS b/NEWS
index 0fca77a..4405f6c 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,7 @@ Noteworthy changes in version 1.8.1 (unreleased)
cpp: Key::UserID::revoke() NEW.
cpp: Key::addUid() NEW.
qt: CryptoConfig::stringValueList() NEW.
+ gpgme_data_rewind UN-DEPRECATE.
Noteworthy changes in version 1.8.0 (2016-11-16)
diff --git a/src/data-compat.c b/src/data-compat.c
index 5c7d543..87eaeef 100644
--- a/src/data-compat.c
+++ b/src/data-compat.c
@@ -239,16 +239,3 @@ gpgme_data_new_with_read_cb (gpgme_data_t *r_dh,
(*r_dh)->data.old_user.handle = read_cb_value;
return TRACE_ERR (0);
}
-
-
-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);
-}
diff --git a/src/data.c b/src/data.c
index 6964246..e4e9ee3 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)
diff --git a/src/gpgme.h.in b/src/gpgme.h.in
index e3ca165..769c2c8 100644
--- a/src/gpgme.h.in
+++ b/src/gpgme.h.in
@@ -1165,9 +1165,8 @@ gpgme_error_t gpgme_data_new_from_filepart (gpgme_data_t *r_dh,
const char *fname, FILE *fp,
@API__OFF_T@ offset, size_t length);
-/* Reset the read pointer in DH. Deprecated, please use
- gpgme_data_seek instead. */
-gpgme_error_t gpgme_data_rewind (gpgme_data_t dh) _GPGME_DEPRECATED(0,4);
+/* Convenience function to do a gpgme_data_seek (dh, 0, SEEK_SET). */
+gpgme_error_t gpgme_data_rewind (gpgme_data_t dh);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gpgme.git
More information about the Pkg-gnupg-commit
mailing list