aboutsummaryrefslogtreecommitdiffstats
path: root/assuan/assuan-util.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2009-03-06 22:29:49 +0000
committerMarcus Brinkmann <[email protected]>2009-03-06 22:29:49 +0000
commit9ace1d56423f849b23fecdb77dd7ad6854975460 (patch)
tree212cfbddf9a9a640d597f2b39c993b166852e811 /assuan/assuan-util.c
parentChnaged the op-assuan interface. (diff)
downloadgpgme-9ace1d56423f849b23fecdb77dd7ad6854975460.tar.gz
gpgme-9ace1d56423f849b23fecdb77dd7ad6854975460.zip
assuan/
2009-03-06 Marcus Brinkmann <[email protected]> * assuan/: Update to libassuan SVN 2009-03-06. src/ 2009-03-06 Marcus Brinkmann <[email protected]> * version.c (do_subsystem_inits): Do not set assuan log level. * debug.c (debug_init): Likewise.
Diffstat (limited to 'assuan/assuan-util.c')
-rw-r--r--assuan/assuan-util.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/assuan/assuan-util.c b/assuan/assuan-util.c
index d12277fc..cefefcb2 100644
--- a/assuan/assuan-util.c
+++ b/assuan/assuan-util.c
@@ -14,9 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- * USA.
+ * License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
@@ -32,6 +30,10 @@ static void *(*alloc_func)(size_t n) = malloc;
static void *(*realloc_func)(void *p, size_t n) = realloc;
static void (*free_func)(void*) = free;
+struct assuan_io_hooks _assuan_io_hooks;
+
+
+
void
assuan_set_malloc_hooks ( void *(*new_alloc_func)(size_t n),
void *(*new_realloc_func)(void *p, size_t n),
@@ -42,6 +44,20 @@ assuan_set_malloc_hooks ( void *(*new_alloc_func)(size_t n),
free_func = new_free_func;
}
+
+void
+assuan_set_io_hooks (assuan_io_hooks_t io_hooks)
+{
+ _assuan_io_hooks.read_hook = NULL;
+ _assuan_io_hooks.write_hook = NULL;
+ if (io_hooks)
+ {
+ _assuan_io_hooks.read_hook = io_hooks->read_hook;
+ _assuan_io_hooks.write_hook = io_hooks->write_hook;
+ }
+}
+
+
void *
_assuan_malloc (size_t n)
{
@@ -152,6 +168,7 @@ assuan_set_flag (assuan_context_t ctx, assuan_flag_t flag, int value)
switch (flag)
{
case ASSUAN_NO_WAITPID: ctx->flags.no_waitpid = value; break;
+ case ASSUAN_CONFIDENTIAL: ctx->confidential = value; break;
}
}
@@ -164,8 +181,8 @@ assuan_get_flag (assuan_context_t ctx, assuan_flag_t flag)
switch (flag)
{
case ASSUAN_NO_WAITPID: return ctx->flags.no_waitpid;
+ case ASSUAN_CONFIDENTIAL: return ctx->confidential;
}
return 0;
}
-