[Pkg-gnupg-commit] [gnupg2] 83/205: gpg: Rename pop_filter to iobuf_pop_filter and export it.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Wed May 11 08:38:20 UTC 2016
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch experimental
in repository gnupg2.
commit 1463f9b9624fae97cc89df3aa4546655ee893f7c
Author: Neal H. Walfield <neal at g10code.com>
Date: Wed Mar 2 15:42:18 2016 +0100
gpg: Rename pop_filter to iobuf_pop_filter and export it.
* common/iobuf.c (pop_filter): Rename from this...
(iobuf_pop_filter): ... to this. Don't mark it as static.
--
Signed-off-by: Neal H. Walfield <neal at g10code.com>
---
common/iobuf.c | 23 ++++++++++++-----------
common/iobuf.h | 7 +++++++
2 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/common/iobuf.c b/common/iobuf.c
index bd1c30f..c8ec00f 100644
--- a/common/iobuf.c
+++ b/common/iobuf.c
@@ -1683,10 +1683,10 @@ iobuf_push_filter2 (iobuf_t a,
/****************
* Remove an i/o filter.
*/
-static int
-pop_filter (iobuf_t a, int (*f) (void *opaque, int control,
- iobuf_t chain, byte * buf, size_t * len),
- void *ov)
+int
+iobuf_pop_filter (iobuf_t a, int (*f) (void *opaque, int control,
+ iobuf_t chain, byte * buf, size_t * len),
+ void *ov)
{
iobuf_t b;
size_t dummy_len = 0;
@@ -1716,12 +1716,13 @@ pop_filter (iobuf_t a, int (*f) (void *opaque, int control,
if (b->filter == f && (!ov || b->filter_ov == ov))
break;
if (!b)
- log_bug ("pop_filter(): filter function not found\n");
+ log_bug ("iobuf_pop_filter(): filter function not found\n");
/* flush this stream if it is an output stream */
if (a->use == IOBUF_OUTPUT && (rc = filter_flush (b)))
{
- log_error ("filter_flush failed in pop_filter: %s\n", gpg_strerror (rc));
+ log_error ("filter_flush failed in iobuf_pop_filter: %s\n",
+ gpg_strerror (rc));
return rc;
}
/* and tell the filter to free it self */
@@ -2268,7 +2269,7 @@ iobuf_flush_temp (iobuf_t temp)
if (temp->use == IOBUF_INPUT || temp->use == IOBUF_INPUT_TEMP)
log_bug ("iobuf_flush_temp called on an input pipeline!\n");
while (temp->chain)
- pop_filter (temp, temp->filter, NULL);
+ iobuf_pop_filter (temp, temp->filter, NULL);
}
@@ -2467,9 +2468,9 @@ iobuf_seek (iobuf_t a, off_t newpos)
/* remove filters, but the last */
if (a->chain)
- log_debug ("pop_filter called in iobuf_seek - please report\n");
+ log_debug ("iobuf_pop_filter called in iobuf_seek - please report\n");
while (a->chain)
- pop_filter (a, a->filter, NULL);
+ iobuf_pop_filter (a, a->filter, NULL);
return 0;
}
@@ -2536,11 +2537,11 @@ iobuf_set_partial_body_length_mode (iobuf_t a, size_t len)
/* Disable partial body length mode. */
{
if (a->use == IOBUF_INPUT)
- log_debug ("pop_filter called in set_partial_block_mode"
+ log_debug ("iobuf_pop_filter called in set_partial_block_mode"
" - please report\n");
log_assert (a->filter == block_filter);
- pop_filter (a, block_filter, NULL);
+ iobuf_pop_filter (a, block_filter, NULL);
}
else
/* Enabled partial body length mode. */
diff --git a/common/iobuf.h b/common/iobuf.h
index 785efdc..a8ca4dc 100644
--- a/common/iobuf.h
+++ b/common/iobuf.h
@@ -421,6 +421,13 @@ int iobuf_push_filter2 (iobuf_t a,
byte * buf, size_t * len), void *ov,
int rel_ov);
+/* Pop the top filter. The top filter must have the filter function F
+ and the cookie OV. The cookie check is ignored if OV is NULL. */
+int iobuf_pop_filter (iobuf_t a,
+ int (*f) (void *opaque, int control,
+ iobuf_t chain, byte * buf, size_t * len),
+ void *ov);
+
/* Used for debugging. Prints out the chain using log_debug if
IOBUF_DEBUG_MODE is not 0. */
int iobuf_print_chain (iobuf_t a);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git
More information about the Pkg-gnupg-commit
mailing list