1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

common: New put_membuf_cb to replace static membuf_data_cb.

* common/membuf.c (put_membuf_cb): New.
* agent/call-scd.c (membuf_data_cb): Remove.  Change callers to use
put_membuf_cb.
* common/get-passphrase.c (membuf_data_cb): Ditto.
* g10/call-agent.c (membuf_data_cb): Ditto.
* sm/call-agent.c (membuf_data_cb): Ditto.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2016-01-08 06:33:27 +01:00
parent 8fd406c317
commit 833ba5faa1
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
6 changed files with 41 additions and 73 deletions

View file

@ -116,6 +116,20 @@ put_membuf (membuf_t *mb, const void *buf, size_t len)
}
/* A variant of put_membuf accepting a void * and returning a
gpg_error_t (which will always return 0) to be used as a generic
callback handler. This function also allows buffer to be NULL. */
gpg_error_t
put_membuf_cb (void *opaque, const void *buf, size_t len)
{
membuf_t *data = opaque;
if (buf)
put_membuf (data, buf, len);
return 0;
}
void
put_membuf_str (membuf_t *mb, const char *string)
{