2002-05-08 04:04:12 +00:00
|
|
|
|
/* debug.h - interface to debugging functions
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
Copyright (C) 2002, 2004, 2005, 2007 g10 Code GmbH
|
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* README: Refer to COPYING.LESSER and "each file" instead of
COPYING.
* COPYING.LESSER: New file.
* gpgme.spec.in (%doc): Add COPYING.LESSER.
* acinclude.m4, configure.ac, Makefile.am: Change license to LGPL
2.1 or later.
* TODO: Add copyright notice.
* README.CVS: Likewise.
assuan/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* README.1st: Add copyright notice.
doc/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am: Change license to LGPL.
(gpgme_TEXINFOS): Replace gpl.texi with lesser.texi.
* gpgme.texi: Change license to LGPL (also for documentation of
GPGME's license).
* lesser.texi: New file.
* gpl.texi: File removed.
gpgme/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* putc_unlocked.c, funopen.c: I just claim copyright on these
files and change their license to LGPL, because they are totally
trivial wrapper functions.
* isascii.c: Change copyright notice to the one from ctype/ctype.h
in the GNU C Library (CVS Head 2004-10-10), where isascii is
defined as a macro doing exactly the same as the function in this
file.
* memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06).
* stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10).
* ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c,
ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c,
data.c, data-compat.c, data-fd.c, data.h, data-mem.c,
data-stream.c, data-user.c, debug.c, debug.h, decrypt.c,
decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c,
engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c,
export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h,
key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c,
passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c,
rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c,
util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c,
wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change
license to LGPL.
tests/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* gpg/mkdemodirs: Add copyright notice.
* gpgsm/Makefile.am, gpgsm/t-support.h, gpgsm/t-decrypt.c,
gpgsm/t-encrypt.c, gpgsm/t-export.c, gpgsm/t-genkey.c,
gpgsm/t-import.c, gpgsm/t-keylist.c, gpgsm/t-sign.c,
gpgsm/t-verify.c, gpg/Makefile.am, gpg/t-decrypt.c,
gpg/t-decrypt-verify.c, gpg/t-edit.c, gpg/t-encrypt.c,
gpg/t-encrypt-sign.c, gpg/t-encrypt-sym.c, gpg/t-eventloop.c,
gpg/t-export.c, gpg/t-genkey.c, gpg/t-import.c, gpg/t-keylist.c,
gpg/t-keylist-sig.c, gpg/t-sign.c, gpg/t-signers.c,
gpg/t-support.h, gpg/t-thread1.c, gpg/t-trustlist.c,
gpg/t-verify.c, Makefile.am, t-data.c, t-engine-info.c,
t-version.c: Change license to LGPL.
2004-12-07 21:13:39 +00:00
|
|
|
|
|
|
|
|
|
This file is part of GPGME.
|
|
|
|
|
|
|
|
|
|
GPGME is free software; you can redistribute it and/or modify it
|
|
|
|
|
under the terms of the GNU Lesser General Public License as
|
|
|
|
|
published by the Free Software Foundation; either version 2.1 of
|
|
|
|
|
the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
GPGME is distributed in the hope that it will be useful, but
|
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
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., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
|
02111-1307, USA. */
|
2002-05-08 04:04:12 +00:00
|
|
|
|
|
|
|
|
|
#ifndef DEBUG_H
|
|
|
|
|
#define DEBUG_H
|
|
|
|
|
|
2006-01-05 08:58:50 +00:00
|
|
|
|
#include <string.h>
|
2009-06-22 14:50:17 +00:00
|
|
|
|
#ifdef HAVE_STDINT_H
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#endif
|
2006-01-05 08:58:50 +00:00
|
|
|
|
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
/* Indirect stringification, requires __STDC__ to work. */
|
|
|
|
|
#define STRINGIFY(v) #v
|
|
|
|
|
#define XSTRINGIFY(v) STRINGIFY(v)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* The debug levels. */
|
|
|
|
|
|
|
|
|
|
#define DEBUG_INIT 1
|
2009-10-26 17:38:39 +00:00
|
|
|
|
#define DEBUG_GLOBAL 2
|
|
|
|
|
#define DEBUG_CTX 3
|
|
|
|
|
#define DEBUG_ENGINE 4
|
|
|
|
|
#define DEBUG_DATA 5
|
|
|
|
|
#define DEBUG_ASSUAN 6
|
|
|
|
|
#define DEBUG_SYSIO 7
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
|
|
|
|
|
|
2006-01-05 08:58:50 +00:00
|
|
|
|
/* Remove path components from filenames (i.e. __FILE__) for cleaner
|
|
|
|
|
logs. */
|
|
|
|
|
static inline const char *_gpgme_debug_srcname (const char *file)
|
|
|
|
|
GPGME_GCC_A_PURE;
|
|
|
|
|
|
|
|
|
|
static inline const char *
|
|
|
|
|
_gpgme_debug_srcname (const char *file)
|
|
|
|
|
{
|
|
|
|
|
const char *s = strrchr (file, '/');
|
|
|
|
|
return s? s+1:file;
|
|
|
|
|
}
|
|
|
|
|
|
2007-08-02 14:59:01 +00:00
|
|
|
|
/* Called early to initialize the logging. */
|
|
|
|
|
void _gpgme_debug_subsystem_init (void);
|
|
|
|
|
|
2002-05-08 04:04:12 +00:00
|
|
|
|
/* Log the formatted string FORMAT at debug level LEVEL or higher. */
|
|
|
|
|
void _gpgme_debug (int level, const char *format, ...);
|
|
|
|
|
|
|
|
|
|
/* Start a new debug line in *LINE, logged at level LEVEL or higher,
|
|
|
|
|
and starting with the formatted string FORMAT. */
|
|
|
|
|
void _gpgme_debug_begin (void **helper, int level, const char *format, ...);
|
|
|
|
|
|
|
|
|
|
/* Add the formatted string FORMAT to the debug line *LINE. */
|
|
|
|
|
void _gpgme_debug_add (void **helper, const char *format, ...);
|
|
|
|
|
|
|
|
|
|
/* Finish construction of *LINE and send it to the debug output
|
|
|
|
|
stream. */
|
|
|
|
|
void _gpgme_debug_end (void **helper);
|
|
|
|
|
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
void _gpgme_debug_buffer (int lvl, const char *const fmt,
|
2009-11-04 18:13:44 +00:00
|
|
|
|
const char *const func, const char *const buffer,
|
2009-11-02 17:18:48 +00:00
|
|
|
|
size_t len);
|
2002-05-08 04:04:12 +00:00
|
|
|
|
|
2009-11-04 18:13:44 +00:00
|
|
|
|
void _gpgme_debug_frame_begin (void);
|
|
|
|
|
void _gpgme_debug_frame_end (void);
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
|
|
|
|
|
/* Trace support. */
|
|
|
|
|
|
|
|
|
|
/* FIXME: For now. */
|
|
|
|
|
#define _gpgme_debug_trace() 1
|
|
|
|
|
|
|
|
|
|
#define _TRACE(lvl, name, tag) \
|
|
|
|
|
int _gpgme_trace_level = lvl; \
|
|
|
|
|
const char *const _gpgme_trace_func = name; \
|
|
|
|
|
const char *const _gpgme_trace_tagname = STRINGIFY (tag); \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
void *_gpgme_trace_tag = (void *) (uintptr_t) tag; \
|
|
|
|
|
_gpgme_debug_frame_begin ()
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
|
|
|
|
|
#define TRACE_BEG(lvl, name, tag) \
|
|
|
|
|
_TRACE (lvl, name, tag); \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: enter: %s=%p\n", \
|
|
|
|
|
_gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_BEG0(lvl, name, tag, fmt) \
|
|
|
|
|
_TRACE (lvl, name, tag); \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: enter: %s=%p, " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_BEG1(lvl, name, tag, fmt, arg1) \
|
|
|
|
|
_TRACE (lvl, name, tag); \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: enter: %s=%p, " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \
|
|
|
|
|
arg1), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_BEG2(lvl, name, tag, fmt, arg1, arg2) \
|
|
|
|
|
_TRACE (lvl, name, tag); \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: enter: %s=%p, " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \
|
|
|
|
|
arg1, arg2), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_BEG3(lvl, name, tag, fmt, arg1, arg2, arg3) \
|
|
|
|
|
_TRACE (lvl, name, tag); \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: enter: %s=%p, " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \
|
|
|
|
|
arg1, arg2, arg3), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_BEG4(lvl, name, tag, fmt, arg1, arg2, arg3, arg4) \
|
|
|
|
|
_TRACE (lvl, name, tag); \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: enter: %s=%p, " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \
|
|
|
|
|
arg1, arg2, arg3, arg4), 0
|
2009-10-27 Marcus Brinkmann <marcus@g10code.de>
* edit.c (gpgme_op_edit_start, gpgme_op_edit)
(gpgme_op_card_edit_start, gpgme_op_card_edit): Add debug output.
* encrypt-sign.c (gpgme_op_encrypt_sign_start)
(gpgme_op_encrypt_sign): Likewise.
* encrypt.c (gpgme_op_encrypt_start, gpgme_op_encrypt)
(gpgme_op_encrypt_result): Likewise.
* export.c (gpgme_op_export_start, gpgme_op_export)
(gpgme_op_export_ext_start, gpgme_op_export_ext)
(gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise.
* genkey.c (gpgme_op_genkey_start, gpgme_op_genkey)
(gpgme_op_genkey_result): Likewise.
* getauditlog.c (gpgme_op_getauditlog_start)
(gpgme_op_getauditlog): Likewise.
* import.c (gpgme_op_import_result, gpgme_op_import_start)
(gpgme_op_import): Likewise.
* keylist.c (gpgme_op_keylist_result, keylist_colon_handler)
(gpgme_op_keylist_start, gpgme_op_keylist_ext_start)
(gpgme_op_keylist_next, gpgme_op_keylist_end, gpgme_get_key): Likewise.
* opassuan.c (gpgme_op_assuan_transact_start)
(gpgme_op_assuan_transact_ext, gpgme_op_assuan_result)
(gpgme_op_assuan_transact): Likewise.
* signers.c (gpgme_signers_add, gpgme_signers_clear): Likewise.
* trustlist.c (gpgme_op_trustlist_start)
(gpgme_op_trustlist_next, gpgme_op_trustlist_end): Likewise.
* verify.c (gpgme_op_verify_start, gpgme_op_verify)
(gpgme_op_verify_result): Likewise.
2009-10-27 19:23:56 +00:00
|
|
|
|
#define TRACE_BEG5(lvl, name, tag, fmt, arg1, arg2, arg3, arg4, arg5) \
|
|
|
|
|
_TRACE (lvl, name, tag); \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: enter: %s=%p, " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \
|
|
|
|
|
arg1, arg2, arg3, arg4, arg5), 0
|
2009-10-27 Marcus Brinkmann <marcus@g10code.de>
* edit.c (gpgme_op_edit_start, gpgme_op_edit)
(gpgme_op_card_edit_start, gpgme_op_card_edit): Add debug output.
* encrypt-sign.c (gpgme_op_encrypt_sign_start)
(gpgme_op_encrypt_sign): Likewise.
* encrypt.c (gpgme_op_encrypt_start, gpgme_op_encrypt)
(gpgme_op_encrypt_result): Likewise.
* export.c (gpgme_op_export_start, gpgme_op_export)
(gpgme_op_export_ext_start, gpgme_op_export_ext)
(gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise.
* genkey.c (gpgme_op_genkey_start, gpgme_op_genkey)
(gpgme_op_genkey_result): Likewise.
* getauditlog.c (gpgme_op_getauditlog_start)
(gpgme_op_getauditlog): Likewise.
* import.c (gpgme_op_import_result, gpgme_op_import_start)
(gpgme_op_import): Likewise.
* keylist.c (gpgme_op_keylist_result, keylist_colon_handler)
(gpgme_op_keylist_start, gpgme_op_keylist_ext_start)
(gpgme_op_keylist_next, gpgme_op_keylist_end, gpgme_get_key): Likewise.
* opassuan.c (gpgme_op_assuan_transact_start)
(gpgme_op_assuan_transact_ext, gpgme_op_assuan_result)
(gpgme_op_assuan_transact): Likewise.
* signers.c (gpgme_signers_add, gpgme_signers_clear): Likewise.
* trustlist.c (gpgme_op_trustlist_start)
(gpgme_op_trustlist_next, gpgme_op_trustlist_end): Likewise.
* verify.c (gpgme_op_verify_start, gpgme_op_verify)
(gpgme_op_verify_result): Likewise.
2009-10-27 19:23:56 +00:00
|
|
|
|
#define TRACE_BEG7(lvl, name, tag, fmt, arg1, arg2, arg3, arg4, \
|
|
|
|
|
arg5, arg6, arg7) \
|
|
|
|
|
_TRACE (lvl, name, tag); \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: enter: %s=%p, " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \
|
|
|
|
|
arg1, arg2, arg3, arg4, arg5, \
|
2009-10-27 Marcus Brinkmann <marcus@g10code.de>
* edit.c (gpgme_op_edit_start, gpgme_op_edit)
(gpgme_op_card_edit_start, gpgme_op_card_edit): Add debug output.
* encrypt-sign.c (gpgme_op_encrypt_sign_start)
(gpgme_op_encrypt_sign): Likewise.
* encrypt.c (gpgme_op_encrypt_start, gpgme_op_encrypt)
(gpgme_op_encrypt_result): Likewise.
* export.c (gpgme_op_export_start, gpgme_op_export)
(gpgme_op_export_ext_start, gpgme_op_export_ext)
(gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise.
* genkey.c (gpgme_op_genkey_start, gpgme_op_genkey)
(gpgme_op_genkey_result): Likewise.
* getauditlog.c (gpgme_op_getauditlog_start)
(gpgme_op_getauditlog): Likewise.
* import.c (gpgme_op_import_result, gpgme_op_import_start)
(gpgme_op_import): Likewise.
* keylist.c (gpgme_op_keylist_result, keylist_colon_handler)
(gpgme_op_keylist_start, gpgme_op_keylist_ext_start)
(gpgme_op_keylist_next, gpgme_op_keylist_end, gpgme_get_key): Likewise.
* opassuan.c (gpgme_op_assuan_transact_start)
(gpgme_op_assuan_transact_ext, gpgme_op_assuan_result)
(gpgme_op_assuan_transact): Likewise.
* signers.c (gpgme_signers_add, gpgme_signers_clear): Likewise.
* trustlist.c (gpgme_op_trustlist_start)
(gpgme_op_trustlist_next, gpgme_op_trustlist_end): Likewise.
* verify.c (gpgme_op_verify_start, gpgme_op_verify)
(gpgme_op_verify_result): Likewise.
2009-10-27 19:23:56 +00:00
|
|
|
|
arg6, arg7), 0
|
|
|
|
|
#define TRACE_BEG8(lvl, name, tag, fmt, arg1, arg2, arg3, arg4, \
|
|
|
|
|
arg5, arg6, arg7, arg8) \
|
|
|
|
|
_TRACE (lvl, name, tag); \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: enter: %s=%p, " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \
|
|
|
|
|
arg1, arg2, arg3, arg4, arg5, \
|
2009-10-27 Marcus Brinkmann <marcus@g10code.de>
* edit.c (gpgme_op_edit_start, gpgme_op_edit)
(gpgme_op_card_edit_start, gpgme_op_card_edit): Add debug output.
* encrypt-sign.c (gpgme_op_encrypt_sign_start)
(gpgme_op_encrypt_sign): Likewise.
* encrypt.c (gpgme_op_encrypt_start, gpgme_op_encrypt)
(gpgme_op_encrypt_result): Likewise.
* export.c (gpgme_op_export_start, gpgme_op_export)
(gpgme_op_export_ext_start, gpgme_op_export_ext)
(gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise.
* genkey.c (gpgme_op_genkey_start, gpgme_op_genkey)
(gpgme_op_genkey_result): Likewise.
* getauditlog.c (gpgme_op_getauditlog_start)
(gpgme_op_getauditlog): Likewise.
* import.c (gpgme_op_import_result, gpgme_op_import_start)
(gpgme_op_import): Likewise.
* keylist.c (gpgme_op_keylist_result, keylist_colon_handler)
(gpgme_op_keylist_start, gpgme_op_keylist_ext_start)
(gpgme_op_keylist_next, gpgme_op_keylist_end, gpgme_get_key): Likewise.
* opassuan.c (gpgme_op_assuan_transact_start)
(gpgme_op_assuan_transact_ext, gpgme_op_assuan_result)
(gpgme_op_assuan_transact): Likewise.
* signers.c (gpgme_signers_add, gpgme_signers_clear): Likewise.
* trustlist.c (gpgme_op_trustlist_start)
(gpgme_op_trustlist_next, gpgme_op_trustlist_end): Likewise.
* verify.c (gpgme_op_verify_start, gpgme_op_verify)
(gpgme_op_verify_result): Likewise.
2009-10-27 19:23:56 +00:00
|
|
|
|
arg6, arg7, arg8), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
|
|
|
|
|
#define TRACE(lvl, name, tag) \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug_frame_begin (), \
|
|
|
|
|
_gpgme_debug (lvl, "%s: call: %s=%p\n", \
|
|
|
|
|
name, STRINGIFY (tag), (void *) (uintptr_t) tag), \
|
|
|
|
|
_gpgme_debug_frame_end (), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE0(lvl, name, tag, fmt) \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug_frame_begin (), \
|
|
|
|
|
_gpgme_debug (lvl, "%s: call: %s=%p, " fmt "\n", \
|
|
|
|
|
name, STRINGIFY (tag), (void *) (uintptr_t) tag), \
|
|
|
|
|
_gpgme_debug_frame_end (), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE1(lvl, name, tag, fmt, arg1) \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug_frame_begin (), \
|
|
|
|
|
_gpgme_debug (lvl, "%s: call: %s=%p, " fmt "\n", \
|
|
|
|
|
name, STRINGIFY (tag), (void *) (uintptr_t) tag, arg1), \
|
|
|
|
|
_gpgme_debug_frame_end (), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE2(lvl, name, tag, fmt, arg1, arg2) \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug_frame_begin (), \
|
|
|
|
|
_gpgme_debug (lvl, "%s: call: %s=%p, " fmt "\n", \
|
|
|
|
|
name, STRINGIFY (tag), (void *) (uintptr_t) tag, arg1, \
|
|
|
|
|
arg2), _gpgme_debug_frame_end (), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE3(lvl, name, tag, fmt, arg1, arg2, arg3) \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug_frame_begin (), \
|
|
|
|
|
_gpgme_debug (lvl, "%s: call: %s=%p, " fmt "\n", \
|
|
|
|
|
name, STRINGIFY (tag), (void *) (uintptr_t) tag, arg1, \
|
|
|
|
|
arg2, arg3), _gpgme_debug_frame_end (), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE6(lvl, name, tag, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug_frame_begin (), \
|
|
|
|
|
_gpgme_debug (lvl, "%s: call: %s=%p, " fmt "\n", \
|
|
|
|
|
name, STRINGIFY (tag), (void *) (uintptr_t) tag, arg1, \
|
|
|
|
|
arg2, arg3, arg4, arg5, arg6), \
|
|
|
|
|
_gpgme_debug_frame_end (), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
|
|
|
|
|
#define TRACE_ERR(err) \
|
|
|
|
|
err == 0 ? (TRACE_SUC ()) : \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
(_gpgme_debug (_gpgme_trace_level, "%s: error: %s <%s>\n", \
|
2009-10-30 14:21:08 +00:00
|
|
|
|
_gpgme_trace_func, gpgme_strerror (err), \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
gpgme_strsource (err)), _gpgme_debug_frame_end (), (err))
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
/* The cast to void suppresses GCC warnings. */
|
|
|
|
|
#define TRACE_SYSRES(res) \
|
|
|
|
|
res >= 0 ? ((void) (TRACE_SUC1 ("result=%i", res)), (res)) : \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
(_gpgme_debug (_gpgme_trace_level, "%s: error: %s\n", \
|
|
|
|
|
_gpgme_trace_func, strerror (errno)), _gpgme_debug_frame_end (), (res))
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_SYSERR(res) \
|
|
|
|
|
res == 0 ? ((void) (TRACE_SUC1 ("result=%i", res)), (res)) : \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
(_gpgme_debug (_gpgme_trace_level, "%s: error: %s\n", \
|
|
|
|
|
_gpgme_trace_func, strerror (res)), \
|
|
|
|
|
_gpgme_debug_frame_end (), (res))
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
|
|
|
|
|
#define TRACE_SUC() \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: leave\n", \
|
|
|
|
|
_gpgme_trace_func), _gpgme_debug_frame_end (), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_SUC0(fmt) \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: leave: " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func), _gpgme_debug_frame_end (), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_SUC1(fmt, arg1) \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: leave: " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func, arg1), _gpgme_debug_frame_end (), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_SUC2(fmt, arg1, arg2) \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: leave: " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func, arg1, arg2), _gpgme_debug_frame_end (), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_SUC5(fmt, arg1, arg2, arg3, arg4, arg5) \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: leave: " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func, arg1, arg2, arg3, arg4, arg5), \
|
|
|
|
|
_gpgme_debug_frame_end (), 0
|
2010-06-10 13:49:19 +00:00
|
|
|
|
#define TRACE_SUC6(fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
|
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: leave: " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func, arg1, arg2, arg3, arg4, arg5, arg6), \
|
|
|
|
|
_gpgme_debug_frame_end (), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
|
|
|
|
|
#define TRACE_LOG(fmt) \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: check: %s=%p, " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_LOG1(fmt, arg1) \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: check: %s=%p, " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \
|
|
|
|
|
arg1), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_LOG2(fmt, arg1, arg2) \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: check: %s=%p, " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \
|
|
|
|
|
arg1, arg2), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_LOG3(fmt, arg1, arg2, arg3) \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: check: %s=%p, " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \
|
|
|
|
|
arg1, arg2, arg3), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_LOG4(fmt, arg1, arg2, arg3, arg4) \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: check: %s=%p, " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \
|
|
|
|
|
arg1, arg2, arg3, arg4), 0
|
2009-10-27 Marcus Brinkmann <marcus@g10code.de>
* edit.c (gpgme_op_edit_start, gpgme_op_edit)
(gpgme_op_card_edit_start, gpgme_op_card_edit): Add debug output.
* encrypt-sign.c (gpgme_op_encrypt_sign_start)
(gpgme_op_encrypt_sign): Likewise.
* encrypt.c (gpgme_op_encrypt_start, gpgme_op_encrypt)
(gpgme_op_encrypt_result): Likewise.
* export.c (gpgme_op_export_start, gpgme_op_export)
(gpgme_op_export_ext_start, gpgme_op_export_ext)
(gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise.
* genkey.c (gpgme_op_genkey_start, gpgme_op_genkey)
(gpgme_op_genkey_result): Likewise.
* getauditlog.c (gpgme_op_getauditlog_start)
(gpgme_op_getauditlog): Likewise.
* import.c (gpgme_op_import_result, gpgme_op_import_start)
(gpgme_op_import): Likewise.
* keylist.c (gpgme_op_keylist_result, keylist_colon_handler)
(gpgme_op_keylist_start, gpgme_op_keylist_ext_start)
(gpgme_op_keylist_next, gpgme_op_keylist_end, gpgme_get_key): Likewise.
* opassuan.c (gpgme_op_assuan_transact_start)
(gpgme_op_assuan_transact_ext, gpgme_op_assuan_result)
(gpgme_op_assuan_transact): Likewise.
* signers.c (gpgme_signers_add, gpgme_signers_clear): Likewise.
* trustlist.c (gpgme_op_trustlist_start)
(gpgme_op_trustlist_next, gpgme_op_trustlist_end): Likewise.
* verify.c (gpgme_op_verify_start, gpgme_op_verify)
(gpgme_op_verify_result): Likewise.
2009-10-27 19:23:56 +00:00
|
|
|
|
#define TRACE_LOG5(fmt, arg1, arg2, arg3, arg4, arg5) \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: check: %s=%p, " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \
|
|
|
|
|
arg1, arg2, arg3, arg4, arg5), 0
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_LOG6(fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
_gpgme_debug (_gpgme_trace_level, "%s: check: %s=%p, " fmt "\n", \
|
|
|
|
|
_gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \
|
|
|
|
|
arg1, arg2, arg3, arg4, arg5, \
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
arg6), 0
|
|
|
|
|
|
2009-11-04 18:13:44 +00:00
|
|
|
|
#define TRACE_LOGBUF(buf, len) \
|
|
|
|
|
_gpgme_debug_buffer (_gpgme_trace_level, "%s: check: %s", \
|
2009-10-30 14:21:08 +00:00
|
|
|
|
_gpgme_trace_func, buf, len)
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
|
|
|
|
|
#define TRACE_SEQ(hlp,fmt) \
|
|
|
|
|
_gpgme_debug_begin (&(hlp), _gpgme_trace_level, \
|
2009-11-04 18:13:44 +00:00
|
|
|
|
"%s: check: %s=%p, " fmt, _gpgme_trace_func, \
|
|
|
|
|
_gpgme_trace_tagname, _gpgme_trace_tag)
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_ADD0(hlp,fmt) \
|
2002-05-08 04:04:12 +00:00
|
|
|
|
_gpgme_debug_add (&(hlp), fmt)
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_ADD1(hlp,fmt,a) \
|
2002-05-08 04:04:12 +00:00
|
|
|
|
_gpgme_debug_add (&(hlp), fmt, (a))
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_ADD2(hlp,fmt,a,b) \
|
2002-05-08 04:04:12 +00:00
|
|
|
|
_gpgme_debug_add (&(hlp), fmt, (a), (b))
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_ADD3(hlp,fmt,a,b,c) \
|
2002-05-08 04:04:12 +00:00
|
|
|
|
_gpgme_debug_add (&(hlp), fmt, (a), (b), (c))
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_END(hlp,fmt) \
|
2002-05-08 04:04:12 +00:00
|
|
|
|
_gpgme_debug_add (&(hlp), fmt); \
|
|
|
|
|
_gpgme_debug_end (&(hlp))
|
2007-07-17 Marcus Brinkmann <marcus@g10code.de>
* debug.c:;5B Include <errno.h> and "debug.h".
(_gpgme_debug): Save and restore ERRNO.
(TOHEX): New macro.
(_gpgme_debug_buffer): New function.
* conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants. In
most of these files, add many more tracepoints.
2007-07-17 12:36:04 +00:00
|
|
|
|
#define TRACE_ENABLED(hlp) (!!(hlp))
|
2002-05-08 04:04:12 +00:00
|
|
|
|
|
|
|
|
|
#endif /* DEBUG_H */
|