2003-05-18 Marcus Brinkmann <marcus@g10code.de>

In all files, replace the Gpgme* type names with the new gpgme_*
	type names.

doc/
2003-05-18  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Header): Remove Gpgme as namespace prefix.  Add
	_GPGME to namespace prefix.
	* gpgme.texi (Multi Threading): Add note about link order.

gpgme/
2003-05-18  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h: The following types are renamed.  The old name is kept
	as a deprecated typedef.
	(GpgmeCtx): Rename to gpgme_ctx_t.
	(GpgmeData): Rename to gpgme_data_t.
	(GpgmeRecipients): Rename to gpgme_recipients_t.
	(GpgmeError): Rename to gpgme_error_t.
	(GpgmeDataEncoding): Rename to gpgme_data_encoding_t.
	(GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t.
	(GpgmeHashAlgo): Rename to gpgme_hash_algo_t.
	(GpgmeSigStat): Rename to gpgme_sig_stat_t.
	(GpgmeSigMode): Rename to gpgme_sig_mode_t.
	(GpgmeAttr): Rename to gpgme_attr_t.
	(GpgmeValidity): Rename to gpgme_validity_t.
	(GpgmeProtocol): Rename to gpgme_protocol_t.
	(GpgmeStatusCode): Rename to gpgme_status_code_t.
	(GpgmeEngineInfo): Rename to gpgme_engine_info_t.
	(GpgmeSubkey): Rename to gpgme_subkey_t.
	(GpgmeKeySig): Rename to gpgme_keysig_t.
	(GpgmeUserID): Rename to gpgme_user_id_t.
	(GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t.
	(GpgmeProgressCb): Rename to gpgme_progress_cb_t.
	(GpgmeEditCb): Rename to gpgme_edit_cb_t.
	(GpgmeIOCb): Rename to gpgme_io_cb_t.
	(GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t.
	(GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t.
	(GpgmeEventIO): Rename to gpgme_event_io_t.
	(GpgmeEventIOCb): Rename to gpgme_event_io_cb_t.
	(GpgmeIOCbs): Rename to gpgme_io_cbs.
	(gpgme_io_cbs_t): New type.
	(GpgmeDataReadCb): Rename to gpgme_data_read_cb_t.
	(GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t.
	(GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t.
	(GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t.
	(GpgmeDataCbs): Rename to gpgme_data_cbs.
	(gpgme_data_cbs_t): New type.
	(GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t.
	(GpgmeEncryptResult): Rename to gpgme_encrypt_result_t.
	(GpgmeDecryptResult): Rename to gpgme_decrypt_result_t.
	(GpgmeNewSignature): Rename to gpgme_new_signature_t.
	(GpgmeSignResult): Rename to gpgme_sign_result_t.
	(GpgmeSigNotation): Rename to gpgme_sig_notation_t.
	(GpgmeSignature): Rename to gpgme_signature_t.
	(GpgmeVerifyResult): Rename to gpgme_verify_result_t.
	(GpgmeImportStatus): Rename to gpgme_import_status_t.
	(GpgmeImportResult): Rename to gpgme_import_result_t.
	(GpgmeGenKeyResult): Rename to gpgme_genkey_result_t.
	(GpgmeKeyListResult): Rename to gpgme_keylist_result_t.
	(GpgmeTrustItem): Rename to gpgme_trust_item_t.
	* gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros
	GPGME_No_Recipients, GPGME_Invalid_Recipient and
	GPGME_No_Passphrase.
	* data.h (struct gpgme_data_s): Rename to struct gpgme_data.
	* context.h (struct gpgme_context_s): Rename to struct
	gpgme_context.
	(struct gpgme_recipients_s): Rename to gpgme_recipients.
This commit is contained in:
Marcus Brinkmann 2003-05-18 20:45:24 +00:00
parent ce1878d7e9
commit 0a882398e1
78 changed files with 1985 additions and 1712 deletions

View File

@ -1,3 +1,8 @@
2003-05-18 Marcus Brinkmann <marcus@g10code.de>
In all files, replace the Gpgme* type names with the new gpgme_*
type names.
2003-02-01 Marcus Brinkmann <marcus@g10code.de> 2003-02-01 Marcus Brinkmann <marcus@g10code.de>
* assuan/: Update files to 2002-11-10 version of assuan. * assuan/: Update files to 2002-11-10 version of assuan.

159
NEWS
View File

@ -1,15 +1,52 @@
Noteworthy changes in version 0.4.1 (unreleased) Noteworthy changes in version 0.4.1 (unreleased)
------------------------------------------------ ------------------------------------------------
* If gpgme.h is included in sources compiled by GCC 3.1 or later,
deprecated attributes will warn about use of obsolete functions and
typedefs. The use of obsolete error values will appear as the use
of an obsolete type _gpgme_deprecated_error_t. You can suppress
these warnings by passing -Wno-deprecated-declarations to the gcc
command.
* The following types have been renamed. The old types are still
available as aliases, but they are deprecated now:
Old name: New name:
GpgmeCtx gpgme_ctx_t
GpgmeData gpgme_data_t
GpgmeRecipients gpgme_recipients_t
GpgmeError gpgme_error_t
GpgmeDataEncoding gpgme_data_encoding_t
GpgmeSigStat gpgme_sig_stat_t
GpgmeSigMode gpgme_sig_mode_t
GpgmeAttr gpgme_attr_t
GpgmeValidity gpgme_validity_t
GpgmeProtocol gpgme_protocol_t
GpgmeKey gpgme_key_t
GpgmePassphraseCb gpgme_passphrase_cb_t
GpgmeProgressCb gpgme_progress_cb_t
GpgmeIOCb gpgme_io_cb_t
GpgmeRegisterIOCb gpgme_register_io_cb_t
GpgmeRemoveIOCb gpgme_remove_io_cb_t
GpgmeEventIO gpgme_event_io_t
GpgmeEventIOCb gpgme_event_io_cb_t
GpgmeIOCbs gpgme_io_cbs
GpgmeDataReadCb gpgme_data_read_cb_t
GpgmeDataWriteCb gpgme_data_write_cb_t
GpgmeDataSeekCb gpgme_data_seek_cb_t
GpgmeDataReleaseCb gpgme_data_release_cb_t
GpgmeDataCbs gpgme_data_cbs_t
GpgmeTrustItem gpgme_trust_item_t
GpgmeStatusCode gpgme_status_code_t
* GPGME_ATTR_IS_SECRET is not anymore representable as a string. * GPGME_ATTR_IS_SECRET is not anymore representable as a string.
* gpgme_op_verify and gpgme_op_decrypt_verify don't return a status * gpgme_op_verify and gpgme_op_decrypt_verify don't return a status
summary anymore. Use gpgme_get_sig_status to retrieve the individual summary anymore. Use gpgme_get_sig_status to retrieve the individual
stati. stati.
* GpgmeIOCb changed from a void function to a function returning a * gpgme_io_cb_t changed from a void function to a function returning
GpgmeError value. However, it will always return 0, so you can a gpgme_error_t value. However, it will always return 0, so you
safely ignore the return value. can safely ignore the return value.
* A new I/O callback event GPGME_EVENT_START has been added. The new * A new I/O callback event GPGME_EVENT_START has been added. The new
requirement is that you must wait until this event until you are requirement is that you must wait until this event until you are
@ -30,17 +67,17 @@ Noteworthy changes in version 0.4.1 (unreleased)
occurs. In that case *status contains the error code. occurs. In that case *status contains the error code.
* gpgme_get_engine_info was radically changed. Instead an XML * gpgme_get_engine_info was radically changed. Instead an XML
string, an info structure of the new type GpgmeEngineInfo is string, an info structure of the new type gpgme_engine_info_t is
returned. This makes it easier and more robust to evaluate the returned. This makes it easier and more robust to evaluate the
information in an application. information in an application.
* The new function gpgme_get_protocol_name can be used to convert a * The new function gpgme_get_protocol_name can be used to convert a
GpgmeProtocol value into a string. gpgme_protocol_t value into a string.
* The GpgmePassphraseCb type now returns a GpgmeError value, and * The gpgme_passphrase_cb_t type now returns a gpgme_error_t value,
returns the password string in a new parameter. The gpgme_cancel and returns the password string in a new parameter. The
function has been removed, just return GPGME_Canceled in the gpgme_cancel function has been removed, just return GPGME_Canceled
passphrase callback directly. in the passphrase callback directly.
* The status of a context operation is not checked anymore, so the * The status of a context operation is not checked anymore, so the
errors GPGME_Busy and GPGME_No_Request can not occur anymore. errors GPGME_Busy and GPGME_No_Request can not occur anymore.
@ -51,7 +88,7 @@ Noteworthy changes in version 0.4.1 (unreleased)
GPGME_Invalid_UserID and GPGME_Bad_Passphrase resp. GPGME_Invalid_UserID and GPGME_Bad_Passphrase resp.
* The FPR argument to gpgme_op_genkey was removed. Instead, use the * The FPR argument to gpgme_op_genkey was removed. Instead, use the
gpgme_op_genkey_result function to retrieve a GpgmeGenKeyResult gpgme_op_genkey_result function to retrieve a gpgme_genkey_result_t
pointer to a structure which contains the fingerprint. This also pointer to a structure which contains the fingerprint. This also
works with gpgme_op_genkey_start. The structure also provides works with gpgme_op_genkey_start. The structure also provides
other information about the generated keys. other information about the generated keys.
@ -65,7 +102,7 @@ Noteworthy changes in version 0.4.1 (unreleased)
you should now do: you should now do:
GpgmeGenKeyResult result; gpgme_genkey_result_t result;
err = gpgme_op_genkey (ctx, NULL, NULL); err = gpgme_op_genkey (ctx, NULL, NULL);
if (!err) if (!err)
{ {
@ -76,12 +113,12 @@ Noteworthy changes in version 0.4.1 (unreleased)
* The new gpgme_op_import_result function provides detailed * The new gpgme_op_import_result function provides detailed
information about the result of an import operation in information about the result of an import operation in
GpgmeImportResult and GpgmeImportStatus objects. Thus, the gpgme_import_result_t and gpgme_import_status_t objects.
gpgme_op_import_ext variant is deprecated. Thus, the gpgme_op_import_ext variant is deprecated.
* The new gpgme_op_sign_result function provides detailed information * The new gpgme_op_sign_result function provides detailed information
about the result of a signing operation in GpgmeSignResult, about the result of a signing operation in gpgme_sign_result_t,
GpgmeInvalidUserID and GpgmeNewSignature objects. gpgme_invalid_user_id_t and gpgme_new_signature_t objects.
* The new gpgme_op_encrypt_result function provides detailed * The new gpgme_op_encrypt_result function provides detailed
information about the result of an encryption operation in information about the result of an encryption operation in
@ -129,15 +166,67 @@ Noteworthy changes in version 0.4.1 (unreleased)
* Interface changes relative to the 0.4.0 release: * Interface changes relative to the 0.4.0 release:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GpgmeIOCb CHANGED: Return type from void to GpgmeError. GpgmeCtx DEPRECATED: Use gpgme_ctx_t.
GpgmeEventIO CHANGED: New event type (all numbers changed). GpgmeData DEPRECATED: Use gpgme_data_t.
GpgmeRecipients DEPRECATED: Use gpgme_recipients_t.
GpgmeError DEPRECATED: Use gpgme_error_t.
GpgmeDataEncoding DEPRECATED: Use gpgme_data_encoding_t.
GpgmeSigStat DEPRECATED: Use gpgme_sig_stat_t.
GpgmeSigMode DEPRECATED: Use gpgme_sig_mode_t.
GpgmeAttr DEPRECATED: Use gpgme_attr_t.
GpgmeValidity DEPRECATED: Use gpgme_validity_t.
GpgmeProtocol DEPRECATED: Use gpgme_protocol_t.
GpgmeKey DEPRECATED: Use gpgme_key_t.
GpgmePassphraseCb DEPRECATED: Use gpgme_passphrase_cb_t.
GpgmeProgressCb DEPRECATED: Use gpgme_progress_cb_t.
GpgmeIOCb DEPRECATED: Use gpgme_io_cb_t.
GpgmeRegisterIOCb DEPRECATED: Use gpgme_register_io_cb_t.
GpgmeRemoveIOCb DEPRECATED: Use gpgme_remove_io_cb_t.
GpgmeEventIO DEPRECATED: Use gpgme_event_io_t.
GpgmeEventIOCb DEPRECATED: Use gpgme_event_io_cb_t.
GpgmeIOCbs DEPRECATED: Use gpgme_io_cbs.
GpgmeDataReadCb DEPRECATED: Use gpgme_data_read_cb_t.
GpgmeDataWriteCb DEPRECATED: Use gpgme_data_write_cb_t.
GpgmeDataSeekCb DEPRECATED: Use gpgme_data_seek_cb_t.
GpgmeDataReleaseCb DEPRECATED: Use gpgme_data_release_cb_t.
GpgmeDataCbs DEPRECATED: Use gpgme_data_cbs_t.
GpgmeTrustItem DEPRECATED: Use gpgme_trust_item_t.
GpgmeStatusCode DEPRECATED: Use gpgme_status_code_t.
gpgme_ctx_t NEW
gpgme_data_t NEW
gpgme_recipients_t NEW
gpgme_error_t NEW
gpgme_data_encoding_t NEW
gpgme_sig_stat_t NEW
gpgme_sig_mode_t NEW
gpgme_attr_t NEW
gpgme_validity_t NEW
gpgme_protocol_t NEW
gpgme_key_t NEW
gpgme_passphrase_cb_t NEW
gpgme_progress_cb_t NEW
gpgme_io_cb_t NEW
gpgme_register_io_cb_t NEW
gpgme_remove_io_cb_t NEW
gpgme_event_io_t NEW
gpgme_event_io_cb_t NEW
gpgme_io_cbs NEW
gpgme_data_read_cb_t NEW
gpgme_data_write_cb_t NEW
gpgme_data_seek_cb_t NEW
gpgme_data_release_cb_t NEW
gpgme_data_cbs_t NEW
gpgme_trust_item_t NEW
gpgme_status_code_t NEW
gpgme_io_cb_t CHANGED: Return type from void to GpgmeError.
gpgme_event_io_t CHANGED: New event type (all numbers changed).
gpgme_key_get_string_attr CHANGED: Don't handle GPGME_ATTR_IS_SECRET. gpgme_key_get_string_attr CHANGED: Don't handle GPGME_ATTR_IS_SECRET.
gpgme_op_verify CHANGED: Drop R_STAT argument. gpgme_op_verify CHANGED: Drop R_STAT argument.
gpgme_op_decrypt_verify CHANGED: Drop R_STAT argument. gpgme_op_decrypt_verify CHANGED: Drop R_STAT argument.
gpgme_wait CHANGED: Can return NULL even if hang is true. gpgme_wait CHANGED: Can return NULL even if hang is true.
GpgmeIdleFunc REMOVED GpgmeIdleFunc REMOVED
gpgme_register_idle REMOVED gpgme_register_idle REMOVED
GpgmeEngineInfo NEW gpgme_engine_info_t NEW
gpgme_get_engine_info CHANGED: Return info structure instead XML. gpgme_get_engine_info CHANGED: Return info structure instead XML.
gpgme_get_protocol_name NEW gpgme_get_protocol_name NEW
GpgmePassphraseCb CHANGED: Return error value, new argument. GpgmePassphraseCb CHANGED: Return error value, new argument.
@ -152,24 +241,24 @@ GPGME_No_Passphrase DEPRECATED: Use GPGME_Bad_Passphrase.
GPGME_Bad_Passphrase NEW GPGME_Bad_Passphrase NEW
gpgme_op_genkey CHANGED: FPR argument dropped. gpgme_op_genkey CHANGED: FPR argument dropped.
gpgme_op_genkey_result NEW gpgme_op_genkey_result NEW
GpgmeGenKeyResult NEW gpgme_genkey_result_t NEW
gpgme_op_import_ext DEPRECATED: Use gpgme_op_import_result. gpgme_op_import_ext DEPRECATED: Use gpgme_op_import_result.
gpgme_op_import_result NEW gpgme_op_import_result NEW
GpgmeImportStatus NEW gpgme_import_status_t NEW
GpgmeImportResult NEW gpgme_import_result_t NEW
GpgmePubKeyAlgo NEW gpgme_pubkey_algo_t NEW
GpgmeHashAlgo NEW gpgme_hash_algo_t NEW
GpgmeInvalidUserID NEW gpgme_invalid_user_id_t NEW
GpgmeNewSignature NEW gpgme_new_signature_t NEW
GpgmeSignResult NEW gpgme_sign_result_t NEW
gpgme_op_sign_result NEW gpgme_op_sign_result NEW
gpgme_pubkey_algo_name NEW gpgme_pubkey_algo_name NEW
gpgme_hash_algo_name NEW gpgme_hash_algo_name NEW
GpgmeEncryptResult NEW gpgme_encrypt_result_t NEW
gpgme_op_encrypt_result NEW gpgme_op_encrypt_result NEW
GpgmeDecryptResult NEW gpgme_decrypt_result_t NEW
gpgme_op_decrypt_result NEW gpgme_op_decrypt_result NEW
GpgmeVerifyResult NEW gpgme_verify_result_t NEW
gpgme_op_verify_result NEW gpgme_op_verify_result NEW
gpgme_get_notation REMOVED: Access verify result directly instead. gpgme_get_notation REMOVED: Access verify result directly instead.
gpgme_get_sig_key DEPRECATED: Use gpgme_get_key with fingerprint. gpgme_get_sig_key DEPRECATED: Use gpgme_get_key with fingerprint.
@ -177,23 +266,23 @@ gpgme_get_sig_ulong_attr DEPRECATED: Use verify result directly.
gpgme_get_sig_string_attr DEPRECATED: Use verify result directly. gpgme_get_sig_string_attr DEPRECATED: Use verify result directly.
GPGME_SIG_STAT_* DEPRECATED: Use error value in sig status. GPGME_SIG_STAT_* DEPRECATED: Use error value in sig status.
gpgme_get_sig_status DEPRECATED: Use verify result directly. gpgme_get_sig_status DEPRECATED: Use verify result directly.
GpgmeTrustItem CHANGED: Now has user accessible data members. gpgme_trust_item_t CHANGED: Now has user accessible data members.
gpgme_trust_item_ref NEW gpgme_trust_item_ref NEW
gpgme_trust_item_unref NEW gpgme_trust_item_unref NEW
gpgme_trust_item_release DEPRECATED: Use gpgme_trust_item_unref. gpgme_trust_item_release DEPRECATED: Use gpgme_trust_item_unref.
gpgme_trust_item_get_string_attr DEPRECATED gpgme_trust_item_get_string_attr DEPRECATED
gpgme_trust_item_get_ulong_attr DEPRECATED gpgme_trust_item_get_ulong_attr DEPRECATED
gpgme_get_key CHANGED: Removed force_update argument. gpgme_get_key CHANGED: Removed force_update argument.
GpgmeSubKey NEW gpgme_sub_key_t NEW
GpgmeKeySig NEW gpgme_key_sig_t NEW
GpgmeUserID NEW gpgme_user_id_t NEW
GpgmeKey CHANGED: Now has user accessible data members. gpgme_key_t CHANGED: Now has user accessible data members.
gpgme_key_get_string_attr DEPRECATED gpgme_key_get_string_attr DEPRECATED
gpgme_key_get_ulong_attr DEPRECATED gpgme_key_get_ulong_attr DEPRECATED
gpgme_key_sig_get_string_attr DEPRECATED gpgme_key_sig_get_string_attr DEPRECATED
gpgme_key_sig_get_ulong_attr DEPRECATED gpgme_key_sig_get_ulong_attr DEPRECATED
gpgme_key_get_as_xml REMOVED gpgme_key_get_as_xml REMOVED
GpgmeKeyListResult NEW gpgme_key_list_result_t NEW
gpgme_op_keylist_result NEW gpgme_op_keylist_result NEW
gpgme_get_op_info REMOVED gpgme_get_op_info REMOVED
GPGME_Invalid_Type DEPRECATED GPGME_Invalid_Type DEPRECATED

5
TODO
View File

@ -1,7 +1,7 @@
Hey Emacs, this is -*- outline -*- mode! Hey Emacs, this is -*- outline -*- mode!
* ABI's to break: * ABI's to break:
** Change GpgmeRecipient stuff to GpgmeUserID (encrypt, export, ...). ** Change gpgme_recipient_t stuff to gpgme_user_id_t (encrypt, export, ...).
** Compatibility interfaces that can be removed in future versions: ** Compatibility interfaces that can be removed in future versions:
*** gpgme_data_new_from_filepart *** gpgme_data_new_from_filepart
*** gpgme_data_new_from_file *** gpgme_data_new_from_file
@ -19,8 +19,9 @@ Hey Emacs, this is -*- outline -*- mode!
*** gpgme_trust_item_release *** gpgme_trust_item_release
*** gpgme_trust_item_get_string_attr *** gpgme_trust_item_get_string_attr
*** gpgme_trust_item_get_ulong_attr *** gpgme_trust_item_get_ulong_attr
*** GpgmeAttr *** gpgme_attr_t
*** GPGME_Invalid_Type, GPGME_Invalid_Mode *** GPGME_Invalid_Type, GPGME_Invalid_Mode
*** All Gpgme* typedefs.
* Thread support: * Thread support:
** Build thread modules for static linking (which just suck in the ** Build thread modules for static linking (which just suck in the

View File

@ -1,3 +1,9 @@
2003-05-18 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Header): Remove Gpgme as namespace prefix. Add
_GPGME to namespace prefix.
* gpgme.texi (Multi Threading): Add note about link order.
2003-05-04 Marcus Brinkmann <marcus@g10code.de> 2003-05-04 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Listing Keys): Document what happens if key is not * gpgme.texi (Listing Keys): Document what happens if key is not

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,61 @@
2003-05-18 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h: The following types are renamed. The old name is kept
as a deprecated typedef.
(GpgmeCtx): Rename to gpgme_ctx_t.
(GpgmeData): Rename to gpgme_data_t.
(GpgmeRecipients): Rename to gpgme_recipients_t.
(GpgmeError): Rename to gpgme_error_t.
(GpgmeDataEncoding): Rename to gpgme_data_encoding_t.
(GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t.
(GpgmeHashAlgo): Rename to gpgme_hash_algo_t.
(GpgmeSigStat): Rename to gpgme_sig_stat_t.
(GpgmeSigMode): Rename to gpgme_sig_mode_t.
(GpgmeAttr): Rename to gpgme_attr_t.
(GpgmeValidity): Rename to gpgme_validity_t.
(GpgmeProtocol): Rename to gpgme_protocol_t.
(GpgmeStatusCode): Rename to gpgme_status_code_t.
(GpgmeEngineInfo): Rename to gpgme_engine_info_t.
(GpgmeSubkey): Rename to gpgme_subkey_t.
(GpgmeKeySig): Rename to gpgme_keysig_t.
(GpgmeUserID): Rename to gpgme_user_id_t.
(GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t.
(GpgmeProgressCb): Rename to gpgme_progress_cb_t.
(GpgmeEditCb): Rename to gpgme_edit_cb_t.
(GpgmeIOCb): Rename to gpgme_io_cb_t.
(GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t.
(GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t.
(GpgmeEventIO): Rename to gpgme_event_io_t.
(GpgmeEventIOCb): Rename to gpgme_event_io_cb_t.
(GpgmeIOCbs): Rename to gpgme_io_cbs.
(gpgme_io_cbs_t): New type.
(GpgmeDataReadCb): Rename to gpgme_data_read_cb_t.
(GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t.
(GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t.
(GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t.
(GpgmeDataCbs): Rename to gpgme_data_cbs.
(gpgme_data_cbs_t): New type.
(GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t.
(GpgmeEncryptResult): Rename to gpgme_encrypt_result_t.
(GpgmeDecryptResult): Rename to gpgme_decrypt_result_t.
(GpgmeNewSignature): Rename to gpgme_new_signature_t.
(GpgmeSignResult): Rename to gpgme_sign_result_t.
(GpgmeSigNotation): Rename to gpgme_sig_notation_t.
(GpgmeSignature): Rename to gpgme_signature_t.
(GpgmeVerifyResult): Rename to gpgme_verify_result_t.
(GpgmeImportStatus): Rename to gpgme_import_status_t.
(GpgmeImportResult): Rename to gpgme_import_result_t.
(GpgmeGenKeyResult): Rename to gpgme_genkey_result_t.
(GpgmeKeyListResult): Rename to gpgme_keylist_result_t.
(GpgmeTrustItem): Rename to gpgme_trust_item_t.
* gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros
GPGME_No_Recipients, GPGME_Invalid_Recipient and
GPGME_No_Passphrase.
* data.h (struct gpgme_data_s): Rename to struct gpgme_data.
* context.h (struct gpgme_context_s): Rename to struct
gpgme_context.
(struct gpgme_recipients_s): Rename to gpgme_recipients.
2003-05-18 Marcus Brinkmann <marcus@g10code.de> 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
* keylist.c (finish_key): Clear OPD->tmp_uid. * keylist.c (finish_key): Clear OPD->tmp_uid.

View File

@ -58,10 +58,10 @@ struct ctx_op_data
/* The context defines an environment in which crypto operations can /* The context defines an environment in which crypto operations can
be performed (sequentially). */ be performed (sequentially). */
struct gpgme_context_s struct gpgme_context
{ {
/* The protocol used by this context. */ /* The protocol used by this context. */
GpgmeProtocol protocol; gpgme_protocol_t protocol;
/* The running engine process. */ /* The running engine process. */
EngineObject engine; EngineObject engine;
@ -83,31 +83,31 @@ struct gpgme_context_s
/* Size of the following array. */ /* Size of the following array. */
unsigned int signers_size; unsigned int signers_size;
GpgmeKey *signers; gpgme_key_t *signers;
/* The operation data hooked into the context. */ /* The operation data hooked into the context. */
struct ctx_op_data *op_data; struct ctx_op_data *op_data;
/* The user provided passphrase callback and its hook value. */ /* The user provided passphrase callback and its hook value. */
GpgmePassphraseCb passphrase_cb; gpgme_passphrase_cb_t passphrase_cb;
void *passphrase_cb_value; void *passphrase_cb_value;
/* The user provided progress callback and its hook value. */ /* The user provided progress callback and its hook value. */
GpgmeProgressCb progress_cb; gpgme_progress_cb_t progress_cb;
void *progress_cb_value; void *progress_cb_value;
/* A list of file descriptors in active use by the current /* A list of file descriptors in active use by the current
operation. */ operation. */
struct fd_table fdt; struct fd_table fdt;
struct GpgmeIOCbs io_cbs; struct gpgme_io_cbs io_cbs;
}; };
/* A recipient is defined by a user ID, but we define it as an opaque /* A recipient is defined by a user ID, but we define it as an opaque
type for the user. */ type for the user. */
struct gpgme_recipients_s struct gpgme_recipients
{ {
GpgmeUserID list; gpgme_user_id_t list;
}; };
#endif /* CONTEXT_H */ #endif /* CONTEXT_H */

View File

@ -63,7 +63,7 @@ _gpgme_hextobyte (const unsigned char *str)
the result. Currently, LEN is only used to specify if allocation the result. Currently, LEN is only used to specify if allocation
is desired or not, the caller is expected to make sure that *DESTP is desired or not, the caller is expected to make sure that *DESTP
is large enough if LEN is not zero. */ is large enough if LEN is not zero. */
GpgmeError gpgme_error_t
_gpgme_decode_c_string (const char *src, char **destp, int len) _gpgme_decode_c_string (const char *src, char **destp, int len)
{ {
char *dest; char *dest;
@ -165,7 +165,7 @@ _gpgme_decode_c_string (const char *src, char **destp, int len)
the result. Currently, LEN is only used to specify if allocation the result. Currently, LEN is only used to specify if allocation
is desired or not, the caller is expected to make sure that *DESTP is desired or not, the caller is expected to make sure that *DESTP
is large enough if LEN is not zero. */ is large enough if LEN is not zero. */
GpgmeError gpgme_error_t
_gpgme_decode_percent_string (const char *src, char **destp, int len) _gpgme_decode_percent_string (const char *src, char **destp, int len)
{ {
char *dest; char *dest;
@ -234,7 +234,7 @@ _gpgme_decode_percent_string (const char *src, char **destp, int len)
static struct static struct
{ {
char *name; char *name;
GpgmeError err; gpgme_error_t err;
} gnupg_errors[] = } gnupg_errors[] =
{ {
{ "EOF", GPGME_EOF }, { "EOF", GPGME_EOF },
@ -318,7 +318,7 @@ static struct
}; };
GpgmeError gpgme_error_t
_gpgme_map_gnupg_error (char *err) _gpgme_map_gnupg_error (char *err)
{ {
int i; int i;

View File

@ -32,11 +32,11 @@
/* Create a new data buffer filled with LENGTH bytes starting from /* Create a new data buffer filled with LENGTH bytes starting from
OFFSET within the file FNAME or stream STREAM (exactly one must be OFFSET within the file FNAME or stream STREAM (exactly one must be
non-zero). */ non-zero). */
GpgmeError gpgme_error_t
gpgme_data_new_from_filepart (GpgmeData *dh, const char *fname, FILE *stream, gpgme_data_new_from_filepart (gpgme_data_t *dh, const char *fname,
off_t offset, size_t length) FILE *stream, off_t offset, size_t length)
{ {
GpgmeError err; gpgme_error_t err;
char *buf = NULL; char *buf = NULL;
if (stream && fname) if (stream && fname)
@ -92,8 +92,8 @@ gpgme_data_new_from_filepart (GpgmeData *dh, const char *fname, FILE *stream,
/* Create a new data buffer filled with the content of file FNAME. /* Create a new data buffer filled with the content of file FNAME.
COPY must be non-zero (delayed reads are not supported yet). */ COPY must be non-zero (delayed reads are not supported yet). */
GpgmeError gpgme_error_t
gpgme_data_new_from_file (GpgmeData *dh, const char *fname, int copy) gpgme_data_new_from_file (gpgme_data_t *dh, const char *fname, int copy)
{ {
struct stat statbuf; struct stat statbuf;
@ -108,7 +108,7 @@ gpgme_data_new_from_file (GpgmeData *dh, const char *fname, int copy)
static int static int
gpgme_error_to_errno (GpgmeError err) gpgme_error_to_errno (gpgme_error_t err)
{ {
switch (err) switch (err)
{ {
@ -131,10 +131,10 @@ gpgme_error_to_errno (GpgmeError err)
} }
static ssize_t static ssize_t
old_user_read (GpgmeData dh, void *buffer, size_t size) old_user_read (gpgme_data_t dh, void *buffer, size_t size)
{ {
size_t amt; size_t amt;
GpgmeError err = (*dh->data.old_user.cb) (dh->data.old_user.handle, gpgme_error_t err = (*dh->data.old_user.cb) (dh->data.old_user.handle,
buffer, size, &amt); buffer, size, &amt);
if (err) if (err)
return gpgme_error_to_errno (err); return gpgme_error_to_errno (err);
@ -143,9 +143,9 @@ old_user_read (GpgmeData dh, void *buffer, size_t size)
static off_t static off_t
old_user_seek (GpgmeData dh, off_t offset, int whence) old_user_seek (gpgme_data_t dh, off_t offset, int whence)
{ {
GpgmeError err; gpgme_error_t err;
if (whence != SEEK_SET || offset) if (whence != SEEK_SET || offset)
return EINVAL; return EINVAL;
err = (*dh->data.old_user.cb) (dh->data.old_user.handle, NULL, 0, NULL); err = (*dh->data.old_user.cb) (dh->data.old_user.handle, NULL, 0, NULL);
@ -155,7 +155,7 @@ old_user_seek (GpgmeData dh, off_t offset, int whence)
} }
static struct gpgme_data_cbs old_user_cbs = static struct _gpgme_data_cbs old_user_cbs =
{ {
old_user_read, old_user_read,
NULL, NULL,
@ -166,12 +166,12 @@ static struct gpgme_data_cbs old_user_cbs =
/* Create a new data buffer which retrieves the data from the callback /* Create a new data buffer which retrieves the data from the callback
function READ_CB. */ function READ_CB. */
GpgmeError gpgme_error_t
gpgme_data_new_with_read_cb (GpgmeData *dh, gpgme_data_new_with_read_cb (gpgme_data_t *dh,
int (*read_cb) (void *, char *, size_t, size_t *), int (*read_cb) (void *, char *, size_t, size_t *),
void *read_cb_value) void *read_cb_value)
{ {
GpgmeError err = _gpgme_data_new (dh, &old_user_cbs); gpgme_error_t err = _gpgme_data_new (dh, &old_user_cbs);
if (err) if (err)
return err; return err;
@ -181,8 +181,8 @@ gpgme_data_new_with_read_cb (GpgmeData *dh,
} }
GpgmeError gpgme_error_t
gpgme_data_rewind (GpgmeData dh) gpgme_data_rewind (gpgme_data_t dh)
{ {
return (gpgme_data_seek (dh, 0, SEEK_SET) == -1) return (gpgme_data_seek (dh, 0, SEEK_SET) == -1)
? GPGME_File_Error : 0; ? GPGME_File_Error : 0;

View File

@ -28,27 +28,27 @@
static ssize_t static ssize_t
fd_read (GpgmeData dh, void *buffer, size_t size) fd_read (gpgme_data_t dh, void *buffer, size_t size)
{ {
return read (dh->data.fd, buffer, size); return read (dh->data.fd, buffer, size);
} }
static ssize_t static ssize_t
fd_write (GpgmeData dh, const void *buffer, size_t size) fd_write (gpgme_data_t dh, const void *buffer, size_t size)
{ {
return write (dh->data.fd, buffer, size); return write (dh->data.fd, buffer, size);
} }
static off_t static off_t
fd_seek (GpgmeData dh, off_t offset, int whence) fd_seek (gpgme_data_t dh, off_t offset, int whence)
{ {
return lseek (dh->data.fd, offset, whence); return lseek (dh->data.fd, offset, whence);
} }
static struct gpgme_data_cbs fd_cbs = static struct _gpgme_data_cbs fd_cbs =
{ {
fd_read, fd_read,
fd_write, fd_write,
@ -57,10 +57,10 @@ static struct gpgme_data_cbs fd_cbs =
}; };
GpgmeError gpgme_error_t
gpgme_data_new_from_fd (GpgmeData *dh, int fd) gpgme_data_new_from_fd (gpgme_data_t *dh, int fd)
{ {
GpgmeError err = _gpgme_data_new (dh, &fd_cbs); gpgme_error_t err = _gpgme_data_new (dh, &fd_cbs);
if (err) if (err)
return err; return err;

View File

@ -32,7 +32,7 @@
static ssize_t static ssize_t
mem_read (GpgmeData dh, void *buffer, size_t size) mem_read (gpgme_data_t dh, void *buffer, size_t size)
{ {
size_t amt = dh->data.mem.length - dh->data.mem.offset; size_t amt = dh->data.mem.length - dh->data.mem.offset;
const char *src; const char *src;
@ -51,7 +51,7 @@ mem_read (GpgmeData dh, void *buffer, size_t size)
static ssize_t static ssize_t
mem_write (GpgmeData dh, const void *buffer, size_t size) mem_write (gpgme_data_t dh, const void *buffer, size_t size)
{ {
size_t unused; size_t unused;
@ -104,7 +104,7 @@ mem_write (GpgmeData dh, const void *buffer, size_t size)
static off_t static off_t
mem_seek (GpgmeData dh, off_t offset, int whence) mem_seek (gpgme_data_t dh, off_t offset, int whence)
{ {
switch (whence) switch (whence)
{ {
@ -142,14 +142,14 @@ mem_seek (GpgmeData dh, off_t offset, int whence)
static void static void
mem_release (GpgmeData dh) mem_release (gpgme_data_t dh)
{ {
if (dh->data.mem.buffer) if (dh->data.mem.buffer)
free (dh->data.mem.buffer); free (dh->data.mem.buffer);
} }
static struct gpgme_data_cbs mem_cbs = static struct _gpgme_data_cbs mem_cbs =
{ {
mem_read, mem_read,
mem_write, mem_write,
@ -158,10 +158,10 @@ static struct gpgme_data_cbs mem_cbs =
}; };
GpgmeError gpgme_error_t
gpgme_data_new (GpgmeData *dh) gpgme_data_new (gpgme_data_t *dh)
{ {
GpgmeError err = _gpgme_data_new (dh, &mem_cbs); gpgme_error_t err = _gpgme_data_new (dh, &mem_cbs);
if (err) if (err)
return err; return err;
@ -172,11 +172,11 @@ gpgme_data_new (GpgmeData *dh)
/* Create a new data buffer filled with SIZE bytes starting from /* Create a new data buffer filled with SIZE bytes starting from
BUFFER. If COPY is zero, copying is delayed until necessary, and BUFFER. If COPY is zero, copying is delayed until necessary, and
the data is taken from the original location when needed. */ the data is taken from the original location when needed. */
GpgmeError gpgme_error_t
gpgme_data_new_from_mem (GpgmeData *dh, const char *buffer, gpgme_data_new_from_mem (gpgme_data_t *dh, const char *buffer,
size_t size, int copy) size_t size, int copy)
{ {
GpgmeError err = _gpgme_data_new (dh, &mem_cbs); gpgme_error_t err = _gpgme_data_new (dh, &mem_cbs);
if (err) if (err)
return err; return err;
@ -198,7 +198,7 @@ gpgme_data_new_from_mem (GpgmeData *dh, const char *buffer,
char * char *
gpgme_data_release_and_get_mem (GpgmeData dh, size_t *r_len) gpgme_data_release_and_get_mem (gpgme_data_t dh, size_t *r_len)
{ {
char *str = NULL; char *str = NULL;

View File

@ -28,7 +28,7 @@
static ssize_t static ssize_t
stream_read (GpgmeData dh, void *buffer, size_t size) stream_read (gpgme_data_t dh, void *buffer, size_t size)
{ {
size_t amt = fread (buffer, 1, size, dh->data.stream); size_t amt = fread (buffer, 1, size, dh->data.stream);
if (amt > 0) if (amt > 0)
@ -38,7 +38,7 @@ stream_read (GpgmeData dh, void *buffer, size_t size)
static ssize_t static ssize_t
stream_write (GpgmeData dh, const void *buffer, size_t size) stream_write (gpgme_data_t dh, const void *buffer, size_t size)
{ {
size_t amt = fwrite (buffer, 1, size, dh->data.stream); size_t amt = fwrite (buffer, 1, size, dh->data.stream);
if (amt > 0) if (amt > 0)
@ -48,13 +48,13 @@ stream_write (GpgmeData dh, const void *buffer, size_t size)
static off_t static off_t
stream_seek (GpgmeData dh, off_t offset, int whence) stream_seek (gpgme_data_t dh, off_t offset, int whence)
{ {
return fseek (dh->data.stream, offset, whence); return fseek (dh->data.stream, offset, whence);
} }
static struct gpgme_data_cbs stream_cbs = static struct _gpgme_data_cbs stream_cbs =
{ {
stream_read, stream_read,
stream_write, stream_write,
@ -63,10 +63,10 @@ static struct gpgme_data_cbs stream_cbs =
}; };
GpgmeError gpgme_error_t
gpgme_data_new_from_stream (GpgmeData *dh, FILE *stream) gpgme_data_new_from_stream (gpgme_data_t *dh, FILE *stream)
{ {
GpgmeError err = _gpgme_data_new (dh, &stream_cbs); gpgme_error_t err = _gpgme_data_new (dh, &stream_cbs);
if (err) if (err)
return err; return err;

View File

@ -27,34 +27,34 @@
static ssize_t static ssize_t
user_read (GpgmeData dh, void *buffer, size_t size) user_read (gpgme_data_t dh, void *buffer, size_t size)
{ {
return (*dh->data.user.cbs->read) (dh->data.user.handle, buffer, size); return (*dh->data.user.cbs->read) (dh->data.user.handle, buffer, size);
} }
static ssize_t static ssize_t
user_write (GpgmeData dh, const void *buffer, size_t size) user_write (gpgme_data_t dh, const void *buffer, size_t size)
{ {
return (*dh->data.user.cbs->write) (dh->data.user.handle, buffer, size); return (*dh->data.user.cbs->write) (dh->data.user.handle, buffer, size);
} }
static off_t static off_t
user_seek (GpgmeData dh, off_t offset, int whence) user_seek (gpgme_data_t dh, off_t offset, int whence)
{ {
return (*dh->data.user.cbs->seek) (dh->data.user.handle, offset, whence); return (*dh->data.user.cbs->seek) (dh->data.user.handle, offset, whence);
} }
static void static void
user_release (GpgmeData dh) user_release (gpgme_data_t dh)
{ {
(*dh->data.user.cbs->release) (dh->data.user.handle); (*dh->data.user.cbs->release) (dh->data.user.handle);
} }
static struct gpgme_data_cbs user_cbs = static struct _gpgme_data_cbs user_cbs =
{ {
user_read, user_read,
user_write, user_write,
@ -63,10 +63,10 @@ static struct gpgme_data_cbs user_cbs =
}; };
GpgmeError gpgme_error_t
gpgme_data_new_from_cbs (GpgmeData *dh, struct GpgmeDataCbs *cbs, void *handle) gpgme_data_new_from_cbs (gpgme_data_t *dh, gpgme_data_cbs_t cbs, void *handle)
{ {
GpgmeError err = _gpgme_data_new (dh, &user_cbs); gpgme_error_t err = _gpgme_data_new (dh, &user_cbs);
if (err) if (err)
return err; return err;

View File

@ -33,10 +33,10 @@
#include "io.h" #include "io.h"
GpgmeError gpgme_error_t
_gpgme_data_new (GpgmeData *r_dh, struct gpgme_data_cbs *cbs) _gpgme_data_new (gpgme_data_t *r_dh, struct _gpgme_data_cbs *cbs)
{ {
GpgmeData dh; gpgme_data_t dh;
if (!r_dh) if (!r_dh)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -54,7 +54,7 @@ _gpgme_data_new (GpgmeData *r_dh, struct gpgme_data_cbs *cbs)
void void
_gpgme_data_release (GpgmeData dh) _gpgme_data_release (gpgme_data_t dh)
{ {
if (dh) if (dh)
free (dh); free (dh);
@ -65,7 +65,7 @@ _gpgme_data_release (GpgmeData dh)
the handle DH. Return the number of characters read, 0 on EOF and the handle DH. Return the number of characters read, 0 on EOF and
-1 on error. If an error occurs, errno is set. */ -1 on error. If an error occurs, errno is set. */
ssize_t ssize_t
gpgme_data_read (GpgmeData dh, void *buffer, size_t size) gpgme_data_read (gpgme_data_t dh, void *buffer, size_t size)
{ {
if (!dh) if (!dh)
{ {
@ -85,7 +85,7 @@ gpgme_data_read (GpgmeData dh, void *buffer, size_t size)
the handle DH. Return the number of characters written, or -1 on the handle DH. Return the number of characters written, or -1 on
error. If an error occurs, errno is set. */ error. If an error occurs, errno is set. */
ssize_t ssize_t
gpgme_data_write (GpgmeData dh, const void *buffer, size_t size) gpgme_data_write (gpgme_data_t dh, const void *buffer, size_t size)
{ {
if (!dh) if (!dh)
{ {
@ -105,7 +105,7 @@ gpgme_data_write (GpgmeData dh, const void *buffer, size_t size)
in the data object with the handle DH to OFFSET, relativ to in the data object with the handle DH to OFFSET, relativ to
WHENCE. */ WHENCE. */
off_t off_t
gpgme_data_seek (GpgmeData dh, off_t offset, int whence) gpgme_data_seek (gpgme_data_t dh, off_t offset, int whence)
{ {
if (!dh) if (!dh)
{ {
@ -123,7 +123,7 @@ gpgme_data_seek (GpgmeData dh, off_t offset, int whence)
/* Release the data object with the handle DH. */ /* Release the data object with the handle DH. */
void void
gpgme_data_release (GpgmeData dh) gpgme_data_release (gpgme_data_t dh)
{ {
if (!dh) if (!dh)
return; return;
@ -136,8 +136,8 @@ gpgme_data_release (GpgmeData dh)
/* Get the current encoding meta information for the data object with /* Get the current encoding meta information for the data object with
handle DH. */ handle DH. */
GpgmeDataEncoding gpgme_data_encoding_t
gpgme_data_get_encoding (GpgmeData dh) gpgme_data_get_encoding (gpgme_data_t dh)
{ {
return dh ? dh->encoding : GPGME_DATA_ENCODING_NONE; return dh ? dh->encoding : GPGME_DATA_ENCODING_NONE;
} }
@ -145,8 +145,8 @@ gpgme_data_get_encoding (GpgmeData dh)
/* Set the encoding meta information for the data object with handle /* Set the encoding meta information for the data object with handle
DH to ENC. */ DH to ENC. */
GpgmeError gpgme_error_t
gpgme_data_set_encoding (GpgmeData dh, GpgmeDataEncoding enc) gpgme_data_set_encoding (gpgme_data_t dh, gpgme_data_encoding_t enc)
{ {
if (!dh) if (!dh)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -159,10 +159,10 @@ gpgme_data_set_encoding (GpgmeData dh, GpgmeDataEncoding enc)
/* Functions to support the wait interface. */ /* Functions to support the wait interface. */
GpgmeError gpgme_error_t
_gpgme_data_inbound_handler (void *opaque, int fd) _gpgme_data_inbound_handler (void *opaque, int fd)
{ {
GpgmeData dh = (GpgmeData) opaque; gpgme_data_t dh = (gpgme_data_t) opaque;
char buffer[BUFFER_SIZE]; char buffer[BUFFER_SIZE];
char *bufp = buffer; char *bufp = buffer;
ssize_t buflen; ssize_t buflen;
@ -189,10 +189,10 @@ _gpgme_data_inbound_handler (void *opaque, int fd)
} }
GpgmeError gpgme_error_t
_gpgme_data_outbound_handler (void *opaque, int fd) _gpgme_data_outbound_handler (void *opaque, int fd)
{ {
GpgmeData dh = (GpgmeData) opaque; gpgme_data_t dh = (gpgme_data_t) opaque;
ssize_t nwritten; ssize_t nwritten;
if (!dh->pending_len) if (!dh->pending_len)

View File

@ -33,24 +33,24 @@
/* Read up to SIZE bytes into buffer BUFFER from the data object with /* Read up to SIZE bytes into buffer BUFFER from the data object with
the handle DH. Return the number of characters read, 0 on EOF and the handle DH. Return the number of characters read, 0 on EOF and
-1 on error. If an error occurs, errno is set. */ -1 on error. If an error occurs, errno is set. */
typedef ssize_t (*gpgme_data_read_cb) (GpgmeData dh, void *buffer, typedef ssize_t (*gpgme_data_read_cb) (gpgme_data_t dh, void *buffer,
size_t size); size_t size);
/* Write up to SIZE bytes from buffer BUFFER to the data object with /* Write up to SIZE bytes from buffer BUFFER to the data object with
the handle DH. Return the number of characters written, or -1 on the handle DH. Return the number of characters written, or -1 on
error. If an error occurs, errno is set. */ error. If an error occurs, errno is set. */
typedef ssize_t (*gpgme_data_write_cb) (GpgmeData dh, const void *buffer, typedef ssize_t (*gpgme_data_write_cb) (gpgme_data_t dh, const void *buffer,
size_t size); size_t size);
/* Set the current position from where the next read or write starts /* Set the current position from where the next read or write starts
in the data object with the handle DH to OFFSET, relativ to in the data object with the handle DH to OFFSET, relativ to
WHENCE. */ WHENCE. */
typedef off_t (*gpgme_data_seek_cb) (GpgmeData dh, off_t offset, int whence); typedef off_t (*gpgme_data_seek_cb) (gpgme_data_t dh, off_t offset, int whence);
/* Release the data object with the handle DH. */ /* Release the data object with the handle DH. */
typedef void (*gpgme_data_release_cb) (GpgmeData dh); typedef void (*gpgme_data_release_cb) (gpgme_data_t dh);
struct gpgme_data_cbs struct _gpgme_data_cbs
{ {
gpgme_data_read_cb read; gpgme_data_read_cb read;
gpgme_data_write_cb write; gpgme_data_write_cb write;
@ -58,10 +58,10 @@ struct gpgme_data_cbs
gpgme_data_release_cb release; gpgme_data_release_cb release;
}; };
struct gpgme_data_s struct gpgme_data
{ {
struct gpgme_data_cbs *cbs; struct _gpgme_data_cbs *cbs;
GpgmeDataEncoding encoding; gpgme_data_encoding_t encoding;
#ifdef PIPE_BUF #ifdef PIPE_BUF
#define BUFFER_SIZE PIPE_BUF #define BUFFER_SIZE PIPE_BUF
@ -86,7 +86,7 @@ struct gpgme_data_s
/* For gpgme_data_new_from_cbs. */ /* For gpgme_data_new_from_cbs. */
struct struct
{ {
struct GpgmeDataCbs *cbs; gpgme_data_cbs_t cbs;
void *handle; void *handle;
} user; } user;
@ -111,8 +111,8 @@ struct gpgme_data_s
}; };
GpgmeError _gpgme_data_new (GpgmeData *r_dh, struct gpgme_data_cbs *cbs); gpgme_error_t _gpgme_data_new (gpgme_data_t *r_dh, struct _gpgme_data_cbs *cbs);
void _gpgme_data_release (GpgmeData dh); void _gpgme_data_release (gpgme_data_t dh);
#endif /* DATA_H */ #endif /* DATA_H */

View File

@ -26,19 +26,19 @@
#include "ops.h" #include "ops.h"
static GpgmeError static gpgme_error_t
decrypt_verify_status_handler (void *priv, GpgmeStatusCode code, char *args) decrypt_verify_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
return _gpgme_decrypt_status_handler (priv, code, args) return _gpgme_decrypt_status_handler (priv, code, args)
|| _gpgme_verify_status_handler (priv, code, args); || _gpgme_verify_status_handler (priv, code, args);
} }
static GpgmeError static gpgme_error_t
_gpgme_op_decrypt_verify_start (GpgmeCtx ctx, int synchronous, _gpgme_op_decrypt_verify_start (gpgme_ctx_t ctx, int synchronous,
GpgmeData cipher, GpgmeData plain) gpgme_data_t cipher, gpgme_data_t plain)
{ {
GpgmeError err; gpgme_error_t err;
err = _gpgme_op_reset (ctx, synchronous); err = _gpgme_op_reset (ctx, synchronous);
if (err) if (err)
@ -75,8 +75,8 @@ _gpgme_op_decrypt_verify_start (GpgmeCtx ctx, int synchronous,
/* Decrypt ciphertext CIPHER and make a signature verification within /* Decrypt ciphertext CIPHER and make a signature verification within
CTX and store the resulting plaintext in PLAIN. */ CTX and store the resulting plaintext in PLAIN. */
GpgmeError gpgme_error_t
gpgme_op_decrypt_verify_start (GpgmeCtx ctx, GpgmeData cipher, GpgmeData plain) gpgme_op_decrypt_verify_start (gpgme_ctx_t ctx, gpgme_data_t cipher, gpgme_data_t plain)
{ {
return _gpgme_op_decrypt_verify_start (ctx, 0, cipher, plain); return _gpgme_op_decrypt_verify_start (ctx, 0, cipher, plain);
} }
@ -84,10 +84,10 @@ gpgme_op_decrypt_verify_start (GpgmeCtx ctx, GpgmeData cipher, GpgmeData plain)
/* Decrypt ciphertext CIPHER and make a signature verification within /* Decrypt ciphertext CIPHER and make a signature verification within
CTX and store the resulting plaintext in PLAIN. */ CTX and store the resulting plaintext in PLAIN. */
GpgmeError gpgme_error_t
gpgme_op_decrypt_verify (GpgmeCtx ctx, GpgmeData cipher, GpgmeData plain) gpgme_op_decrypt_verify (gpgme_ctx_t ctx, gpgme_data_t cipher, gpgme_data_t plain)
{ {
GpgmeError err = _gpgme_op_decrypt_verify_start (ctx, 1, cipher, plain); gpgme_error_t err = _gpgme_op_decrypt_verify_start (ctx, 1, cipher, plain);
if (!err) if (!err)
err = _gpgme_wait_one (ctx); err = _gpgme_wait_one (ctx);
return err; return err;

View File

@ -49,11 +49,11 @@ release_op_data (void *hook)
} }
GpgmeDecryptResult gpgme_decrypt_result_t
gpgme_op_decrypt_result (GpgmeCtx ctx) gpgme_op_decrypt_result (gpgme_ctx_t ctx)
{ {
op_data_t opd; op_data_t opd;
GpgmeError err; gpgme_error_t err;
err = _gpgme_op_data_lookup (ctx, OPDATA_DECRYPT, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_DECRYPT, (void **) &opd, -1, NULL);
if (err || !opd) if (err || !opd)
@ -63,11 +63,11 @@ gpgme_op_decrypt_result (GpgmeCtx ctx)
} }
GpgmeError gpgme_error_t
_gpgme_decrypt_status_handler (void *priv, GpgmeStatusCode code, char *args) _gpgme_decrypt_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
GpgmeCtx ctx = (GpgmeCtx) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
GpgmeError err; gpgme_error_t err;
op_data_t opd; op_data_t opd;
err = _gpgme_passphrase_status_handler (priv, code, args); err = _gpgme_passphrase_status_handler (priv, code, args);
@ -136,8 +136,8 @@ _gpgme_decrypt_status_handler (void *priv, GpgmeStatusCode code, char *args)
} }
GpgmeError gpgme_error_t
_gpgme_op_decrypt_init_result (GpgmeCtx ctx) _gpgme_op_decrypt_init_result (gpgme_ctx_t ctx)
{ {
op_data_t opd; op_data_t opd;
@ -146,11 +146,11 @@ _gpgme_op_decrypt_init_result (GpgmeCtx ctx)
} }
static GpgmeError static gpgme_error_t
decrypt_start (GpgmeCtx ctx, int synchronous, decrypt_start (gpgme_ctx_t ctx, int synchronous,
GpgmeData cipher, GpgmeData plain) gpgme_data_t cipher, gpgme_data_t plain)
{ {
GpgmeError err; gpgme_error_t err;
err = _gpgme_op_reset (ctx, synchronous); err = _gpgme_op_reset (ctx, synchronous);
if (err) if (err)
@ -184,8 +184,8 @@ decrypt_start (GpgmeCtx ctx, int synchronous,
} }
GpgmeError gpgme_error_t
gpgme_op_decrypt_start (GpgmeCtx ctx, GpgmeData cipher, GpgmeData plain) gpgme_op_decrypt_start (gpgme_ctx_t ctx, gpgme_data_t cipher, gpgme_data_t plain)
{ {
return decrypt_start (ctx, 0, cipher, plain); return decrypt_start (ctx, 0, cipher, plain);
} }
@ -193,10 +193,10 @@ gpgme_op_decrypt_start (GpgmeCtx ctx, GpgmeData cipher, GpgmeData plain)
/* Decrypt ciphertext CIPHER within CTX and store the resulting /* Decrypt ciphertext CIPHER within CTX and store the resulting
plaintext in PLAIN. */ plaintext in PLAIN. */
GpgmeError gpgme_error_t
gpgme_op_decrypt (GpgmeCtx ctx, GpgmeData cipher, GpgmeData plain) gpgme_op_decrypt (gpgme_ctx_t ctx, gpgme_data_t cipher, gpgme_data_t plain)
{ {
GpgmeError err = decrypt_start (ctx, 1, cipher, plain); gpgme_error_t err = decrypt_start (ctx, 1, cipher, plain);
if (!err) if (!err)
err = _gpgme_wait_one (ctx); err = _gpgme_wait_one (ctx);
return err; return err;

View File

@ -28,8 +28,8 @@
#include "ops.h" #include "ops.h"
static GpgmeError static gpgme_error_t
delete_status_handler (void *priv, GpgmeStatusCode code, char *args) delete_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
if (code == GPGME_STATUS_DELETE_PROBLEM) if (code == GPGME_STATUS_DELETE_PROBLEM)
{ {
@ -70,11 +70,11 @@ delete_status_handler (void *priv, GpgmeStatusCode code, char *args)
} }
static GpgmeError static gpgme_error_t
delete_start (GpgmeCtx ctx, int synchronous, const GpgmeKey key, delete_start (gpgme_ctx_t ctx, int synchronous, const gpgme_key_t key,
int allow_secret) int allow_secret)
{ {
GpgmeError err; gpgme_error_t err;
err = _gpgme_op_reset (ctx, synchronous); err = _gpgme_op_reset (ctx, synchronous);
if (err) if (err)
@ -88,8 +88,8 @@ delete_start (GpgmeCtx ctx, int synchronous, const GpgmeKey key,
/* Delete KEY from the keyring. If ALLOW_SECRET is non-zero, secret /* Delete KEY from the keyring. If ALLOW_SECRET is non-zero, secret
keys are also deleted. */ keys are also deleted. */
GpgmeError gpgme_error_t
gpgme_op_delete_start (GpgmeCtx ctx, const GpgmeKey key, int allow_secret) gpgme_op_delete_start (gpgme_ctx_t ctx, const gpgme_key_t key, int allow_secret)
{ {
return delete_start (ctx, 0, key, allow_secret); return delete_start (ctx, 0, key, allow_secret);
} }
@ -97,10 +97,10 @@ gpgme_op_delete_start (GpgmeCtx ctx, const GpgmeKey key, int allow_secret)
/* Delete KEY from the keyring. If ALLOW_SECRET is non-zero, secret /* Delete KEY from the keyring. If ALLOW_SECRET is non-zero, secret
keys are also deleted. */ keys are also deleted. */
GpgmeError gpgme_error_t
gpgme_op_delete (GpgmeCtx ctx, const GpgmeKey key, int allow_secret) gpgme_op_delete (gpgme_ctx_t ctx, const gpgme_key_t key, int allow_secret)
{ {
GpgmeError err = delete_start (ctx, 1, key, allow_secret); gpgme_error_t err = delete_start (ctx, 1, key, allow_secret);
if (!err) if (!err)
err = _gpgme_wait_one (ctx); err = _gpgme_wait_one (ctx);
return err; return err;

View File

@ -30,15 +30,15 @@
typedef struct typedef struct
{ {
/* The user callback function and its hook value. */ /* The user callback function and its hook value. */
GpgmeEditCb fnc; gpgme_edit_cb_t fnc;
void *fnc_value; void *fnc_value;
} *op_data_t; } *op_data_t;
static GpgmeError static gpgme_error_t
edit_status_handler (void *priv, GpgmeStatusCode status, char *args) edit_status_handler (void *priv, gpgme_status_code_t status, char *args)
{ {
GpgmeCtx ctx = (GpgmeCtx) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
op_data_t opd; op_data_t opd;
return _gpgme_passphrase_status_handler (priv, status, args) return _gpgme_passphrase_status_handler (priv, status, args)
@ -48,12 +48,12 @@ edit_status_handler (void *priv, GpgmeStatusCode status, char *args)
} }
static GpgmeError static gpgme_error_t
command_handler (void *priv, GpgmeStatusCode status, const char *args, command_handler (void *priv, gpgme_status_code_t status, const char *args,
const char **result) const char **result)
{ {
GpgmeCtx ctx = (GpgmeCtx) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
GpgmeError err; gpgme_error_t err;
op_data_t opd; op_data_t opd;
*result = NULL; *result = NULL;
@ -76,11 +76,11 @@ command_handler (void *priv, GpgmeStatusCode status, const char *args,
} }
static GpgmeError static gpgme_error_t
edit_start (GpgmeCtx ctx, int synchronous, GpgmeKey key, edit_start (gpgme_ctx_t ctx, int synchronous, gpgme_key_t key,
GpgmeEditCb fnc, void *fnc_value, GpgmeData out) gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out)
{ {
GpgmeError err; gpgme_error_t err;
op_data_t opd; op_data_t opd;
err = _gpgme_op_reset (ctx, synchronous); err = _gpgme_op_reset (ctx, synchronous);
@ -109,9 +109,9 @@ edit_start (GpgmeCtx ctx, int synchronous, GpgmeKey key,
} }
GpgmeError gpgme_error_t
gpgme_op_edit_start (GpgmeCtx ctx, GpgmeKey key, gpgme_op_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
GpgmeEditCb fnc, void *fnc_value, GpgmeData out) gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out)
{ {
return edit_start (ctx, 0, key, fnc, fnc_value, out); return edit_start (ctx, 0, key, fnc, fnc_value, out);
} }
@ -119,11 +119,11 @@ gpgme_op_edit_start (GpgmeCtx ctx, GpgmeKey key,
/* Edit the key KEY. Send status and command requests to FNC and /* Edit the key KEY. Send status and command requests to FNC and
output of edit commands to OUT. */ output of edit commands to OUT. */
GpgmeError gpgme_error_t
gpgme_op_edit (GpgmeCtx ctx, GpgmeKey key, gpgme_op_edit (gpgme_ctx_t ctx, gpgme_key_t key,
GpgmeEditCb fnc, void *fnc_value, GpgmeData out) gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out)
{ {
GpgmeError err = edit_start (ctx, 1, key, fnc, fnc_value, out); gpgme_error_t err = edit_start (ctx, 1, key, fnc, fnc_value, out);
if (!err) if (!err)
err = _gpgme_wait_one (ctx); err = _gpgme_wait_one (ctx);
return err; return err;

View File

@ -27,19 +27,19 @@
#include "ops.h" #include "ops.h"
static GpgmeError static gpgme_error_t
encrypt_sign_status_handler (void *priv, GpgmeStatusCode code, char *args) encrypt_sign_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
return _gpgme_encrypt_status_handler (priv, code, args) return _gpgme_encrypt_status_handler (priv, code, args)
|| _gpgme_sign_status_handler (priv, code, args); || _gpgme_sign_status_handler (priv, code, args);
} }
static GpgmeError static gpgme_error_t
encrypt_sign_start (GpgmeCtx ctx, int synchronous, GpgmeRecipients recp, encrypt_sign_start (gpgme_ctx_t ctx, int synchronous, gpgme_recipients_t recp,
GpgmeData plain, GpgmeData cipher) gpgme_data_t plain, gpgme_data_t cipher)
{ {
GpgmeError err; gpgme_error_t err;
err = _gpgme_op_reset (ctx, synchronous); err = _gpgme_op_reset (ctx, synchronous);
if (err) if (err)
@ -78,9 +78,9 @@ encrypt_sign_start (GpgmeCtx ctx, int synchronous, GpgmeRecipients recp,
/* Encrypt plaintext PLAIN within CTX for the recipients RECP and /* Encrypt plaintext PLAIN within CTX for the recipients RECP and
store the resulting ciphertext in CIPHER. Also sign the ciphertext store the resulting ciphertext in CIPHER. Also sign the ciphertext
with the signers in CTX. */ with the signers in CTX. */
GpgmeError gpgme_error_t
gpgme_op_encrypt_sign_start (GpgmeCtx ctx, GpgmeRecipients recp, gpgme_op_encrypt_sign_start (gpgme_ctx_t ctx, gpgme_recipients_t recp,
GpgmeData plain, GpgmeData cipher) gpgme_data_t plain, gpgme_data_t cipher)
{ {
return encrypt_sign_start (ctx, 0, recp, plain, cipher); return encrypt_sign_start (ctx, 0, recp, plain, cipher);
} }
@ -89,11 +89,11 @@ gpgme_op_encrypt_sign_start (GpgmeCtx ctx, GpgmeRecipients recp,
/* Encrypt plaintext PLAIN within CTX for the recipients RECP and /* Encrypt plaintext PLAIN within CTX for the recipients RECP and
store the resulting ciphertext in CIPHER. Also sign the ciphertext store the resulting ciphertext in CIPHER. Also sign the ciphertext
with the signers in CTX. */ with the signers in CTX. */
GpgmeError gpgme_error_t
gpgme_op_encrypt_sign (GpgmeCtx ctx, GpgmeRecipients recp, gpgme_op_encrypt_sign (gpgme_ctx_t ctx, gpgme_recipients_t recp,
GpgmeData plain, GpgmeData cipher) gpgme_data_t plain, gpgme_data_t cipher)
{ {
GpgmeError err = encrypt_sign_start (ctx, 1, recp, plain, cipher); gpgme_error_t err = encrypt_sign_start (ctx, 1, recp, plain, cipher);
if (!err) if (!err)
err = _gpgme_wait_one (ctx); err = _gpgme_wait_one (ctx);
return err; return err;

View File

@ -37,7 +37,7 @@ typedef struct
/* A pointer to the next pointer of the last invalid recipient in /* A pointer to the next pointer of the last invalid recipient in
the list. This makes appending new invalid recipients painless the list. This makes appending new invalid recipients painless
while preserving the order. */ while preserving the order. */
GpgmeInvalidUserID *lastp; gpgme_invalid_user_id_t *lastp;
} *op_data_t; } *op_data_t;
@ -45,22 +45,22 @@ static void
release_op_data (void *hook) release_op_data (void *hook)
{ {
op_data_t opd = (op_data_t) hook; op_data_t opd = (op_data_t) hook;
GpgmeInvalidUserID invalid_recipient = opd->result.invalid_recipients; gpgme_invalid_user_id_t invalid_recipient = opd->result.invalid_recipients;
while (invalid_recipient) while (invalid_recipient)
{ {
GpgmeInvalidUserID next = invalid_recipient->next; gpgme_invalid_user_id_t next = invalid_recipient->next;
free (invalid_recipient->id); free (invalid_recipient->id);
invalid_recipient = next; invalid_recipient = next;
} }
} }
GpgmeEncryptResult gpgme_encrypt_result_t
gpgme_op_encrypt_result (GpgmeCtx ctx) gpgme_op_encrypt_result (gpgme_ctx_t ctx)
{ {
op_data_t opd; op_data_t opd;
GpgmeError err; gpgme_error_t err;
err = _gpgme_op_data_lookup (ctx, OPDATA_ENCRYPT, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_ENCRYPT, (void **) &opd, -1, NULL);
if (err || !opd) if (err || !opd)
@ -70,11 +70,11 @@ gpgme_op_encrypt_result (GpgmeCtx ctx)
} }
GpgmeError gpgme_error_t
_gpgme_encrypt_status_handler (void *priv, GpgmeStatusCode code, char *args) _gpgme_encrypt_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
GpgmeCtx ctx = (GpgmeCtx) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
GpgmeError err; gpgme_error_t err;
op_data_t opd; op_data_t opd;
err = _gpgme_op_data_lookup (ctx, OPDATA_ENCRYPT, (void **) &opd, err = _gpgme_op_data_lookup (ctx, OPDATA_ENCRYPT, (void **) &opd,
@ -108,18 +108,18 @@ _gpgme_encrypt_status_handler (void *priv, GpgmeStatusCode code, char *args)
} }
GpgmeError gpgme_error_t
_gpgme_encrypt_sym_status_handler (void *priv, GpgmeStatusCode code, _gpgme_encrypt_sym_status_handler (void *priv, gpgme_status_code_t code,
char *args) char *args)
{ {
return _gpgme_passphrase_status_handler (priv, code, args); return _gpgme_passphrase_status_handler (priv, code, args);
} }
GpgmeError gpgme_error_t
_gpgme_op_encrypt_init_result (GpgmeCtx ctx) _gpgme_op_encrypt_init_result (gpgme_ctx_t ctx)
{ {
GpgmeError err; gpgme_error_t err;
op_data_t opd; op_data_t opd;
err = _gpgme_op_data_lookup (ctx, OPDATA_ENCRYPT, (void **) &opd, err = _gpgme_op_data_lookup (ctx, OPDATA_ENCRYPT, (void **) &opd,
@ -131,11 +131,11 @@ _gpgme_op_encrypt_init_result (GpgmeCtx ctx)
} }
static GpgmeError static gpgme_error_t
encrypt_start (GpgmeCtx ctx, int synchronous, GpgmeRecipients recp, encrypt_start (gpgme_ctx_t ctx, int synchronous, gpgme_recipients_t recp,
GpgmeData plain, GpgmeData cipher) gpgme_data_t plain, gpgme_data_t cipher)
{ {
GpgmeError err; gpgme_error_t err;
int symmetric = 0; int symmetric = 0;
err = _gpgme_op_reset (ctx, synchronous); err = _gpgme_op_reset (ctx, synchronous);
@ -177,9 +177,9 @@ encrypt_start (GpgmeCtx ctx, int synchronous, GpgmeRecipients recp,
} }
GpgmeError gpgme_error_t
gpgme_op_encrypt_start (GpgmeCtx ctx, GpgmeRecipients recp, GpgmeData plain, gpgme_op_encrypt_start (gpgme_ctx_t ctx, gpgme_recipients_t recp, gpgme_data_t plain,
GpgmeData cipher) gpgme_data_t cipher)
{ {
return encrypt_start (ctx, 0, recp, plain, cipher); return encrypt_start (ctx, 0, recp, plain, cipher);
} }
@ -187,9 +187,9 @@ gpgme_op_encrypt_start (GpgmeCtx ctx, GpgmeRecipients recp, GpgmeData plain,
/* Encrypt plaintext PLAIN within CTX for the recipients RECP and /* Encrypt plaintext PLAIN within CTX for the recipients RECP and
store the resulting ciphertext in CIPHER. */ store the resulting ciphertext in CIPHER. */
GpgmeError gpgme_error_t
gpgme_op_encrypt (GpgmeCtx ctx, GpgmeRecipients recp, gpgme_op_encrypt (gpgme_ctx_t ctx, gpgme_recipients_t recp,
GpgmeData plain, GpgmeData cipher) gpgme_data_t plain, gpgme_data_t cipher)
{ {
int err = encrypt_start (ctx, 1, recp, plain, cipher); int err = encrypt_start (ctx, 1, recp, plain, cipher);
if (!err) if (!err)

View File

@ -33,45 +33,45 @@ struct engine_ops
const char *(*get_file_name) (void); const char *(*get_file_name) (void);
const char *(*get_version) (void); const char *(*get_version) (void);
const char *(*get_req_version) (void); const char *(*get_req_version) (void);
GpgmeError (*new) (void **r_engine); gpgme_error_t (*new) (void **r_engine);
/* Member functions. */ /* Member functions. */
void (*release) (void *engine); void (*release) (void *engine);
void (*set_status_handler) (void *engine, EngineStatusHandler fnc, void (*set_status_handler) (void *engine, EngineStatusHandler fnc,
void *fnc_value); void *fnc_value);
GpgmeError (*set_command_handler) (void *engine, EngineCommandHandler fnc, gpgme_error_t (*set_command_handler) (void *engine, EngineCommandHandler fnc,
void *fnc_value, GpgmeData data); void *fnc_value, gpgme_data_t data);
GpgmeError (*set_colon_line_handler) (void *engine, gpgme_error_t (*set_colon_line_handler) (void *engine,
EngineColonLineHandler fnc, EngineColonLineHandler fnc,
void *fnc_value); void *fnc_value);
GpgmeError (*decrypt) (void *engine, GpgmeData ciph, GpgmeData plain); gpgme_error_t (*decrypt) (void *engine, gpgme_data_t ciph, gpgme_data_t plain);
GpgmeError (*delete) (void *engine, GpgmeKey key, int allow_secret); gpgme_error_t (*delete) (void *engine, gpgme_key_t key, int allow_secret);
GpgmeError (*edit) (void *engine, GpgmeKey key, GpgmeData out, gpgme_error_t (*edit) (void *engine, gpgme_key_t key, gpgme_data_t out,
GpgmeCtx ctx /* FIXME */); gpgme_ctx_t ctx /* FIXME */);
GpgmeError (*encrypt) (void *engine, GpgmeRecipients recp, gpgme_error_t (*encrypt) (void *engine, gpgme_recipients_t recp,
GpgmeData plain, GpgmeData ciph, int use_armor); gpgme_data_t plain, gpgme_data_t ciph, int use_armor);
GpgmeError (*encrypt_sign) (void *engine, GpgmeRecipients recp, gpgme_error_t (*encrypt_sign) (void *engine, gpgme_recipients_t recp,
GpgmeData plain, GpgmeData ciph, gpgme_data_t plain, gpgme_data_t ciph,
int use_armor, GpgmeCtx ctx /* FIXME */); int use_armor, gpgme_ctx_t ctx /* FIXME */);
GpgmeError (*export) (void *engine, GpgmeRecipients recp, gpgme_error_t (*export) (void *engine, gpgme_recipients_t recp,
GpgmeData keydata, int use_armor); gpgme_data_t keydata, int use_armor);
GpgmeError (*genkey) (void *engine, GpgmeData help_data, int use_armor, gpgme_error_t (*genkey) (void *engine, gpgme_data_t help_data, int use_armor,
GpgmeData pubkey, GpgmeData seckey); gpgme_data_t pubkey, gpgme_data_t seckey);
GpgmeError (*import) (void *engine, GpgmeData keydata); gpgme_error_t (*import) (void *engine, gpgme_data_t keydata);
GpgmeError (*keylist) (void *engine, const char *pattern, gpgme_error_t (*keylist) (void *engine, const char *pattern,
int secret_only, int keylist_mode); int secret_only, int keylist_mode);
GpgmeError (*keylist_ext) (void *engine, const char *pattern[], gpgme_error_t (*keylist_ext) (void *engine, const char *pattern[],
int secret_only, int reserved, int secret_only, int reserved,
int keylist_mode); int keylist_mode);
GpgmeError (*sign) (void *engine, GpgmeData in, GpgmeData out, gpgme_error_t (*sign) (void *engine, gpgme_data_t in, gpgme_data_t out,
GpgmeSigMode mode, int use_armor, int use_textmode, gpgme_sig_mode_t mode, int use_armor, int use_textmode,
int include_certs, GpgmeCtx ctx /* FIXME */); int include_certs, gpgme_ctx_t ctx /* FIXME */);
GpgmeError (*trustlist) (void *engine, const char *pattern); gpgme_error_t (*trustlist) (void *engine, const char *pattern);
GpgmeError (*verify) (void *engine, GpgmeData sig, GpgmeData signed_text, gpgme_error_t (*verify) (void *engine, gpgme_data_t sig, gpgme_data_t signed_text,
GpgmeData plaintext); gpgme_data_t plaintext);
void (*set_io_cbs) (void *engine, struct GpgmeIOCbs *io_cbs); void (*set_io_cbs) (void *engine, gpgme_io_cbs_t io_cbs);
void (*io_event) (void *engine, GpgmeEventIO type, void *type_data); void (*io_event) (void *engine, gpgme_event_io_t type, void *type_data);
}; };

View File

@ -87,7 +87,7 @@ struct gpgsm_object_s
int any; /* any data line seen */ int any; /* any data line seen */
} colon; } colon;
struct GpgmeIOCbs io_cbs; struct gpgme_io_cbs io_cbs;
}; };
typedef struct gpgsm_object_s *GpgsmObject; typedef struct gpgsm_object_s *GpgsmObject;
@ -148,7 +148,7 @@ close_notify_handler (int fd, void *opaque)
} }
static GpgmeError static gpgme_error_t
map_assuan_error (AssuanError err) map_assuan_error (AssuanError err)
{ {
switch (err) switch (err)
@ -273,10 +273,10 @@ gpgsm_release (void *engine)
} }
static GpgmeError static gpgme_error_t
gpgsm_new (void **engine) gpgsm_new (void **engine)
{ {
GpgmeError err = 0; gpgme_error_t err = 0;
GpgsmObject gpgsm; GpgsmObject gpgsm;
char *argv[3]; char *argv[3];
int fds[2]; int fds[2];
@ -538,9 +538,9 @@ gpgsm_new (void **engine)
/* Forward declaration. */ /* Forward declaration. */
static GpgmeStatusCode parse_status (const char *name); static gpgme_status_code_t parse_status (const char *name);
static GpgmeError static gpgme_error_t
gpgsm_assuan_simple_command (ASSUAN_CONTEXT ctx, char *cmd, EngineStatusHandler status_fnc, gpgsm_assuan_simple_command (ASSUAN_CONTEXT ctx, char *cmd, EngineStatusHandler status_fnc,
void *status_fnc_value) void *status_fnc_value)
{ {
@ -573,7 +573,7 @@ gpgsm_assuan_simple_command (ASSUAN_CONTEXT ctx, char *cmd, EngineStatusHandler
&& line[0] == 'S' && line[1] == ' ') && line[0] == 'S' && line[1] == ' ')
{ {
char *rest; char *rest;
GpgmeStatusCode r; gpgme_status_code_t r;
rest = strchr (line + 2, ' '); rest = strchr (line + 2, ' ');
if (!rest) if (!rest)
@ -598,7 +598,7 @@ gpgsm_assuan_simple_command (ASSUAN_CONTEXT ctx, char *cmd, EngineStatusHandler
#define COMMANDLINELEN 40 #define COMMANDLINELEN 40
static GpgmeError static gpgme_error_t
gpgsm_set_fd (ASSUAN_CONTEXT ctx, const char *which, int fd, const char *opt) gpgsm_set_fd (ASSUAN_CONTEXT ctx, const char *which, int fd, const char *opt)
{ {
char line[COMMANDLINELEN]; char line[COMMANDLINELEN];
@ -613,7 +613,7 @@ gpgsm_set_fd (ASSUAN_CONTEXT ctx, const char *which, int fd, const char *opt)
static const char * static const char *
map_input_enc (GpgmeData d) map_input_enc (gpgme_data_t d)
{ {
switch (gpgme_data_get_encoding (d)) switch (gpgme_data_get_encoding (d))
{ {
@ -642,7 +642,7 @@ status_cmp (const void *ap, const void *bp)
} }
static GpgmeStatusCode static gpgme_status_code_t
parse_status (const char *name) parse_status (const char *name)
{ {
struct status_table_s t, *r; struct status_table_s t, *r;
@ -653,11 +653,11 @@ parse_status (const char *name)
} }
static GpgmeError static gpgme_error_t
status_handler (void *opaque, int fd) status_handler (void *opaque, int fd)
{ {
AssuanError assuan_err; AssuanError assuan_err;
GpgmeError err = 0; gpgme_error_t err = 0;
GpgsmObject gpgsm = opaque; GpgsmObject gpgsm = opaque;
char *line; char *line;
size_t linelen; size_t linelen;
@ -777,7 +777,7 @@ status_handler (void *opaque, int fd)
&& line[0] == 'S' && line[1] == ' ') && line[0] == 'S' && line[1] == ' ')
{ {
char *rest; char *rest;
GpgmeStatusCode r; gpgme_status_code_t r;
rest = strchr (line + 2, ' '); rest = strchr (line + 2, ' ');
if (!rest) if (!rest)
@ -802,10 +802,10 @@ status_handler (void *opaque, int fd)
} }
static GpgmeError static gpgme_error_t
add_io_cb (GpgsmObject gpgsm, iocb_data_t *iocbd, GpgmeIOCb handler) add_io_cb (GpgsmObject gpgsm, iocb_data_t *iocbd, gpgme_io_cb_t handler)
{ {
GpgmeError err; gpgme_error_t err;
err = (*gpgsm->io_cbs.add) (gpgsm->io_cbs.add_priv, err = (*gpgsm->io_cbs.add) (gpgsm->io_cbs.add_priv,
iocbd->fd, iocbd->dir, iocbd->fd, iocbd->dir,
@ -819,10 +819,10 @@ add_io_cb (GpgsmObject gpgsm, iocb_data_t *iocbd, GpgmeIOCb handler)
} }
static GpgmeError static gpgme_error_t
start (GpgsmObject gpgsm, const char *command) start (GpgsmObject gpgsm, const char *command)
{ {
GpgmeError err; gpgme_error_t err;
err = add_io_cb (gpgsm, &gpgsm->status_cb, status_handler); err = add_io_cb (gpgsm, &gpgsm->status_cb, status_handler);
if (!err && gpgsm->input_cb.fd != -1) if (!err && gpgsm->input_cb.fd != -1)
@ -842,11 +842,11 @@ start (GpgsmObject gpgsm, const char *command)
} }
static GpgmeError static gpgme_error_t
gpgsm_decrypt (void *engine, GpgmeData ciph, GpgmeData plain) gpgsm_decrypt (void *engine, gpgme_data_t ciph, gpgme_data_t plain)
{ {
GpgsmObject gpgsm = engine; GpgsmObject gpgsm = engine;
GpgmeError err; gpgme_error_t err;
if (!gpgsm) if (!gpgsm)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -867,11 +867,11 @@ gpgsm_decrypt (void *engine, GpgmeData ciph, GpgmeData plain)
} }
static GpgmeError static gpgme_error_t
gpgsm_delete (void *engine, GpgmeKey key, int allow_secret) gpgsm_delete (void *engine, gpgme_key_t key, int allow_secret)
{ {
GpgsmObject gpgsm = engine; GpgsmObject gpgsm = engine;
GpgmeError err; gpgme_error_t err;
char *fpr = key->subkeys ? key->subkeys->fpr : NULL; char *fpr = key->subkeys ? key->subkeys->fpr : NULL;
char *linep = fpr; char *linep = fpr;
char *line; char *line;
@ -934,14 +934,14 @@ gpgsm_delete (void *engine, GpgmeKey key, int allow_secret)
} }
static GpgmeError static gpgme_error_t
set_recipients (GpgsmObject gpgsm, GpgmeRecipients recp) set_recipients (GpgsmObject gpgsm, gpgme_recipients_t recp)
{ {
GpgmeError err; gpgme_error_t err;
ASSUAN_CONTEXT ctx = gpgsm->assuan_ctx; ASSUAN_CONTEXT ctx = gpgsm->assuan_ctx;
char *line; char *line;
int linelen; int linelen;
GpgmeUserID uid; gpgme_user_id_t uid;
int invalid_recipients = 0; int invalid_recipients = 0;
linelen = 10 + 40 + 1; /* "RECIPIENT " + guess + '\0'. */ linelen = 10 + 40 + 1; /* "RECIPIENT " + guess + '\0'. */
@ -980,12 +980,12 @@ set_recipients (GpgsmObject gpgsm, GpgmeRecipients recp)
} }
static GpgmeError static gpgme_error_t
gpgsm_encrypt (void *engine, GpgmeRecipients recp, GpgmeData plain, gpgsm_encrypt (void *engine, gpgme_recipients_t recp, gpgme_data_t plain,
GpgmeData ciph, int use_armor) gpgme_data_t ciph, int use_armor)
{ {
GpgsmObject gpgsm = engine; GpgsmObject gpgsm = engine;
GpgmeError err; gpgme_error_t err;
if (!gpgsm) if (!gpgsm)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -1013,12 +1013,12 @@ gpgsm_encrypt (void *engine, GpgmeRecipients recp, GpgmeData plain,
} }
static GpgmeError static gpgme_error_t
gpgsm_export (void *engine, GpgmeRecipients recp, GpgmeData keydata, gpgsm_export (void *engine, gpgme_recipients_t recp, gpgme_data_t keydata,
int use_armor) int use_armor)
{ {
GpgsmObject gpgsm = engine; GpgsmObject gpgsm = engine;
GpgmeError err = 0; gpgme_error_t err = 0;
char *cmd = NULL; char *cmd = NULL;
int cmdi; int cmdi;
int cmdlen = 32; int cmdlen = 32;
@ -1077,12 +1077,12 @@ gpgsm_export (void *engine, GpgmeRecipients recp, GpgmeData keydata,
} }
static GpgmeError static gpgme_error_t
gpgsm_genkey (void *engine, GpgmeData help_data, int use_armor, gpgsm_genkey (void *engine, gpgme_data_t help_data, int use_armor,
GpgmeData pubkey, GpgmeData seckey) gpgme_data_t pubkey, gpgme_data_t seckey)
{ {
GpgsmObject gpgsm = engine; GpgsmObject gpgsm = engine;
GpgmeError err; gpgme_error_t err;
if (!gpgsm || !pubkey || seckey) if (!gpgsm || !pubkey || seckey)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -1104,11 +1104,11 @@ gpgsm_genkey (void *engine, GpgmeData help_data, int use_armor,
} }
static GpgmeError static gpgme_error_t
gpgsm_import (void *engine, GpgmeData keydata) gpgsm_import (void *engine, gpgme_data_t keydata)
{ {
GpgsmObject gpgsm = engine; GpgsmObject gpgsm = engine;
GpgmeError err; gpgme_error_t err;
if (!gpgsm) if (!gpgsm)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -1126,13 +1126,13 @@ gpgsm_import (void *engine, GpgmeData keydata)
} }
static GpgmeError static gpgme_error_t
gpgsm_keylist (void *engine, const char *pattern, int secret_only, gpgsm_keylist (void *engine, const char *pattern, int secret_only,
int keylist_mode) int keylist_mode)
{ {
GpgsmObject gpgsm = engine; GpgsmObject gpgsm = engine;
char *line; char *line;
GpgmeError err; gpgme_error_t err;
if (!pattern) if (!pattern)
pattern = ""; pattern = "";
@ -1169,13 +1169,13 @@ gpgsm_keylist (void *engine, const char *pattern, int secret_only,
} }
static GpgmeError static gpgme_error_t
gpgsm_keylist_ext (void *engine, const char *pattern[], int secret_only, gpgsm_keylist_ext (void *engine, const char *pattern[], int secret_only,
int reserved, int keylist_mode) int reserved, int keylist_mode)
{ {
GpgsmObject gpgsm = engine; GpgsmObject gpgsm = engine;
char *line; char *line;
GpgmeError err; gpgme_error_t err;
/* Length is "LISTSECRETKEYS " + p + '\0'. */ /* Length is "LISTSECRETKEYS " + p + '\0'. */
int length = 15 + 1; int length = 15 + 1;
char *linep; char *linep;
@ -1270,16 +1270,16 @@ gpgsm_keylist_ext (void *engine, const char *pattern[], int secret_only,
} }
static GpgmeError static gpgme_error_t
gpgsm_sign (void *engine, GpgmeData in, GpgmeData out, GpgmeSigMode mode, gpgsm_sign (void *engine, gpgme_data_t in, gpgme_data_t out, gpgme_sig_mode_t mode,
int use_armor, int use_textmode, int include_certs, int use_armor, int use_textmode, int include_certs,
GpgmeCtx ctx /* FIXME */) gpgme_ctx_t ctx /* FIXME */)
{ {
GpgsmObject gpgsm = engine; GpgsmObject gpgsm = engine;
GpgmeError err; gpgme_error_t err;
char *assuan_cmd; char *assuan_cmd;
int i; int i;
GpgmeKey key; gpgme_key_t key;
if (!gpgsm) if (!gpgsm)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -1333,7 +1333,7 @@ gpgsm_sign (void *engine, GpgmeData in, GpgmeData out, GpgmeSigMode mode,
} }
static GpgmeError static gpgme_error_t
gpgsm_trustlist (void *engine, const char *pattern) gpgsm_trustlist (void *engine, const char *pattern)
{ {
/* FIXME */ /* FIXME */
@ -1341,12 +1341,12 @@ gpgsm_trustlist (void *engine, const char *pattern)
} }
static GpgmeError static gpgme_error_t
gpgsm_verify (void *engine, GpgmeData sig, GpgmeData signed_text, gpgsm_verify (void *engine, gpgme_data_t sig, gpgme_data_t signed_text,
GpgmeData plaintext) gpgme_data_t plaintext)
{ {
GpgsmObject gpgsm = engine; GpgsmObject gpgsm = engine;
GpgmeError err; gpgme_error_t err;
if (!gpgsm) if (!gpgsm)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -1391,7 +1391,7 @@ gpgsm_set_status_handler (void *engine, EngineStatusHandler fnc,
} }
static GpgmeError static gpgme_error_t
gpgsm_set_colon_line_handler (void *engine, EngineColonLineHandler fnc, gpgsm_set_colon_line_handler (void *engine, EngineColonLineHandler fnc,
void *fnc_value) void *fnc_value)
{ {
@ -1405,7 +1405,7 @@ gpgsm_set_colon_line_handler (void *engine, EngineColonLineHandler fnc,
static void static void
gpgsm_set_io_cbs (void *engine, struct GpgmeIOCbs *io_cbs) gpgsm_set_io_cbs (void *engine, gpgme_io_cbs_t io_cbs)
{ {
GpgsmObject gpgsm = engine; GpgsmObject gpgsm = engine;
gpgsm->io_cbs = *io_cbs; gpgsm->io_cbs = *io_cbs;
@ -1413,7 +1413,7 @@ gpgsm_set_io_cbs (void *engine, struct GpgmeIOCbs *io_cbs)
static void static void
gpgsm_io_event (void *engine, GpgmeEventIO type, void *type_data) gpgsm_io_event (void *engine, gpgme_event_io_t type, void *type_data)
{ {
GpgsmObject gpgsm = engine; GpgsmObject gpgsm = engine;

View File

@ -53,7 +53,7 @@ static struct engine_ops *engine_ops[] =
/* Get the file name of the engine for PROTOCOL. */ /* Get the file name of the engine for PROTOCOL. */
static const char * static const char *
engine_get_file_name (GpgmeProtocol proto) engine_get_file_name (gpgme_protocol_t proto)
{ {
if (proto > DIM (engine_ops)) if (proto > DIM (engine_ops))
return NULL; return NULL;
@ -67,7 +67,7 @@ engine_get_file_name (GpgmeProtocol proto)
/* Get the version number of the engine for PROTOCOL. */ /* Get the version number of the engine for PROTOCOL. */
static const char * static const char *
engine_get_version (GpgmeProtocol proto) engine_get_version (gpgme_protocol_t proto)
{ {
if (proto > DIM (engine_ops)) if (proto > DIM (engine_ops))
return NULL; return NULL;
@ -81,7 +81,7 @@ engine_get_version (GpgmeProtocol proto)
/* Get the required version number of the engine for PROTOCOL. */ /* Get the required version number of the engine for PROTOCOL. */
static const char * static const char *
engine_get_req_version (GpgmeProtocol proto) engine_get_req_version (gpgme_protocol_t proto)
{ {
if (proto > DIM (engine_ops)) if (proto > DIM (engine_ops))
return NULL; return NULL;
@ -94,8 +94,8 @@ engine_get_req_version (GpgmeProtocol proto)
/* Verify the version requirement for the engine for PROTOCOL. */ /* Verify the version requirement for the engine for PROTOCOL. */
GpgmeError gpgme_error_t
gpgme_engine_check_version (GpgmeProtocol proto) gpgme_engine_check_version (gpgme_protocol_t proto)
{ {
return _gpgme_compare_versions (engine_get_version (proto), return _gpgme_compare_versions (engine_get_version (proto),
engine_get_req_version (proto)) engine_get_req_version (proto))
@ -106,17 +106,17 @@ gpgme_engine_check_version (GpgmeProtocol proto)
/* Get the information about the configured and installed engines. A /* Get the information about the configured and installed engines. A
pointer to the first engine in the statically allocated linked list pointer to the first engine in the statically allocated linked list
is returned in *INFO. If an error occurs, it is returned. */ is returned in *INFO. If an error occurs, it is returned. */
GpgmeError gpgme_error_t
gpgme_get_engine_info (GpgmeEngineInfo *info) gpgme_get_engine_info (gpgme_engine_info_t *info)
{ {
static GpgmeEngineInfo engine_info; static gpgme_engine_info_t engine_info;
DEFINE_STATIC_LOCK (engine_info_lock); DEFINE_STATIC_LOCK (engine_info_lock);
LOCK (engine_info_lock); LOCK (engine_info_lock);
if (!engine_info) if (!engine_info)
{ {
GpgmeEngineInfo *lastp = &engine_info; gpgme_engine_info_t *lastp = &engine_info;
GpgmeProtocol proto_list[] = { GPGME_PROTOCOL_OpenPGP, gpgme_protocol_t proto_list[] = { GPGME_PROTOCOL_OpenPGP,
GPGME_PROTOCOL_CMS }; GPGME_PROTOCOL_CMS };
int proto; int proto;
@ -132,7 +132,7 @@ gpgme_get_engine_info (GpgmeEngineInfo *info)
{ {
while (engine_info) while (engine_info)
{ {
GpgmeEngineInfo next_info = engine_info->next; gpgme_engine_info_t next_info = engine_info->next;
free (engine_info); free (engine_info);
engine_info = next_info; engine_info = next_info;
} }
@ -153,8 +153,8 @@ gpgme_get_engine_info (GpgmeEngineInfo *info)
} }
GpgmeError gpgme_error_t
_gpgme_engine_new (GpgmeProtocol proto, EngineObject *r_engine) _gpgme_engine_new (gpgme_protocol_t proto, EngineObject *r_engine)
{ {
EngineObject engine; EngineObject engine;
@ -179,7 +179,7 @@ _gpgme_engine_new (GpgmeProtocol proto, EngineObject *r_engine)
engine->ops = engine_ops[proto]; engine->ops = engine_ops[proto];
if (engine_ops[proto]->new) if (engine_ops[proto]->new)
{ {
GpgmeError err = (*engine_ops[proto]->new) (&engine->engine); gpgme_error_t err = (*engine_ops[proto]->new) (&engine->engine);
if (err) if (err)
{ {
free (engine); free (engine);
@ -218,10 +218,10 @@ _gpgme_engine_set_status_handler (EngineObject engine,
} }
GpgmeError gpgme_error_t
_gpgme_engine_set_command_handler (EngineObject engine, _gpgme_engine_set_command_handler (EngineObject engine,
EngineCommandHandler fnc, void *fnc_value, EngineCommandHandler fnc, void *fnc_value,
GpgmeData linked_data) gpgme_data_t linked_data)
{ {
if (!engine) if (!engine)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -233,7 +233,7 @@ _gpgme_engine_set_command_handler (EngineObject engine,
fnc, fnc_value, linked_data); fnc, fnc_value, linked_data);
} }
GpgmeError _gpgme_engine_set_colon_line_handler (EngineObject engine, gpgme_error_t _gpgme_engine_set_colon_line_handler (EngineObject engine,
EngineColonLineHandler fnc, EngineColonLineHandler fnc,
void *fnc_value) void *fnc_value)
{ {
@ -247,8 +247,8 @@ GpgmeError _gpgme_engine_set_colon_line_handler (EngineObject engine,
fnc, fnc_value); fnc, fnc_value);
} }
GpgmeError gpgme_error_t
_gpgme_engine_op_decrypt (EngineObject engine, GpgmeData ciph, GpgmeData plain) _gpgme_engine_op_decrypt (EngineObject engine, gpgme_data_t ciph, gpgme_data_t plain)
{ {
if (!engine) if (!engine)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -259,8 +259,8 @@ _gpgme_engine_op_decrypt (EngineObject engine, GpgmeData ciph, GpgmeData plain)
return (*engine->ops->decrypt) (engine->engine, ciph, plain); return (*engine->ops->decrypt) (engine->engine, ciph, plain);
} }
GpgmeError gpgme_error_t
_gpgme_engine_op_delete (EngineObject engine, GpgmeKey key, int allow_secret) _gpgme_engine_op_delete (EngineObject engine, gpgme_key_t key, int allow_secret)
{ {
if (!engine) if (!engine)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -272,9 +272,9 @@ _gpgme_engine_op_delete (EngineObject engine, GpgmeKey key, int allow_secret)
} }
GpgmeError gpgme_error_t
_gpgme_engine_op_edit (EngineObject engine, GpgmeKey key, GpgmeData out, _gpgme_engine_op_edit (EngineObject engine, gpgme_key_t key, gpgme_data_t out,
GpgmeCtx ctx /* FIXME */) gpgme_ctx_t ctx /* FIXME */)
{ {
if (!engine) if (!engine)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -286,9 +286,9 @@ _gpgme_engine_op_edit (EngineObject engine, GpgmeKey key, GpgmeData out,
} }
GpgmeError gpgme_error_t
_gpgme_engine_op_encrypt (EngineObject engine, GpgmeRecipients recp, _gpgme_engine_op_encrypt (EngineObject engine, gpgme_recipients_t recp,
GpgmeData plain, GpgmeData ciph, int use_armor) gpgme_data_t plain, gpgme_data_t ciph, int use_armor)
{ {
if (!engine) if (!engine)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -301,10 +301,10 @@ _gpgme_engine_op_encrypt (EngineObject engine, GpgmeRecipients recp,
} }
GpgmeError gpgme_error_t
_gpgme_engine_op_encrypt_sign (EngineObject engine, GpgmeRecipients recp, _gpgme_engine_op_encrypt_sign (EngineObject engine, gpgme_recipients_t recp,
GpgmeData plain, GpgmeData ciph, int use_armor, gpgme_data_t plain, gpgme_data_t ciph, int use_armor,
GpgmeCtx ctx /* FIXME */) gpgme_ctx_t ctx /* FIXME */)
{ {
if (!engine) if (!engine)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -317,9 +317,9 @@ _gpgme_engine_op_encrypt_sign (EngineObject engine, GpgmeRecipients recp,
} }
GpgmeError gpgme_error_t
_gpgme_engine_op_export (EngineObject engine, GpgmeRecipients recp, _gpgme_engine_op_export (EngineObject engine, gpgme_recipients_t recp,
GpgmeData keydata, int use_armor) gpgme_data_t keydata, int use_armor)
{ {
if (!engine) if (!engine)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -332,9 +332,9 @@ _gpgme_engine_op_export (EngineObject engine, GpgmeRecipients recp,
} }
GpgmeError gpgme_error_t
_gpgme_engine_op_genkey (EngineObject engine, GpgmeData help_data, _gpgme_engine_op_genkey (EngineObject engine, gpgme_data_t help_data,
int use_armor, GpgmeData pubkey, GpgmeData seckey) int use_armor, gpgme_data_t pubkey, gpgme_data_t seckey)
{ {
if (!engine) if (!engine)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -347,8 +347,8 @@ _gpgme_engine_op_genkey (EngineObject engine, GpgmeData help_data,
} }
GpgmeError gpgme_error_t
_gpgme_engine_op_import (EngineObject engine, GpgmeData keydata) _gpgme_engine_op_import (EngineObject engine, gpgme_data_t keydata)
{ {
if (!engine) if (!engine)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -360,7 +360,7 @@ _gpgme_engine_op_import (EngineObject engine, GpgmeData keydata)
} }
GpgmeError gpgme_error_t
_gpgme_engine_op_keylist (EngineObject engine, const char *pattern, _gpgme_engine_op_keylist (EngineObject engine, const char *pattern,
int secret_only, int keylist_mode) int secret_only, int keylist_mode)
{ {
@ -375,7 +375,7 @@ _gpgme_engine_op_keylist (EngineObject engine, const char *pattern,
} }
GpgmeError gpgme_error_t
_gpgme_engine_op_keylist_ext (EngineObject engine, const char *pattern[], _gpgme_engine_op_keylist_ext (EngineObject engine, const char *pattern[],
int secret_only, int reserved, int keylist_mode) int secret_only, int reserved, int keylist_mode)
{ {
@ -390,11 +390,11 @@ _gpgme_engine_op_keylist_ext (EngineObject engine, const char *pattern[],
} }
GpgmeError gpgme_error_t
_gpgme_engine_op_sign (EngineObject engine, GpgmeData in, GpgmeData out, _gpgme_engine_op_sign (EngineObject engine, gpgme_data_t in, gpgme_data_t out,
GpgmeSigMode mode, int use_armor, gpgme_sig_mode_t mode, int use_armor,
int use_textmode, int include_certs, int use_textmode, int include_certs,
GpgmeCtx ctx /* FIXME */) gpgme_ctx_t ctx /* FIXME */)
{ {
if (!engine) if (!engine)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -407,7 +407,7 @@ _gpgme_engine_op_sign (EngineObject engine, GpgmeData in, GpgmeData out,
} }
GpgmeError gpgme_error_t
_gpgme_engine_op_trustlist (EngineObject engine, const char *pattern) _gpgme_engine_op_trustlist (EngineObject engine, const char *pattern)
{ {
if (!engine) if (!engine)
@ -420,9 +420,9 @@ _gpgme_engine_op_trustlist (EngineObject engine, const char *pattern)
} }
GpgmeError gpgme_error_t
_gpgme_engine_op_verify (EngineObject engine, GpgmeData sig, _gpgme_engine_op_verify (EngineObject engine, gpgme_data_t sig,
GpgmeData signed_text, GpgmeData plaintext) gpgme_data_t signed_text, gpgme_data_t plaintext)
{ {
if (!engine) if (!engine)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -435,8 +435,7 @@ _gpgme_engine_op_verify (EngineObject engine, GpgmeData sig,
void void
_gpgme_engine_set_io_cbs (EngineObject engine, _gpgme_engine_set_io_cbs (EngineObject engine, gpgme_io_cbs_t io_cbs)
struct GpgmeIOCbs *io_cbs)
{ {
if (!engine) if (!engine)
return; return;
@ -447,7 +446,7 @@ _gpgme_engine_set_io_cbs (EngineObject engine,
void void
_gpgme_engine_io_event (EngineObject engine, _gpgme_engine_io_event (EngineObject engine,
GpgmeEventIO type, void *type_data) gpgme_event_io_t type, void *type_data)
{ {
if (!engine) if (!engine)
return; return;

View File

@ -26,67 +26,67 @@
struct engine_object_s; struct engine_object_s;
typedef struct engine_object_s *EngineObject; typedef struct engine_object_s *EngineObject;
typedef GpgmeError (*EngineStatusHandler) (void *priv, GpgmeStatusCode code, typedef gpgme_error_t (*EngineStatusHandler) (void *priv, gpgme_status_code_t code,
char *args); char *args);
typedef GpgmeError (*EngineColonLineHandler) (void *priv, char *line); typedef gpgme_error_t (*EngineColonLineHandler) (void *priv, char *line);
typedef GpgmeError (*EngineCommandHandler) (void *priv, GpgmeStatusCode code, typedef gpgme_error_t (*EngineCommandHandler) (void *priv, gpgme_status_code_t code,
const char *keyword, const char *keyword,
const char **result); const char **result);
GpgmeError _gpgme_engine_new (GpgmeProtocol proto, EngineObject *r_engine); gpgme_error_t _gpgme_engine_new (gpgme_protocol_t proto, EngineObject *r_engine);
void _gpgme_engine_release (EngineObject engine); void _gpgme_engine_release (EngineObject engine);
void _gpgme_engine_set_status_handler (EngineObject engine, void _gpgme_engine_set_status_handler (EngineObject engine,
EngineStatusHandler fnc, EngineStatusHandler fnc,
void *fnc_value); void *fnc_value);
GpgmeError _gpgme_engine_set_command_handler (EngineObject engine, gpgme_error_t _gpgme_engine_set_command_handler (EngineObject engine,
EngineCommandHandler fnc, EngineCommandHandler fnc,
void *fnc_value, void *fnc_value,
GpgmeData data); gpgme_data_t data);
GpgmeError _gpgme_engine_set_colon_line_handler (EngineObject engine, gpgme_error_t _gpgme_engine_set_colon_line_handler (EngineObject engine,
EngineColonLineHandler fnc, EngineColonLineHandler fnc,
void *fnc_value); void *fnc_value);
GpgmeError _gpgme_engine_op_decrypt (EngineObject engine, GpgmeData ciph, gpgme_error_t _gpgme_engine_op_decrypt (EngineObject engine, gpgme_data_t ciph,
GpgmeData plain); gpgme_data_t plain);
GpgmeError _gpgme_engine_op_delete (EngineObject engine, GpgmeKey key, gpgme_error_t _gpgme_engine_op_delete (EngineObject engine, gpgme_key_t key,
int allow_secret); int allow_secret);
GpgmeError _gpgme_engine_op_edit (EngineObject engine, GpgmeKey key, gpgme_error_t _gpgme_engine_op_edit (EngineObject engine, gpgme_key_t key,
GpgmeData out, GpgmeCtx ctx /* FIXME */); gpgme_data_t out, gpgme_ctx_t ctx /* FIXME */);
GpgmeError _gpgme_engine_op_encrypt (EngineObject engine, GpgmeRecipients recp, gpgme_error_t _gpgme_engine_op_encrypt (EngineObject engine, gpgme_recipients_t recp,
GpgmeData plain, GpgmeData ciph, gpgme_data_t plain, gpgme_data_t ciph,
int use_armor); int use_armor);
GpgmeError _gpgme_engine_op_encrypt_sign (EngineObject engine, gpgme_error_t _gpgme_engine_op_encrypt_sign (EngineObject engine,
GpgmeRecipients recp, gpgme_recipients_t recp,
GpgmeData plain, GpgmeData ciph, gpgme_data_t plain, gpgme_data_t ciph,
int use_armor, int use_armor,
GpgmeCtx ctx /* FIXME */); gpgme_ctx_t ctx /* FIXME */);
GpgmeError _gpgme_engine_op_export (EngineObject engine, GpgmeRecipients recp, gpgme_error_t _gpgme_engine_op_export (EngineObject engine, gpgme_recipients_t recp,
GpgmeData keydata, int use_armor); gpgme_data_t keydata, int use_armor);
GpgmeError _gpgme_engine_op_genkey (EngineObject engine, GpgmeData help_data, gpgme_error_t _gpgme_engine_op_genkey (EngineObject engine, gpgme_data_t help_data,
int use_armor, GpgmeData pubkey, int use_armor, gpgme_data_t pubkey,
GpgmeData seckey); gpgme_data_t seckey);
GpgmeError _gpgme_engine_op_import (EngineObject engine, GpgmeData keydata); gpgme_error_t _gpgme_engine_op_import (EngineObject engine, gpgme_data_t keydata);
GpgmeError _gpgme_engine_op_keylist (EngineObject engine, const char *pattern, gpgme_error_t _gpgme_engine_op_keylist (EngineObject engine, const char *pattern,
int secret_only, int secret_only,
int keylist_mode); int keylist_mode);
GpgmeError _gpgme_engine_op_keylist_ext (EngineObject engine, gpgme_error_t _gpgme_engine_op_keylist_ext (EngineObject engine,
const char *pattern[], const char *pattern[],
int secret_only, int secret_only,
int reserved, int reserved,
int keylist_mode); int keylist_mode);
GpgmeError _gpgme_engine_op_sign (EngineObject engine, GpgmeData in, gpgme_error_t _gpgme_engine_op_sign (EngineObject engine, gpgme_data_t in,
GpgmeData out, GpgmeSigMode mode, gpgme_data_t out, gpgme_sig_mode_t mode,
int use_armor, int use_textmode, int use_armor, int use_textmode,
int include_certs, int include_certs,
GpgmeCtx ctx /* FIXME */); gpgme_ctx_t ctx /* FIXME */);
GpgmeError _gpgme_engine_op_trustlist (EngineObject engine, gpgme_error_t _gpgme_engine_op_trustlist (EngineObject engine,
const char *pattern); const char *pattern);
GpgmeError _gpgme_engine_op_verify (EngineObject engine, GpgmeData sig, gpgme_error_t _gpgme_engine_op_verify (EngineObject engine, gpgme_data_t sig,
GpgmeData signed_text, gpgme_data_t signed_text,
GpgmeData plaintext); gpgme_data_t plaintext);
void _gpgme_engine_set_io_cbs (EngineObject engine, void _gpgme_engine_set_io_cbs (EngineObject engine,
struct GpgmeIOCbs *io_cbs); gpgme_io_cbs_t io_cbs);
void _gpgme_engine_io_event (EngineObject engine, void _gpgme_engine_io_event (EngineObject engine,
GpgmeEventIO type, void *type_data); gpgme_event_io_t type, void *type_data);
#endif /* ENGINE_H */ #endif /* ENGINE_H */

View File

@ -27,18 +27,18 @@
#include "ops.h" #include "ops.h"
static GpgmeError static gpgme_error_t
export_status_handler (void *priv, GpgmeStatusCode code, char *args) export_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
return 0; return 0;
} }
static GpgmeError static gpgme_error_t
export_start (GpgmeCtx ctx, int synchronous, export_start (gpgme_ctx_t ctx, int synchronous,
GpgmeRecipients recp, GpgmeData keydata) gpgme_recipients_t recp, gpgme_data_t keydata)
{ {
GpgmeError err; gpgme_error_t err;
if (!keydata || !recp) if (!keydata || !recp)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -54,18 +54,18 @@ export_start (GpgmeCtx ctx, int synchronous,
/* Export the keys listed in RECP into KEYDATA. */ /* Export the keys listed in RECP into KEYDATA. */
GpgmeError gpgme_error_t
gpgme_op_export_start (GpgmeCtx ctx, GpgmeRecipients recp, GpgmeData keydata) gpgme_op_export_start (gpgme_ctx_t ctx, gpgme_recipients_t recp, gpgme_data_t keydata)
{ {
return export_start (ctx, 0, recp, keydata); return export_start (ctx, 0, recp, keydata);
} }
/* Export the keys listed in RECP into KEYDATA. */ /* Export the keys listed in RECP into KEYDATA. */
GpgmeError gpgme_error_t
gpgme_op_export (GpgmeCtx ctx, GpgmeRecipients recipients, GpgmeData keydata) gpgme_op_export (gpgme_ctx_t ctx, gpgme_recipients_t recipients, gpgme_data_t keydata)
{ {
GpgmeError err = export_start (ctx, 1, recipients, keydata); gpgme_error_t err = export_start (ctx, 1, recipients, keydata);
if (!err) if (!err)
err = _gpgme_wait_one (ctx); err = _gpgme_wait_one (ctx);
return err; return err;

View File

@ -34,7 +34,7 @@ typedef struct
struct _gpgme_op_genkey_result result; struct _gpgme_op_genkey_result result;
/* The key parameters passed to the crypto engine. */ /* The key parameters passed to the crypto engine. */
GpgmeData key_parameter; gpgme_data_t key_parameter;
} *op_data_t; } *op_data_t;
@ -50,11 +50,11 @@ release_op_data (void *hook)
} }
GpgmeGenKeyResult gpgme_genkey_result_t
gpgme_op_genkey_result (GpgmeCtx ctx) gpgme_op_genkey_result (gpgme_ctx_t ctx)
{ {
op_data_t opd; op_data_t opd;
GpgmeError err; gpgme_error_t err;
err = _gpgme_op_data_lookup (ctx, OPDATA_GENKEY, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_GENKEY, (void **) &opd, -1, NULL);
if (err || !opd) if (err || !opd)
@ -64,11 +64,11 @@ gpgme_op_genkey_result (GpgmeCtx ctx)
} }
static GpgmeError static gpgme_error_t
genkey_status_handler (void *priv, GpgmeStatusCode code, char *args) genkey_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
GpgmeCtx ctx = (GpgmeCtx) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
GpgmeError err; gpgme_error_t err;
op_data_t opd; op_data_t opd;
/* Pipe the status code through the progress status handler. */ /* Pipe the status code through the progress status handler. */
@ -114,8 +114,8 @@ genkey_status_handler (void *priv, GpgmeStatusCode code, char *args)
} }
static GpgmeError static gpgme_error_t
get_key_parameter (const char *parms, GpgmeData *key_parameter) get_key_parameter (const char *parms, gpgme_data_t *key_parameter)
{ {
const char *content; const char *content;
const char *attrib; const char *attrib;
@ -145,11 +145,11 @@ get_key_parameter (const char *parms, GpgmeData *key_parameter)
} }
static GpgmeError static gpgme_error_t
genkey_start (GpgmeCtx ctx, int synchronous, const char *parms, genkey_start (gpgme_ctx_t ctx, int synchronous, const char *parms,
GpgmeData pubkey, GpgmeData seckey) gpgme_data_t pubkey, gpgme_data_t seckey)
{ {
GpgmeError err; gpgme_error_t err;
op_data_t opd; op_data_t opd;
err = _gpgme_op_reset (ctx, synchronous); err = _gpgme_op_reset (ctx, synchronous);
if (err) if (err)
@ -174,9 +174,9 @@ genkey_start (GpgmeCtx ctx, int synchronous, const char *parms,
/* Generate a new keypair and add it to the keyring. PUBKEY and /* Generate a new keypair and add it to the keyring. PUBKEY and
SECKEY should be null for now. PARMS specifies what keys should be SECKEY should be null for now. PARMS specifies what keys should be
generated. */ generated. */
GpgmeError gpgme_error_t
gpgme_op_genkey_start (GpgmeCtx ctx, const char *parms, gpgme_op_genkey_start (gpgme_ctx_t ctx, const char *parms,
GpgmeData pubkey, GpgmeData seckey) gpgme_data_t pubkey, gpgme_data_t seckey)
{ {
return genkey_start (ctx, 0, parms, pubkey, seckey); return genkey_start (ctx, 0, parms, pubkey, seckey);
} }
@ -185,11 +185,11 @@ gpgme_op_genkey_start (GpgmeCtx ctx, const char *parms,
/* Generate a new keypair and add it to the keyring. PUBKEY and /* Generate a new keypair and add it to the keyring. PUBKEY and
SECKEY should be null for now. PARMS specifies what keys should be SECKEY should be null for now. PARMS specifies what keys should be
generated. */ generated. */
GpgmeError gpgme_error_t
gpgme_op_genkey (GpgmeCtx ctx, const char *parms, GpgmeData pubkey, gpgme_op_genkey (gpgme_ctx_t ctx, const char *parms, gpgme_data_t pubkey,
GpgmeData seckey) gpgme_data_t seckey)
{ {
GpgmeError err; gpgme_error_t err;
err = genkey_start (ctx, 1, parms, pubkey, seckey); err = genkey_start (ctx, 1, parms, pubkey, seckey);
if (!err) if (!err)

View File

@ -33,10 +33,10 @@
/* Create a new context as an environment for GPGME crypto /* Create a new context as an environment for GPGME crypto
operations. */ operations. */
GpgmeError gpgme_error_t
gpgme_new (GpgmeCtx *r_ctx) gpgme_new (gpgme_ctx_t *r_ctx)
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
if (!r_ctx) if (!r_ctx)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -60,7 +60,7 @@ gpgme_new (GpgmeCtx *r_ctx)
* Release all resources associated with the given context. * Release all resources associated with the given context.
**/ **/
void void
gpgme_release (GpgmeCtx ctx) gpgme_release (gpgme_ctx_t ctx)
{ {
if (!ctx) if (!ctx)
return; return;
@ -74,7 +74,7 @@ gpgme_release (GpgmeCtx ctx)
} }
void void
_gpgme_release_result (GpgmeCtx ctx) _gpgme_release_result (gpgme_ctx_t ctx)
{ {
struct ctx_op_data *data = ctx->op_data; struct ctx_op_data *data = ctx->op_data;
@ -90,8 +90,8 @@ _gpgme_release_result (GpgmeCtx ctx)
} }
GpgmeError gpgme_error_t
gpgme_set_protocol (GpgmeCtx ctx, GpgmeProtocol protocol) gpgme_set_protocol (gpgme_ctx_t ctx, gpgme_protocol_t protocol)
{ {
if (protocol != GPGME_PROTOCOL_OpenPGP && protocol != GPGME_PROTOCOL_CMS) if (protocol != GPGME_PROTOCOL_OpenPGP && protocol != GPGME_PROTOCOL_CMS)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -101,15 +101,15 @@ gpgme_set_protocol (GpgmeCtx ctx, GpgmeProtocol protocol)
} }
GpgmeProtocol gpgme_protocol_t
gpgme_get_protocol (GpgmeCtx ctx) gpgme_get_protocol (gpgme_ctx_t ctx)
{ {
return ctx->protocol; return ctx->protocol;
} }
const char * const char *
gpgme_get_protocol_name (GpgmeProtocol protocol) gpgme_get_protocol_name (gpgme_protocol_t protocol)
{ {
switch (protocol) switch (protocol)
{ {
@ -132,7 +132,7 @@ gpgme_get_protocol_name (GpgmeProtocol protocol)
* Enable or disable the use of an ascii armor for all output. * Enable or disable the use of an ascii armor for all output.
**/ **/
void void
gpgme_set_armor (GpgmeCtx ctx, int yes) gpgme_set_armor (gpgme_ctx_t ctx, int yes)
{ {
if (!ctx) if (!ctx)
return; return;
@ -150,7 +150,7 @@ gpgme_set_armor (GpgmeCtx ctx, int yes)
* Return value: Boolean whether armor mode is to be used. * Return value: Boolean whether armor mode is to be used.
**/ **/
int int
gpgme_get_armor (GpgmeCtx ctx) gpgme_get_armor (gpgme_ctx_t ctx)
{ {
return ctx && ctx->use_armor; return ctx && ctx->use_armor;
} }
@ -166,7 +166,7 @@ gpgme_get_armor (GpgmeCtx ctx)
* that the MUA does some preparations so that textmode is not needed anymore. * that the MUA does some preparations so that textmode is not needed anymore.
**/ **/
void void
gpgme_set_textmode (GpgmeCtx ctx, int yes) gpgme_set_textmode (gpgme_ctx_t ctx, int yes)
{ {
if (!ctx) if (!ctx)
return; return;
@ -183,7 +183,7 @@ gpgme_set_textmode (GpgmeCtx ctx, int yes)
* Return value: Boolean whether textmode is to be used. * Return value: Boolean whether textmode is to be used.
**/ **/
int int
gpgme_get_textmode (GpgmeCtx ctx) gpgme_get_textmode (gpgme_ctx_t ctx)
{ {
return ctx && ctx->use_textmode; return ctx && ctx->use_textmode;
} }
@ -200,7 +200,7 @@ gpgme_get_textmode (GpgmeCtx ctx)
* Return value: Boolean whether textmode is to be used. * Return value: Boolean whether textmode is to be used.
**/ **/
void void
gpgme_set_include_certs (GpgmeCtx ctx, int nr_of_certs) gpgme_set_include_certs (gpgme_ctx_t ctx, int nr_of_certs)
{ {
if (nr_of_certs < -2) if (nr_of_certs < -2)
ctx->include_certs = -2; ctx->include_certs = -2;
@ -218,7 +218,7 @@ gpgme_set_include_certs (GpgmeCtx ctx, int nr_of_certs)
* Return value: Boolean whether textmode is to be used. * Return value: Boolean whether textmode is to be used.
**/ **/
int int
gpgme_get_include_certs (GpgmeCtx ctx) gpgme_get_include_certs (gpgme_ctx_t ctx)
{ {
return ctx->include_certs; return ctx->include_certs;
} }
@ -236,8 +236,8 @@ gpgme_get_include_certs (GpgmeCtx ctx)
* Return value: GPGME_Invalid_Value if ctx is not a context or mode * Return value: GPGME_Invalid_Value if ctx is not a context or mode
* not a valid mode. * not a valid mode.
**/ **/
GpgmeError gpgme_error_t
gpgme_set_keylist_mode (GpgmeCtx ctx, int mode) gpgme_set_keylist_mode (gpgme_ctx_t ctx, int mode)
{ {
if (!ctx) if (!ctx)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -264,7 +264,7 @@ gpgme_set_keylist_mode (GpgmeCtx ctx, int mode)
* Note that 0 is never a valid mode. * Note that 0 is never a valid mode.
**/ **/
int int
gpgme_get_keylist_mode (GpgmeCtx ctx) gpgme_get_keylist_mode (gpgme_ctx_t ctx)
{ {
if (!ctx) if (!ctx)
return 0; return 0;
@ -285,7 +285,7 @@ gpgme_get_keylist_mode (GpgmeCtx ctx)
* *
* The callback function is defined as: * The callback function is defined as:
* <literal> * <literal>
* typedef const char *(*GpgmePassphraseCb)(void*cb_value, * typedef const char *(*gpgme_passphrase_cb_t)(void*cb_value,
* const char *desc, * const char *desc,
* void **r_hd); * void **r_hd);
* </literal> * </literal>
@ -300,7 +300,7 @@ gpgme_get_keylist_mode (GpgmeCtx ctx)
* *
**/ **/
void void
gpgme_set_passphrase_cb (GpgmeCtx ctx, GpgmePassphraseCb cb, void *cb_value) gpgme_set_passphrase_cb (gpgme_ctx_t ctx, gpgme_passphrase_cb_t cb, void *cb_value)
{ {
if (ctx) if (ctx)
{ {
@ -320,7 +320,7 @@ gpgme_set_passphrase_cb (GpgmeCtx ctx, GpgmePassphraseCb cb, void *cb_value)
* to the crypto engine. * to the crypto engine.
**/ **/
void void
gpgme_get_passphrase_cb (GpgmeCtx ctx, GpgmePassphraseCb *r_cb, void **r_cb_value) gpgme_get_passphrase_cb (gpgme_ctx_t ctx, gpgme_passphrase_cb_t *r_cb, void **r_cb_value)
{ {
if (ctx) if (ctx)
{ {
@ -349,7 +349,7 @@ gpgme_get_passphrase_cb (GpgmeCtx ctx, GpgmePassphraseCb *r_cb, void **r_cb_valu
* *
* The callback function is defined as: * The callback function is defined as:
* <literal> * <literal>
* typedef void (*GpgmeProgressCb) (void *cb_value, * typedef void (*gpgme_progress_cb_t) (void *cb_value,
* const char *what, int type, * const char *what, int type,
* int curretn, int total); * int curretn, int total);
* </literal> * </literal>
@ -357,7 +357,7 @@ gpgme_get_passphrase_cb (GpgmeCtx ctx, GpgmePassphraseCb *r_cb, void **r_cb_valu
* status in the file doc/DETAILS of the GnuPG distribution. * status in the file doc/DETAILS of the GnuPG distribution.
**/ **/
void void
gpgme_set_progress_cb (GpgmeCtx ctx, GpgmeProgressCb cb, void *cb_value) gpgme_set_progress_cb (gpgme_ctx_t ctx, gpgme_progress_cb_t cb, void *cb_value)
{ {
if (ctx) if (ctx)
{ {
@ -377,7 +377,7 @@ gpgme_set_progress_cb (GpgmeCtx ctx, GpgmeProgressCb cb, void *cb_value)
* progress indicator. * progress indicator.
**/ **/
void void
gpgme_get_progress_cb (GpgmeCtx ctx, GpgmeProgressCb *r_cb, void **r_cb_value) gpgme_get_progress_cb (gpgme_ctx_t ctx, gpgme_progress_cb_t *r_cb, void **r_cb_value)
{ {
if (ctx) if (ctx)
{ {
@ -405,7 +405,7 @@ gpgme_get_progress_cb (GpgmeCtx ctx, GpgmeProgressCb *r_cb, void **r_cb_value)
* *
**/ **/
void void
gpgme_set_io_cbs (GpgmeCtx ctx, struct GpgmeIOCbs *io_cbs) gpgme_set_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs)
{ {
if (!ctx) if (!ctx)
return; return;
@ -435,7 +435,7 @@ gpgme_set_io_cbs (GpgmeCtx ctx, struct GpgmeIOCbs *io_cbs)
* to the crypto engine. * to the crypto engine.
**/ **/
void void
gpgme_get_io_cbs (GpgmeCtx ctx, struct GpgmeIOCbs *io_cbs) gpgme_get_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs)
{ {
if (ctx && io_cbs) if (ctx && io_cbs)
*io_cbs = ctx->io_cbs; *io_cbs = ctx->io_cbs;
@ -443,7 +443,7 @@ gpgme_get_io_cbs (GpgmeCtx ctx, struct GpgmeIOCbs *io_cbs)
const char * const char *
gpgme_pubkey_algo_name (GpgmePubKeyAlgo algo) gpgme_pubkey_algo_name (gpgme_pubkey_algo_t algo)
{ {
switch (algo) switch (algo)
{ {
@ -472,7 +472,7 @@ gpgme_pubkey_algo_name (GpgmePubKeyAlgo algo)
const char * const char *
gpgme_hash_algo_name (GpgmeHashAlgo algo) gpgme_hash_algo_name (gpgme_hash_algo_t algo)
{ {
switch (algo) switch (algo)
{ {

File diff suppressed because it is too large Load Diff

View File

@ -37,7 +37,7 @@ typedef struct
/* A pointer to the next pointer of the last import status in the /* A pointer to the next pointer of the last import status in the
list. This makes appending new imports painless while preserving list. This makes appending new imports painless while preserving
the order. */ the order. */
GpgmeImportStatus *lastp; gpgme_import_status_t *lastp;
} *op_data_t; } *op_data_t;
@ -45,11 +45,11 @@ static void
release_op_data (void *hook) release_op_data (void *hook)
{ {
op_data_t opd = (op_data_t) hook; op_data_t opd = (op_data_t) hook;
GpgmeImportStatus import = opd->result.imports; gpgme_import_status_t import = opd->result.imports;
while (import) while (import)
{ {
GpgmeImportStatus next = import->next; gpgme_import_status_t next = import->next;
free (import->fpr); free (import->fpr);
free (import); free (import);
import = next; import = next;
@ -57,11 +57,11 @@ release_op_data (void *hook)
} }
GpgmeImportResult gpgme_import_result_t
gpgme_op_import_result (GpgmeCtx ctx) gpgme_op_import_result (gpgme_ctx_t ctx)
{ {
op_data_t opd; op_data_t opd;
GpgmeError err; gpgme_error_t err;
err = _gpgme_op_data_lookup (ctx, OPDATA_IMPORT, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_IMPORT, (void **) &opd, -1, NULL);
if (err || !opd) if (err || !opd)
@ -71,10 +71,10 @@ gpgme_op_import_result (GpgmeCtx ctx)
} }
static GpgmeError static gpgme_error_t
parse_import (char *args, GpgmeImportStatus *import_status, int problem) parse_import (char *args, gpgme_import_status_t *import_status, int problem)
{ {
GpgmeImportStatus import; gpgme_import_status_t import;
char *tail; char *tail;
long int nr; long int nr;
@ -142,8 +142,8 @@ parse_import (char *args, GpgmeImportStatus *import_status, int problem)
GpgmeError gpgme_error_t
parse_import_res (char *args, GpgmeImportResult result) parse_import_res (char *args, gpgme_import_result_t result)
{ {
char *tail; char *tail;
@ -174,11 +174,11 @@ parse_import_res (char *args, GpgmeImportResult result)
} }
static GpgmeError static gpgme_error_t
import_status_handler (void *priv, GpgmeStatusCode code, char *args) import_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
GpgmeCtx ctx = (GpgmeCtx) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
GpgmeError err; gpgme_error_t err;
op_data_t opd; op_data_t opd;
err = _gpgme_op_data_lookup (ctx, OPDATA_IMPORT, (void **) &opd, err = _gpgme_op_data_lookup (ctx, OPDATA_IMPORT, (void **) &opd,
@ -209,10 +209,10 @@ import_status_handler (void *priv, GpgmeStatusCode code, char *args)
} }
static GpgmeError static gpgme_error_t
_gpgme_op_import_start (GpgmeCtx ctx, int synchronous, GpgmeData keydata) _gpgme_op_import_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t keydata)
{ {
GpgmeError err; gpgme_error_t err;
op_data_t opd; op_data_t opd;
err = _gpgme_op_reset (ctx, synchronous); err = _gpgme_op_reset (ctx, synchronous);
@ -234,31 +234,31 @@ _gpgme_op_import_start (GpgmeCtx ctx, int synchronous, GpgmeData keydata)
} }
GpgmeError gpgme_error_t
gpgme_op_import_start (GpgmeCtx ctx, GpgmeData keydata) gpgme_op_import_start (gpgme_ctx_t ctx, gpgme_data_t keydata)
{ {
return _gpgme_op_import_start (ctx, 0, keydata); return _gpgme_op_import_start (ctx, 0, keydata);
} }
/* Import the key in KEYDATA into the keyring. */ /* Import the key in KEYDATA into the keyring. */
GpgmeError gpgme_error_t
gpgme_op_import (GpgmeCtx ctx, GpgmeData keydata) gpgme_op_import (gpgme_ctx_t ctx, gpgme_data_t keydata)
{ {
GpgmeError err = _gpgme_op_import_start (ctx, 1, keydata); gpgme_error_t err = _gpgme_op_import_start (ctx, 1, keydata);
if (!err) if (!err)
err = _gpgme_wait_one (ctx); err = _gpgme_wait_one (ctx);
return err; return err;
} }
GpgmeError gpgme_error_t
gpgme_op_import_ext (GpgmeCtx ctx, GpgmeData keydata, int *nr) gpgme_op_import_ext (gpgme_ctx_t ctx, gpgme_data_t keydata, int *nr)
{ {
GpgmeError err = gpgme_op_import (ctx, keydata); gpgme_error_t err = gpgme_op_import (ctx, keydata);
if (!err && nr) if (!err && nr)
{ {
GpgmeImportResult result = gpgme_op_import_result (ctx); gpgme_import_result_t result = gpgme_op_import_result (ctx);
*nr = result->considered; *nr = result->considered;
} }
return err; return err;

View File

@ -37,10 +37,10 @@ DEFINE_STATIC_LOCK (key_ref_lock);
/* Create a new key. */ /* Create a new key. */
GpgmeError gpgme_error_t
_gpgme_key_new (GpgmeKey *r_key) _gpgme_key_new (gpgme_key_t *r_key)
{ {
GpgmeKey key; gpgme_key_t key;
key = calloc (1, sizeof *key); key = calloc (1, sizeof *key);
if (!key) if (!key)
@ -52,10 +52,10 @@ _gpgme_key_new (GpgmeKey *r_key)
} }
GpgmeError gpgme_error_t
_gpgme_key_add_subkey (GpgmeKey key, GpgmeSubkey *r_subkey) _gpgme_key_add_subkey (gpgme_key_t key, gpgme_subkey_t *r_subkey)
{ {
GpgmeSubkey subkey; gpgme_subkey_t subkey;
subkey = calloc (1, sizeof *subkey); subkey = calloc (1, sizeof *subkey);
if (!subkey) if (!subkey)
@ -200,10 +200,10 @@ parse_x509_user_id (char *src, char **name, char **email,
/* Take a name from the --with-colon listing, remove certain escape /* Take a name from the --with-colon listing, remove certain escape
sequences sequences and put it into the list of UIDs. */ sequences sequences and put it into the list of UIDs. */
GpgmeError gpgme_error_t
_gpgme_key_append_name (GpgmeKey key, char *src) _gpgme_key_append_name (gpgme_key_t key, char *src)
{ {
GpgmeUserID uid; gpgme_user_id_t uid;
char *dst; char *dst;
int src_len = strlen (src); int src_len = strlen (src);
@ -238,12 +238,12 @@ _gpgme_key_append_name (GpgmeKey key, char *src)
} }
GpgmeKeySig gpgme_key_sig_t
_gpgme_key_add_sig (GpgmeKey key, char *src) _gpgme_key_add_sig (gpgme_key_t key, char *src)
{ {
int src_len = src ? strlen (src) : 0; int src_len = src ? strlen (src) : 0;
GpgmeUserID uid; gpgme_user_id_t uid;
GpgmeKeySig sig; gpgme_key_sig_t sig;
assert (key); /* XXX */ assert (key); /* XXX */
@ -285,7 +285,7 @@ _gpgme_key_add_sig (GpgmeKey key, char *src)
/* Acquire a reference to KEY. */ /* Acquire a reference to KEY. */
void void
gpgme_key_ref (GpgmeKey key) gpgme_key_ref (gpgme_key_t key)
{ {
LOCK (key_ref_lock); LOCK (key_ref_lock);
key->_refs++; key->_refs++;
@ -299,10 +299,10 @@ gpgme_key_ref (GpgmeKey key)
created key object as well as for every gpgme_key_ref() done on the created key object as well as for every gpgme_key_ref() done on the
key object. */ key object. */
void void
gpgme_key_unref (GpgmeKey key) gpgme_key_unref (gpgme_key_t key)
{ {
GpgmeUserID uid; gpgme_user_id_t uid;
GpgmeSubkey subkey; gpgme_subkey_t subkey;
LOCK (key_ref_lock); LOCK (key_ref_lock);
assert (key->_refs > 0); assert (key->_refs > 0);
@ -316,7 +316,7 @@ gpgme_key_unref (GpgmeKey key)
subkey = key->subkeys; subkey = key->subkeys;
while (subkey) while (subkey)
{ {
GpgmeSubkey next = subkey->next; gpgme_subkey_t next = subkey->next;
if (subkey->fpr) if (subkey->fpr)
free (subkey->fpr); free (subkey->fpr);
free (subkey); free (subkey);
@ -326,12 +326,12 @@ gpgme_key_unref (GpgmeKey key)
uid = key->uids; uid = key->uids;
while (uid) while (uid)
{ {
GpgmeUserID next_uid = uid->next; gpgme_user_id_t next_uid = uid->next;
GpgmeKeySig keysig = uid->signatures; gpgme_key_sig_t keysig = uid->signatures;
while (keysig) while (keysig)
{ {
GpgmeKeySig next = keysig->next; gpgme_key_sig_t next = keysig->next;
free (keysig); free (keysig);
keysig = next; keysig = next;
} }
@ -354,7 +354,7 @@ gpgme_key_unref (GpgmeKey key)
/* Compatibility interfaces. */ /* Compatibility interfaces. */
void void
gpgme_key_release (GpgmeKey key) gpgme_key_release (gpgme_key_t key)
{ {
gpgme_key_unref (key); gpgme_key_unref (key);
} }
@ -411,7 +411,7 @@ validity_to_string (int validity)
static const char * static const char *
capabilities_to_string (GpgmeSubkey subkey) capabilities_to_string (gpgme_subkey_t subkey)
{ {
static const char *const strings[8] = static const char *const strings[8] =
{ {
@ -433,11 +433,11 @@ capabilities_to_string (GpgmeSubkey subkey)
/* Return the value of the attribute WHAT of ITEM, which has to be /* Return the value of the attribute WHAT of ITEM, which has to be
representable by a string. */ representable by a string. */
const char * const char *
gpgme_key_get_string_attr (GpgmeKey key, GpgmeAttr what, gpgme_key_get_string_attr (gpgme_key_t key, _gpgme_attr_t what,
const void *reserved, int idx) const void *reserved, int idx)
{ {
GpgmeSubkey subkey; gpgme_subkey_t subkey;
GpgmeUserID uid; gpgme_user_id_t uid;
int i; int i;
if (!key || reserved || idx < 0) if (!key || reserved || idx < 0)
@ -512,11 +512,11 @@ gpgme_key_get_string_attr (GpgmeKey key, GpgmeAttr what,
unsigned long unsigned long
gpgme_key_get_ulong_attr (GpgmeKey key, GpgmeAttr what, gpgme_key_get_ulong_attr (gpgme_key_t key, _gpgme_attr_t what,
const void *reserved, int idx) const void *reserved, int idx)
{ {
GpgmeSubkey subkey; gpgme_subkey_t subkey;
GpgmeUserID uid; gpgme_user_id_t uid;
int i; int i;
if (!key || reserved || idx < 0) if (!key || reserved || idx < 0)
@ -601,11 +601,11 @@ gpgme_key_get_ulong_attr (GpgmeKey key, GpgmeAttr what,
} }
static GpgmeKeySig static gpgme_key_sig_t
get_keysig (GpgmeKey key, int uid_idx, int idx) get_keysig (gpgme_key_t key, int uid_idx, int idx)
{ {
GpgmeUserID uid; gpgme_user_id_t uid;
GpgmeKeySig sig; gpgme_key_sig_t sig;
if (!key || uid_idx < 0 || idx < 0) if (!key || uid_idx < 0 || idx < 0)
return NULL; return NULL;
@ -630,10 +630,10 @@ get_keysig (GpgmeKey key, int uid_idx, int idx)
const char * const char *
gpgme_key_sig_get_string_attr (GpgmeKey key, int uid_idx, GpgmeAttr what, gpgme_key_sig_get_string_attr (gpgme_key_t key, int uid_idx, _gpgme_attr_t what,
const void *reserved, int idx) const void *reserved, int idx)
{ {
GpgmeKeySig certsig = get_keysig (key, uid_idx, idx); gpgme_key_sig_t certsig = get_keysig (key, uid_idx, idx);
if (!certsig || reserved) if (!certsig || reserved)
return NULL; return NULL;
@ -665,10 +665,10 @@ gpgme_key_sig_get_string_attr (GpgmeKey key, int uid_idx, GpgmeAttr what,
unsigned long unsigned long
gpgme_key_sig_get_ulong_attr (GpgmeKey key, int uid_idx, GpgmeAttr what, gpgme_key_sig_get_ulong_attr (gpgme_key_t key, int uid_idx, _gpgme_attr_t what,
const void *reserved, int idx) const void *reserved, int idx)
{ {
GpgmeKeySig certsig = get_keysig (key, uid_idx, idx); gpgme_key_sig_t certsig = get_keysig (key, uid_idx, idx);
if (!certsig || reserved) if (!certsig || reserved)
return 0; return 0;

View File

@ -38,15 +38,15 @@
struct key_queue_item_s struct key_queue_item_s
{ {
struct key_queue_item_s *next; struct key_queue_item_s *next;
GpgmeKey key; gpgme_key_t key;
}; };
typedef struct typedef struct
{ {
struct _gpgme_op_keylist_result result; struct _gpgme_op_keylist_result result;
GpgmeKey tmp_key; gpgme_key_t tmp_key;
GpgmeUserID tmp_uid; gpgme_user_id_t tmp_uid;
/* Something new is available. */ /* Something new is available. */
int key_cond; int key_cond;
struct key_queue_item_s *key_queue; struct key_queue_item_s *key_queue;
@ -73,11 +73,11 @@ release_op_data (void *hook)
} }
GpgmeKeyListResult gpgme_keylist_result_t
gpgme_op_keylist_result (GpgmeCtx ctx) gpgme_op_keylist_result (gpgme_ctx_t ctx)
{ {
op_data_t opd; op_data_t opd;
GpgmeError err; gpgme_error_t err;
err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, (void **) &opd, -1, NULL);
if (err || !opd) if (err || !opd)
@ -87,11 +87,11 @@ gpgme_op_keylist_result (GpgmeCtx ctx)
} }
static GpgmeError static gpgme_error_t
keylist_status_handler (void *priv, GpgmeStatusCode code, char *args) keylist_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
GpgmeCtx ctx = (GpgmeCtx) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
GpgmeError err; gpgme_error_t err;
op_data_t opd; op_data_t opd;
err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, (void **) &opd, -1, NULL);
@ -122,7 +122,7 @@ parse_timestamp (char *timestamp)
static void static void
set_mainkey_trust_info (GpgmeKey key, const char *src) set_mainkey_trust_info (gpgme_key_t key, const char *src)
{ {
/* Look at letters and stop at the first digit. */ /* Look at letters and stop at the first digit. */
while (*src && !isdigit (*src)) while (*src && !isdigit (*src))
@ -153,9 +153,9 @@ set_mainkey_trust_info (GpgmeKey key, const char *src)
static void static void
set_userid_flags (GpgmeKey key, const char *src) set_userid_flags (gpgme_key_t key, const char *src)
{ {
GpgmeUserID uid = key->_last_uid; gpgme_user_id_t uid = key->_last_uid;
assert (uid); assert (uid);
/* Look at letters and stop at the first digit. */ /* Look at letters and stop at the first digit. */
@ -193,7 +193,7 @@ set_userid_flags (GpgmeKey key, const char *src)
static void static void
set_subkey_trust_info (GpgmeSubkey subkey, const char *src) set_subkey_trust_info (gpgme_subkey_t subkey, const char *src)
{ {
/* Look at letters and stop at the first digit. */ /* Look at letters and stop at the first digit. */
while (*src && !isdigit (*src)) while (*src && !isdigit (*src))
@ -222,7 +222,7 @@ set_subkey_trust_info (GpgmeSubkey subkey, const char *src)
static void static void
set_mainkey_capability (GpgmeKey key, const char *src) set_mainkey_capability (gpgme_key_t key, const char *src)
{ {
while (*src) while (*src)
{ {
@ -268,7 +268,7 @@ set_mainkey_capability (GpgmeKey key, const char *src)
static void static void
set_subkey_capability (GpgmeSubkey subkey, const char *src) set_subkey_capability (gpgme_subkey_t subkey, const char *src)
{ {
while (*src) while (*src)
{ {
@ -291,7 +291,7 @@ set_subkey_capability (GpgmeSubkey subkey, const char *src)
} }
static void static void
set_ownertrust (GpgmeKey key, const char *src) set_ownertrust (gpgme_key_t key, const char *src)
{ {
/* Look at letters and stop at the first digit. */ /* Look at letters and stop at the first digit. */
while (*src && !isdigit (*src)) while (*src && !isdigit (*src))
@ -326,9 +326,9 @@ set_ownertrust (GpgmeKey key, const char *src)
/* We have read an entire key into tmp_key and should now finish it. /* We have read an entire key into tmp_key and should now finish it.
It is assumed that this releases tmp_key. */ It is assumed that this releases tmp_key. */
static void static void
finish_key (GpgmeCtx ctx, op_data_t opd) finish_key (gpgme_ctx_t ctx, op_data_t opd)
{ {
GpgmeKey key = opd->tmp_key; gpgme_key_t key = opd->tmp_key;
opd->tmp_key = NULL; opd->tmp_key = NULL;
opd->tmp_uid = NULL; opd->tmp_uid = NULL;
@ -339,10 +339,10 @@ finish_key (GpgmeCtx ctx, op_data_t opd)
/* Note: We are allowed to modify LINE. */ /* Note: We are allowed to modify LINE. */
static GpgmeError static gpgme_error_t
keylist_colon_handler (void *priv, char *line) keylist_colon_handler (void *priv, char *line)
{ {
GpgmeCtx ctx = (GpgmeCtx) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
enum enum
{ {
RT_NONE, RT_SIG, RT_UID, RT_SUB, RT_PUB, RT_FPR, RT_NONE, RT_SIG, RT_UID, RT_SUB, RT_PUB, RT_FPR,
@ -353,10 +353,10 @@ keylist_colon_handler (void *priv, char *line)
char *field[NR_FIELDS]; char *field[NR_FIELDS];
int fields = 0; int fields = 0;
op_data_t opd; op_data_t opd;
GpgmeError err; gpgme_error_t err;
GpgmeKey key; gpgme_key_t key;
GpgmeSubkey subkey = NULL; gpgme_subkey_t subkey = NULL;
GpgmeKeySig keysig = NULL; gpgme_key_sig_t keysig = NULL;
DEBUG3 ("keylist_colon_handler ctx = %p, key = %p, line = %s\n", DEBUG3 ("keylist_colon_handler ctx = %p, key = %p, line = %s\n",
ctx, key, line ? line : "(null)"); ctx, key, line ? line : "(null)");
@ -661,11 +661,11 @@ keylist_colon_handler (void *priv, char *line)
void void
_gpgme_op_keylist_event_cb (void *data, GpgmeEventIO type, void *type_data) _gpgme_op_keylist_event_cb (void *data, gpgme_event_io_t type, void *type_data)
{ {
GpgmeError err; gpgme_error_t err;
GpgmeCtx ctx = (GpgmeCtx) data; gpgme_ctx_t ctx = (gpgme_ctx_t) data;
GpgmeKey key = (GpgmeKey) type_data; gpgme_key_t key = (gpgme_key_t) type_data;
op_data_t opd; op_data_t opd;
struct key_queue_item_s *q, *q2; struct key_queue_item_s *q, *q2;
@ -700,10 +700,10 @@ _gpgme_op_keylist_event_cb (void *data, GpgmeEventIO type, void *type_data)
/* Start a keylist operation within CTX, searching for keys which /* Start a keylist operation within CTX, searching for keys which
match PATTERN. If SECRET_ONLY is true, only secret keys are match PATTERN. If SECRET_ONLY is true, only secret keys are
returned. */ returned. */
GpgmeError gpgme_error_t
gpgme_op_keylist_start (GpgmeCtx ctx, const char *pattern, int secret_only) gpgme_op_keylist_start (gpgme_ctx_t ctx, const char *pattern, int secret_only)
{ {
GpgmeError err; gpgme_error_t err;
op_data_t opd; op_data_t opd;
err = _gpgme_op_reset (ctx, 2); err = _gpgme_op_reset (ctx, 2);
@ -730,11 +730,11 @@ gpgme_op_keylist_start (GpgmeCtx ctx, const char *pattern, int secret_only)
/* Start a keylist operation within CTX, searching for keys which /* Start a keylist operation within CTX, searching for keys which
match PATTERN. If SECRET_ONLY is true, only secret keys are match PATTERN. If SECRET_ONLY is true, only secret keys are
returned. */ returned. */
GpgmeError gpgme_error_t
gpgme_op_keylist_ext_start (GpgmeCtx ctx, const char *pattern[], gpgme_op_keylist_ext_start (gpgme_ctx_t ctx, const char *pattern[],
int secret_only, int reserved) int secret_only, int reserved)
{ {
GpgmeError err; gpgme_error_t err;
op_data_t opd; op_data_t opd;
err = _gpgme_op_reset (ctx, 2); err = _gpgme_op_reset (ctx, 2);
@ -758,10 +758,10 @@ gpgme_op_keylist_ext_start (GpgmeCtx ctx, const char *pattern[],
/* Return the next key from the keylist in R_KEY. */ /* Return the next key from the keylist in R_KEY. */
GpgmeError gpgme_error_t
gpgme_op_keylist_next (GpgmeCtx ctx, GpgmeKey *r_key) gpgme_op_keylist_next (gpgme_ctx_t ctx, gpgme_key_t *r_key)
{ {
GpgmeError err; gpgme_error_t err;
struct key_queue_item_s *queue_item; struct key_queue_item_s *queue_item;
op_data_t opd; op_data_t opd;
@ -799,8 +799,8 @@ gpgme_op_keylist_next (GpgmeCtx ctx, GpgmeKey *r_key)
/* Terminate a pending keylist operation within CTX. */ /* Terminate a pending keylist operation within CTX. */
GpgmeError gpgme_error_t
gpgme_op_keylist_end (GpgmeCtx ctx) gpgme_op_keylist_end (gpgme_ctx_t ctx)
{ {
if (!ctx) if (!ctx)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -811,12 +811,12 @@ gpgme_op_keylist_end (GpgmeCtx ctx)
/* Get the key with the fingerprint FPR from the crypto backend. If /* Get the key with the fingerprint FPR from the crypto backend. If
SECRET is true, get the secret key. */ SECRET is true, get the secret key. */
GpgmeError gpgme_error_t
gpgme_get_key (GpgmeCtx ctx, const char *fpr, GpgmeKey *r_key, gpgme_get_key (gpgme_ctx_t ctx, const char *fpr, gpgme_key_t *r_key,
int secret) int secret)
{ {
GpgmeCtx listctx; gpgme_ctx_t listctx;
GpgmeError err; gpgme_error_t err;
if (!ctx || !r_key) if (!ctx || !r_key)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;

View File

@ -38,7 +38,7 @@ cat <<EOF
* Return value: String with the error description. * Return value: String with the error description.
**/ **/
const char * const char *
gpgme_strerror (GpgmeError err) gpgme_strerror (gpgme_error_t err)
{ {
const char *s; const char *s;
static char buf[25]; static char buf[25];

View File

@ -31,7 +31,7 @@ cat <<EOF
struct status_table_s { struct status_table_s {
const char *name; const char *name;
GpgmeStatusCode code; gpgme_status_code_t code;
}; };
static struct status_table_s status_table[] = static struct status_table_s status_table[] =

View File

@ -29,8 +29,8 @@
#include "ops.h" #include "ops.h"
GpgmeError gpgme_error_t
_gpgme_op_data_lookup (GpgmeCtx ctx, ctx_op_data_type type, void **hook, _gpgme_op_data_lookup (gpgme_ctx_t ctx, ctx_op_data_type type, void **hook,
int size, void (*cleanup) (void *)) int size, void (*cleanup) (void *))
{ {
struct ctx_op_data *data = ctx->op_data; struct ctx_op_data *data = ctx->op_data;
@ -62,11 +62,11 @@ _gpgme_op_data_lookup (GpgmeCtx ctx, ctx_op_data_type type, void **hook,
1: synchronous operation (always use private event loop). 1: synchronous operation (always use private event loop).
2: asynchronous private operation (use private or user 2: asynchronous private operation (use private or user
event loop). */ event loop). */
GpgmeError gpgme_error_t
_gpgme_op_reset (GpgmeCtx ctx, int type) _gpgme_op_reset (gpgme_ctx_t ctx, int type)
{ {
GpgmeError err = 0; gpgme_error_t err = 0;
struct GpgmeIOCbs io_cbs; struct gpgme_io_cbs io_cbs;
_gpgme_release_result (ctx); _gpgme_release_result (ctx);
@ -109,10 +109,10 @@ _gpgme_op_reset (GpgmeCtx ctx, int type)
} }
GpgmeError gpgme_error_t
_gpgme_parse_inv_userid (char *args, GpgmeInvalidUserID *userid) _gpgme_parse_inv_userid (char *args, gpgme_invalid_user_id_t *userid)
{ {
GpgmeInvalidUserID inv_userid; gpgme_invalid_user_id_t inv_userid;
char *tail; char *tail;
long int reason; long int reason;

View File

@ -26,46 +26,49 @@
/* From gpgme.c. */ /* From gpgme.c. */
void _gpgme_release_result (GpgmeCtx ctx); void _gpgme_release_result (gpgme_ctx_t ctx);
/* From wait.c. */ /* From wait.c. */
GpgmeError _gpgme_wait_one (GpgmeCtx ctx); gpgme_error_t _gpgme_wait_one (gpgme_ctx_t ctx);
GpgmeError _gpgme_wait_on_condition (GpgmeCtx ctx, volatile int *cond); gpgme_error_t _gpgme_wait_on_condition (gpgme_ctx_t ctx, volatile int *cond);
/* From recipient.c. */ /* From recipient.c. */
int _gpgme_recipients_all_valid ( const GpgmeRecipients rset ); int _gpgme_recipients_all_valid ( const gpgme_recipients_t rset );
/* From data.c. */ /* From data.c. */
GpgmeError _gpgme_data_inbound_handler (void *opaque, int fd); gpgme_error_t _gpgme_data_inbound_handler (void *opaque, int fd);
GpgmeError _gpgme_data_outbound_handler (void *opaque, int fd); gpgme_error_t _gpgme_data_outbound_handler (void *opaque, int fd);
/* From op-support.c. */ /* From op-support.c. */
/* Find or create the op data object of type TYPE. */ /* Find or create the op data object of type TYPE. */
GpgmeError _gpgme_op_data_lookup (GpgmeCtx ctx, ctx_op_data_type type, gpgme_error_t _gpgme_op_data_lookup (gpgme_ctx_t ctx, ctx_op_data_type type,
void **hook, int size, void **hook, int size,
void (*cleanup) (void *)); void (*cleanup) (void *));
/* Prepare a new operation on CTX. */ /* Prepare a new operation on CTX. */
GpgmeError _gpgme_op_reset (GpgmeCtx ctx, int synchronous); gpgme_error_t _gpgme_op_reset (gpgme_ctx_t ctx, int synchronous);
/* Parse the invalid user ID status line in ARGS and return the result /* Parse the invalid user ID status line in ARGS and return the result
in USERID. */ in USERID. */
GpgmeError _gpgme_parse_inv_userid (char *args, GpgmeInvalidUserID *userid); gpgme_error_t _gpgme_parse_inv_userid (char *args,
gpgme_invalid_user_id_t *userid);
/* From verify.c. */ /* From verify.c. */
GpgmeError _gpgme_op_verify_init_result (GpgmeCtx ctx); gpgme_error_t _gpgme_op_verify_init_result (gpgme_ctx_t ctx);
GpgmeError _gpgme_verify_status_handler (void *priv, GpgmeStatusCode code, gpgme_error_t _gpgme_verify_status_handler (void *priv,
gpgme_status_code_t code,
char *args); char *args);
/* From decrypt.c. */ /* From decrypt.c. */
GpgmeError _gpgme_op_decrypt_init_result (GpgmeCtx ctx); gpgme_error_t _gpgme_op_decrypt_init_result (gpgme_ctx_t ctx);
GpgmeError _gpgme_decrypt_status_handler (void *priv, GpgmeStatusCode code, gpgme_error_t _gpgme_decrypt_status_handler (void *priv,
gpgme_status_code_t code,
char *args); char *args);
@ -73,10 +76,11 @@ GpgmeError _gpgme_decrypt_status_handler (void *priv, GpgmeStatusCode code,
/* Create an initial op data object for signing. Needs to be called /* Create an initial op data object for signing. Needs to be called
once before calling _gpgme_sign_status_handler. */ once before calling _gpgme_sign_status_handler. */
GpgmeError _gpgme_op_sign_init_result (GpgmeCtx ctx); gpgme_error_t _gpgme_op_sign_init_result (gpgme_ctx_t ctx);
/* Process a status line for signing operations. */ /* Process a status line for signing operations. */
GpgmeError _gpgme_sign_status_handler (void *priv, GpgmeStatusCode code, gpgme_error_t _gpgme_sign_status_handler (void *priv,
gpgme_status_code_t code,
char *args); char *args);
@ -84,45 +88,52 @@ GpgmeError _gpgme_sign_status_handler (void *priv, GpgmeStatusCode code,
/* Create an initial op data object for encrypt. Needs to be called /* Create an initial op data object for encrypt. Needs to be called
once before calling _gpgme_encrypt_status_handler. */ once before calling _gpgme_encrypt_status_handler. */
GpgmeError _gpgme_op_encrypt_init_result (GpgmeCtx ctx); gpgme_error_t _gpgme_op_encrypt_init_result (gpgme_ctx_t ctx);
/* Process a status line for encryption operations. */ /* Process a status line for encryption operations. */
GpgmeError _gpgme_encrypt_status_handler (void *priv, GpgmeStatusCode code, gpgme_error_t _gpgme_encrypt_status_handler (void *priv,
gpgme_status_code_t code,
char *args); char *args);
/* From passphrase.c. */ /* From passphrase.c. */
GpgmeError _gpgme_passphrase_status_handler (void *priv, GpgmeStatusCode code, gpgme_error_t _gpgme_passphrase_status_handler (void *priv,
gpgme_status_code_t code,
char *args); char *args);
GpgmeError _gpgme_passphrase_command_handler (void *opaque, gpgme_error_t _gpgme_passphrase_command_handler (void *opaque,
GpgmeStatusCode code, gpgme_status_code_t code,
const char *key, const char **result); const char *key,
const char **result);
/* From progress.c. */ /* From progress.c. */
GpgmeError _gpgme_progress_status_handler (void *priv, GpgmeStatusCode code, gpgme_error_t _gpgme_progress_status_handler (void *priv,
gpgme_status_code_t code,
char *args); char *args);
/* From key.c. */ /* From key.c. */
GpgmeError _gpgme_key_new (GpgmeKey *r_key); gpgme_error_t _gpgme_key_new (gpgme_key_t *r_key);
GpgmeError _gpgme_key_add_subkey (GpgmeKey key, GpgmeSubkey *r_subkey); gpgme_error_t _gpgme_key_add_subkey (gpgme_key_t key,
GpgmeError _gpgme_key_append_name (GpgmeKey key, char *src); gpgme_subkey_t *r_subkey);
GpgmeKeySig _gpgme_key_add_sig (GpgmeKey key, char *src); gpgme_error_t _gpgme_key_append_name (gpgme_key_t key, char *src);
gpgme_key_sig_t _gpgme_key_add_sig (gpgme_key_t key, char *src);
/* From keylist.c. */ /* From keylist.c. */
void _gpgme_op_keylist_event_cb (void *data, GpgmeEventIO type, void *type_data); void _gpgme_op_keylist_event_cb (void *data, gpgme_event_io_t type,
void *type_data);
/* From trust-item.c. */ /* From trust-item.c. */
/* Create a new trust item. */ /* Create a new trust item. */
GpgmeError _gpgme_trust_item_new (GpgmeTrustItem *r_item); gpgme_error_t _gpgme_trust_item_new (gpgme_trust_item_t *r_item);
/* From trustlist.c. */ /* From trustlist.c. */
void _gpgme_op_trustlist_event_cb (void *data, GpgmeEventIO type, void *type_data); void _gpgme_op_trustlist_event_cb (void *data, gpgme_event_io_t type,
void *type_data);
/*-- version.c --*/ /*-- version.c --*/

View File

@ -50,11 +50,11 @@ release_op_data (void *hook)
} }
GpgmeError gpgme_error_t
_gpgme_passphrase_status_handler (void *priv, GpgmeStatusCode code, char *args) _gpgme_passphrase_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
GpgmeCtx ctx = (GpgmeCtx) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
GpgmeError err; gpgme_error_t err;
op_data_t opd; op_data_t opd;
if (!ctx->passphrase_cb) if (!ctx->passphrase_cb)
@ -110,12 +110,12 @@ _gpgme_passphrase_status_handler (void *priv, GpgmeStatusCode code, char *args)
} }
GpgmeError gpgme_error_t
_gpgme_passphrase_command_handler (void *priv, GpgmeStatusCode code, _gpgme_passphrase_command_handler (void *priv, gpgme_status_code_t code,
const char *key, const char **result) const char *key, const char **result)
{ {
GpgmeCtx ctx = (GpgmeCtx) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
GpgmeError err; gpgme_error_t err;
op_data_t opd; op_data_t opd;
if (!ctx->passphrase_cb) if (!ctx->passphrase_cb)

View File

@ -28,10 +28,10 @@
#include "context.h" #include "context.h"
GpgmeError gpgme_error_t
_gpgme_progress_status_handler (void *priv, GpgmeStatusCode code, char *args) _gpgme_progress_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
GpgmeCtx ctx = (GpgmeCtx) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
char *p; char *p;
char *args_cpy; char *args_cpy;
int type = 0; int type = 0;

View File

@ -28,10 +28,10 @@
/* Create a new uninitialized recipient object and return it in R_RSET. */ /* Create a new uninitialized recipient object and return it in R_RSET. */
GpgmeError gpgme_error_t
gpgme_recipients_new (GpgmeRecipients *r_rset) gpgme_recipients_new (gpgme_recipients_t *r_rset)
{ {
GpgmeRecipients rset; gpgme_recipients_t rset;
rset = calloc (1, sizeof *rset); rset = calloc (1, sizeof *rset);
if (!rset) if (!rset)
@ -43,13 +43,13 @@ gpgme_recipients_new (GpgmeRecipients *r_rset)
/* Release the recipient object RSET. */ /* Release the recipient object RSET. */
void void
gpgme_recipients_release (GpgmeRecipients rset) gpgme_recipients_release (gpgme_recipients_t rset)
{ {
GpgmeUserID uid = rset->list; gpgme_user_id_t uid = rset->list;
while (uid) while (uid)
{ {
GpgmeUserID next_uid = uid->next; gpgme_user_id_t next_uid = uid->next;
free (uid); free (uid);
uid = next_uid; uid = next_uid;
@ -60,12 +60,12 @@ gpgme_recipients_release (GpgmeRecipients rset)
/* Add the name NAME to the recipient set RSET with the given key /* Add the name NAME to the recipient set RSET with the given key
validity VALIDITY. */ validity VALIDITY. */
GpgmeError gpgme_error_t
gpgme_recipients_add_name_with_validity (GpgmeRecipients rset, gpgme_recipients_add_name_with_validity (gpgme_recipients_t rset,
const char *name, const char *name,
GpgmeValidity validity) gpgme_validity_t validity)
{ {
GpgmeUserID uid; gpgme_user_id_t uid;
if (!name || !rset) if (!name || !rset)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -87,8 +87,8 @@ gpgme_recipients_add_name_with_validity (GpgmeRecipients rset,
/* Add the name NAME to the recipient set RSET. Same as /* Add the name NAME to the recipient set RSET. Same as
gpgme_recipients_add_name_with_validity with validitiy gpgme_recipients_add_name_with_validity with validitiy
GPGME_VALIDITY_UNKNOWN. */ GPGME_VALIDITY_UNKNOWN. */
GpgmeError gpgme_error_t
gpgme_recipients_add_name (GpgmeRecipients rset, const char *name) gpgme_recipients_add_name (gpgme_recipients_t rset, const char *name)
{ {
return gpgme_recipients_add_name_with_validity (rset, name, return gpgme_recipients_add_name_with_validity (rset, name,
GPGME_VALIDITY_UNKNOWN); GPGME_VALIDITY_UNKNOWN);
@ -97,9 +97,9 @@ gpgme_recipients_add_name (GpgmeRecipients rset, const char *name)
/* Return the number of recipients in the set. */ /* Return the number of recipients in the set. */
unsigned int unsigned int
gpgme_recipients_count (const GpgmeRecipients rset) gpgme_recipients_count (const gpgme_recipients_t rset)
{ {
GpgmeUserID uid = rset->list; gpgme_user_id_t uid = rset->list;
unsigned int count = 0; unsigned int count = 0;
while (uid) while (uid)
@ -115,8 +115,8 @@ gpgme_recipients_count (const GpgmeRecipients rset)
/* Start an enumeration on the recipient set RSET. The caller must /* Start an enumeration on the recipient set RSET. The caller must
pass the address of a void pointer which is used as the iterator pass the address of a void pointer which is used as the iterator
object. */ object. */
GpgmeError gpgme_error_t
gpgme_recipients_enum_open (const GpgmeRecipients rset, void **iter) gpgme_recipients_enum_open (const gpgme_recipients_t rset, void **iter)
{ {
*iter = rset->list; *iter = rset->list;
return 0; return 0;
@ -124,9 +124,9 @@ gpgme_recipients_enum_open (const GpgmeRecipients rset, void **iter)
/* Return the name of the next recipient in the set RSET. */ /* Return the name of the next recipient in the set RSET. */
const char * const char *
gpgme_recipients_enum_read (const GpgmeRecipients rset, void **iter) gpgme_recipients_enum_read (const gpgme_recipients_t rset, void **iter)
{ {
GpgmeUserID uid; gpgme_user_id_t uid;
uid = *iter; uid = *iter;
if (!uid) if (!uid)
@ -137,8 +137,8 @@ gpgme_recipients_enum_read (const GpgmeRecipients rset, void **iter)
} }
/* Release the iterator for this object. */ /* Release the iterator for this object. */
GpgmeError gpgme_error_t
gpgme_recipients_enum_close (const GpgmeRecipients rset, void **iter) gpgme_recipients_enum_close (const gpgme_recipients_t rset, void **iter)
{ {
/* Not really needed, but might catch the occasional mistake. */ /* Not really needed, but might catch the occasional mistake. */
*iter = NULL; *iter = NULL;
@ -148,9 +148,9 @@ gpgme_recipients_enum_close (const GpgmeRecipients rset, void **iter)
int int
_gpgme_recipients_all_valid (const GpgmeRecipients rset) _gpgme_recipients_all_valid (const gpgme_recipients_t rset)
{ {
GpgmeUserID uid = rset->list; gpgme_user_id_t uid = rset->list;
while (uid) while (uid)
{ {

View File

@ -51,7 +51,7 @@
struct arg_and_data_s struct arg_and_data_s
{ {
struct arg_and_data_s *next; struct arg_and_data_s *next;
GpgmeData data; /* If this is not NULL, use arg below. */ gpgme_data_t data; /* If this is not NULL, use arg below. */
int inbound; /* True if this is used for reading from gpg. */ int inbound; /* True if this is used for reading from gpg. */
int dup_to; int dup_to;
int print_fd; /* Print the fd number and not the special form of it. */ int print_fd; /* Print the fd number and not the special form of it. */
@ -61,7 +61,7 @@ struct arg_and_data_s
struct fd_data_map_s struct fd_data_map_s
{ {
GpgmeData data; gpgme_data_t data;
int inbound; /* true if this is used for reading from gpg */ int inbound; /* true if this is used for reading from gpg */
int dup_to; int dup_to;
int fd; /* the fd to use */ int fd; /* the fd to use */
@ -110,25 +110,25 @@ struct gpg_object_s
int used; int used;
int fd; int fd;
int idx; /* Index in fd_data_map */ int idx; /* Index in fd_data_map */
GpgmeData cb_data; /* hack to get init the above idx later */ gpgme_data_t cb_data; /* hack to get init the above idx later */
GpgmeStatusCode code; /* last code */ gpgme_status_code_t code; /* last code */
char *keyword; /* what has been requested (malloced) */ char *keyword; /* what has been requested (malloced) */
EngineCommandHandler fnc; EngineCommandHandler fnc;
void *fnc_value; void *fnc_value;
/* The kludges never end. This is used to couple command handlers /* The kludges never end. This is used to couple command handlers
with output data in edit key mode. */ with output data in edit key mode. */
GpgmeData linked_data; gpgme_data_t linked_data;
int linked_idx; int linked_idx;
} cmd; } cmd;
struct GpgmeIOCbs io_cbs; struct gpgme_io_cbs io_cbs;
}; };
typedef struct gpg_object_s *GpgObject; typedef struct gpg_object_s *GpgObject;
static void static void
gpg_io_event (void *engine, GpgmeEventIO type, void *type_data) gpg_io_event (void *engine, gpgme_event_io_t type, void *type_data)
{ {
GpgObject gpg = engine; GpgObject gpg = engine;
@ -181,7 +181,7 @@ close_notify_handler (int fd, void *opaque)
} }
} }
static GpgmeError static gpgme_error_t
add_arg (GpgObject gpg, const char *arg) add_arg (GpgObject gpg, const char *arg)
{ {
struct arg_and_data_s *a; struct arg_and_data_s *a;
@ -204,8 +204,8 @@ add_arg (GpgObject gpg, const char *arg)
return 0; return 0;
} }
static GpgmeError static gpgme_error_t
add_data (GpgObject gpg, GpgmeData data, int dup_to, int inbound) add_data (GpgObject gpg, gpgme_data_t data, int dup_to, int inbound)
{ {
struct arg_and_data_s *a; struct arg_and_data_s *a;
@ -327,7 +327,7 @@ gpg_release (void *engine)
} }
static GpgmeError static gpgme_error_t
gpg_new (void **engine) gpg_new (void **engine)
{ {
GpgObject gpg; GpgObject gpg;
@ -360,7 +360,7 @@ gpg_new (void **engine)
goto leave; goto leave;
} }
/* In any case we need a status pipe - create it right here and /* In any case we need a status pipe - create it right here and
don't handle it with our generic GpgmeData mechanism. */ don't handle it with our generic gpgme_data_t mechanism. */
if (_gpgme_io_pipe (gpg->status.fd, 1) == -1) if (_gpgme_io_pipe (gpg->status.fd, 1) == -1)
{ {
rc = GPGME_Pipe_Error; rc = GPGME_Pipe_Error;
@ -406,7 +406,7 @@ gpg_set_status_handler (void *engine, EngineStatusHandler fnc, void *fnc_value)
} }
/* Kludge to process --with-colon output. */ /* Kludge to process --with-colon output. */
static GpgmeError static gpgme_error_t
gpg_set_colon_line_handler (void *engine, EngineColonLineHandler fnc, gpg_set_colon_line_handler (void *engine, EngineColonLineHandler fnc,
void *fnc_value) void *fnc_value)
{ {
@ -437,10 +437,10 @@ gpg_set_colon_line_handler (void *engine, EngineColonLineHandler fnc,
/* Here we handle --command-fd. This works closely together with the /* Here we handle --command-fd. This works closely together with the
status handler. */ status handler. */
static GpgmeError static gpgme_error_t
command_cb (void *opaque, char *buffer, size_t length, size_t *nread) command_cb (void *opaque, char *buffer, size_t length, size_t *nread)
{ {
GpgmeError err; gpgme_error_t err;
GpgObject gpg = opaque; GpgObject gpg = opaque;
const char *value; const char *value;
int value_len; int value_len;
@ -506,13 +506,13 @@ command_cb (void *opaque, char *buffer, size_t length, size_t *nread)
resources associated with the returned value from another call. To resources associated with the returned value from another call. To
match such a second call to a first call, the returned value from match such a second call to a first call, the returned value from
the first call is passed as keyword. */ the first call is passed as keyword. */
static GpgmeError static gpgme_error_t
gpg_set_command_handler (void *engine, EngineCommandHandler fnc, gpg_set_command_handler (void *engine, EngineCommandHandler fnc,
void *fnc_value, GpgmeData linked_data) void *fnc_value, gpgme_data_t linked_data)
{ {
GpgObject gpg = engine; GpgObject gpg = engine;
GpgmeData tmp; gpgme_data_t tmp;
GpgmeError err; gpgme_error_t err;
err = gpgme_data_new_with_read_cb (&tmp, command_cb, gpg); err = gpgme_data_new_with_read_cb (&tmp, command_cb, gpg);
if (err) if (err)
@ -529,7 +529,7 @@ gpg_set_command_handler (void *engine, EngineCommandHandler fnc,
} }
static GpgmeError static gpgme_error_t
build_argv (GpgObject gpg) build_argv (GpgObject gpg)
{ {
struct arg_and_data_s *a; struct arg_and_data_s *a;
@ -740,11 +740,11 @@ build_argv (GpgObject gpg)
} }
static GpgmeError static gpgme_error_t
add_io_cb (GpgObject gpg, int fd, int dir, GpgmeIOCb handler, void *data, add_io_cb (GpgObject gpg, int fd, int dir, gpgme_io_cb_t handler, void *data,
void **tag) void **tag)
{ {
GpgmeError err; gpgme_error_t err;
err = (*gpg->io_cbs.add) (gpg->io_cbs.add_priv, fd, dir, handler, data, tag); err = (*gpg->io_cbs.add) (gpg->io_cbs.add_priv, fd, dir, handler, data, tag);
if (err) if (err)
@ -773,7 +773,7 @@ status_cmp (const void *ap, const void *bp)
e.g. with a large user ID. Note: We can optimize this to only cope e.g. with a large user ID. Note: We can optimize this to only cope
with status line code we know about and skip all other stuff with status line code we know about and skip all other stuff
without buffering (i.e. without extending the buffer). */ without buffering (i.e. without extending the buffer). */
static GpgmeError static gpgme_error_t
read_status (GpgObject gpg) read_status (GpgObject gpg)
{ {
char *p; char *p;
@ -802,7 +802,7 @@ read_status (GpgObject gpg)
gpg->status.eof = 1; gpg->status.eof = 1;
if (gpg->status.fnc) if (gpg->status.fnc)
{ {
GpgmeError err; gpgme_error_t err;
err = gpg->status.fnc (gpg->status.fnc_value, GPGME_STATUS_EOF, ""); err = gpg->status.fnc (gpg->status.fnc_value, GPGME_STATUS_EOF, "");
if (err) if (err)
return err; return err;
@ -884,7 +884,7 @@ read_status (GpgObject gpg)
} }
else if (gpg->status.fnc) else if (gpg->status.fnc)
{ {
GpgmeError err; gpgme_error_t err;
err = gpg->status.fnc (gpg->status.fnc_value, err = gpg->status.fnc (gpg->status.fnc_value,
r->code, rest); r->code, rest);
if (err) if (err)
@ -931,7 +931,7 @@ read_status (GpgObject gpg)
} }
static GpgmeError static gpgme_error_t
status_handler (void *opaque, int fd) status_handler (void *opaque, int fd)
{ {
GpgObject gpg = opaque; GpgObject gpg = opaque;
@ -947,7 +947,7 @@ status_handler (void *opaque, int fd)
} }
static GpgmeError static gpgme_error_t
read_colon_line (GpgObject gpg) read_colon_line (GpgObject gpg)
{ {
char *p; char *p;
@ -1022,14 +1022,14 @@ read_colon_line (GpgObject gpg)
/* This colonline handler thing is not the clean way to do it. It /* This colonline handler thing is not the clean way to do it. It
might be better to enhance the GpgmeData object to act as a wrapper might be better to enhance the gpgme_data_t object to act as a wrapper
for a callback. Same goes for the status thing. For now we use for a callback. Same goes for the status thing. For now we use
this thing here because it is easier to implement. */ this thing here because it is easier to implement. */
static GpgmeError static gpgme_error_t
colon_line_handler (void *opaque, int fd) colon_line_handler (void *opaque, int fd)
{ {
GpgObject gpg = opaque; GpgObject gpg = opaque;
GpgmeError rc = 0; gpgme_error_t rc = 0;
assert (fd == gpg->colon.fd[0]); assert (fd == gpg->colon.fd[0]);
rc = read_colon_line (gpg); rc = read_colon_line (gpg);
@ -1041,10 +1041,10 @@ colon_line_handler (void *opaque, int fd)
} }
static GpgmeError static gpgme_error_t
start (GpgObject gpg) start (GpgObject gpg)
{ {
GpgmeError rc; gpgme_error_t rc;
int i, n; int i, n;
int status; int status;
struct spawn_fd_item_s *fd_child_list, *fd_parent_list; struct spawn_fd_item_s *fd_child_list, *fd_parent_list;
@ -1169,11 +1169,11 @@ start (GpgObject gpg)
} }
static GpgmeError static gpgme_error_t
gpg_decrypt (void *engine, GpgmeData ciph, GpgmeData plain) gpg_decrypt (void *engine, gpgme_data_t ciph, gpgme_data_t plain)
{ {
GpgObject gpg = engine; GpgObject gpg = engine;
GpgmeError err; gpgme_error_t err;
err = add_arg (gpg, "--decrypt"); err = add_arg (gpg, "--decrypt");
@ -1192,11 +1192,11 @@ gpg_decrypt (void *engine, GpgmeData ciph, GpgmeData plain)
return err; return err;
} }
static GpgmeError static gpgme_error_t
gpg_delete (void *engine, GpgmeKey key, int allow_secret) gpg_delete (void *engine, gpgme_key_t key, int allow_secret)
{ {
GpgObject gpg = engine; GpgObject gpg = engine;
GpgmeError err; gpgme_error_t err;
err = add_arg (gpg, allow_secret ? "--delete-secret-and-public-key" err = add_arg (gpg, allow_secret ? "--delete-secret-and-public-key"
: "--delete-key"); : "--delete-key");
@ -1216,12 +1216,12 @@ gpg_delete (void *engine, GpgmeKey key, int allow_secret)
} }
static GpgmeError static gpgme_error_t
append_args_from_signers (GpgObject gpg, GpgmeCtx ctx /* FIXME */) append_args_from_signers (GpgObject gpg, gpgme_ctx_t ctx /* FIXME */)
{ {
GpgmeError err = 0; gpgme_error_t err = 0;
int i; int i;
GpgmeKey key; gpgme_key_t key;
for (i = 0; (key = gpgme_signers_enum (ctx, i)); i++) for (i = 0; (key = gpgme_signers_enum (ctx, i)); i++)
{ {
@ -1240,11 +1240,11 @@ append_args_from_signers (GpgObject gpg, GpgmeCtx ctx /* FIXME */)
} }
static GpgmeError static gpgme_error_t
gpg_edit (void *engine, GpgmeKey key, GpgmeData out, GpgmeCtx ctx /* FIXME */) gpg_edit (void *engine, gpgme_key_t key, gpgme_data_t out, gpgme_ctx_t ctx /* FIXME */)
{ {
GpgObject gpg = engine; GpgObject gpg = engine;
GpgmeError err; gpgme_error_t err;
err = add_arg (gpg, "--with-colons"); err = add_arg (gpg, "--with-colons");
if (!err) if (!err)
@ -1270,11 +1270,11 @@ gpg_edit (void *engine, GpgmeKey key, GpgmeData out, GpgmeCtx ctx /* FIXME */)
} }
static GpgmeError static gpgme_error_t
append_args_from_recipients (GpgObject gpg, const GpgmeRecipients rset) append_args_from_recipients (GpgObject gpg, const gpgme_recipients_t rset)
{ {
GpgmeError err = 0; gpgme_error_t err = 0;
GpgmeUserID uid; gpgme_user_id_t uid;
assert (rset); assert (rset);
for (uid = rset->list; uid; uid = uid->next) for (uid = rset->list; uid; uid = uid->next)
@ -1289,12 +1289,12 @@ append_args_from_recipients (GpgObject gpg, const GpgmeRecipients rset)
} }
static GpgmeError static gpgme_error_t
gpg_encrypt (void *engine, GpgmeRecipients recp, GpgmeData plain, gpg_encrypt (void *engine, gpgme_recipients_t recp, gpgme_data_t plain,
GpgmeData ciph, int use_armor) gpgme_data_t ciph, int use_armor)
{ {
GpgObject gpg = engine; GpgObject gpg = engine;
GpgmeError err; gpgme_error_t err;
int symmetric = !recp; int symmetric = !recp;
err = add_arg (gpg, symmetric ? "--symmetric" : "--encrypt"); err = add_arg (gpg, symmetric ? "--symmetric" : "--encrypt");
@ -1332,12 +1332,12 @@ gpg_encrypt (void *engine, GpgmeRecipients recp, GpgmeData plain,
} }
static GpgmeError static gpgme_error_t
gpg_encrypt_sign (void *engine, GpgmeRecipients recp, GpgmeData plain, gpg_encrypt_sign (void *engine, gpgme_recipients_t recp, gpgme_data_t plain,
GpgmeData ciph, int use_armor, GpgmeCtx ctx /* FIXME */) gpgme_data_t ciph, int use_armor, gpgme_ctx_t ctx /* FIXME */)
{ {
GpgObject gpg = engine; GpgObject gpg = engine;
GpgmeError err; gpgme_error_t err;
err = add_arg (gpg, "--encrypt"); err = add_arg (gpg, "--encrypt");
if (!err) if (!err)
@ -1375,12 +1375,12 @@ gpg_encrypt_sign (void *engine, GpgmeRecipients recp, GpgmeData plain,
} }
static GpgmeError static gpgme_error_t
gpg_export (void *engine, GpgmeRecipients recp, GpgmeData keydata, gpg_export (void *engine, gpgme_recipients_t recp, gpgme_data_t keydata,
int use_armor) int use_armor)
{ {
GpgObject gpg = engine; GpgObject gpg = engine;
GpgmeError err; gpgme_error_t err;
err = add_arg (gpg, "--export"); err = add_arg (gpg, "--export");
if (!err && use_armor) if (!err && use_armor)
@ -1409,12 +1409,12 @@ gpg_export (void *engine, GpgmeRecipients recp, GpgmeData keydata,
} }
static GpgmeError static gpgme_error_t
gpg_genkey (void *engine, GpgmeData help_data, int use_armor, gpg_genkey (void *engine, gpgme_data_t help_data, int use_armor,
GpgmeData pubkey, GpgmeData seckey) gpgme_data_t pubkey, gpgme_data_t seckey)
{ {
GpgObject gpg = engine; GpgObject gpg = engine;
GpgmeError err; gpgme_error_t err;
if (!gpg) if (!gpg)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -1439,11 +1439,11 @@ gpg_genkey (void *engine, GpgmeData help_data, int use_armor,
} }
static GpgmeError static gpgme_error_t
gpg_import (void *engine, GpgmeData keydata) gpg_import (void *engine, gpgme_data_t keydata)
{ {
GpgObject gpg = engine; GpgObject gpg = engine;
GpgmeError err; gpgme_error_t err;
err = add_arg (gpg, "--import"); err = add_arg (gpg, "--import");
if (!err) if (!err)
@ -1456,12 +1456,12 @@ gpg_import (void *engine, GpgmeData keydata)
} }
static GpgmeError static gpgme_error_t
gpg_keylist (void *engine, const char *pattern, int secret_only, gpg_keylist (void *engine, const char *pattern, int secret_only,
int keylist_mode) int keylist_mode)
{ {
GpgObject gpg = engine; GpgObject gpg = engine;
GpgmeError err; gpgme_error_t err;
err = add_arg (gpg, "--with-colons"); err = add_arg (gpg, "--with-colons");
if (!err) if (!err)
@ -1488,12 +1488,12 @@ gpg_keylist (void *engine, const char *pattern, int secret_only,
} }
static GpgmeError static gpgme_error_t
gpg_keylist_ext (void *engine, const char *pattern[], int secret_only, gpg_keylist_ext (void *engine, const char *pattern[], int secret_only,
int reserved, int keylist_mode) int reserved, int keylist_mode)
{ {
GpgObject gpg = engine; GpgObject gpg = engine;
GpgmeError err; gpgme_error_t err;
if (reserved) if (reserved)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
@ -1526,13 +1526,13 @@ gpg_keylist_ext (void *engine, const char *pattern[], int secret_only,
} }
static GpgmeError static gpgme_error_t
gpg_sign (void *engine, GpgmeData in, GpgmeData out, GpgmeSigMode mode, gpg_sign (void *engine, gpgme_data_t in, gpgme_data_t out, gpgme_sig_mode_t mode,
int use_armor, int use_textmode, int include_certs, int use_armor, int use_textmode, int include_certs,
GpgmeCtx ctx /* FIXME */) gpgme_ctx_t ctx /* FIXME */)
{ {
GpgObject gpg = engine; GpgObject gpg = engine;
GpgmeError err; gpgme_error_t err;
if (mode == GPGME_SIG_MODE_CLEAR) if (mode == GPGME_SIG_MODE_CLEAR)
err = add_arg (gpg, "--clearsign"); err = add_arg (gpg, "--clearsign");
@ -1562,11 +1562,11 @@ gpg_sign (void *engine, GpgmeData in, GpgmeData out, GpgmeSigMode mode,
return err; return err;
} }
static GpgmeError static gpgme_error_t
gpg_trustlist (void *engine, const char *pattern) gpg_trustlist (void *engine, const char *pattern)
{ {
GpgObject gpg = engine; GpgObject gpg = engine;
GpgmeError err; gpgme_error_t err;
err = add_arg (gpg, "--with-colons"); err = add_arg (gpg, "--with-colons");
if (!err) if (!err)
@ -1585,12 +1585,12 @@ gpg_trustlist (void *engine, const char *pattern)
} }
static GpgmeError static gpgme_error_t
gpg_verify (void *engine, GpgmeData sig, GpgmeData signed_text, gpg_verify (void *engine, gpgme_data_t sig, gpgme_data_t signed_text,
GpgmeData plaintext) gpgme_data_t plaintext)
{ {
GpgObject gpg = engine; GpgObject gpg = engine;
GpgmeError err = 0; gpgme_error_t err = 0;
if (plaintext) if (plaintext)
{ {
@ -1630,7 +1630,7 @@ gpg_verify (void *engine, GpgmeData sig, GpgmeData signed_text,
static void static void
gpg_set_io_cbs (void *engine, struct GpgmeIOCbs *io_cbs) gpg_set_io_cbs (void *engine, gpgme_io_cbs_t io_cbs)
{ {
GpgObject gpg = engine; GpgObject gpg = engine;

View File

@ -37,10 +37,10 @@ typedef struct
/* A pointer to the next pointer of the last invalid signer in /* A pointer to the next pointer of the last invalid signer in
the list. This makes appending new invalid signers painless the list. This makes appending new invalid signers painless
while preserving the order. */ while preserving the order. */
GpgmeInvalidUserID *last_signer_p; gpgme_invalid_user_id_t *last_signer_p;
/* Likewise for signature information. */ /* Likewise for signature information. */
GpgmeNewSignature *last_sig_p; gpgme_new_signature_t *last_sig_p;
} *op_data_t; } *op_data_t;
@ -48,12 +48,12 @@ static void
release_op_data (void *hook) release_op_data (void *hook)
{ {
op_data_t opd = (op_data_t) hook; op_data_t opd = (op_data_t) hook;
GpgmeInvalidUserID invalid_signer = opd->result.invalid_signers; gpgme_invalid_user_id_t invalid_signer = opd->result.invalid_signers;
GpgmeNewSignature sig = opd->result.signatures; gpgme_new_signature_t sig = opd->result.signatures;
while (invalid_signer) while (invalid_signer)
{ {
GpgmeInvalidUserID next = invalid_signer->next; gpgme_invalid_user_id_t next = invalid_signer->next;
free (invalid_signer->id); free (invalid_signer->id);
free (invalid_signer); free (invalid_signer);
invalid_signer = next; invalid_signer = next;
@ -61,7 +61,7 @@ release_op_data (void *hook)
while (sig) while (sig)
{ {
GpgmeNewSignature next = sig->next; gpgme_new_signature_t next = sig->next;
free (sig->fpr); free (sig->fpr);
free (sig); free (sig);
sig = next; sig = next;
@ -69,11 +69,11 @@ release_op_data (void *hook)
} }
GpgmeSignResult gpgme_sign_result_t
gpgme_op_sign_result (GpgmeCtx ctx) gpgme_op_sign_result (gpgme_ctx_t ctx)
{ {
op_data_t opd; op_data_t opd;
GpgmeError err; gpgme_error_t err;
err = _gpgme_op_data_lookup (ctx, OPDATA_SIGN, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_SIGN, (void **) &opd, -1, NULL);
if (err || !opd) if (err || !opd)
@ -83,10 +83,10 @@ gpgme_op_sign_result (GpgmeCtx ctx)
} }
static GpgmeError static gpgme_error_t
parse_sig_created (char *args, GpgmeNewSignature *sigp) parse_sig_created (char *args, gpgme_new_signature_t *sigp)
{ {
GpgmeNewSignature sig; gpgme_new_signature_t sig;
char *tail; char *tail;
sig = malloc (sizeof (*sig)); sig = malloc (sizeof (*sig));
@ -182,11 +182,11 @@ parse_sig_created (char *args, GpgmeNewSignature *sigp)
} }
GpgmeError gpgme_error_t
_gpgme_sign_status_handler (void *priv, GpgmeStatusCode code, char *args) _gpgme_sign_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
GpgmeCtx ctx = (GpgmeCtx) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
GpgmeError err; gpgme_error_t err;
op_data_t opd; op_data_t opd;
err = _gpgme_passphrase_status_handler (priv, code, args); err = _gpgme_passphrase_status_handler (priv, code, args);
@ -227,10 +227,10 @@ _gpgme_sign_status_handler (void *priv, GpgmeStatusCode code, char *args)
} }
GpgmeError gpgme_error_t
_gpgme_op_sign_init_result (GpgmeCtx ctx) _gpgme_op_sign_init_result (gpgme_ctx_t ctx)
{ {
GpgmeError err; gpgme_error_t err;
op_data_t opd; op_data_t opd;
err = _gpgme_op_data_lookup (ctx, OPDATA_SIGN, (void **) &opd, err = _gpgme_op_data_lookup (ctx, OPDATA_SIGN, (void **) &opd,
@ -243,11 +243,11 @@ _gpgme_op_sign_init_result (GpgmeCtx ctx)
} }
static GpgmeError static gpgme_error_t
sign_start (GpgmeCtx ctx, int synchronous, GpgmeData plain, GpgmeData sig, sign_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t plain, gpgme_data_t sig,
GpgmeSigMode mode) gpgme_sig_mode_t mode)
{ {
GpgmeError err; gpgme_error_t err;
err = _gpgme_op_reset (ctx, synchronous); err = _gpgme_op_reset (ctx, synchronous);
if (err) if (err)
@ -285,19 +285,19 @@ sign_start (GpgmeCtx ctx, int synchronous, GpgmeData plain, GpgmeData sig,
/* Sign the plaintext PLAIN and store the signature in SIG. */ /* Sign the plaintext PLAIN and store the signature in SIG. */
GpgmeError gpgme_error_t
gpgme_op_sign_start (GpgmeCtx ctx, GpgmeData plain, GpgmeData sig, gpgme_op_sign_start (gpgme_ctx_t ctx, gpgme_data_t plain, gpgme_data_t sig,
GpgmeSigMode mode) gpgme_sig_mode_t mode)
{ {
return sign_start (ctx, 0, plain, sig, mode); return sign_start (ctx, 0, plain, sig, mode);
} }
/* Sign the plaintext PLAIN and store the signature in SIG. */ /* Sign the plaintext PLAIN and store the signature in SIG. */
GpgmeError gpgme_error_t
gpgme_op_sign (GpgmeCtx ctx, GpgmeData plain, GpgmeData sig, GpgmeSigMode mode) gpgme_op_sign (gpgme_ctx_t ctx, gpgme_data_t plain, gpgme_data_t sig, gpgme_sig_mode_t mode)
{ {
GpgmeError err = sign_start (ctx, 1, plain, sig, mode); gpgme_error_t err = sign_start (ctx, 1, plain, sig, mode);
if (!err) if (!err)
err = _gpgme_wait_one (ctx); err = _gpgme_wait_one (ctx);
return err; return err;

View File

@ -35,7 +35,7 @@
/* Delete all signers from CTX. */ /* Delete all signers from CTX. */
void void
gpgme_signers_clear (GpgmeCtx ctx) gpgme_signers_clear (gpgme_ctx_t ctx)
{ {
int i; int i;
@ -52,15 +52,15 @@ gpgme_signers_clear (GpgmeCtx ctx)
} }
/* Add KEY to list of signers in CTX. */ /* Add KEY to list of signers in CTX. */
GpgmeError gpgme_error_t
gpgme_signers_add (GpgmeCtx ctx, const GpgmeKey key) gpgme_signers_add (gpgme_ctx_t ctx, const gpgme_key_t key)
{ {
if (!ctx || !key) if (!ctx || !key)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
if (ctx->signers_len == ctx->signers_size) if (ctx->signers_len == ctx->signers_size)
{ {
GpgmeKey *newarr; gpgme_key_t *newarr;
int n = ctx->signers_size + 5; int n = ctx->signers_size + 5;
int j; int j;
@ -80,8 +80,8 @@ gpgme_signers_add (GpgmeCtx ctx, const GpgmeKey key)
/* Return the SEQth signer's key in CTX with one reference. */ /* Return the SEQth signer's key in CTX with one reference. */
GpgmeKey gpgme_key_t
gpgme_signers_enum (const GpgmeCtx ctx, int seq) gpgme_signers_enum (const gpgme_ctx_t ctx, int seq)
{ {
if (!ctx || seq < 0) if (!ctx || seq < 0)
return NULL; return NULL;

View File

@ -37,10 +37,10 @@ DEFINE_STATIC_LOCK (trust_item_ref_lock);
/* Create a new trust item. */ /* Create a new trust item. */
GpgmeError gpgme_error_t
_gpgme_trust_item_new (GpgmeTrustItem *r_item) _gpgme_trust_item_new (gpgme_trust_item_t *r_item)
{ {
GpgmeTrustItem item; gpgme_trust_item_t item;
item = calloc (1, sizeof *item); item = calloc (1, sizeof *item);
if (!item) if (!item)
@ -59,7 +59,7 @@ _gpgme_trust_item_new (GpgmeTrustItem *r_item)
/* Acquire a reference to ITEM. */ /* Acquire a reference to ITEM. */
void void
gpgme_trust_item_ref (GpgmeTrustItem item) gpgme_trust_item_ref (gpgme_trust_item_t item)
{ {
LOCK (trust_item_ref_lock); LOCK (trust_item_ref_lock);
item->_refs++; item->_refs++;
@ -73,7 +73,7 @@ gpgme_trust_item_ref (GpgmeTrustItem item)
every newly created trust item object as well as for every every newly created trust item object as well as for every
gpgme_trust_item_ref() done on the trust item object. */ gpgme_trust_item_ref() done on the trust item object. */
void void
gpgme_trust_item_unref (GpgmeTrustItem item) gpgme_trust_item_unref (gpgme_trust_item_t item)
{ {
LOCK (trust_item_ref_lock); LOCK (trust_item_ref_lock);
assert (item->_refs > 0); assert (item->_refs > 0);
@ -92,15 +92,15 @@ gpgme_trust_item_unref (GpgmeTrustItem item)
/* Compatibility interfaces. */ /* Compatibility interfaces. */
void void
gpgme_trust_item_release (GpgmeTrustItem item) gpgme_trust_item_release (gpgme_trust_item_t item)
{ {
gpgme_trust_item_unref (item); gpgme_trust_item_unref (item);
} }
/* Return the value of the attribute WHAT of ITEM, which has to be /* Return the value of the attribute WHAT of ITEM, which has to be
representable by a string. */ representable by a string. */
const char *gpgme_trust_item_get_string_attr (GpgmeTrustItem item, const char *gpgme_trust_item_get_string_attr (gpgme_trust_item_t item,
GpgmeAttr what, _gpgme_attr_t what,
const void *reserved, int idx) const void *reserved, int idx)
{ {
const char *val = NULL; const char *val = NULL;
@ -140,7 +140,7 @@ const char *gpgme_trust_item_get_string_attr (GpgmeTrustItem item,
/* Return the value of the attribute WHAT of KEY, which has to be /* Return the value of the attribute WHAT of KEY, which has to be
representable by an integer. IDX specifies a running index if the representable by an integer. IDX specifies a running index if the
attribute appears more than once in the key. */ attribute appears more than once in the key. */
int gpgme_trust_item_get_int_attr (GpgmeTrustItem item, GpgmeAttr what, int gpgme_trust_item_get_int_attr (gpgme_trust_item_t item, _gpgme_attr_t what,
const void *reserved, int idx) const void *reserved, int idx)
{ {
int val = 0; int val = 0;

View File

@ -34,7 +34,7 @@
struct trust_queue_item_s struct trust_queue_item_s
{ {
struct trust_queue_item_s *next; struct trust_queue_item_s *next;
GpgmeTrustItem item; gpgme_trust_item_t item;
}; };
typedef struct typedef struct
@ -46,8 +46,8 @@ typedef struct
static GpgmeError static gpgme_error_t
trustlist_status_handler (void *priv, GpgmeStatusCode code, char *args) trustlist_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
return 0; return 0;
} }
@ -64,14 +64,14 @@ trustlist_status_handler (void *priv, GpgmeStatusCode code, char *args)
counter and only available on U lines CC is the same for the counter and only available on U lines CC is the same for the
complete count NAME ist the username and only printed on U complete count NAME ist the username and only printed on U
lines. */ lines. */
static GpgmeError static gpgme_error_t
trustlist_colon_handler (void *priv, char *line) trustlist_colon_handler (void *priv, char *line)
{ {
GpgmeCtx ctx = (GpgmeCtx) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
GpgmeError err; gpgme_error_t err;
char *p, *pend; char *p, *pend;
int field = 0; int field = 0;
GpgmeTrustItem item = NULL; gpgme_trust_item_t item = NULL;
if (!line) if (!line)
return 0; /* EOF */ return 0; /* EOF */
@ -121,12 +121,12 @@ trustlist_colon_handler (void *priv, char *line)
void void
_gpgme_op_trustlist_event_cb (void *data, GpgmeEventIO type, void *type_data) _gpgme_op_trustlist_event_cb (void *data, gpgme_event_io_t type, void *type_data)
{ {
GpgmeCtx ctx = (GpgmeCtx) data; gpgme_ctx_t ctx = (gpgme_ctx_t) data;
GpgmeError err; gpgme_error_t err;
op_data_t opd; op_data_t opd;
GpgmeTrustItem item = (GpgmeTrustItem) type_data; gpgme_trust_item_t item = (gpgme_trust_item_t) type_data;
struct trust_queue_item_s *q, *q2; struct trust_queue_item_s *q, *q2;
assert (type == GPGME_EVENT_NEXT_TRUSTITEM); assert (type == GPGME_EVENT_NEXT_TRUSTITEM);
@ -160,10 +160,10 @@ _gpgme_op_trustlist_event_cb (void *data, GpgmeEventIO type, void *type_data)
} }
GpgmeError gpgme_error_t
gpgme_op_trustlist_start (GpgmeCtx ctx, const char *pattern, int max_level) gpgme_op_trustlist_start (gpgme_ctx_t ctx, const char *pattern, int max_level)
{ {
GpgmeError err = 0; gpgme_error_t err = 0;
op_data_t opd; op_data_t opd;
if (!pattern || !*pattern) if (!pattern || !*pattern)
@ -189,10 +189,10 @@ gpgme_op_trustlist_start (GpgmeCtx ctx, const char *pattern, int max_level)
} }
GpgmeError gpgme_error_t
gpgme_op_trustlist_next (GpgmeCtx ctx, GpgmeTrustItem *r_item) gpgme_op_trustlist_next (gpgme_ctx_t ctx, gpgme_trust_item_t *r_item)
{ {
GpgmeError err; gpgme_error_t err;
op_data_t opd; op_data_t opd;
struct trust_queue_item_s *q; struct trust_queue_item_s *q;
@ -227,8 +227,8 @@ gpgme_op_trustlist_next (GpgmeCtx ctx, GpgmeTrustItem *r_item)
/* Terminate a pending trustlist operation within CTX. */ /* Terminate a pending trustlist operation within CTX. */
GpgmeError gpgme_error_t
gpgme_op_trustlist_end (GpgmeCtx ctx) gpgme_op_trustlist_end (gpgme_ctx_t ctx)
{ {
if (!ctx) if (!ctx)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;

View File

@ -72,7 +72,7 @@ int _gpgme_hextobyte (const unsigned char *str);
the result. Currently, LEN is only used to specify if allocation the result. Currently, LEN is only used to specify if allocation
is desired or not, the caller is expected to make sure that *DESTP is desired or not, the caller is expected to make sure that *DESTP
is large enough if LEN is not zero. */ is large enough if LEN is not zero. */
GpgmeError _gpgme_decode_c_string (const char *src, char **destp, int len); gpgme_error_t _gpgme_decode_c_string (const char *src, char **destp, int len);
/* Decode the percent escaped string SRC and store the result in the /* Decode the percent escaped string SRC and store the result in the
buffer *DESTP which is LEN bytes long. If LEN is zero, then a buffer *DESTP which is LEN bytes long. If LEN is zero, then a
@ -80,9 +80,9 @@ GpgmeError _gpgme_decode_c_string (const char *src, char **destp, int len);
the result. Currently, LEN is only used to specify if allocation the result. Currently, LEN is only used to specify if allocation
is desired or not, the caller is expected to make sure that *DESTP is desired or not, the caller is expected to make sure that *DESTP
is large enough if LEN is not zero. */ is large enough if LEN is not zero. */
GpgmeError _gpgme_decode_percent_string (const char *src, char **destp, gpgme_error_t _gpgme_decode_percent_string (const char *src, char **destp,
int len); int len);
GpgmeError _gpgme_map_gnupg_error (char *err); gpgme_error_t _gpgme_map_gnupg_error (char *err);
#endif /* UTIL_H */ #endif /* UTIL_H */

View File

@ -35,7 +35,7 @@ typedef struct
{ {
struct _gpgme_op_verify_result result; struct _gpgme_op_verify_result result;
GpgmeSignature current_sig; gpgme_signature_t current_sig;
} *op_data_t; } *op_data_t;
@ -43,16 +43,16 @@ static void
release_op_data (void *hook) release_op_data (void *hook)
{ {
op_data_t opd = (op_data_t) hook; op_data_t opd = (op_data_t) hook;
GpgmeSignature sig = opd->result.signatures; gpgme_signature_t sig = opd->result.signatures;
while (sig) while (sig)
{ {
GpgmeSignature next = sig->next; gpgme_signature_t next = sig->next;
GpgmeSigNotation notation = sig->notations; gpgme_sig_notation_t notation = sig->notations;
while (notation) while (notation)
{ {
GpgmeSigNotation next_nota = notation->next; gpgme_sig_notation_t next_nota = notation->next;
if (notation->name) if (notation->name)
free (notation->name); free (notation->name);
@ -69,11 +69,11 @@ release_op_data (void *hook)
} }
GpgmeVerifyResult gpgme_verify_result_t
gpgme_op_verify_result (GpgmeCtx ctx) gpgme_op_verify_result (gpgme_ctx_t ctx)
{ {
op_data_t opd; op_data_t opd;
GpgmeError err; gpgme_error_t err;
err = _gpgme_op_data_lookup (ctx, OPDATA_VERIFY, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_VERIFY, (void **) &opd, -1, NULL);
if (err || !opd) if (err || !opd)
@ -85,7 +85,7 @@ gpgme_op_verify_result (GpgmeCtx ctx)
/* Build a summary vector from RESULT. */ /* Build a summary vector from RESULT. */
static void static void
calc_sig_summary (GpgmeSignature sig) calc_sig_summary (gpgme_signature_t sig)
{ {
unsigned long sum = 0; unsigned long sum = 0;
@ -143,10 +143,10 @@ calc_sig_summary (GpgmeSignature sig)
} }
static GpgmeError static gpgme_error_t
parse_new_sig (op_data_t opd, GpgmeStatusCode code, char *args) parse_new_sig (op_data_t opd, gpgme_status_code_t code, char *args)
{ {
GpgmeSignature sig; gpgme_signature_t sig;
char *end = strchr (args, ' '); char *end = strchr (args, ' ');
if (end) if (end)
@ -225,8 +225,8 @@ parse_new_sig (op_data_t opd, GpgmeStatusCode code, char *args)
} }
static GpgmeError static gpgme_error_t
parse_valid_sig (GpgmeSignature sig, char *args) parse_valid_sig (gpgme_signature_t sig, char *args)
{ {
char *end = strchr (args, ' '); char *end = strchr (args, ' ');
@ -264,12 +264,12 @@ parse_valid_sig (GpgmeSignature sig, char *args)
} }
static GpgmeError static gpgme_error_t
parse_notation (GpgmeSignature sig, GpgmeStatusCode code, char *args) parse_notation (gpgme_signature_t sig, gpgme_status_code_t code, char *args)
{ {
GpgmeError err; gpgme_error_t err;
GpgmeSigNotation *lastp = &sig->notations; gpgme_sig_notation_t *lastp = &sig->notations;
GpgmeSigNotation notation = sig->notations; gpgme_sig_notation_t notation = sig->notations;
char *end = strchr (args, ' '); char *end = strchr (args, ' ');
if (end) if (end)
@ -370,8 +370,8 @@ parse_notation (GpgmeSignature sig, GpgmeStatusCode code, char *args)
} }
static GpgmeError static gpgme_error_t
parse_trust (GpgmeSignature sig, GpgmeStatusCode code, char *args) parse_trust (gpgme_signature_t sig, gpgme_status_code_t code, char *args)
{ {
char *end = strchr (args, ' '); char *end = strchr (args, ' ');
@ -406,10 +406,10 @@ parse_trust (GpgmeSignature sig, GpgmeStatusCode code, char *args)
} }
static GpgmeError static gpgme_error_t
parse_error (GpgmeSignature sig, char *args) parse_error (gpgme_signature_t sig, char *args)
{ {
GpgmeError err; gpgme_error_t err;
char *where = strchr (args, ' '); char *where = strchr (args, ' ');
char *which; char *which;
@ -438,13 +438,13 @@ parse_error (GpgmeSignature sig, char *args)
} }
GpgmeError gpgme_error_t
_gpgme_verify_status_handler (void *priv, GpgmeStatusCode code, char *args) _gpgme_verify_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
GpgmeCtx ctx = (GpgmeCtx) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
GpgmeError err; gpgme_error_t err;
op_data_t opd; op_data_t opd;
GpgmeSignature sig; gpgme_signature_t sig;
err = _gpgme_op_data_lookup (ctx, OPDATA_VERIFY, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_VERIFY, (void **) &opd, -1, NULL);
if (err) if (err)
@ -505,8 +505,8 @@ _gpgme_verify_status_handler (void *priv, GpgmeStatusCode code, char *args)
} }
GpgmeError gpgme_error_t
_gpgme_op_verify_init_result (GpgmeCtx ctx) _gpgme_op_verify_init_result (gpgme_ctx_t ctx)
{ {
op_data_t opd; op_data_t opd;
@ -515,11 +515,11 @@ _gpgme_op_verify_init_result (GpgmeCtx ctx)
} }
static GpgmeError static gpgme_error_t
_gpgme_op_verify_start (GpgmeCtx ctx, int synchronous, GpgmeData sig, _gpgme_op_verify_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t sig,
GpgmeData signed_text, GpgmeData plaintext) gpgme_data_t signed_text, gpgme_data_t plaintext)
{ {
GpgmeError err; gpgme_error_t err;
err = _gpgme_op_reset (ctx, synchronous); err = _gpgme_op_reset (ctx, synchronous);
if (err) if (err)
@ -543,9 +543,9 @@ _gpgme_op_verify_start (GpgmeCtx ctx, int synchronous, GpgmeData sig,
/* Decrypt ciphertext CIPHER and make a signature verification within /* Decrypt ciphertext CIPHER and make a signature verification within
CTX and store the resulting plaintext in PLAIN. */ CTX and store the resulting plaintext in PLAIN. */
GpgmeError gpgme_error_t
gpgme_op_verify_start (GpgmeCtx ctx, GpgmeData sig, GpgmeData signed_text, gpgme_op_verify_start (gpgme_ctx_t ctx, gpgme_data_t sig, gpgme_data_t signed_text,
GpgmeData plaintext) gpgme_data_t plaintext)
{ {
return _gpgme_op_verify_start (ctx, 0, sig, signed_text, plaintext); return _gpgme_op_verify_start (ctx, 0, sig, signed_text, plaintext);
} }
@ -553,11 +553,11 @@ gpgme_op_verify_start (GpgmeCtx ctx, GpgmeData sig, GpgmeData signed_text,
/* Decrypt ciphertext CIPHER and make a signature verification within /* Decrypt ciphertext CIPHER and make a signature verification within
CTX and store the resulting plaintext in PLAIN. */ CTX and store the resulting plaintext in PLAIN. */
GpgmeError gpgme_error_t
gpgme_op_verify (GpgmeCtx ctx, GpgmeData sig, GpgmeData signed_text, gpgme_op_verify (gpgme_ctx_t ctx, gpgme_data_t sig, gpgme_data_t signed_text,
GpgmeData plaintext) gpgme_data_t plaintext)
{ {
GpgmeError err; gpgme_error_t err;
err = _gpgme_op_verify_start (ctx, 1, sig, signed_text, plaintext); err = _gpgme_op_verify_start (ctx, 1, sig, signed_text, plaintext);
if (!err) if (!err)
@ -570,11 +570,11 @@ gpgme_op_verify (GpgmeCtx ctx, GpgmeData sig, GpgmeData signed_text,
/* Get the key used to create signature IDX in CTX and return it in /* Get the key used to create signature IDX in CTX and return it in
R_KEY. */ R_KEY. */
GpgmeError gpgme_error_t
gpgme_get_sig_key (GpgmeCtx ctx, int idx, GpgmeKey *r_key) gpgme_get_sig_key (gpgme_ctx_t ctx, int idx, gpgme_key_t *r_key)
{ {
GpgmeVerifyResult result; gpgme_verify_result_t result;
GpgmeSignature sig; gpgme_signature_t sig;
result = gpgme_op_verify_result (ctx); result = gpgme_op_verify_result (ctx);
sig = result->signatures; sig = result->signatures;
@ -595,11 +595,11 @@ gpgme_get_sig_key (GpgmeCtx ctx, int idx, GpgmeKey *r_key)
successful verify operation in R_STAT (if non-null). The creation successful verify operation in R_STAT (if non-null). The creation
time stamp of the signature is returned in R_CREATED (if non-null). time stamp of the signature is returned in R_CREATED (if non-null).
The function returns a string containing the fingerprint. */ The function returns a string containing the fingerprint. */
const char *gpgme_get_sig_status (GpgmeCtx ctx, int idx, const char *gpgme_get_sig_status (gpgme_ctx_t ctx, int idx,
GpgmeSigStat *r_stat, time_t *r_created) _gpgme_sig_stat_t *r_stat, time_t *r_created)
{ {
GpgmeVerifyResult result; gpgme_verify_result_t result;
GpgmeSignature sig; gpgme_signature_t sig;
result = gpgme_op_verify_result (ctx); result = gpgme_op_verify_result (ctx);
sig = result->signatures; sig = result->signatures;
@ -655,11 +655,11 @@ const char *gpgme_get_sig_status (GpgmeCtx ctx, int idx,
number of the signature after a successful verify operation. WHAT number of the signature after a successful verify operation. WHAT
is an attribute where GPGME_ATTR_EXPIRE is probably the most useful is an attribute where GPGME_ATTR_EXPIRE is probably the most useful
one. WHATIDX is to be passed as 0 for most attributes . */ one. WHATIDX is to be passed as 0 for most attributes . */
unsigned long gpgme_get_sig_ulong_attr (GpgmeCtx ctx, int idx, unsigned long gpgme_get_sig_ulong_attr (gpgme_ctx_t ctx, int idx,
GpgmeAttr what, int whatidx) _gpgme_attr_t what, int whatidx)
{ {
GpgmeVerifyResult result; gpgme_verify_result_t result;
GpgmeSignature sig; gpgme_signature_t sig;
result = gpgme_op_verify_result (ctx); result = gpgme_op_verify_result (ctx);
sig = result->signatures; sig = result->signatures;
@ -718,11 +718,11 @@ unsigned long gpgme_get_sig_ulong_attr (GpgmeCtx ctx, int idx,
} }
const char *gpgme_get_sig_string_attr (GpgmeCtx ctx, int idx, const char *gpgme_get_sig_string_attr (gpgme_ctx_t ctx, int idx,
GpgmeAttr what, int whatidx) _gpgme_attr_t what, int whatidx)
{ {
GpgmeVerifyResult result; gpgme_verify_result_t result;
GpgmeSignature sig; gpgme_signature_t sig;
result = gpgme_op_verify_result (ctx); result = gpgme_op_verify_result (ctx);
sig = result->signatures; sig = result->signatures;

View File

@ -68,9 +68,9 @@ struct ctx_list_item
struct ctx_list_item *next; struct ctx_list_item *next;
struct ctx_list_item *prev; struct ctx_list_item *prev;
GpgmeCtx ctx; gpgme_ctx_t ctx;
/* The status is set when the ctx is moved to the done list. */ /* The status is set when the ctx is moved to the done list. */
GpgmeError status; gpgme_error_t status;
}; };
/* The active list contains all contexts that are in the global event /* The active list contains all contexts that are in the global event
@ -87,8 +87,8 @@ static struct ctx_list_item *ctx_done_list;
/* Enter the context CTX into the active list. */ /* Enter the context CTX into the active list. */
static GpgmeError static gpgme_error_t
ctx_active (GpgmeCtx ctx) ctx_active (gpgme_ctx_t ctx)
{ {
struct ctx_list_item *li = malloc (sizeof (struct ctx_list_item)); struct ctx_list_item *li = malloc (sizeof (struct ctx_list_item));
if (!li) if (!li)
@ -109,7 +109,7 @@ ctx_active (GpgmeCtx ctx)
/* Enter the context CTX into the done list with status STATUS. */ /* Enter the context CTX into the done list with status STATUS. */
static void static void
ctx_done (GpgmeCtx ctx, GpgmeError status) ctx_done (gpgme_ctx_t ctx, gpgme_error_t status)
{ {
struct ctx_list_item *li; struct ctx_list_item *li;
@ -143,8 +143,8 @@ ctx_done (GpgmeCtx ctx, GpgmeError status)
return its status in STATUS after removing it from the done list. return its status in STATUS after removing it from the done list.
If a matching context could be found, return it. Return NULL if no If a matching context could be found, return it. Return NULL if no
context could be found. */ context could be found. */
static GpgmeCtx static gpgme_ctx_t
ctx_wait (GpgmeCtx ctx, GpgmeError *status) ctx_wait (gpgme_ctx_t ctx, gpgme_error_t *status)
{ {
struct ctx_list_item *li; struct ctx_list_item *li;
@ -184,9 +184,9 @@ ctx_wait (GpgmeCtx ctx, GpgmeError *status)
event loops. */ event loops. */
void void
_gpgme_wait_global_event_cb (void *data, GpgmeEventIO type, void *type_data) _gpgme_wait_global_event_cb (void *data, gpgme_event_io_t type, void *type_data)
{ {
GpgmeCtx ctx = (GpgmeCtx) data; gpgme_ctx_t ctx = (gpgme_ctx_t) data;
assert (ctx); assert (ctx);
@ -194,7 +194,7 @@ _gpgme_wait_global_event_cb (void *data, GpgmeEventIO type, void *type_data)
{ {
case GPGME_EVENT_START: case GPGME_EVENT_START:
{ {
GpgmeError err = ctx_active (ctx); gpgme_error_t err = ctx_active (ctx);
if (err) if (err)
{ {
@ -212,7 +212,7 @@ _gpgme_wait_global_event_cb (void *data, GpgmeEventIO type, void *type_data)
case GPGME_EVENT_DONE: case GPGME_EVENT_DONE:
{ {
GpgmeError *errp = (GpgmeError *) type_data; gpgme_error_t *errp = (gpgme_error_t *) type_data;
assert (errp); assert (errp);
ctx_done (ctx, *errp); ctx_done (ctx, *errp);
} }
@ -248,8 +248,8 @@ _gpgme_wait_global_event_cb (void *data, GpgmeEventIO type, void *type_data)
the timeout expires, NULL is returned and *STATUS is 0. If an the timeout expires, NULL is returned and *STATUS is 0. If an
error occurs, NULL is returned and *STATUS is set to the error error occurs, NULL is returned and *STATUS is set to the error
value. */ value. */
GpgmeCtx gpgme_ctx_t
gpgme_wait (GpgmeCtx ctx, GpgmeError *status, int hang) gpgme_wait (gpgme_ctx_t ctx, gpgme_error_t *status, int hang)
{ {
do do
{ {
@ -293,8 +293,8 @@ gpgme_wait (GpgmeCtx ctx, GpgmeError *status, int hang)
{ {
if (fdt.fds[i].fd != -1 && fdt.fds[i].signaled) if (fdt.fds[i].fd != -1 && fdt.fds[i].signaled)
{ {
GpgmeCtx ictx; gpgme_ctx_t ictx;
GpgmeError err; gpgme_error_t err;
struct wait_item_s *item; struct wait_item_s *item;
assert (nr); assert (nr);
@ -330,14 +330,14 @@ gpgme_wait (GpgmeCtx ctx, GpgmeError *status, int hang)
break; break;
if (i == ctx->fdt.size) if (i == ctx->fdt.size)
{ {
GpgmeError err = 0; gpgme_error_t err = 0;
_gpgme_engine_io_event (ctx->engine, GPGME_EVENT_DONE, &err); _gpgme_engine_io_event (ctx->engine, GPGME_EVENT_DONE, &err);
} }
} }
UNLOCK (ctx_list_lock); UNLOCK (ctx_list_lock);
{ {
GpgmeCtx dctx = ctx_wait (ctx, status); gpgme_ctx_t dctx = ctx_wait (ctx, status);
if (dctx) if (dctx)
{ {

View File

@ -42,7 +42,7 @@
event loops. */ event loops. */
void void
_gpgme_wait_private_event_cb (void *data, GpgmeEventIO type, void *type_data) _gpgme_wait_private_event_cb (void *data, gpgme_event_io_t type, void *type_data)
{ {
switch (type) switch (type)
{ {
@ -68,10 +68,10 @@ _gpgme_wait_private_event_cb (void *data, GpgmeEventIO type, void *type_data)
/* If COND is a null pointer, wait until the blocking operation in CTX /* If COND is a null pointer, wait until the blocking operation in CTX
finished and return its error value. Otherwise, wait until COND is finished and return its error value. Otherwise, wait until COND is
satisfied or the operation finished. */ satisfied or the operation finished. */
GpgmeError gpgme_error_t
_gpgme_wait_on_condition (GpgmeCtx ctx, volatile int *cond) _gpgme_wait_on_condition (gpgme_ctx_t ctx, volatile int *cond)
{ {
GpgmeError err = 0; gpgme_error_t err = 0;
int hang = 1; int hang = 1;
do do
@ -141,8 +141,8 @@ _gpgme_wait_on_condition (GpgmeCtx ctx, volatile int *cond)
/* Wait until the blocking operation in context CTX has finished and /* Wait until the blocking operation in context CTX has finished and
return the error value. */ return the error value. */
GpgmeError gpgme_error_t
_gpgme_wait_one (GpgmeCtx ctx) _gpgme_wait_one (gpgme_ctx_t ctx)
{ {
return _gpgme_wait_on_condition (ctx, NULL); return _gpgme_wait_on_condition (ctx, NULL);
} }

View File

@ -35,12 +35,12 @@
/* Internal I/O Callbacks. */ /* Internal I/O Callbacks. */
GpgmeError gpgme_error_t
_gpgme_user_io_cb_handler (void *data, int fd) _gpgme_user_io_cb_handler (void *data, int fd)
{ {
GpgmeError err; gpgme_error_t err;
struct tag *tag = (struct tag *) data; struct tag *tag = (struct tag *) data;
GpgmeCtx ctx; gpgme_ctx_t ctx;
struct wait_item_s *item; struct wait_item_s *item;
assert (data); assert (data);
@ -77,13 +77,13 @@ _gpgme_user_io_cb_handler (void *data, int fd)
FNC_DATA as its first argument) for the direction DIR. DATA should FNC_DATA as its first argument) for the direction DIR. DATA should
be the context for which the fd is added. R_TAG will hold the tag be the context for which the fd is added. R_TAG will hold the tag
that can be used to remove the fd. */ that can be used to remove the fd. */
GpgmeError gpgme_error_t
_gpgme_wait_user_add_io_cb (void *data, int fd, int dir, GpgmeIOCb fnc, _gpgme_wait_user_add_io_cb (void *data, int fd, int dir, gpgme_io_cb_t fnc,
void *fnc_data, void **r_tag) void *fnc_data, void **r_tag)
{ {
GpgmeCtx ctx = (GpgmeCtx) data; gpgme_ctx_t ctx = (gpgme_ctx_t) data;
struct tag *tag; struct tag *tag;
GpgmeError err; gpgme_error_t err;
assert (ctx); assert (ctx);
err = _gpgme_add_io_cb (data, fd, dir, fnc, fnc_data, r_tag); err = _gpgme_add_io_cb (data, fd, dir, fnc, fnc_data, r_tag);
@ -104,7 +104,7 @@ void
_gpgme_wait_user_remove_io_cb (void *data) _gpgme_wait_user_remove_io_cb (void *data)
{ {
struct tag *tag = (struct tag *) data; struct tag *tag = (struct tag *) data;
GpgmeCtx ctx; gpgme_ctx_t ctx;
assert (tag); assert (tag);
ctx = tag->ctx; ctx = tag->ctx;
@ -115,9 +115,9 @@ _gpgme_wait_user_remove_io_cb (void *data)
void void
_gpgme_wait_user_event_cb (void *data, GpgmeEventIO type, void *type_data) _gpgme_wait_user_event_cb (void *data, gpgme_event_io_t type, void *type_data)
{ {
GpgmeCtx ctx = data; gpgme_ctx_t ctx = data;
if (ctx->io_cbs.event) if (ctx->io_cbs.event)
(*ctx->io_cbs.event) (ctx->io_cbs.event_priv, type, type_data); (*ctx->io_cbs.event) (ctx->io_cbs.event_priv, type, type_data);

View File

@ -53,7 +53,7 @@ _gpgme_fd_table_deinit (fd_table_t fdt)
/* XXX We should keep a marker and roll over for speed. */ /* XXX We should keep a marker and roll over for speed. */
static GpgmeError static gpgme_error_t
fd_table_put (fd_table_t fdt, int fd, int dir, void *opaque, int *idx) fd_table_put (fd_table_t fdt, int fd, int dir, void *opaque, int *idx)
{ {
int i, j; int i, j;
@ -93,12 +93,12 @@ fd_table_put (fd_table_t fdt, int fd, int dir, void *opaque, int *idx)
FNC_DATA as its first argument) for the direction DIR. DATA should FNC_DATA as its first argument) for the direction DIR. DATA should
be the context for which the fd is added. R_TAG will hold the tag be the context for which the fd is added. R_TAG will hold the tag
that can be used to remove the fd. */ that can be used to remove the fd. */
GpgmeError gpgme_error_t
_gpgme_add_io_cb (void *data, int fd, int dir, GpgmeIOCb fnc, void *fnc_data, _gpgme_add_io_cb (void *data, int fd, int dir, gpgme_io_cb_t fnc,
void **r_tag) void *fnc_data, void **r_tag)
{ {
GpgmeError err; gpgme_error_t err;
GpgmeCtx ctx = (GpgmeCtx) data; gpgme_ctx_t ctx = (gpgme_ctx_t) data;
fd_table_t fdt; fd_table_t fdt;
struct wait_item_s *item; struct wait_item_s *item;
struct tag *tag; struct tag *tag;
@ -143,7 +143,7 @@ void
_gpgme_remove_io_cb (void *data) _gpgme_remove_io_cb (void *data)
{ {
struct tag *tag = data; struct tag *tag = data;
GpgmeCtx ctx; gpgme_ctx_t ctx;
fd_table_t fdt; fd_table_t fdt;
int idx; int idx;

View File

@ -35,8 +35,8 @@ typedef struct fd_table *fd_table_t;
a callback handler. */ a callback handler. */
struct wait_item_s struct wait_item_s
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeIOCb handler; gpgme_io_cb_t handler;
void *handler_value; void *handler_value;
int dir; int dir;
}; };
@ -46,7 +46,7 @@ struct wait_item_s
struct tag struct tag
{ {
/* The context for which the fd was registered. */ /* The context for which the fd was registered. */
GpgmeCtx ctx; gpgme_ctx_t ctx;
/* The index into the fd table for this context. */ /* The index into the fd table for this context. */
int idx; int idx;
@ -59,17 +59,18 @@ struct tag
void _gpgme_fd_table_init (fd_table_t fdt); void _gpgme_fd_table_init (fd_table_t fdt);
void _gpgme_fd_table_deinit (fd_table_t fdt); void _gpgme_fd_table_deinit (fd_table_t fdt);
GpgmeError _gpgme_add_io_cb (void *data, int fd, int dir, gpgme_error_t _gpgme_add_io_cb (void *data, int fd, int dir,
GpgmeIOCb fnc, void *fnc_data, void **r_tag); gpgme_io_cb_t fnc, void *fnc_data, void **r_tag);
void _gpgme_remove_io_cb (void *tag); void _gpgme_remove_io_cb (void *tag);
void _gpgme_wait_private_event_cb (void *data, GpgmeEventIO type, void *type_data); void _gpgme_wait_private_event_cb (void *data, gpgme_event_io_t type, void *type_data);
void _gpgme_wait_global_event_cb (void *data, GpgmeEventIO type, void *type_data); void _gpgme_wait_global_event_cb (void *data, gpgme_event_io_t type, void *type_data);
GpgmeError _gpgme_wait_user_add_io_cb (void *data, int fd, int dir, gpgme_error_t _gpgme_wait_user_add_io_cb (void *data, int fd, int dir,
GpgmeIOCb fnc, void *fnc_data, void **r_tag); gpgme_io_cb_t fnc, void *fnc_data,
void **r_tag);
void _gpgme_wait_user_remove_io_cb (void *tag); void _gpgme_wait_user_remove_io_cb (void *tag);
void _gpgme_wait_user_event_cb (void *data, GpgmeEventIO type, void *type_data); void _gpgme_wait_user_event_cb (void *data, gpgme_event_io_t type, void *type_data);
GpgmeError _gpgme_wait_one (GpgmeCtx ctx); gpgme_error_t _gpgme_wait_one (gpgme_ctx_t ctx);
#endif /* WAIT_H */ #endif /* WAIT_H */

View File

@ -31,7 +31,7 @@
{ \ { \
if (err) \ if (err) \
{ \ { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror (err)); \ __FILE__, __LINE__, gpgme_strerror (err)); \
exit (1); \ exit (1); \
} \ } \
@ -40,7 +40,7 @@
static void static void
print_data (GpgmeData dh) print_data (gpgme_data_t dh)
{ {
#define BUF_SIZE 512 #define BUF_SIZE 512
char buf[BUF_SIZE + 1]; char buf[BUF_SIZE + 1];
@ -56,7 +56,7 @@ print_data (GpgmeData dh)
} }
static GpgmeError static gpgme_error_t
passphrase_cb (void *opaque, const char *desc, void **hd, const char **result) passphrase_cb (void *opaque, const char *desc, void **hd, const char **result)
{ {
/* Cleanup by looking at *hd. */ /* Cleanup by looking at *hd. */
@ -91,10 +91,10 @@ make_filename (const char *fname)
static void static void
check_verify_result (GpgmeVerifyResult result, int summary, char *fpr, check_verify_result (gpgme_verify_result_t result, int summary, char *fpr,
GpgmeError status) gpgme_error_t status)
{ {
GpgmeSignature sig; gpgme_signature_t sig;
sig = result->signatures; sig = result->signatures;
if (!sig || sig->next) if (!sig || sig->next)
@ -151,11 +151,11 @@ check_verify_result (GpgmeVerifyResult result, int summary, char *fpr,
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
GpgmeData in, out; gpgme_data_t in, out;
GpgmeDecryptResult decrypt_result; gpgme_decrypt_result_t decrypt_result;
GpgmeVerifyResult verify_result; gpgme_verify_result_t verify_result;
const char *cipher_2_asc = make_filename ("cipher-2.asc"); const char *cipher_2_asc = make_filename ("cipher-2.asc");
char *agent_info; char *agent_info;

View File

@ -30,7 +30,7 @@
{ \ { \
if (err) \ if (err) \
{ \ { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror (err)); \ __FILE__, __LINE__, gpgme_strerror (err)); \
exit (1); \ exit (1); \
} \ } \
@ -39,7 +39,7 @@
static void static void
print_data (GpgmeData dh) print_data (gpgme_data_t dh)
{ {
#define BUF_SIZE 512 #define BUF_SIZE 512
char buf[BUF_SIZE + 1]; char buf[BUF_SIZE + 1];
@ -55,7 +55,7 @@ print_data (GpgmeData dh)
} }
static GpgmeError static gpgme_error_t
passphrase_cb (void *opaque, const char *desc, void **hd, const char **result) passphrase_cb (void *opaque, const char *desc, void **hd, const char **result)
{ {
/* Cleanup by looking at *hd. */ /* Cleanup by looking at *hd. */
@ -92,10 +92,10 @@ make_filename (const char *fname)
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
GpgmeData in, out; gpgme_data_t in, out;
GpgmeDecryptResult result; gpgme_decrypt_result_t result;
const char *cipher_1_asc = make_filename ("cipher-1.asc"); const char *cipher_1_asc = make_filename ("cipher-1.asc");
char *agent_info; char *agent_info;

View File

@ -28,13 +28,13 @@
#include <gpgme.h> #include <gpgme.h>
struct passphrase_cb_info_s { struct passphrase_cb_info_s {
GpgmeCtx c; gpgme_ctx_t c;
int did_it; int did_it;
}; };
#define fail_if_err(a) do { if(a) { int my_errno = errno; \ #define fail_if_err(a) do { if(a) { int my_errno = errno; \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror(a)); \ __FILE__, __LINE__, gpgme_strerror(a)); \
if ((a) == GPGME_File_Error) \ if ((a) == GPGME_File_Error) \
fprintf (stderr, "\terrno=`%s'\n", strerror (my_errno)); \ fprintf (stderr, "\terrno=`%s'\n", strerror (my_errno)); \
@ -42,7 +42,7 @@ struct passphrase_cb_info_s {
} while(0) } while(0)
static void static void
flush_data (GpgmeData dh) flush_data (gpgme_data_t dh)
{ {
char buf[100]; char buf[100];
int ret; int ret;
@ -57,7 +57,7 @@ flush_data (GpgmeData dh)
} }
static GpgmeError static gpgme_error_t
passphrase_cb (void *opaque, const char *desc, passphrase_cb (void *opaque, const char *desc,
void **r_hd, const char **result) void **r_hd, const char **result)
{ {
@ -73,10 +73,10 @@ passphrase_cb (void *opaque, const char *desc,
} }
GpgmeError gpgme_error_t
edit_fnc (void *opaque, GpgmeStatusCode status, const char *args, const char **result) edit_fnc (void *opaque, gpgme_status_code_t status, const char *args, const char **result)
{ {
GpgmeData out = (GpgmeData) opaque; gpgme_data_t out = (gpgme_data_t) opaque;
fputs ("[-- Response --]\n", stdout); fputs ("[-- Response --]\n", stdout);
flush_data (out); flush_data (out);
@ -120,10 +120,10 @@ edit_fnc (void *opaque, GpgmeStatusCode status, const char *args, const char **r
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
GpgmeData out = NULL; gpgme_data_t out = NULL;
GpgmeKey key = NULL; gpgme_key_t key = NULL;
struct passphrase_cb_info_s info; struct passphrase_cb_info_s info;
const char *pattern = "Alpha"; const char *pattern = "Alpha";
char *p; char *p;

View File

@ -29,7 +29,7 @@
{ \ { \
if (err) \ if (err) \
{ \ { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror (err)); \ __FILE__, __LINE__, gpgme_strerror (err)); \
exit (1); \ exit (1); \
} \ } \
@ -38,7 +38,7 @@
static void static void
print_data (GpgmeData dh) print_data (gpgme_data_t dh)
{ {
#define BUF_SIZE 512 #define BUF_SIZE 512
char buf[BUF_SIZE + 1]; char buf[BUF_SIZE + 1];
@ -54,7 +54,7 @@ print_data (GpgmeData dh)
} }
static GpgmeError static gpgme_error_t
passphrase_cb (void *opaque, const char *desc, void **hd, const char **result) passphrase_cb (void *opaque, const char *desc, void **hd, const char **result)
{ {
/* Cleanup by looking at *hd. */ /* Cleanup by looking at *hd. */
@ -67,7 +67,7 @@ passphrase_cb (void *opaque, const char *desc, void **hd, const char **result)
static void static void
check_result (GpgmeSignResult result, GpgmeSigMode type) check_result (gpgme_sign_result_t result, gpgme_sig_mode_t type)
{ {
if (result->invalid_signers) if (result->invalid_signers)
{ {
@ -116,12 +116,12 @@ check_result (GpgmeSignResult result, GpgmeSigMode type)
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
GpgmeData in, out; gpgme_data_t in, out;
GpgmeRecipients rset; gpgme_recipients_t rset;
GpgmeEncryptResult result; gpgme_encrypt_result_t result;
GpgmeSignResult sign_result; gpgme_sign_result_t sign_result;
char *agent_info; char *agent_info;
err = gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP); err = gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP);

View File

@ -27,13 +27,13 @@
#include <gpgme.h> #include <gpgme.h>
#define fail_if_err(a) do { if(a) { \ #define fail_if_err(a) do { if(a) { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror(a)); \ __FILE__, __LINE__, gpgme_strerror(a)); \
exit (1); } \ exit (1); } \
} while(0) } while(0)
static void static void
print_data (GpgmeData dh) print_data (gpgme_data_t dh)
{ {
char buf[100]; char buf[100];
int ret; int ret;
@ -47,7 +47,7 @@ print_data (GpgmeData dh)
fail_if_err (GPGME_File_Error); fail_if_err (GPGME_File_Error);
} }
static GpgmeError static gpgme_error_t
passphrase_cb (void *opaque, const char *desc, passphrase_cb (void *opaque, const char *desc,
void **r_hd, const char **result) void **r_hd, const char **result)
{ {
@ -66,9 +66,9 @@ passphrase_cb (void *opaque, const char *desc,
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
GpgmeData plain, cipher; gpgme_data_t plain, cipher;
const char *text = "Hallo Leute\n"; const char *text = "Hallo Leute\n";
char *text2; char *text2;
char *p; char *p;
@ -101,8 +101,7 @@ main (int argc, char **argv)
print_data (cipher); print_data (cipher);
fputs ("End Result.\n", stdout); fputs ("End Result.\n", stdout);
err = gpgme_data_rewind (cipher); gpgme_data_seek (cipher, 0, SEEK_SET);
fail_if_err (err);
gpgme_data_release (plain); gpgme_data_release (plain);
err = gpgme_data_new (&plain); err = gpgme_data_new (&plain);

View File

@ -29,7 +29,7 @@
{ \ { \
if (err) \ if (err) \
{ \ { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror (err)); \ __FILE__, __LINE__, gpgme_strerror (err)); \
exit (1); \ exit (1); \
} \ } \
@ -38,7 +38,7 @@
static void static void
print_data (GpgmeData dh) print_data (gpgme_data_t dh)
{ {
#define BUF_SIZE 512 #define BUF_SIZE 512
char buf[BUF_SIZE + 1]; char buf[BUF_SIZE + 1];
@ -57,11 +57,11 @@ print_data (GpgmeData dh)
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
GpgmeData in, out; gpgme_data_t in, out;
GpgmeRecipients rset; gpgme_recipients_t rset;
GpgmeEncryptResult result; gpgme_encrypt_result_t result;
err = gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP); err = gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP);
fail_if_err (err); fail_if_err (err);

View File

@ -28,13 +28,13 @@
#include <gpgme.h> #include <gpgme.h>
#define fail_if_err(a) do { if(a) { \ #define fail_if_err(a) do { if(a) { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror(a)); \ __FILE__, __LINE__, gpgme_strerror(a)); \
exit (1); } \ exit (1); } \
} while(0) } while(0)
static void static void
print_data (GpgmeData dh) print_data (gpgme_data_t dh)
{ {
char buf[100]; char buf[100];
int ret; int ret;
@ -54,7 +54,7 @@ print_data (GpgmeData dh)
struct op_result struct op_result
{ {
int done; int done;
GpgmeError err; gpgme_error_t err;
}; };
struct op_result op_result; struct op_result op_result;
@ -63,15 +63,15 @@ struct one_fd
{ {
int fd; int fd;
int dir; int dir;
GpgmeIOCb fnc; gpgme_io_cb_t fnc;
void *fnc_data; void *fnc_data;
}; };
#define FDLIST_MAX 32 #define FDLIST_MAX 32
struct one_fd fdlist[FDLIST_MAX]; struct one_fd fdlist[FDLIST_MAX];
GpgmeError gpgme_error_t
add_io_cb (void *data, int fd, int dir, GpgmeIOCb fnc, void *fnc_data, add_io_cb (void *data, int fd, int dir, gpgme_io_cb_t fnc, void *fnc_data,
void **r_tag) void **r_tag)
{ {
struct one_fd *fds = data; struct one_fd *fds = data;
@ -103,14 +103,14 @@ remove_io_cb (void *tag)
} }
void void
io_event (void *data, GpgmeEventIO type, void *type_data) io_event (void *data, gpgme_event_io_t type, void *type_data)
{ {
struct op_result *result = data; struct op_result *result = data;
if (type == GPGME_EVENT_DONE) if (type == GPGME_EVENT_DONE)
{ {
result->done = 1; result->done = 1;
result->err = * (GpgmeError *) type_data; result->err = * (gpgme_error_t *) type_data;
} }
} }
@ -166,7 +166,7 @@ my_wait (void)
return 0; return 0;
} }
struct GpgmeIOCbs io_cbs = struct gpgme_io_cbs io_cbs =
{ {
add_io_cb, add_io_cb,
fdlist, fdlist,
@ -178,10 +178,10 @@ struct GpgmeIOCbs io_cbs =
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
GpgmeData in, out; gpgme_data_t in, out;
GpgmeRecipients rset; gpgme_recipients_t rset;
int i; int i;
for (i = 0; i < FDLIST_MAX; i++) for (i = 0; i < FDLIST_MAX; i++)

View File

@ -27,14 +27,14 @@
#include <gpgme.h> #include <gpgme.h>
#define fail_if_err(a) do { if(a) { \ #define fail_if_err(a) do { if(a) { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror(a)); \ __FILE__, __LINE__, gpgme_strerror(a)); \
exit (1); } \ exit (1); } \
} while(0) } while(0)
static void static void
print_data (GpgmeData dh) print_data (gpgme_data_t dh)
{ {
char buf[100]; char buf[100];
int ret; int ret;
@ -51,10 +51,10 @@ print_data (GpgmeData dh)
int int
main (int argc, char **argv ) main (int argc, char **argv )
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
GpgmeData out; gpgme_data_t out;
GpgmeRecipients rset; gpgme_recipients_t rset;
do { do {
err = gpgme_new (&ctx); err = gpgme_new (&ctx);

View File

@ -29,7 +29,7 @@
{ \ { \
if (err) \ if (err) \
{ \ { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror (err)); \ __FILE__, __LINE__, gpgme_strerror (err)); \
exit (1); \ exit (1); \
} \ } \
@ -62,8 +62,8 @@ progress (void *self, const char *what, int type, int current, int total)
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
const char *parms = "<GnupgKeyParms format=\"internal\">\n" const char *parms = "<GnupgKeyParms format=\"internal\">\n"
"Key-Type: DSA\n" "Key-Type: DSA\n"
"Key-Length: 1024\n" "Key-Length: 1024\n"
@ -75,7 +75,7 @@ main (int argc, char **argv)
"Expire-Date: 0\n" "Expire-Date: 0\n"
"Passphrase: abc\n" "Passphrase: abc\n"
"</GnupgKeyParms>\n"; "</GnupgKeyParms>\n";
GpgmeGenKeyResult result; gpgme_genkey_result_t result;
err = gpgme_new (&ctx); err = gpgme_new (&ctx);
fail_if_err (err); fail_if_err (err);

View File

@ -31,7 +31,7 @@
{ \ { \
if (err) \ if (err) \
{ \ { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror (err)); \ __FILE__, __LINE__, gpgme_strerror (err)); \
exit (1); \ exit (1); \
} \ } \
@ -58,7 +58,7 @@ mk_fname (const char *fname)
void void
check_result (GpgmeImportResult result, char *fpr, int secret) check_result (gpgme_import_result_t result, char *fpr, int secret)
{ {
if (result->considered != 1) if (result->considered != 1)
{ {
@ -183,10 +183,10 @@ check_result (GpgmeImportResult result, char *fpr, int secret)
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
GpgmeData in; gpgme_data_t in;
GpgmeImportResult result; gpgme_import_result_t result;
const char *pubkey_1_asc = mk_fname ("pubkey-1.asc"); const char *pubkey_1_asc = mk_fname ("pubkey-1.asc");
const char *seckey_1_asc = mk_fname ("seckey-1.asc"); const char *seckey_1_asc = mk_fname ("seckey-1.asc");

View File

@ -30,7 +30,7 @@
{ \ { \
if (err) \ if (err) \
{ \ { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror (err)); \ __FILE__, __LINE__, gpgme_strerror (err)); \
exit (1); \ exit (1); \
} \ } \
@ -49,7 +49,7 @@ struct
char *email; char *email;
struct struct
{ {
GpgmePubKeyAlgo algo; gpgme_pubkey_algo_t algo;
char *keyid; char *keyid;
char *name; char *name;
char *comment; char *comment;
@ -77,10 +77,10 @@ keys[] =
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
GpgmeError err; gpgme_error_t err;
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeKey key; gpgme_key_t key;
GpgmeKeyListResult result; gpgme_keylist_result_t result;
int mode; int mode;
int i = 0; int i = 0;

View File

@ -30,7 +30,7 @@
{ \ { \
if (err) \ if (err) \
{ \ { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror (err)); \ __FILE__, __LINE__, gpgme_strerror (err)); \
exit (1); \ exit (1); \
} \ } \
@ -118,10 +118,10 @@ keys[] =
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
GpgmeError err; gpgme_error_t err;
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeKey key; gpgme_key_t key;
GpgmeKeyListResult result; gpgme_keylist_result_t result;
int i = 0; int i = 0;
err = gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP); err = gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP);

View File

@ -29,7 +29,7 @@
{ \ { \
if (err) \ if (err) \
{ \ { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror (err)); \ __FILE__, __LINE__, gpgme_strerror (err)); \
exit (1); \ exit (1); \
} \ } \
@ -38,7 +38,7 @@
static void static void
print_data (GpgmeData dh) print_data (gpgme_data_t dh)
{ {
#define BUF_SIZE 512 #define BUF_SIZE 512
char buf[BUF_SIZE + 1]; char buf[BUF_SIZE + 1];
@ -54,7 +54,7 @@ print_data (GpgmeData dh)
} }
static GpgmeError static gpgme_error_t
passphrase_cb (void *opaque, const char *desc, void **hd, const char **result) passphrase_cb (void *opaque, const char *desc, void **hd, const char **result)
{ {
/* Cleanup by looking at *hd. */ /* Cleanup by looking at *hd. */
@ -67,7 +67,7 @@ passphrase_cb (void *opaque, const char *desc, void **hd, const char **result)
static void static void
check_result (GpgmeSignResult result, GpgmeSigMode type) check_result (gpgme_sign_result_t result, gpgme_sig_mode_t type)
{ {
if (result->invalid_signers) if (result->invalid_signers)
{ {
@ -116,10 +116,10 @@ check_result (GpgmeSignResult result, GpgmeSigMode type)
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
GpgmeData in, out; gpgme_data_t in, out;
GpgmeSignResult result; gpgme_sign_result_t result;
char *agent_info; char *agent_info;
err = gpgme_new (&ctx); err = gpgme_new (&ctx);
@ -146,7 +146,7 @@ main (int argc, char **argv)
gpgme_data_release (out); gpgme_data_release (out);
/* Now a detached signature. */ /* Now a detached signature. */
gpgme_data_rewind (in); gpgme_data_seek (in, 0, SEEK_SET);
err = gpgme_data_new (&out); err = gpgme_data_new (&out);
fail_if_err (err); fail_if_err (err);
err = gpgme_op_sign (ctx, in, out, GPGME_SIG_MODE_DETACH); err = gpgme_op_sign (ctx, in, out, GPGME_SIG_MODE_DETACH);
@ -157,7 +157,7 @@ main (int argc, char **argv)
gpgme_data_release (out); gpgme_data_release (out);
/* And finally a cleartext signature. */ /* And finally a cleartext signature. */
gpgme_data_rewind (in); gpgme_data_seek (in, 0, SEEK_SET);
err = gpgme_data_new (&out); err = gpgme_data_new (&out);
fail_if_err (err); fail_if_err (err);
err = gpgme_op_sign (ctx, in, out, GPGME_SIG_MODE_CLEAR); err = gpgme_op_sign (ctx, in, out, GPGME_SIG_MODE_CLEAR);

View File

@ -1,4 +1,4 @@
/* t-signers.c - Regression tests for the Gpgme multiple signers interface. /* t-signers.c - Regression tests for the multiple signers interface.
Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2003 g10 Code GmbH Copyright (C) 2001, 2003 g10 Code GmbH
@ -29,7 +29,7 @@
{ \ { \
if (err) \ if (err) \
{ \ { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror (err)); \ __FILE__, __LINE__, gpgme_strerror (err)); \
exit (1); \ exit (1); \
} \ } \
@ -38,7 +38,7 @@
static void static void
print_data (GpgmeData dh) print_data (gpgme_data_t dh)
{ {
#define BUF_SIZE 512 #define BUF_SIZE 512
char buf[BUF_SIZE + 1]; char buf[BUF_SIZE + 1];
@ -54,7 +54,7 @@ print_data (GpgmeData dh)
} }
static GpgmeError static gpgme_error_t
passphrase_cb (void *opaque, const char *desc, void **hd, const char **result) passphrase_cb (void *opaque, const char *desc, void **hd, const char **result)
{ {
/* Cleanup by looking at *hd. */ /* Cleanup by looking at *hd. */
@ -67,9 +67,9 @@ passphrase_cb (void *opaque, const char *desc, void **hd, const char **result)
static void static void
check_result (GpgmeSignResult result, GpgmeSigMode type) check_result (gpgme_sign_result_t result, gpgme_sig_mode_t type)
{ {
GpgmeNewSignature signature; gpgme_new_signature_t signature;
if (result->invalid_signers) if (result->invalid_signers)
{ {
@ -127,11 +127,11 @@ check_result (GpgmeSignResult result, GpgmeSigMode type)
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
GpgmeData in, out; gpgme_data_t in, out;
GpgmeKey key[2]; gpgme_key_t key[2];
GpgmeSignResult result; gpgme_sign_result_t result;
char *agent_info; char *agent_info;
err = gpgme_new (&ctx); err = gpgme_new (&ctx);
@ -172,7 +172,7 @@ main (int argc, char *argv[])
gpgme_data_release (out); gpgme_data_release (out);
/* Now a detached signature. */ /* Now a detached signature. */
gpgme_data_rewind (in); gpgme_data_seek (in, 0, SEEK_SET);
err = gpgme_data_new (&out); err = gpgme_data_new (&out);
fail_if_err (err); fail_if_err (err);
err = gpgme_op_sign (ctx, in, out, GPGME_SIG_MODE_DETACH); err = gpgme_op_sign (ctx, in, out, GPGME_SIG_MODE_DETACH);
@ -183,7 +183,7 @@ main (int argc, char *argv[])
gpgme_data_release (out); gpgme_data_release (out);
/* And finally a cleartext signature. */ /* And finally a cleartext signature. */
gpgme_data_rewind (in); gpgme_data_seek (in, 0, SEEK_SET);
err = gpgme_data_new (&out); err = gpgme_data_new (&out);
fail_if_err (err); fail_if_err (err);
err = gpgme_op_sign (ctx, in, out, GPGME_SIG_MODE_CLEAR); err = gpgme_op_sign (ctx, in, out, GPGME_SIG_MODE_CLEAR);
@ -192,7 +192,7 @@ main (int argc, char *argv[])
check_result (result, GPGME_SIG_MODE_CLEAR); check_result (result, GPGME_SIG_MODE_CLEAR);
print_data (out); print_data (out);
gpgme_data_release (out); gpgme_data_release (out);
gpgme_data_rewind (in); gpgme_data_seek (in, 0, SEEK_SET);
gpgme_data_release (in); gpgme_data_release (in);
gpgme_release (ctx); gpgme_release (ctx);

View File

@ -30,7 +30,7 @@
{ \ { \
if (err) \ if (err) \
{ \ { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror (err)); \ __FILE__, __LINE__, gpgme_strerror (err)); \
exit (1); \ exit (1); \
} \ } \
@ -41,9 +41,9 @@
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
GpgmeTrustItem item; gpgme_trust_item_t item;
err = gpgme_new (&ctx); err = gpgme_new (&ctx);
fail_if_err (err); fail_if_err (err);

View File

@ -30,7 +30,7 @@
{ \ { \
if (err) \ if (err) \
{ \ { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror (err)); \ __FILE__, __LINE__, gpgme_strerror (err)); \
exit (1); \ exit (1); \
} \ } \
@ -82,10 +82,10 @@ static const char test_sig2[] =
static void static void
check_result (GpgmeVerifyResult result, int summary, char *fpr, check_result (gpgme_verify_result_t result, int summary, char *fpr,
GpgmeError status, int notation) gpgme_error_t status, int notation)
{ {
GpgmeSignature sig; gpgme_signature_t sig;
sig = result->signatures; sig = result->signatures;
if (!sig || sig->next) if (!sig || sig->next)
@ -157,10 +157,10 @@ check_result (GpgmeVerifyResult result, int summary, char *fpr,
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
GpgmeData sig, text; gpgme_data_t sig, text;
GpgmeVerifyResult result; gpgme_verify_result_t result;
err = gpgme_new (&ctx); err = gpgme_new (&ctx);
fail_if_err (err); fail_if_err (err);
@ -180,7 +180,7 @@ main (int argc, char *argv[])
gpgme_data_release (text); gpgme_data_release (text);
err = gpgme_data_new_from_mem (&text, test_text1f, strlen (test_text1f), 0); err = gpgme_data_new_from_mem (&text, test_text1f, strlen (test_text1f), 0);
fail_if_err (err); fail_if_err (err);
gpgme_data_rewind (sig); gpgme_data_seek (sig, 0, SEEK_SET);
err = gpgme_op_verify (ctx, sig, text, NULL); err = gpgme_op_verify (ctx, sig, text, NULL);
fail_if_err (err); fail_if_err (err);
result = gpgme_op_verify_result (ctx); result = gpgme_op_verify_result (ctx);

View File

@ -40,7 +40,7 @@ static const char test_cip1[] =
"-----END CMS OBJECT-----\n"; "-----END CMS OBJECT-----\n";
#define fail_if_err(a) do { if(a) { int my_errno = errno; \ #define fail_if_err(a) do { if(a) { int my_errno = errno; \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror(a)); \ __FILE__, __LINE__, gpgme_strerror(a)); \
if ((a) == GPGME_File_Error) \ if ((a) == GPGME_File_Error) \
fprintf (stderr, "\terrno=`%s'\n", strerror (my_errno)); \ fprintf (stderr, "\terrno=`%s'\n", strerror (my_errno)); \
@ -48,7 +48,7 @@ static const char test_cip1[] =
} while(0) } while(0)
static void static void
print_data (GpgmeData dh) print_data (gpgme_data_t dh)
{ {
#define BUF_SIZE 512 #define BUF_SIZE 512
char buf[BUF_SIZE + 1]; char buf[BUF_SIZE + 1];
@ -67,10 +67,10 @@ print_data (GpgmeData dh)
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
GpgmeData in, out; gpgme_data_t in, out;
GpgmeDecryptResult result; gpgme_decrypt_result_t result;
err = gpgme_new (&ctx); err = gpgme_new (&ctx);
fail_if_err (err); fail_if_err (err);

View File

@ -29,7 +29,7 @@
{ \ { \
if (err) \ if (err) \
{ \ { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror (err)); \ __FILE__, __LINE__, gpgme_strerror (err)); \
exit (1); \ exit (1); \
} \ } \
@ -38,7 +38,7 @@
static void static void
print_data (GpgmeData dh) print_data (gpgme_data_t dh)
{ {
#define BUF_SIZE 512 #define BUF_SIZE 512
char buf[BUF_SIZE + 1]; char buf[BUF_SIZE + 1];
@ -57,11 +57,11 @@ print_data (GpgmeData dh)
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
GpgmeData in, out; gpgme_data_t in, out;
GpgmeRecipients rset; gpgme_recipients_t rset;
GpgmeEncryptResult result; gpgme_encrypt_result_t result;
err = gpgme_engine_check_version (GPGME_PROTOCOL_CMS); err = gpgme_engine_check_version (GPGME_PROTOCOL_CMS);
fail_if_err (err); fail_if_err (err);

View File

@ -27,13 +27,13 @@
#include <gpgme.h> #include <gpgme.h>
#define fail_if_err(a) do { if(a) { \ #define fail_if_err(a) do { if(a) { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror(a)); \ __FILE__, __LINE__, gpgme_strerror(a)); \
exit (1); } \ exit (1); } \
} while(0) } while(0)
static void static void
print_data (GpgmeData dh) print_data (gpgme_data_t dh)
{ {
char buf[100]; char buf[100];
int ret; int ret;
@ -51,10 +51,10 @@ print_data (GpgmeData dh)
int int
main (int argc, char **argv ) main (int argc, char **argv )
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
GpgmeData out; gpgme_data_t out;
GpgmeRecipients rset; gpgme_recipients_t rset;
do { do {
err = gpgme_new (&ctx); err = gpgme_new (&ctx);

View File

@ -30,7 +30,7 @@
{ \ { \
if (err) \ if (err) \
{ \ { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror (err)); \ __FILE__, __LINE__, gpgme_strerror (err)); \
exit (1); \ exit (1); \
} \ } \
@ -39,7 +39,7 @@
static void static void
print_data (GpgmeData dh) print_data (gpgme_data_t dh)
{ {
#define BUF_SIZE 512 #define BUF_SIZE 512
char buf[BUF_SIZE + 1]; char buf[BUF_SIZE + 1];
@ -81,16 +81,16 @@ progress (void *self, const char *what, int type, int current, int total)
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
const char *parms = "<GnupgKeyParms format=\"internal\">\n" const char *parms = "<GnupgKeyParms format=\"internal\">\n"
"Key-Type: RSA\n" "Key-Type: RSA\n"
"Key-Length: 1024\n" "Key-Length: 1024\n"
"Name-DN: C=de,O=g10 code,OU=Testlab,CN=Joe 2 Tester\n" "Name-DN: C=de,O=g10 code,OU=Testlab,CN=Joe 2 Tester\n"
"Name-Email: joe@foo.bar\n" "Name-Email: joe@foo.bar\n"
"</GnupgKeyParms>\n"; "</GnupgKeyParms>\n";
GpgmeGenKeyResult result; gpgme_genkey_result_t result;
GpgmeData certreq; gpgme_data_t certreq;
err = gpgme_engine_check_version (GPGME_PROTOCOL_CMS); err = gpgme_engine_check_version (GPGME_PROTOCOL_CMS);
fail_if_err (err); fail_if_err (err);

View File

@ -31,7 +31,7 @@
{ \ { \
if (err) \ if (err) \
{ \ { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror (err)); \ __FILE__, __LINE__, gpgme_strerror (err)); \
exit (1); \ exit (1); \
} \ } \
@ -62,7 +62,7 @@ make_filename (const char *fname)
void void
check_result (GpgmeImportResult result, char *fpr, int total) check_result (gpgme_import_result_t result, char *fpr, int total)
{ {
if (result->considered != total) if (result->considered != total)
{ {
@ -154,10 +154,10 @@ check_result (GpgmeImportResult result, char *fpr, int total)
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
GpgmeData in; gpgme_data_t in;
GpgmeImportResult result; gpgme_import_result_t result;
const char *cert_1 = make_filename ("cert_dfn_pca01.der"); const char *cert_1 = make_filename ("cert_dfn_pca01.der");
const char *cert_2 = make_filename ("cert_dfn_pca15.der"); const char *cert_2 = make_filename ("cert_dfn_pca15.der");

View File

@ -30,7 +30,7 @@
{ \ { \
if (err) \ if (err) \
{ \ { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror (err)); \ __FILE__, __LINE__, gpgme_strerror (err)); \
exit (1); \ exit (1); \
} \ } \
@ -76,10 +76,10 @@ keys[] =
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
GpgmeError err; gpgme_error_t err;
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeKey key; gpgme_key_t key;
GpgmeKeyListResult result; gpgme_keylist_result_t result;
int i = 0; int i = 0;
err = gpgme_engine_check_version (GPGME_PROTOCOL_CMS); err = gpgme_engine_check_version (GPGME_PROTOCOL_CMS);

View File

@ -29,7 +29,7 @@
{ \ { \
if (err) \ if (err) \
{ \ { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror (err)); \ __FILE__, __LINE__, gpgme_strerror (err)); \
exit (1); \ exit (1); \
} \ } \
@ -38,7 +38,7 @@
static void static void
print_data (GpgmeData dh) print_data (gpgme_data_t dh)
{ {
#define BUF_SIZE 512 #define BUF_SIZE 512
char buf[BUF_SIZE + 1]; char buf[BUF_SIZE + 1];
@ -55,7 +55,7 @@ print_data (GpgmeData dh)
static void static void
check_result (GpgmeSignResult result, GpgmeSigMode type) check_result (gpgme_sign_result_t result, gpgme_sig_mode_t type)
{ {
if (result->invalid_signers) if (result->invalid_signers)
{ {
@ -104,10 +104,10 @@ check_result (GpgmeSignResult result, GpgmeSigMode type)
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
GpgmeData in, out; gpgme_data_t in, out;
GpgmeSignResult result; gpgme_sign_result_t result;
err = gpgme_engine_check_version (GPGME_PROTOCOL_CMS); err = gpgme_engine_check_version (GPGME_PROTOCOL_CMS);
fail_if_err (err); fail_if_err (err);
@ -133,7 +133,7 @@ main (int argc, char **argv)
gpgme_data_release (out); gpgme_data_release (out);
/* Now a detached signature. */ /* Now a detached signature. */
gpgme_data_rewind (in); gpgme_data_seek (in, 0, SEEK_SET);
err = gpgme_data_new (&out); err = gpgme_data_new (&out);
fail_if_err (err); fail_if_err (err);
err = gpgme_op_sign (ctx, in, out, GPGME_SIG_MODE_DETACH); err = gpgme_op_sign (ctx, in, out, GPGME_SIG_MODE_DETACH);

View File

@ -30,7 +30,7 @@
{ \ { \
if (err) \ if (err) \
{ \ { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror (err)); \ __FILE__, __LINE__, gpgme_strerror (err)); \
exit (1); \ exit (1); \
} \ } \
@ -54,10 +54,10 @@ static const char test_sig1[] =
static void static void
check_result (GpgmeVerifyResult result, int summary, char *fpr, check_result (gpgme_verify_result_t result, int summary, char *fpr,
GpgmeError status, GpgmeValidity validity) gpgme_error_t status, gpgme_validity_t validity)
{ {
GpgmeSignature sig; gpgme_signature_t sig;
sig = result->signatures; sig = result->signatures;
if (!sig || sig->next) if (!sig || sig->next)
@ -114,10 +114,10 @@ check_result (GpgmeVerifyResult result, int summary, char *fpr,
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
GpgmeCtx ctx; gpgme_ctx_t ctx;
GpgmeError err; gpgme_error_t err;
GpgmeData sig, text; gpgme_data_t sig, text;
GpgmeVerifyResult result; gpgme_verify_result_t result;
err = gpgme_new (&ctx); err = gpgme_new (&ctx);
fail_if_err (err); fail_if_err (err);
@ -139,7 +139,7 @@ main (int argc, char **argv)
gpgme_data_release (text); gpgme_data_release (text);
err = gpgme_data_new_from_mem (&text, test_text1f, strlen (test_text1f), 0); err = gpgme_data_new_from_mem (&text, test_text1f, strlen (test_text1f), 0);
fail_if_err (err); fail_if_err (err);
gpgme_data_rewind (sig); gpgme_data_seek (sig, 0, SEEK_SET);
err = gpgme_op_verify (ctx, sig, text, NULL); err = gpgme_op_verify (ctx, sig, text, NULL);
fail_if_err (err); fail_if_err (err);
result = gpgme_op_verify_result (ctx); result = gpgme_op_verify_result (ctx);

View File

@ -1,4 +1,4 @@
/* t-data - Regression tests for the GpgmeData abstraction. /* t-data - Regression tests for the gpgme_data_t abstraction.
* Copyright (C) 2001 g10 Code GmbH * Copyright (C) 2001 g10 Code GmbH
* *
* This file is part of GPGME. * This file is part of GPGME.
@ -27,7 +27,7 @@
#include <gpgme.h> #include <gpgme.h>
#define fail_if_err(a) do { if(a) { \ #define fail_if_err(a) do { if(a) { \
fprintf (stderr, "%s:%d: (%i) GpgmeError " \ fprintf (stderr, "%s:%d: (%i) gpgme_error_t " \
"%s\n", __FILE__, __LINE__, round, \ "%s\n", __FILE__, __LINE__, round, \
gpgme_strerror(a)); \ gpgme_strerror(a)); \
exit (1); } \ exit (1); } \
@ -104,7 +104,7 @@ read_cb (void *cb_value, char *buffer, size_t count, size_t *nread)
} }
void void
read_once_test (round_t round, GpgmeData data) read_once_test (round_t round, gpgme_data_t data)
{ {
char buffer[1024]; char buffer[1024];
size_t read; size_t read;
@ -128,9 +128,8 @@ read_once_test (round_t round, GpgmeData data)
} }
void void
read_test (round_t round, GpgmeData data) read_test (round_t round, gpgme_data_t data)
{ {
GpgmeError err;
char buffer[1024]; char buffer[1024];
size_t read; size_t read;
@ -147,15 +146,13 @@ read_test (round_t round, GpgmeData data)
} }
read_once_test (round, data); read_once_test (round, data);
err = gpgme_data_rewind (data); gpgme_data_seek (data, 0, SEEK_SET);
fail_if_err (err);
read_once_test (round, data); read_once_test (round, data);
} }
void void
write_test (round_t round, GpgmeData data) write_test (round_t round, gpgme_data_t data)
{ {
GpgmeError err;
char buffer[1024]; char buffer[1024];
size_t amt; size_t amt;
@ -163,8 +160,7 @@ write_test (round_t round, GpgmeData data)
if (amt != strlen (text)) if (amt != strlen (text))
fail_if_err (GPGME_File_Error); fail_if_err (GPGME_File_Error);
err = gpgme_data_rewind (data); gpgme_data_seek (data, 0, SEEK_SET);
fail_if_err (err);
if (round == TEST_INOUT_NONE) if (round == TEST_INOUT_NONE)
read_once_test (round, data); read_once_test (round, data);
@ -196,8 +192,8 @@ main (int argc, char **argv)
const char *text_filename = make_filename ("t-data-1.txt"); const char *text_filename = make_filename ("t-data-1.txt");
const char *longer_text_filename = make_filename ("t-data-2.txt"); const char *longer_text_filename = make_filename ("t-data-2.txt");
const char *missing_filename = "this-file-surely-does-not-exist"; const char *missing_filename = "this-file-surely-does-not-exist";
GpgmeError err = GPGME_No_Error; gpgme_error_t err = GPGME_No_Error;
GpgmeData data; gpgme_data_t data;
while (++round) while (++round)
{ {

View File

@ -33,7 +33,7 @@
{ \ { \
if (err) \ if (err) \
{ \ { \
fprintf (stderr, "%s:%d: GpgmeError %s\n", \ fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \
__FILE__, __LINE__, gpgme_strerror (err)); \ __FILE__, __LINE__, gpgme_strerror (err)); \
exit (1); \ exit (1); \
} \ } \
@ -42,7 +42,7 @@
void void
check_engine_info (GpgmeEngineInfo info, GpgmeProtocol protocol, check_engine_info (gpgme_engine_info_t info, gpgme_protocol_t protocol,
const char *file_name, const char *req_version) const char *file_name, const char *req_version)
{ {
if (info->protocol != protocol) if (info->protocol != protocol)
@ -69,8 +69,8 @@ check_engine_info (GpgmeEngineInfo info, GpgmeProtocol protocol,
int int
main (int argc, char **argv ) main (int argc, char **argv )
{ {
GpgmeEngineInfo info; gpgme_engine_info_t info;
GpgmeError err; gpgme_error_t err;
err = gpgme_get_engine_info (&info); err = gpgme_get_engine_info (&info);
fail_if_err (err); fail_if_err (err);

View File

@ -29,7 +29,7 @@
static const char version[] = VERSION; static const char version[] = VERSION;
int int
main (int argc, char **argv ) main (int argc, char **argv)
{ {
const char *null_result; const char *null_result;
const char *current_result; const char *current_result;