Commit Graph

1575 Commits

Author SHA1 Message Date
Karl-Heinz Zimmer
c445a85ff2 Bugfix #949: (a) call gpgme_check_version(NULL) during initialization and (b) provide additional function libVersion(void) to retrieve the library version used - this function has been added to the CryptPlug API as new *MUST* function for all implementations. 2002-06-19 12:56:43 +00:00
Karl-Heinz Zimmer
6798c68f2f Use gpgme_get_sig_ulong_attr(.., GPGME_ATTR_SIG_SUMMARY ) function to return extended signature status information from the CryptPlug to the calling process after trying to verify a signature. 2002-06-19 10:22:49 +00:00
Marcus Brinkmann
ccde48c08d 2002-06-14 Marcus Brinkmann <marcus@g10code.de>
* wait.c (do_select): Return -1 on error, and 0 if nothing to run.
	(_gpgme_wait_one): Only set HANG to zero if do_select returned an
	error, or there are no more file descriptors to wait on.
	(_gpgme_wait_on_condition): Ignore return value from do_select for
	now.
2002-06-14 20:06:35 +00:00
Marcus Brinkmann
2fe7046d15 Cosmetic fix. 2002-06-14 20:05:26 +00:00
Marcus Brinkmann
d89d383d54 Update list. 2002-06-14 19:41:43 +00:00
Marcus Brinkmann
f54a11ad14 Add items about I/O callbacks. 2002-06-14 19:40:55 +00:00
Werner Koch
276e401c42 * verify.c (gpgme_op_verify): Make sure that we never access an
unitialized result structure.
2002-06-13 08:45:32 +00:00
Steffen Hansen
1bd00d0a18 bugfix + change to the nextCertificate() function prototype 2002-06-13 01:56:31 +00:00
Werner Koch
61c97e9fa9 tests/
* gpgsm/t-keylist.c (doit): Print operation info if available.
gpgme/
* keylist.c (struct keylist_result_s): New.
(_gpgme_release_keylist_result): Release it here
(keylist_status_handler): Handle truncated.
(append_xml_keylistinfo): New.
* gpgme.c (_gpgme_release_result): and use it here.
* types.h: Declare the new type here.
* context.h (struct gpgme_context_s): Use it here.
2002-06-12 14:34:15 +00:00
Karl-Heinz Zimmer
e7dc765826 Add Plugin configuration option to allow for sending of *opaque* signed messages. Unfortunately this is necessary for communication with some MS Outlook clients, e.g. TrustedMime is not able to understand Multipart/Signed messages. <sigh> NOTE: This breaks compabilitity with kdenetwork, so make sure to update the KDE sources as well... 2002-06-12 11:05:42 +00:00
Marcus Brinkmann
14f16305b0 2002-06-11 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_release): Close status_cb.fd.
	(_gpgme_gpgsm_new): Duplicate status file descriptor, so we can
	use our own close notification mechanism without interfering with
	assuan.
2002-06-11 18:12:19 +00:00
Werner Koch
6b89172051 * gpgme.h: Add GPGME_ATTR_SIG_SUMMARY and the GPGME_SIGSUM_
constants.
* verify.c (calc_sig_summary): New.
(gpgme_get_sig_ulong_attr): And use it here.
2002-06-11 15:33:08 +00:00
Steffen Hansen
8ac95a9772 support for listing of external certs (untested) 2002-06-10 18:37:11 +00:00
Steffen Hansen
15188d9a79 reorder issuer DN also 2002-06-10 17:53:04 +00:00
Steffen Hansen
2879352eb5 typecast to make khz happy 2002-06-10 16:36:38 +00:00
Marcus Brinkmann
5b75138331 2002-06-10 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_start): Move the code that sets the
	close notification for the status fd to ...
	(_gpgme_gpgsm_new): ... here.
	* wait.h: Include "sema.h".  Remove prototypes of
	_gpgme_remove_proc_from_wait_queue and
	_gpgme_register_pipe_handler.  Add prototypes of
	_gpgme_fd_table_init, _gpgme_fd_table_deinit, _gpgme_fd_table_put,
	_gpgme_add_io_cb, _gpgme_remove_io_cb, _gpgme_wait_event_cb and
	_gpgme_wait_one..
	* wait.c: Remove global variables PROC_QUEUE, PROC_QUEUE_LOCK,
	FD_TABLE_SIZE, FD_TABLE, FD_TABLE_LOCK.  New global variables
	FDT_GLOBAL, CTX_DONE_LIST, CTX_DONE_LIST_SIZE,
	CTX_DONE_LIST_LENGTH and CTX_DONE_LIST_LOCK.  Remove struct
	proc_s.  Replace struct wait_item_s.
	(_gpgme_fd_table_init): New function.
	(_gpgme_fd_table_deinit): Likewise.
	(_gpgme_fd_table_put): Likewise.
	(set_process_done): Remove function.
	(do_select): Take argument FDT.  Use that to decide which fds to
	select on.
	(_gpgme_remove_proc_from_wait_queue): Remove function.
	(_gpgme_wait_event_cb): New function.
	(_gpgme_wait_one): Likewise.
	(_gpgme_register_pipe_hanldler): Remove function.
	(_gpgme_add_io_cb): New function.
	(_gpgme_remove_io_cb): Likewise.
	(_gpgme_freeze_fd): Remove function.
	(_gpgme_thaw_fd): Remove function.
	* rungpg.c (struct fd_data_map_s): Add new member TAG.
	(struct gpg_object_s): Likewise for STATUS and COLON.  Add member
	IDX to CMD.  Add new member IO_CBS.
	(close_notify_handler): New variables POSSIBLY_DONE and NOT_DONE.
	For each I/O callback, check if it should be unregistered.  If all
	callbacks have been unregistered, trigger GPGME_EVENT_DONE.
	Remove member RUNNING.
	(_gpgme_gpg_new): Initialize new members.
	(_gpgme_gpg_release): Check PID not RUNNING.  Don't call
	_gpgme_remove_proc_from_wait_queue.  Close GPG->CMD.FD if set.
	(build_argv): Store away the index instead the file descriptor for
	CMD.
	(_gpgme_gpg_add_io_cb): New function.
	(_gpgme_gpg_spawn): Use _gpgme_gpg_add_io_cb to register IO
	callbacks.
	(gpg_status_handler): Change return type to void, remove PID
	argument, close filedescriptor if EOF or error occurs.
	(read_status): Use _gpgme_gpg_add_io_cb instead _gpgme_thaw_fd.
	Use IO_CBS->remove instead _gpgme_freeze_fd.
	(gpg_colon_line_handler): Change return type to void, remove PID
	argument, close filedescriptor if EOF or error occurs.
	(command_cb): Use IO_CBS->remove instead _gpgme_freeze_fd.
	(_gpgme_gpg_set_io_cbs): New function.
	* rungpg.h (_gpgme_gpg_set_io_cbs): Prototype for
	_gpgme_gpg_set_io_cbs.
	* gpgme.h (GpgmeIOCb): New type.
	(GpgmeRegisterIOCb): Likewise.
	(GpgmeRemoveIOCb): Likewise.
	(GpgmeEventIO): Likewise.
	(GpgmeEventIOCb): Likewise.
	(struct GpgmeIOCbs): New structure to hold I/O callbacks.
	(gpgme_set_op_io_cbs): New prototype.
	(gpgme_get_op_io_cbs): Likewise.
	* ops.h: New prototype for _gpgme_op_event_cb.  Remove prototypes
	for _gpgme_freeze_fd and _gpgme_thaw_fd.  Remove PID argument from
	_gpgme_data_inbound_handler and _gpgme_data_outbound_handler
	prototype.  Add prototype for _gpgme_op_reset.
	Add synchronous argument to _gpgme_decrypt_start prototype.
	* io.h: Beautification.
	* gpgme.c: Include "wait.h".
	(gpgme_new): Initialize FDT.
	(gpgme_set_io_cbs): New function.
	(gpgme_get_io_cbs): Likewise.
	(_gpgme_op_event_cb): Likewise.
	* data.c (_gpgme_data_inbound_handler): Change return type to
	void.  Drop PID argument.  Close FD on error and EOF.
	(write_mem_data): Don't close FD here ...
	(write_cb_data): ... or here ...
	(_gpgme_data_outbound_handler): ... but here.  Change return type
	to void.  Drop PID argument.
	* context.h: Include "wait.h".
	(struct gpgme_context_s): New members FDT and IO_CBS.
	* op-support.c: New file.
	* Makefile.am (libgpgme_la_SOURCES): Add op-support.c.
	* ops.h: Add prototype for _gpgme_op_reset().
	* decrypt.c (_gpgme_decrypt_start): New argument SYNCHRONOUS.  Use
	_gpgme_op_reset.
	(gpgme_op_decrypt_start): Add synchronous argument.
	(gpgme_op_decrypt): Likewise.  Use _gpgme_wait_one instead
	gpgme_wait.
	* delete.c (gpgme_op_delete_start): Rename to ...
	(_gpgme_op_delete_start): ... this.  New argument SYNCHRONOUS.
	Use _gpgme_op_reset.  Make function static.
	(gpgme_op_delete_start): Just a wrapper around
	_gpgme_op_delete_start now.
	(gpgme_op_delete): Add synchronous argument.  Use _gpgme_wait_one
	instead gpgme_wait.
	* encrypt.c: Include "wait.h".
	(ggpgme_op_encrypt_start): Rename to ...
	(_gpgme_op_encrypt_start): ... this.  New argument SYNCHRONOUS.
	Use _gpgme_op_reset.  Make function static.
	(gpgme_op_encrypt_start): Just a wrapper around
	_gpgme_op_encrypt_start now.
	(gpgme_op_encrypt): Add synchronous argument.  Use _gpgme_wait_one
	instead gpgme_wait.
	* encrypt_sign.c (gpgme_op_encrypt_sign_start): Rename to ...
	(_gpgme_op_encrypt_sign_start): ... this.  New argument
	SYNCHRONOUS.  Use _gpgme_op_reset.  Make function static.
	(gpgme_op_encrypt_sign_start): Just a wrapper around
	_gpgme_op_encrypt_sign_start now.
	(gpgme_op_encrypt_sign): Add synchronous argument.  Use
	_gpgme_wait_one instead gpgme_wait.
	* export.c (gpgme_op_export_start): Rename to ...
	(_gpgme_op_export_start): ... this.  New argument SYNCHRONOUS.
	Use _gpgme_op_reset.  Make function static.
	(gpgme_op_export_start): Just a wrapper around
	_gpgme_op_export_start now.
	(gpgme_op_export): Add synchronous argument.  Use _gpgme_wait_one
	instead gpgme_wait.
	* genkey.c (gpgme_op_genkey_start): Rename to ...
	(_gpgme_op_genkey_start): ... this.  New argument SYNCHRONOUS.
	Use _gpgme_op_reset.  Make function static.
	(gpgme_op_genkey_start): Just a wrapper around
	_gpgme_op_genkey_start now.
	(gpgme_op_genkey): Add synchronous argument.  Use _gpgme_wait_one
	instead gpgme_wait.
	* import.c (gpgme_op_import_start): Rename to ...
	(_gpgme_op_import_start): ... this.  New argument SYNCHRONOUS.
	Use _gpgme_op_reset.  Make function static.
	(gpgme_op_import_start): Just a wrapper around
	_gpgme_op_import_start now.
	(gpgme_op_import): Add synchronous argument.  Use _gpgme_wait_one
	instead gpgme_wait.
	* keylist.c (gpgme_op_keylist_start): Use _gpgme_op_reset.
	(gpgme_op_keylist_ext_start): Likewise.
	* sign.c (gpgme_op_sign_start): Rename to ...
	(_gpgme_op_sign_start): ... this.  New argument SYNCHRONOUS.  Use
	_gpgme_op_reset.  Make function static.
	(gpgme_op_sign_start): Just a wrapper around _gpgme_op_sign_start
	now.
	(gpgme_op_sign): Add synchronous argument.  Use _gpgme_wait_one
	instead gpgme_wait.
	* trustlist.c (gpgme_op_trustlist_start): Use _gpgme_op_reset.
	* verify.c (gpgme_op_verify_start): Rename to ...
	(_gpgme_op_verify_start): ... this.  New argument SYNCHRONOUS.
	Use _gpgme_op_reset.  Make function static.
	(gpgme_op_verify_start): Just a wrapper around
	_gpgme_op_verify_start now.
	(gpgme_op_verify): Add synchronous argument.  Use _gpgme_wait_one
	instead gpgme_wait.
	* engine-gpgsm.c (iocb_data_t): New type.
	(struct gpgsm_object_s): New member status_cb.  Replace input_fd
	and input_data with input_cb.  Replace output_fd and output_data
	with output_cb.  Replace message_fd and message_data with
	message_cb.  New member io_cbs.
	(_gpgme_gpgsm_new): Initialize all new members (and drop the old
	ones).
	(close_notify_handler): New variable POSSIBLY_DONE.  For each I/O
	callback, check if it should be unregistered.  If all callbacks
	have been unregistered, trigger GPGME_EVENT_DONE.
	(_gpgme_gpgsm_release): Remove variable PID.  Use new variable
	names to close the file descriptors.
	(_gpgme_gpgsm_op_decrypt): Use new variable names,
	(_gpgme_gpgsm_op_encrypt): Likewise.
	(_gpgme_gpgsm_op_genkey): Likewise.
	(_gpgme_gpgsm_op_import): Likewise.
	(_gpgme_gpgsm_op_keylist): Likewise.
	(_gpgme_gpgsm_op_keylist_ext): Likewise.
	(_gpgme_gpgsm_op_sign): Likewise.
	(_gpgme_gpgsm_op_verify): Likewise.
	(gpgsm_status_handler): Drop argument PID.  Change return type to
	void.  Close status pipe before returning because of EOF or error.
	(_gpgme_gpgsm_add_io_cb): New function.
	(_gpgme_gpgsm_start): Use _gpgme_gpgsm_add_io_cb to register
	callback function.
	(_gpgme_gpgsm_set_io_cbs): New function.
	* engine-gpgsm.h: New prototype for _gpgme_gpgsm_set_io_cbs.
	* engine.c (_gpgme_engine_set_io_cbs): New function.
	* engine.h: New prototype for _gpgme_engine_set_io_cbs.
2002-06-10 14:13:55 +00:00
Steffen Hansen
7b8ab474d3 more cert. info features 2002-06-10 11:24:39 +00:00
Werner Koch
9a3eae2c5e * gpgsm/t-encrypt.c (main): Add a simple option parser and allow
to specify an encryption key.
2002-06-04 14:01:11 +00:00
Marcus Brinkmann
37d626bdf3 Prepare everything for CVS hackery. 2002-06-04 12:28:17 +00:00
Marcus Brinkmann
fbdf591fcc 2002-06-04 Marcus Brinkmann <marcus@g10code.de>
Released 0.3.7.

	* configure.ac (AC_INIT): Set version to 0.3.7.
	(LIBGPGME_LT_REVISION): Add one.

	* README: Document version requirement correctly.
2002-06-04 12:20:46 +00:00
Marcus Brinkmann
9a262e6ed8 Updates. 2002-06-04 12:19:00 +00:00
Marcus Brinkmann
e202b91008 2002-06-04 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Multi Threading): Document new autodetection.
2002-06-04 12:12:08 +00:00
Marcus Brinkmann
4df073b733 2002-06-04 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (DISTCLEANFILES): New variable.
2002-06-04 10:56:33 +00:00
Marcus Brinkmann
4816ac107a 2002-06-04 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (libgpgme_la_SOURCES): Remove mutex.h.
2002-06-04 10:40:34 +00:00
Marcus Brinkmann
7892a2a64f 2002-06-03 Marcus Brinkmann <marcus@g10code.de>
* key.c: Include <ctype.h>.
	(_gpgme_key_append_name): Skip one more char when
	processing escaped char.  Submitted by Marc Mutz <mutz@kde.org>.
	Handle hexadecimal encodings.  Also reported by Marc.  Thanks!
2002-06-02 23:09:16 +00:00
Marcus Brinkmann
b024a61d89 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
* acinclude.m4: Fix Pth check so that it doesn't error out if pth
	is not found.

gpgme/
2002-06-02  Marcus Brinkmann  <marcus@g10code.de>

	* ath.h: Enable the _gpgme_ prefix.  Fix all those prefix macros.
	* posix-sema.c: Use that prefix here.
	* posix-io.c: Include "ath.h".
	(_gpgme_io_read): Use _gpgme_ath_read instead read.
	(_gpgme_io_write): Use _gpgme_ath_write instead write.
	(_gpgme_io_waitpid): Use _gpgme_ath_waitpid instead waitpid.
	(_gpgme_io_select): Use _gpgme_ath_select instead select.
2002-06-02 20:43:04 +00:00
Marcus Brinkmann
ae0d104de2 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
* configure.ac: Add checks for Pth and pthreads.
	* acinclude.m4: Add slightly hacked check for pth (seems to be an
	autoconf version problem).

gpgme/
2002-06-02  Marcus Brinkmann  <marcus@g10code.de>

	* Makefile.am (ath_components): New variable.
	(ath_components_pthread): Likewise.
	(ath_components_pth): Likewise.
	(system_components): Add ath_componentes.

	* ath.h: New file.
	* ath.c: Likewise.
	* ath-pthread.c: Likewise.
	* ath-pth.c: Likewise.
	* posix-sema.c (_gpgme_sema_cs_enter): Rework to use the ATH
	interface.
	* mutex.h: Remove file.
2002-06-02 19:19:25 +00:00
Karl-Heinz Zimmer
1ab6177e27 sync our cryptplug.h with the version in KDE/libkdenetwork/ that was corrected my Marc Mutz. 2002-06-01 15:35:07 +00:00
Steffen Hansen
0848c32e0f more cert info 2002-05-31 15:34:39 +00:00
Karl-Heinz Zimmer
3fa6cef5ca Bugfix: use fingerprint as found in "fpr" only if no key was found by gpgme_get_sig_key() 2002-05-31 12:00:18 +00:00
Karl-Heinz Zimmer
e74de5d91a Matze's patch for showing colored bars at S/MIME messages as well as at OpenPGP messages. 2002-05-31 11:08:54 +00:00
Karl-Heinz Zimmer
5afd7bbcc0 more error handling 2002-05-31 09:28:58 +00:00
Steffen Hansen
fda851bfd9 small fix 2002-05-30 17:19:11 +00:00
Werner Koch
e282d78413 * key.c (gpgme_key_get_string_attr): Return NULL when asking for
an issuer with IDX > 0.  We don't support altIssuerNames for now.
2002-05-30 09:06:45 +00:00
Steffen Hansen
068ef9f0f3 * cryptplug.h, gpgmeplug.c: Added certificate info listing functions.
Not yet complete.
Converted more C99 style comments to "classic" style.
2002-05-30 06:24:19 +00:00
Marcus Brinkmann
3d05bb406b 2002-05-26 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi: Some typographical correctons throughout.
2002-05-26 20:12:51 +00:00
Marcus Brinkmann
ac8f6d2c8a 2002-05-26 Marcus Brinkmann <marcus@g10code.de>
* gpg/Makefile.am (all-local): Remove dependency on ./secring.gpg.
	(./secring.gpg): Remove target, and move all rules for this target
	to ...
	(./pubring.gpg): ... here.  This was necessary because GnuPG 1.0.7
	does create an empty secring.gpg file when importing public keys.
2002-05-26 19:51:53 +00:00
Werner Koch
4f3be85e5a * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Aehmm, added
missing variable definition.  Oohh - Marcus was faster.
2002-05-22 06:35:07 +00:00
Marcus Brinkmann
cec2c916bb 2002-05-22 Marcus Brinkmann <marcus@gnu.org>
* engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Fix last change.
2002-05-22 01:22:57 +00:00
Werner Koch
1721e91c88 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist)
(_gpgme_gpgsm_op_keylist_ext):  Pass the keylist mode to gpgsm.

* configure.ac (NEED_GPGSM_VERSION): We need gpgsm 0.3.7.
2002-05-21 15:14:35 +00:00
Werner Koch
fe2e3af237 * key.h (gpgme_key_s): Add OTRUST.
* keylist.c (set_ownertrust): New.
(keylist_colon_handler): Get the ownertrust value
* key.c (gpgme_key_get_string_attr,gpgme_key_get_ulong_attr):
Return that value.
2002-05-10 10:42:45 +00:00
Marcus Brinkmann
0ab2c2918a 2002-05-09 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Using Automake): New section.
2002-05-09 06:49:40 +00:00
Marcus Brinkmann
be5f522140 Bump version numbers in requirements. 2002-05-09 06:49:09 +00:00
Marcus Brinkmann
d9e73425b9 2002-05-09 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Multi Threading): Escape { and }.
2002-05-09 03:39:18 +00:00
Marcus Brinkmann
4e0d4d7cf3 doc/
2002-05-09  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Overview): Replace note about thread-safeness.
	(Multi Threading): New section.

gpgme/
2002-05-08  Marcus Brinkmann  <marcus@g10code.de>

	* w32-util.c: New static variable GET_PATH_LOCK.
	(_gpgme_get_gpg_path): Remove superfluous NULL initializer.
	Take lock while determining path.
	(_gpgme_get_gpgsm_path): Likewise.
	* version.c (do_subsystem_inits): Set DONE to 1 after
	initialization.
	(gpgme_get_engine_info): New variable ENGINE_INFO_LOCK.  Take lock
	while determining engine info.
	* rungpg.c (_gpgme_gpg_get_version): New variable
	GPG_VERSION_LOCK.  Take the lock while determining the program
	version.
	* posix-io.c: Include "sema.h".
	(_gpgme_io_spawn): New variable FIXED_SIGNALS_LOCK.  Take the lock
	while fixing the signals.
	(_gpgme_io_select): Make READFDS and WRITEFDS non-static.
	* key.c: Include "sema.h".  New globals KEY_CACHE_LOCK and
	KEY_REF_LOCK.
	(capabilities_to_string): Make STRINGS very const.
	(_gpgme_key_cache_add): Lock the key cache.
	(_gpgme_key_cache_get): Likewise.
	(gpgme_key_ref, gpgme_key_release): Lock the key_ref_lock.
	* import.c (append_xml_impinfo): Make IMPORTED_FIELDS and
	IMPORT_RES_FIELDS very const.  Make FIELD and FIELD_NAME a litle
	const.
	* engine.c (_gpgme_engine_get_info): New variable
	ENGINE_INFO_LOCK.  Take lock while determining engine info.
	* engine-gpgsm.c: Include "sema.h".
	(_gpgme_gpgsm_get_version): New variable GPGSM_VERSION_LOCK.  Take
	lock while getting program version.
2002-05-09 03:38:12 +00:00
Karl-Heinz Zimmer
d27e6506b1 revoce the previous commit, this was done erroneously 2002-05-08 12:14:13 +00:00
Karl-Heinz Zimmer
ff28fd3b54 Include the protocol parameter of multipart/.. content-type messages into double quotes to fullify requirements of the german government (see BSI document Technische Grundlagen - Tailoring MTTv2, page 60) 2002-05-08 12:05:17 +00:00
Marcus Brinkmann
dca63d93c5 Add some items and comments. 2002-05-08 04:22:07 +00:00
Marcus Brinkmann
51e6cf89ed 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
* debug.h: New file.
	* Makefile.am (libgpgme_la_SOURCES): Add debug.h.
	* util.h: Removed all prototypes and declarations related to
	debugging.  Include "debug.h".

	* debug.c (debug_level): Comment variable and remove superfluous
	zero initializer.
	(errfp): Likewise.
	(_gpgme_debug_enabled): Function removed.
	(struct debug_control_s): Definition removed.
	(_gpgme_debug_level): Function removed.
	(_gpgme_debug_begin): Rewritten to use vasprintf.  Accept a
	pritnf-style format specification and a variable number of
	arguments.
	(_gpgme_debug_add): Rewritten using vasprintf.  Expect that format
	starts out with "%s" for simplicity.
	(_gpgme_debug_end): Rewritten using vasprintf.  Do not accept a
	TEXT argument anymore.

	* posix-io.c (_gpgme_io_select): Use new level argument for
	DEBUG_BEGIN instead explicit if construct.

	* debug.c (debug_init): Remove superfluous zero initializer,
	remove volatile flag of INITIALIZED.  Do not use the
	double-checked locking algorithm, it is fundamentally flawed and
	will empty your fridge (on a more serious note, despite the
	volatile flag it doesn't give you the guarantee you would expect,
	for example on a DEC Alpha or an SMP machine.  The volatile only
	serializes accesses to the volatile variable, but not to the other
	variables).
2002-05-08 04:04:12 +00:00
Marcus Brinkmann
5d03d9b7eb 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
* debug.h: New file.
	* Makefile.am (libgpgme_la_SOURCES): Add debug.h.
	* util.h: Removed all prototypes and declarations related to
	debugging.  Include "debug.h".

	* debug.c (debug_level): Comment variable and remove superfluous
	zero initializer.
	(errfp): Likewise.
	(_gpgme_debug_enabled): Function removed.
	(struct debug_control_s): Definition removed.
	(_gpgme_debug_level): Function removed.
	(_gpgme_debug_begin): Rewritten to use vasprintf.  Accept a
	pritnf-style format specification and a variable number of
	arguments.
	(_gpgme_debug_add): Rewritten using vasprintf.  Expect that format
	starts out with "%s" for simplicity.
	(_gpgme_debug_end): Rewritten using vasprintf.  Do not accept a
	TEXT argument anymore.

	* posix-io.c (_gpgme_io_select): Use new level argument for
	DEBUG_BEGIN instead explicit if construct.

	* debug.c (debug_init): Remove superfluous zero initializer,
	remove volatile flag of INITIALIZED.  Do not use the
	double-checked locking algorithm, it is fundamentally flawed and
	will empty your fridge (on a more serious note, despite the
	volatile flag it doesn't give you the guarantee you would expect,
	for example on a DEC Alpha or an SMP machine.  The volatile only
	serializes accesses to the volatile variable, but not to the other
	variables).
2002-05-08 03:57:42 +00:00