From: Marcus Brinkmann Date: Sun, 18 May 2003 20:45:24 +0000 (+0000) Subject: 2003-05-18 Marcus Brinkmann X-Git-Tag: gpgme-1.2.0@1385~627 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=16dd11f481f96f2b476d018cec384b542dc16d2b;p=gpgme.git 2003-05-18 Marcus Brinkmann In all files, replace the Gpgme* type names with the new gpgme_* type names. doc/ 2003-05-18 Marcus Brinkmann * 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 * 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. --- diff --git a/trunk/ChangeLog b/trunk/ChangeLog index 1295959..5647abb 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -1,3 +1,8 @@ +2003-05-18 Marcus Brinkmann + + In all files, replace the Gpgme* type names with the new gpgme_* + type names. + 2003-02-01 Marcus Brinkmann * assuan/: Update files to 2002-11-10 version of assuan. diff --git a/trunk/NEWS b/trunk/NEWS index af5b223..14e23fc 100644 --- a/trunk/NEWS +++ b/trunk/NEWS @@ -1,15 +1,52 @@ 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_op_verify and gpgme_op_decrypt_verify don't return a status summary anymore. Use gpgme_get_sig_status to retrieve the individual stati. - * GpgmeIOCb changed from a void function to a function returning a - GpgmeError value. However, it will always return 0, so you can - safely ignore the return value. + * gpgme_io_cb_t changed from a void function to a function returning + a gpgme_error_t value. However, it will always return 0, so you + can safely ignore the return value. * 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 @@ -30,17 +67,17 @@ Noteworthy changes in version 0.4.1 (unreleased) occurs. In that case *status contains the error code. * 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 information in an application. * 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 - returns the password string in a new parameter. The gpgme_cancel - function has been removed, just return GPGME_Canceled in the - passphrase callback directly. + * The gpgme_passphrase_cb_t type now returns a gpgme_error_t value, + and returns the password string in a new parameter. The + gpgme_cancel function has been removed, just return GPGME_Canceled + in the passphrase callback directly. * The status of a context operation is not checked anymore, so the 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. * 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 works with gpgme_op_genkey_start. The structure also provides other information about the generated keys. @@ -65,7 +102,7 @@ Noteworthy changes in version 0.4.1 (unreleased) you should now do: - GpgmeGenKeyResult result; + gpgme_genkey_result_t result; err = gpgme_op_genkey (ctx, NULL, NULL); if (!err) { @@ -76,12 +113,12 @@ Noteworthy changes in version 0.4.1 (unreleased) * The new gpgme_op_import_result function provides detailed information about the result of an import operation in - GpgmeImportResult and GpgmeImportStatus objects. Thus, the - gpgme_op_import_ext variant is deprecated. + gpgme_import_result_t and gpgme_import_status_t objects. + Thus, the gpgme_op_import_ext variant is deprecated. * The new gpgme_op_sign_result function provides detailed information - about the result of a signing operation in GpgmeSignResult, - GpgmeInvalidUserID and GpgmeNewSignature objects. + about the result of a signing operation in gpgme_sign_result_t, + gpgme_invalid_user_id_t and gpgme_new_signature_t objects. * The new gpgme_op_encrypt_result function provides detailed 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: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -GpgmeIOCb CHANGED: Return type from void to GpgmeError. -GpgmeEventIO CHANGED: New event type (all numbers changed). +GpgmeCtx DEPRECATED: Use gpgme_ctx_t. +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_op_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. GpgmeIdleFunc REMOVED gpgme_register_idle REMOVED -GpgmeEngineInfo NEW +gpgme_engine_info_t NEW gpgme_get_engine_info CHANGED: Return info structure instead XML. gpgme_get_protocol_name NEW GpgmePassphraseCb CHANGED: Return error value, new argument. @@ -152,24 +241,24 @@ GPGME_No_Passphrase DEPRECATED: Use GPGME_Bad_Passphrase. GPGME_Bad_Passphrase NEW gpgme_op_genkey CHANGED: FPR argument dropped. 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_result NEW -GpgmeImportStatus NEW -GpgmeImportResult NEW -GpgmePubKeyAlgo NEW -GpgmeHashAlgo NEW -GpgmeInvalidUserID NEW -GpgmeNewSignature NEW -GpgmeSignResult NEW +gpgme_import_status_t NEW +gpgme_import_result_t NEW +gpgme_pubkey_algo_t NEW +gpgme_hash_algo_t NEW +gpgme_invalid_user_id_t NEW +gpgme_new_signature_t NEW +gpgme_sign_result_t NEW gpgme_op_sign_result NEW gpgme_pubkey_algo_name NEW gpgme_hash_algo_name NEW -GpgmeEncryptResult NEW +gpgme_encrypt_result_t NEW gpgme_op_encrypt_result NEW -GpgmeDecryptResult NEW +gpgme_decrypt_result_t NEW gpgme_op_decrypt_result NEW -GpgmeVerifyResult NEW +gpgme_verify_result_t NEW gpgme_op_verify_result NEW gpgme_get_notation REMOVED: Access verify result directly instead. 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_SIG_STAT_* DEPRECATED: Use error value in sig status. 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_unref NEW gpgme_trust_item_release DEPRECATED: Use gpgme_trust_item_unref. gpgme_trust_item_get_string_attr DEPRECATED gpgme_trust_item_get_ulong_attr DEPRECATED gpgme_get_key CHANGED: Removed force_update argument. -GpgmeSubKey NEW -GpgmeKeySig NEW -GpgmeUserID NEW -GpgmeKey CHANGED: Now has user accessible data members. +gpgme_sub_key_t NEW +gpgme_key_sig_t NEW +gpgme_user_id_t NEW +gpgme_key_t CHANGED: Now has user accessible data members. gpgme_key_get_string_attr DEPRECATED gpgme_key_get_ulong_attr DEPRECATED gpgme_key_sig_get_string_attr DEPRECATED gpgme_key_sig_get_ulong_attr DEPRECATED gpgme_key_get_as_xml REMOVED -GpgmeKeyListResult NEW +gpgme_key_list_result_t NEW gpgme_op_keylist_result NEW gpgme_get_op_info REMOVED GPGME_Invalid_Type DEPRECATED diff --git a/trunk/TODO b/trunk/TODO index 460f017..0597298 100644 --- a/trunk/TODO +++ b/trunk/TODO @@ -1,7 +1,7 @@ Hey Emacs, this is -*- outline -*- mode! * 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: *** gpgme_data_new_from_filepart *** gpgme_data_new_from_file @@ -19,8 +19,9 @@ Hey Emacs, this is -*- outline -*- mode! *** gpgme_trust_item_release *** gpgme_trust_item_get_string_attr *** gpgme_trust_item_get_ulong_attr -*** GpgmeAttr +*** gpgme_attr_t *** GPGME_Invalid_Type, GPGME_Invalid_Mode +*** All Gpgme* typedefs. * Thread support: ** Build thread modules for static linking (which just suck in the diff --git a/trunk/doc/ChangeLog b/trunk/doc/ChangeLog index 01533fb..a54d202 100644 --- a/trunk/doc/ChangeLog +++ b/trunk/doc/ChangeLog @@ -1,3 +1,9 @@ +2003-05-18 Marcus Brinkmann + + * 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 * gpgme.texi (Listing Keys): Document what happens if key is not diff --git a/trunk/doc/gpgme.texi b/trunk/doc/gpgme.texi index 9fe30d6..44edfa9 100644 --- a/trunk/doc/gpgme.texi +++ b/trunk/doc/gpgme.texi @@ -171,7 +171,7 @@ Key Management Trust Item Management * Listing Trust Items:: Browsing the list of available trust items. -* Information About Trust Items:: Requesting detailed information about trust items. +* Information About Trust Items:: Requesting information about trust items. * Manipulating Trust Items:: Operations on trust items. Crypto Operations @@ -336,10 +336,9 @@ like this: #include @end example -The name space of @acronym{GPGME} is @code{gpgme_*} for function -names, @code{Gpgme*} for data types and @code{GPGME_*} for other -symbols. Symbols internal to @acronym{GPGME} take the form -@code{_gpgme_*}. +The name space of @acronym{GPGME} is @code{gpgme_*} for function names +and data types and @code{GPGME_*} for other symbols. Symbols internal +to @acronym{GPGME} take the form @code{_gpgme_*} and @code{_GPGME_*}. Because @acronym{GPGME} links to the Assuan library, linking to @acronym{GPGME} will also use the @code{assuan_*} and @code{_assuan_*} @@ -486,7 +485,8 @@ contact us if you have the need. @item If you link your program dynamically to @acronym{GPGME} and your supported thread library, @acronym{GPGME} will automatically detect -the presence of this library and activate its use. If you link to +the presence of this library and activate its use. You must link to +the thread library before linking to @acronym{GPGME}. If you link to both pthread and GNU Pth, @acronym{GPGME} will use the pthread support. This feature requires weak symbol support. @@ -541,7 +541,7 @@ initialize_gpgme (void) @end example @item -Any @code{GpgmeData}, @code{GpgmeCtx} and @code{GpgmeRecipients} +Any @code{gpgme_data_t}, @code{gpgme_ctx_t} and @code{gpgme_recipients_t} object must only be accessed by one thread at a time. If multiple threads want to deal with the same object, the caller has to make sure that operations on that object are fully synchronized. @@ -573,9 +573,9 @@ exchange of information between the application and the backend is necessary, @acronym{GPGME} provides the necessary callback function hooks and further interfaces. -@deftp {Data type} {enum GpgmeProtocol} -@tindex GpgmeProtocol -The @code{GpgmeProtocol} type specifies the set of possible protocol +@deftp {Data type} {enum gpgme_protocol_t} +@tindex gpgme_protocol_t +The @code{gpgme_protocol_t} type specifies the set of possible protocol values that are supported by @acronym{GPGME}. The following protocols are supported: @@ -588,7 +588,7 @@ This specifies the Cryptographic Message Syntax. @end deftp -@deftypefun const char *gpgme_get_protocol_name (@w{GpgmeProtocol @var{protocol}}) +@deftypefun const char *gpgme_get_protocol_name (@w{gpgme_protocol_t @var{protocol}}) The function @code{gpgme_get_protocol_name} returns a statically allocated string describing the protocol @var{protocol}, or @code{NULL} if the protocol number is not valid. @@ -606,7 +606,7 @@ allocated string describing the protocol @var{protocol}, or @section Engine Version Check @cindex version check, of the engines -@deftypefun GpgmeError gpgme_engine_check_version (@w{GpgmeProtocol @var{protocol}}) +@deftypefun gpgme_error_t gpgme_engine_check_version (@w{gpgme_protocol_t @var{protocol}}) The function @code{gpgme_engine_check_version} verifies that the engine implementing the protocol @var{PROTOCOL} is installed in the expected path and meets the version requirement of @acronym{GPGME}. @@ -620,18 +620,18 @@ and @code{GPGME_Invalid_Engine} if it is not. @section Engine Information @cindex engine, information about -@deftp {Data type} {GpgmeEngineInfo} -@tindex GpgmeProtocol -The @code{GpgmeEngineInfo} type specifies a pointer to a structure +@deftp {Data type} {gpgme_engine_info_t} +@tindex gpgme_protocol_t +The @code{gpgme_engine_info_t} type specifies a pointer to a structure describing a crypto backend engine. The structure contains the following elements: @table @code -@item GpgmeEngineInfo next +@item gpgme_engine_info_t next This is a pointer to the next engine info structure in the linked list, or @code{NULL} if this is the last element. -@item GpgmeProtocol protocol +@item gpgme_protocol_t protocol This is the protocol for which the crypo engine is used. You can convert this to a string with @code{gpgme_get_protocol_name} for printing. @@ -655,7 +655,7 @@ reserved for future use, so always check before you use it. @end table @end deftp -@deftypefun GpgmeError gpgme_get_engine_info (GpgmeEngineInfo *info) +@deftypefun gpgme_error_t gpgme_get_engine_info (gpgme_engine_info_t *info) The function @code{gpgme_get_engine_info} returns a linked list of engine info structures in @var{info}. Each info structure describes one configured crypto backend engine. @@ -673,14 +673,14 @@ receive an error message which indicates that the crypto engine is invalid. @example -GpgmeCtx ctx; -GpgmeError err; +gpgme_ctx_t ctx; +gpgme_error_t err; [...] if (err == GPGME_Invalid_Engine) @{ - GpgmeEngineInfo info; + gpgme_engine_info_t info; err = gpgme_get_engine_info (&info); if (!err) @{ @@ -755,9 +755,9 @@ denote such an algorithm. Public key algorithms are used for encryption, decryption, signing and verification of signatures. -@deftp {Data type} {enum GpgmePubKeyAlgo} -@tindex GpgmePubKeyAlgo -The @code{GpgmePubKeyAlgo} type specifies the set of all public key +@deftp {Data type} {enum gpgme_pubkey_algo_t} +@tindex gpgme_pubkey_algo_t +The @code{gpgme_pubkey_algo_t} type specifies the set of all public key algorithms that are supported by @acronym{GPGME}. Possible values are: @@ -784,7 +784,7 @@ This value also indicates ElGamal and is used specifically in GnuPG. @end table @end deftp -@deftypefun {const char *} gpgme_pubkey_algo_name (@w{GpgmePubKeyAlgo @var{algo}}) +@deftypefun {const char *} gpgme_pubkey_algo_name (@w{gpgme_pubkey_algo_t @var{algo}}) The function @code{gpgme_pubkey_algo_name} returns a pointer to a statically allocated string containing a description of the public key algorithm @var{algo}. This string can be used to output the name of @@ -805,9 +805,9 @@ returned. Hash (message digest) algorithms are used to compress a long message to make it suitable for public key cryptography. -@deftp {Data type} {enum GpgmeHashAlgo} -@tindex GpgmeHashAlgo -The @code{GpgmeHashAlgo} type specifies the set of all hash algorithms +@deftp {Data type} {enum gpgme_hash_algo_t} +@tindex gpgme_hash_algo_t +The @code{gpgme_hash_algo_t} type specifies the set of all hash algorithms that are supported by @acronym{GPGME}. Possible values are: @table @code @@ -827,7 +827,7 @@ that are supported by @acronym{GPGME}. Possible values are: @end table @end deftp -@deftypefun {const char *} gpgme_hash_algo_name (@w{GpgmeHashAlgo @var{algo}}) +@deftypefun {const char *} gpgme_hash_algo_name (@w{gpgme_hash_algo_t @var{algo}}) The function @code{gpgme_hash_algo_name} returns a pointer to a statically allocated string containing a description of the hash algorithm @var{algo}. This string can be used to output the name of @@ -866,9 +866,9 @@ described in the documentation of those functions. @section Error Values @cindex error values, list of -@deftp {Data type} {enum GpgmeError} -@tindex GpgmeError -The @code{GpgmeError} type specifies the set of all error values that +@deftp {Data type} {enum gpgme_error_t} +@tindex gpgme_error_t +The @code{gpgme_error_t} type specifies the set of all error values that are used by @acronym{GPGME}. Possible values are: @table @code @@ -888,7 +888,7 @@ This value means that an out-of-memory condition occurred. @item GPGME_Invalid_Value This value means that some user provided data was out of range. This -can also refer to objects. For example, if an empty @code{GpgmeData} +can also refer to objects. For example, if an empty @code{gpgme_data_t} object was expected, but one containing data was provided, this error value is returned. @@ -910,7 +910,7 @@ This value means that some, but not all, recipients for a message have been invalid. @item GPGME_No_Data -This value means that a @code{GpgmeData} object which was expected to +This value means that a @code{gpgme_data_t} object which was expected to have content was found empty. @item GPGME_Conflict @@ -1014,7 +1014,7 @@ available. @cindex error values, printing of @cindex error strings -@deftypefun {const char *} gpgme_strerror (@w{GpgmeError @var{err}}) +@deftypefun {const char *} gpgme_strerror (@w{gpgme_error_t @var{err}}) The function @code{gpgme_strerror} returns a pointer to a statically allocated string containing a description of the error with the error value @var{err}. This string can be used to output a diagnostic @@ -1023,8 +1023,8 @@ message to the user. The following example illustrates the use of @code{gpgme_strerror}: @example -GpgmeCtx ctx; -GpgmeError err = gpgme_new (&ctx); +gpgme_ctx_t ctx; +gpgme_error_t err = gpgme_new (&ctx); if (err) @{ fprintf (stderr, "%s: creating GpgME context failed: %s\n", @@ -1043,12 +1043,12 @@ A lot of data has to be exchanged between the user and the crypto engine, like plaintext messages, ciphertext, signatures and information about the keys. The technical details about exchanging the data information are completely abstracted by @acronym{GPGME}. -The user provides and receives the data via @code{GpgmeData} objects, +The user provides and receives the data via @code{gpgme_data_t} objects, regardless of the communication protocol between @acronym{GPGME} and the crypto engine in use. -@deftp {Data type} {GpgmeData} -The @code{GpgmeData} type is a handle for a container for generic +@deftp {Data type} {gpgme_data_t} +The @code{gpgme_data_t} type is a handle for a container for generic data, which is used by @acronym{GPGME} to exchange data with the user. @end deftp @@ -1084,8 +1084,8 @@ fraction of the available physical memory. The data has to be copied from its source and to its destination, which can often be avoided by using one of the other data object -@deftypefun GpgmeError gpgme_data_new (@w{GpgmeData *@var{dh}}) -The function @code{gpgme_data_new} creates a new @code{GpgmeData} +@deftypefun gpgme_error_t gpgme_data_new (@w{gpgme_data_t *@var{dh}}) +The function @code{gpgme_data_new} creates a new @code{gpgme_data_t} object and returns a handle for it in @var{dh}. The data object is memory based and initially empty. @@ -1095,9 +1095,9 @@ valid pointer, and @code{GPGME_Out_Of_Core} if not enough memory is available. @end deftypefun -@deftypefun GpgmeError gpgme_data_new_from_mem (@w{GpgmeData *@var{dh}}, @w{const char *@var{buffer}}, @w{size_t @var{size}}, @w{int @var{copy}}) +@deftypefun gpgme_error_t gpgme_data_new_from_mem (@w{gpgme_data_t *@var{dh}}, @w{const char *@var{buffer}}, @w{size_t @var{size}}, @w{int @var{copy}}) The function @code{gpgme_data_new_from_mem} creates a new -@code{GpgmeData} object and fills it with @var{size} bytes starting +@code{gpgme_data_t} object and fills it with @var{size} bytes starting from @var{buffer}. If @var{copy} is not zero, a private copy of the data is made. If @@ -1111,9 +1111,9 @@ successfully created, @code{GPGME_Invalid_Value} if @var{dh} or not enough memory is available. @end deftypefun -@deftypefun GpgmeError gpgme_data_new_from_file (@w{GpgmeData *@var{dh}}, @w{const char *@var{filename}}, @w{int @var{copy}}) +@deftypefun gpgme_error_t gpgme_data_new_from_file (@w{gpgme_data_t *@var{dh}}, @w{const char *@var{filename}}, @w{int @var{copy}}) The function @code{gpgme_data_new_from_file} creates a new -@code{GpgmeData} object and fills it with the content of the file +@code{gpgme_data_t} object and fills it with the content of the file @var{filename}. If @var{copy} is not zero, the whole file is read in at initialization @@ -1129,9 +1129,9 @@ I/O operation fails, @code{GPGME_Not_Implemented} if @var{code} is zero, and @code{GPGME_Out_Of_Core} if not enough memory is available. @end deftypefun -@deftypefun GpgmeError gpgme_data_new_from_filepart (@w{GpgmeData *@var{dh}}, @w{const char *@var{filename}}, @w{FILE *@var{fp}}, @w{off_t @var{offset}}, @w{size_t @var{length}}) +@deftypefun gpgme_error_t gpgme_data_new_from_filepart (@w{gpgme_data_t *@var{dh}}, @w{const char *@var{filename}}, @w{FILE *@var{fp}}, @w{off_t @var{offset}}, @w{size_t @var{length}}) The function @code{gpgme_data_new_from_filepart} creates a new -@code{GpgmeData} object and fills it with a part of the file specified +@code{gpgme_data_t} object and fills it with a part of the file specified by @var{filename} or @var{fp}. Exactly one of @var{filename} and @var{fp} must be non-zero, the other @@ -1154,9 +1154,9 @@ File based data objects operate directly on file descriptors or streams. Only a small amount of data is stored in core at any time, so the size of the data objects is not limited by @acronym{GPGME}. -@deftypefun GpgmeError gpgme_data_new_from_fd (@w{GpgmeData *@var{dh}}, @w{int @var{fd}}) +@deftypefun gpgme_error_t gpgme_data_new_from_fd (@w{gpgme_data_t *@var{dh}}, @w{int @var{fd}}) The function @code{gpgme_data_new_from_fd} creates a new -@code{GpgmeData} object and uses the file descriptor @var{fd} to read +@code{gpgme_data_t} object and uses the file descriptor @var{fd} to read from (if used as an input data object) and write to (if used as an output data object). @@ -1169,9 +1169,9 @@ successfully created, and @code{GPGME_Out_Of_Core} if not enough memory is available. @end deftypefun -@deftypefun GpgmeError gpgme_data_new_from_stream (@w{GpgmeData *@var{dh}}, @w{FILE *@var{stream}}) +@deftypefun gpgme_error_t gpgme_data_new_from_stream (@w{gpgme_data_t *@var{dh}}, @w{FILE *@var{stream}}) The function @code{gpgme_data_new_from_stream} creates a new -@code{GpgmeData} object and uses the I/O stream @var{stream} to read +@code{gpgme_data_t} object and uses the I/O stream @var{stream} to read from (if used as an input data object) and write to (if used as an output data object). @@ -1192,9 +1192,9 @@ If neither memory nor file based data objects are a good fit for your application, you can implement the functions a data object provides yourself and create a data object from these callback functions. -@deftp {Data type} {ssize_t (*GpgmeDataReadCb) (@w{void *@var{handle}}, @w{void @var{*buffer}}, @w{size_t @var{size}})} -@tindex GpgmeDataReadCb -The @code{GpgmeDataReadCb} type is the type of functions which +@deftp {Data type} {ssize_t (*gpgme_data_read_cb_t) (@w{void *@var{handle}}, @w{void @var{*buffer}}, @w{size_t @var{size}})} +@tindex gpgme_data_read_cb_t +The @code{gpgme_data_read_cb_t} type is the type of functions which @acronym{GPGME} calls if it wants to read data from a user-implemented data object. The function should read up to @var{size} bytes from the current read position into the space starting at @var{buffer}. The @@ -1205,9 +1205,9 @@ on error. If an error occurs, @var{errno} should be set to describe the type of the error. @end deftp -@deftp {Data type} {ssize_t (*GpgmeDataWriteCb) (@w{void *@var{handle}}, @w{const void @var{*buffer}}, @w{size_t @var{size}})} -@tindex GpgmeDataWriteCb -The @code{GpgmeDataWriteCb} type is the type of functions which +@deftp {Data type} {ssize_t (*gpgme_data_write_cb_t) (@w{void *@var{handle}}, @w{const void @var{*buffer}}, @w{size_t @var{size}})} +@tindex gpgme_data_write_cb_t +The @code{gpgme_data_write_cb_t} type is the type of functions which @acronym{GPGME} calls if it wants to write data to a user-implemented data object. The function should write up to @var{size} bytes to the current write position from the space starting at @var{buffer}. The @@ -1218,9 +1218,9 @@ error. If an error occurs, @var{errno} should be set to describe the type of the error. @end deftp -@deftp {Data type} {off_t (*GpgmeDataSeekCb) (@w{void *@var{handle}}, @w{off_t @var{offset}}, @w{int @var{whence}})} -@tindex GpgmeDataSeekCb -The @code{GpgmeDataSeekCb} type is the type of functions which +@deftp {Data type} {off_t (*gpgme_data_seek_cb_t) (@w{void *@var{handle}}, @w{off_t @var{offset}}, @w{int @var{whence}})} +@tindex gpgme_data_seek_cb_t +The @code{gpgme_data_seek_cb_t} type is the type of functions which @acronym{GPGME} calls if it wants to change the current read/write position in a user-implemented data object, just like the @code{lseek} function. @@ -1230,40 +1230,40 @@ error. If an error occurs, @var{errno} should be set to describe the type of the error. @end deftp -@deftp {Data type} {void (*GpgmeDataReleaseCb) (@w{void *@var{handle}})} -@tindex GpgmeDataReleaseCb -The @code{GpgmeDataReleaseCb} type is the type of functions which +@deftp {Data type} {void (*gpgme_data_release_cb_t) (@w{void *@var{handle}})} +@tindex gpgme_data_release_cb_t +The @code{gpgme_data_release_cb_t} type is the type of functions which @acronym{GPGME} calls if it wants to destroy a user-implemented data object. The @var{handle} is provided by the user at data object creation time. @end deftp -@deftp {Data type} {struct GpgmeDataCbs} +@deftp {Data type} {struct gpgme_data_cbs} This structure is used to store the data callback interface functions described above. It has the following members: @table @code -@item GpgmeDataReadCb read +@item gpgme_data_read_cb_t read This is the function called by @acronym{GPGME} to read data from the data object. It is only required for input data object. -@item GpgmeDataWriteCb write +@item gpgme_data_write_cb_t write This is the function called by @acronym{GPGME} to write data to the data object. It is only required for output data object. -@item GpgmeDataSeekCb seek +@item gpgme_data_seek_cb_t seek This is the function called by @acronym{GPGME} to change the current read/write pointer in the data object (if available). It is optional. -@item GpgmeDataReleaseCb release +@item gpgme_data_release_cb_t release This is the function called by @acronym{GPGME} to release a data object. It is optional. @end table @end deftp -@deftypefun GpgmeError gpgme_data_new_from_cbs (@w{GpgmeData *@var{dh}}, @w{struct GpgmeDataCbs *@var{cbs}}, @w{void *@var{handle}}) +@deftypefun gpgme_error_t gpgme_data_new_from_cbs (@w{gpgme_data_t *@var{dh}}, @w{gpgme_data_cbs_t @var{cbs}}, @w{void *@var{handle}}) The function @code{gpgme_data_new_from_cbs} creates a new -@code{GpgmeData} object and uses the user-provided callback functions +@code{gpgme_data_t} object and uses the user-provided callback functions to operate on the data object. The handle @var{handle} is passed as first argument to the callback @@ -1278,9 +1278,9 @@ The following interface is deprecated and only provided for backward compatibility. Don't use it. It will be removed in a future version of @acronym{GPGME}. -@deftypefun GpgmeError gpgme_data_new_with_read_cb (@w{GpgmeData *@var{dh}}, @w{int (*@var{readfunc})} (@w{void *@var{hook}}, @w{char *@var{buffer}}, @w{size_t @var{count}}, @w{size_t *@var{nread}}), @w{void *@var{hook_value}}) +@deftypefun gpgme_error_t gpgme_data_new_with_read_cb (@w{gpgme_data_t *@var{dh}}, @w{int (*@var{readfunc})} (@w{void *@var{hook}}, @w{char *@var{buffer}}, @w{size_t @var{count}}, @w{size_t *@var{nread}}), @w{void *@var{hook_value}}) The function @code{gpgme_data_new_with_read_cb} creates a new -@code{GpgmeData} object and uses the callback function @var{readfunc} +@code{gpgme_data_t} object and uses the callback function @var{readfunc} to retrieve the data on demand. As the callback function can supply the data in any way it wants, this is the most flexible data type @acronym{GPGME} provides. However, it can not be used to write data. @@ -1306,13 +1306,13 @@ not enough memory is available. @section Destroying Data Buffers @cindex data buffer, destruction -@deftypefun void gpgme_data_release (@w{GpgmeData @var{dh}}) +@deftypefun void gpgme_data_release (@w{gpgme_data_t @var{dh}}) The function @code{gpgme_data_release} destroys the data object with the handle @var{dh}. It releases all associated resources that were not provided by the user in the first place. @end deftypefun -@deftypefun {char *} gpgme_data_release_and_get_mem (@w{GpgmeData @var{dh}}, @w{size_t *@var{length}}) +@deftypefun {char *} gpgme_data_release_and_get_mem (@w{gpgme_data_t @var{dh}}, @w{size_t *@var{length}}) The function @code{gpgme_data_release_and_get_mem} is like @code{gpgme_data_release}, except that it returns the data buffer and its length that was provided by the object. @@ -1330,7 +1330,7 @@ be returned to the user, the function will return @code{NULL}. @section Manipulating Data Buffers @cindex data buffere, manipulation -@deftypefun ssize_t gpgme_data_read (@w{GpgmeData @var{dh}}, @w{void *@var{buffer}}, @w{size_t @var{length}}) +@deftypefun ssize_t gpgme_data_read (@w{gpgme_data_t @var{dh}}, @w{void *@var{buffer}}, @w{size_t @var{length}}) The function @code{gpgme_data_read} reads up to @var{length} bytes from the data object with the handle @var{dh} into the space starting at @var{buffer}. @@ -1342,7 +1342,7 @@ sets @var{nread} to zero. In all other cases, the function returns -1 and sets @var{errno}. @end deftypefun -@deftypefun ssize_t gpgme_data_write (@w{GpgmeData @var{dh}}, @w{const void *@var{buffer}}, @w{size_t @var{size}}) +@deftypefun ssize_t gpgme_data_write (@w{gpgme_data_t @var{dh}}, @w{const void *@var{buffer}}, @w{size_t @var{size}}) The function @code{gpgme_data_write} writes up to @var{size} bytes starting from @var{buffer} into the data object with the handle @var{dh} at the current write position. @@ -1354,9 +1354,9 @@ error occurs. If an error occurs, @var{errno} is set. /* Set the current position from where the next read or write starts in the data object with the handle DH to OFFSET, relativ to WHENCE. */ -off_t gpgme_data_seek (GpgmeData dh, off_t offset, int whence); +off_t gpgme_data_seek (gpgme_data_t dh, off_t offset, int whence); -@deftypefun off_t gpgme_data_seek (@w{GpgmeData @var{dh}}, @w{off_t *@var{offset}}, @w{int @var{whence}}) +@deftypefun off_t gpgme_data_seek (@w{gpgme_data_t @var{dh}}, @w{off_t *@var{offset}}, @w{int @var{whence}}) The function @code{gpgme_data_seek} changes the current read/write position. @@ -1392,7 +1392,7 @@ If the function fails, -1 is returned and @var{errno} is set. The following function is deprecated and should not be used. It will be removed in a future version of @acronym{GPGME}. -@deftypefun GpgmeError gpgme_data_rewind (@w{GpgmeData @var{dh}}) +@deftypefun gpgme_error_t gpgme_data_rewind (@w{gpgme_data_t @var{dh}}) The function @code{gpgme_data_rewind} is equivalent to: @example @@ -1402,12 +1402,12 @@ The function @code{gpgme_data_rewind} is equivalent to: @end deftypefun @c -@c GpgmeDataEncoding +@c gpgme_data_encoding_t @c -@deftp {Data type} {enum GpgmeDataEncoding} -@tindex GpgmeDataEncoding -The @code{GpgmeDataEncoding} type specifies the encoding of a -@code{GpgmeData} object. This encoding is useful to give the backend +@deftp {Data type} {enum gpgme_data_encoding_t} +@tindex gpgme_data_encoding_t +The @code{gpgme_data_encoding_t} type specifies the encoding of a +@code{gpgme_data_t} object. This encoding is useful to give the backend a hint on the type of data. The following data types are available: @table @code @@ -1430,14 +1430,14 @@ OpenPGP and PEM. @end table @end deftp -@deftypefun GpgmeDataEncoding gpgme_data_get_encoding (@w{GpgmeData @var{dh}}) +@deftypefun gpgme_data_encoding_t gpgme_data_get_encoding (@w{gpgme_data_t @var{dh}}) The function @code{gpgme_data_get_encoding} returns the encoding of the data object with the handle @var{dh}. If @var{dh} is not a valid pointer (e.g. @code{NULL}) @code{GPGME_DATA_ENCODING_NONE} is returned. @end deftypefun -@deftypefun GpgmeError gpgme_data_set_encoding (@w{GpgmeData @var{dh}, GpgmeDataEncoding @var{enc}}) +@deftypefun gpgme_error_t gpgme_data_set_encoding (@w{gpgme_data_t @var{dh}, gpgme_data_encoding_t @var{enc}}) The function @code{gpgme_data_set_encoding} changes the encoding of the data object with the handle @var{dh} to @var{enc}. @end deftypefun @@ -1456,8 +1456,8 @@ configuration parameters. By using several contexts you can run several cryptographic operations in parallel, with different configuration. -@deftp {Data type} {GpgmeCtx} -The @code{GpgmeCtx} type is a handle for a @acronym{GPGME} context, +@deftp {Data type} {gpgme_ctx_t} +The @code{gpgme_ctx_t} type is a handle for a @acronym{GPGME} context, which is used to hold the configuration, status and result of cryptographic operations. @end deftp @@ -1477,8 +1477,8 @@ cryptographic operations. @section Creating Contexts @cindex context, creation -@deftypefun GpgmeError gpgme_new (@w{GpgmeCtx *@var{ctx}}) -The function @code{gpgme_data_new} creates a new @code{GpgmeCtx} +@deftypefun gpgme_error_t gpgme_new (@w{gpgme_ctx_t *@var{ctx}}) +The function @code{gpgme_data_new} creates a new @code{gpgme_ctx_t} object and returns a handle for it in @var{ctx}. The function returns @code{GPGME_No_Error} if the context was @@ -1492,7 +1492,7 @@ available. @section Destroying Contexts @cindex context, destruction -@deftypefun void gpgme_release (@w{GpgmeCtx @var{ctx}}) +@deftypefun void gpgme_release (@w{gpgme_ctx_t @var{ctx}}) The function @code{gpgme_release} destroys the context with the handle @var{ctx} and releases all associated resources. @end deftypefun @@ -1518,7 +1518,7 @@ The function @code{gpgme_release} destroys the context with the handle @cindex context, selecting protocol @cindex protocol, selecting -@deftypefun GpgmeError gpgme_set_protocol (@w{GpgmeCtx @var{ctx}}, @w{GpgmeProtocol @var{proto}}) +@deftypefun gpgme_error_t gpgme_set_protocol (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_protocol_t @var{proto}}) The function @code{gpgme_set_protocol} sets the protocol used within the context @var{ctx} to @var{proto}. All crypto operations will be performed by the crypto engine configured for that protocol. @@ -1533,7 +1533,7 @@ set successfully, and @code{GPGME_Invalid_Value} if @var{protocol} is not a valid protocol. @end deftypefun -@deftypefun GpgmeProtocol gpgme_get_protocol (@w{GpgmeCtx @var{ctx}}) +@deftypefun gpgme_protocol_t gpgme_get_protocol (@w{gpgme_ctx_t @var{ctx}}) The function @code{gpgme_get_protocol} retrieves the protocol currently use with the context @var{ctx}. @end deftypefun @@ -1544,7 +1544,7 @@ use with the context @var{ctx}. @cindex @acronym{ASCII} armor @cindex armor mode -@deftypefun void gpgme_set_armor (@w{GpgmeCtx @var{ctx}}, @w{int @var{yes}}) +@deftypefun void gpgme_set_armor (@w{gpgme_ctx_t @var{ctx}}, @w{int @var{yes}}) The function @code{gpgme_set_armor} specifies if the output should be @acronym{ASCII} armored. By default, output is not @acronym{ASCII} armored. @@ -1553,7 +1553,7 @@ armored. enabled otherwise. @end deftypefun -@deftypefun int gpgme_get_armor (@w{GpgmeCtx @var{ctx}}) +@deftypefun int gpgme_get_armor (@w{gpgme_ctx_t @var{ctx}}) The function @code{gpgme_get_armor} returns 1 if the output is @acronym{ASCII} armored, and @code{0} if it is not, or if @var{ctx} is not a valid pointer. @@ -1566,7 +1566,7 @@ not a valid pointer. @cindex text mode @cindex canonical text mode -@deftypefun void gpgme_set_textmode (@w{GpgmeCtx @var{ctx}}, @w{int @var{yes}}) +@deftypefun void gpgme_set_textmode (@w{gpgme_ctx_t @var{ctx}}, @w{int @var{yes}}) The function @code{gpgme_set_textmode} specifies if canonical text mode should be used. By default, text mode is not used. @@ -1581,7 +1581,7 @@ Canonical text mode is disabled if @var{yes} is zero, and enabled otherwise. @end deftypefun -@deftypefun int gpgme_get_textmode (@w{GpgmeCtx @var{ctx}}) +@deftypefun int gpgme_get_textmode (@w{gpgme_ctx_t @var{ctx}}) The function @code{gpgme_get_textmode} returns 1 if canonical text mode is enabled, and @code{0} if it is not, or if @var{ctx} is not a valid pointer. @@ -1592,7 +1592,7 @@ valid pointer. @subsection Included Certificates @cindex certificates, included -@deftypefun void gpgme_set_include_certs (@w{GpgmeCtx @var{ctx}}, @w{int @var{nr_of_certs}}) +@deftypefun void gpgme_set_include_certs (@w{gpgme_ctx_t @var{ctx}}, @w{int @var{nr_of_certs}}) The function @code{gpgme_set_include_certs} specifies how many certificates should be included in an S/MIME signed message. By default, only the sender's certificate is included. The possible @@ -1618,7 +1618,7 @@ This option is only relevant to the CMS crypto engine, and ignored by all other engines. @end deftypefun -@deftypefun int gpgme_get_include_certs (@w{GpgmeCtx @var{ctx}}) +@deftypefun int gpgme_get_include_certs (@w{gpgme_ctx_t @var{ctx}}) The function @code{gpgme_get_include_certs} returns the number of certificates to include into an S/MIME signed message. @end deftypefun @@ -1629,7 +1629,7 @@ certificates to include into an S/MIME signed message. @cindex key listing mode @cindex key listing, mode of -@deftypefun void gpgme_set_keylist_mode (@w{GpgmeCtx @var{ctx}}, @w{int @var{mode}}) +@deftypefun void gpgme_set_keylist_mode (@w{gpgme_ctx_t @var{ctx}}, @w{int @var{mode}}) The function @code{gpgme_set_keylist_mode} changes the default behaviour of the key listing functions. The value in @var{mode} is a bitwise-or combination of one or multiple of the following bit values: @@ -1667,7 +1667,7 @@ pointer or @var{mode} is not a valid mode. @end deftypefun -@deftypefun int gpgme_get_keylist_mode (@w{GpgmeCtx @var{ctx}}) +@deftypefun int gpgme_get_keylist_mode (@w{gpgme_ctx_t @var{ctx}}) The function @code{gpgme_get_keylist_mode} returns the current key listing mode of the context @var{ctx}. This value can then be modified and used in a subsequent @code{gpgme_set_keylist_mode} @@ -1684,9 +1684,9 @@ current mode otherwise. Note that 0 is not a valid mode value. @cindex callback, passphrase @cindex passphrase callback -@deftp {Data type} {GpgmeError (*GpgmePassphraseCb)(void *@var{hook}, const char *@var{desc}, void **@var{r_hd}, const char **@var{result})} -@tindex GpgmePassphraseCb -The @code{GpgmePassphraseCb} type is the type of functions usable as +@deftp {Data type} {gpgme_error_t (*gpgme_passphrase_cb_t)(void *@var{hook}, const char *@var{desc}, void **@var{r_hd}, const char **@var{result})} +@tindex gpgme_passphrase_cb_t +The @code{gpgme_passphrase_cb_t} type is the type of functions usable as passphrase callback function. The string @var{desc} contains a text usable to be displayed to the @@ -1700,12 +1700,12 @@ needed by @acronym{GPGME}, the passphrase callback function will be called with @var{desc} being @var{NULL}, and @var{r_hd} being the same as at the first invocation. -If an error occurs, return the corresponding @code{GpgmeError} value. +If an error occurs, return the corresponding @code{gpgme_error_t} value. You can use @code{GPGME_Canceled} to abort the operation. Otherwise, return @code{0}. @end deftp -@deftypefun void gpgme_set_passphrase_cb (@w{GpgmeCtx @var{ctx}}, @w{GpgmePassphraseCb @var{passfunc}}, @w{void *@var{hook_value}}) +@deftypefun void gpgme_set_passphrase_cb (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_passphrase_cb_t @var{passfunc}}, @w{void *@var{hook_value}}) The function @code{gpgme_set_passphrase_cb} sets the function that is used when a passphrase needs to be provided by the user to @var{passfunc}. The function @var{passfunc} needs to implemented by @@ -1723,7 +1723,7 @@ calling @code{gpgme_set_passphrase_cb} with @var{passfunc} being @code{NULL}. @end deftypefun -@deftypefun void gpgme_get_passphrase_cb (@w{GpgmeCtx @var{ctx}}, @w{GpgmePassphraseCb *@var{passfunc}}, @w{void **@var{hook_value}}) +@deftypefun void gpgme_get_passphrase_cb (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_passphrase_cb_t *@var{passfunc}}, @w{void **@var{hook_value}}) The function @code{gpgme_get_passphrase_cb} returns the function that is used when a passphrase needs to be provided by the user in @var{*passfunc}, and the first argument for this function in @@ -1740,9 +1740,9 @@ the corresponding value will not be returned. @cindex callback, progress meter @cindex progress meter callback -@deftp {Data type} {const char *(*GpgmeProgressCb)(void *@var{hook}, const char *@var{what}, int @var{type}, int @var{current}, int @var{total})} -@tindex GpgmeProgressCb -The @code{GpgmeProgressCb} type is the type of functions usable as +@deftp {Data type} {const char *(*gpgme_progress_cb_t)(void *@var{hook}, const char *@var{what}, int @var{type}, int @var{current}, int @var{total})} +@tindex gpgme_progress_cb_t +The @code{gpgme_progress_cb_t} type is the type of functions usable as progress callback function. The arguments are specific to the crypto engine. More information @@ -1751,7 +1751,7 @@ found in the GnuPG source code in the file @file{doc/DETAILS} in the section PROGRESS. @end deftp -@deftypefun void gpgme_set_progress_cb (@w{GpgmeCtx @var{ctx}}, @w{GpgmeProgressCb @var{progfunc}}, @w{void *@var{hook_value}}) +@deftypefun void gpgme_set_progress_cb (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_progress_cb_t @var{progfunc}}, @w{void *@var{hook_value}}) The function @code{gpgme_set_progress_cb} sets the function that is used when progress information about a cryptographic operation is available. The function @var{progfunc} needs to implemented by the @@ -1767,7 +1767,7 @@ calling @code{gpgme_set_progress_cb} with @var{progfunc} being @code{NULL}. @end deftypefun -@deftypefun void gpgme_get_progress_cb (@w{GpgmeCtx @var{ctx}}, @w{GpgmeProgressCb *@var{progfunc}}, @w{void **@var{hook_value}}) +@deftypefun void gpgme_get_progress_cb (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_progress_cb_t *@var{progfunc}}, @w{void **@var{hook_value}}) The function @code{gpgme_get_progress_cb} returns the function that is used to inform the user about the progress made in @var{*progfunc}, and the first argument for this function in @var{*hook_value}. If no @@ -1788,18 +1788,18 @@ signers are specified. This is always done by specifying the respective keys that should be used for the operation. The following section describes how such keys can be selected and manipulated. -@deftp {Data type} GpgmeSubkey -The @code{GpgmeSubKey} type is a pointer to a subkey structure. Sub -keys are one component of a @code{GpgmeKey} object. In fact, subkeys +@deftp {Data type} gpgme_sub_key_t +The @code{gpgme_sub_key_t} type is a pointer to a subkey structure. Sub +keys are one component of a @code{gpgme_key_t} object. In fact, subkeys are those parts that contains the real information about the individual cryptographic keys that belong to the same key object. One -@code{GpgmeKey} can contain several subkeys. The first subkey in the +@code{gpgme_key_t} can contain several subkeys. The first subkey in the linked list is also called the primary key. The subkey structure has the following members: @table @code -@item GpgmeSubkey next +@item gpgme_sub_key_t next This is a pointer to the next subkey structure in the linked list, or @code{NULL} if this is the last element. @@ -1827,7 +1827,7 @@ This is true if the subkey can be used for certification. @item unsigned int secret : 1 This is true if the subkey is a secret key. -@item GpgmePubKeyAlgo pubkey_algo +@item gpgme_pubkey_algo_t pubkey_algo This is the public key algorithm supported by this subkey. @item unsigned int length @@ -1850,9 +1850,9 @@ does not expire. @end table @end deftp -@deftp {Data type} GpgmeKeySig -The @code{GpgmeKeySig} type is a pointer to a key signature structure. -Key signatures are one component of a @code{GpgmeKey} object, and +@deftp {Data type} gpgme_key_sig_t +The @code{gpgme_key_sig_t} type is a pointer to a key signature structure. +Key signatures are one component of a @code{gpgme_key_t} object, and validate user IDs on the key. The signatures on a key are only available if the key was retrieved @@ -1862,7 +1862,7 @@ enabled, because it is expensive to retrieve all signatures of a key. The key signature structure has the following members: @table @code -@item GpgmeKeySig next +@item gpgme_key_sig_t next This is a pointer to the next key signature structure in the linked list, or @code{NULL} if this is the last element. @@ -1878,7 +1878,7 @@ This is true if the key signature is invalid. @item unsigned int disabled : 1 This is true if the key signature is exportable. -@item GpgmePubKeyAlgo pubkey_algo +@item gpgme_pubkey_algo_t pubkey_algo This is the public key algorithm used to create the signature. @item char *keyid @@ -1893,9 +1893,9 @@ the timestamp is invalid, and 0 if it is not available. This is the expiration timestamp of the key signature, or 0 if the key signature does not expire. -@item GpgmeError status +@item gpgme_error_t status This is the status of the signature and has the same meaning as the -member of the same name in a @code{GpgmeSignature} object. +member of the same name in a @code{gpgme_signature_t} object. @item unsigned int class This specifies the signature class of the key signature. The meaning @@ -1915,15 +1915,15 @@ This is the email component of @code{uid}, if available. @end table @end deftp -@deftp {Data type} GpgmeUserID -A user ID is a component of a @code{GpgmeKey} object. One key can +@deftp {Data type} gpgme_user_id_t +A user ID is a component of a @code{gpgme_key_t} object. One key can have many user IDs. The first one in the list is the main (or primary) user ID. The user ID structure has the following members. @table @code -@item GpgmeUserID next +@item gpgme_user_id_t next This is a pointer to the next user ID structure in the linked list, or @code{NULL} if this is the last element. @@ -1933,7 +1933,7 @@ This is true if the user ID is revoked. @item unsigned int invalid : 1 This is true if the user ID is invalid. -@item GpgmeValidity validity +@item gpgme_validity_t validity This specifies the validity of the user ID. @item char *uid @@ -1948,13 +1948,13 @@ This is the comment component of @code{uid}, if available. @item char *email This is the email component of @code{uid}, if available. -@item GpgmeKeySig signatures +@item gpgme_key_sig_t signatures This is a linked list with the signatures on this user ID. @end table @end deftp -@deftp {Data type} GpgmeKey -The @code{GpgmeKey} type is a pointer to a key object. It has the +@deftp {Data type} gpgme_key_t +The @code{gpgme_key_t} type is a pointer to a key object. It has the following members: @table @code @@ -1985,7 +1985,7 @@ certification. @item unsigned int secret : 1 This is true if the key is a secret key. -@item GpgmeProtocol protocol +@item gpgme_protocol_t protocol This is the protocol supported by this key. @item char *issuer_serial @@ -2000,15 +2000,15 @@ issuer name. If @code{protocol} is @code{GPGME_PROTOCOL_CMS}, then this is the chain ID, which can be used to built the certificate chain. -@item GpgmeValidity owner_trust +@item gpgme_validity_t owner_trust If @code{protocol} is @code{GPGME_PROTOCOL_OpenPGP}, then this is the owner trust. -@item GpgmeSubkey subkeys +@item gpgme_sub_key_t subkeys This is a linked list with the subkeys of the key. The first subkey in the list is the primary key and usually available. -@item GpgmeUserID uids +@item gpgme_user_id_t uids This is a linked list with the user IDs of the key. The first user ID in the list is the main (or primary) user ID. @end table @@ -2034,7 +2034,7 @@ in the list is the main (or primary) user ID. @cindex key ring, list @cindex key ring, search -@deftypefun GpgmeError gpgme_op_keylist_start (@w{GpgmeCtx @var{ctx}}, @w{const char *@var{pattern}}, @w{int @var{secret_only}}) +@deftypefun gpgme_error_t gpgme_op_keylist_start (@w{gpgme_ctx_t @var{ctx}}, @w{const char *@var{pattern}}, @w{int @var{secret_only}}) The function @code{gpgme_op_keylist_start} initiates a key listing operation inside the context @var{ctx}. It sets everything up so that subsequent invocations of @code{gpgme_op_keylist_next} return the keys @@ -2056,7 +2056,7 @@ valid pointer, and passes through any errors that are reported by the crypto engine support routines. @end deftypefun -@deftypefun GpgmeError gpgme_op_keylist_ext_start (@w{GpgmeCtx @var{ctx}}, @w{const char *@var{pattern}[]}, @w{int @var{secret_only}}, @w{int @var{reserved}}) +@deftypefun gpgme_error_t gpgme_op_keylist_ext_start (@w{gpgme_ctx_t @var{ctx}}, @w{const char *@var{pattern}[]}, @w{int @var{secret_only}}, @w{int @var{reserved}}) The function @code{gpgme_op_keylist_ext_start} initiates an extended key listing operation inside the context @var{ctx}. It sets everything up so that subsequent invocations of @@ -2081,13 +2081,13 @@ valid pointer, and passes through any errors that are reported by the crypto engine support routines. @end deftypefun -@deftypefun GpgmeError gpgme_op_keylist_next (@w{GpgmeCtx @var{ctx}}, @w{GpgmeKey *@var{r_key}}) +@deftypefun gpgme_error_t gpgme_op_keylist_next (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_key_t *@var{r_key}}) The function @code{gpgme_op_keylist_next} returns the next key in the list created by a previous @code{gpgme_op_keylist_start} operation in the context @var{ctx}. The key will have one reference for the user. @xref{Manipulating Keys}. -This is the only way to get at @code{GpgmeKey} objects in +This is the only way to get at @code{gpgme_key_t} objects in @acronym{GPGME}. If the last key in the list has already been returned, @@ -2098,7 +2098,7 @@ The function returns @code{GPGME_Invalid_Value} if @var{ctx} or there is not enough memory for the operation. @end deftypefun -@deftypefun GpgmeError gpgme_op_keylist_end (@w{GpgmeCtx @var{ctx}}) +@deftypefun gpgme_error_t gpgme_op_keylist_end (@w{gpgme_ctx_t @var{ctx}}) The function @code{gpgme_op_keylist_next} ends a pending key list operation in the context @var{ctx}. @@ -2116,8 +2116,8 @@ string (@code{g10code}) can be listed with their key ID and the name and e-mail address of the main user ID: @example -GpgmeCtx ctx; -GpgmeError err = gpgme_new (&ctx); +gpgme_ctx_t ctx; +gpgme_error_t err = gpgme_new (&ctx); if (!err) @{ @@ -2140,7 +2140,7 @@ if (err) @} @end example -@deftp {Data type} {GpgmeKeyListResult} +@deftp {Data type} {gpgme_keylist_result_t} This is a pointer to a structure used to store the result of a @code{gpgme_op_keylist_*} operation. After successfully ending a key listing operation, you can retrieve the pointer to the result with @@ -2154,9 +2154,9 @@ less than the desired keys could be listed. @end table @end deftp -@deftypefun GpgmeKeyListResult gpgme_op_keylist_result (@w{GpgmeCtx @var{ctx}}) +@deftypefun gpgme_keylist_result_t gpgme_op_keylist_result (@w{gpgme_ctx_t @var{ctx}}) The function @code{gpgme_op_keylist_result} returns a -@code{GpgmeKeyListResult} pointer to a structure holding the result of +@code{gpgme_keylist_result_t} pointer to a structure holding the result of a @code{gpgme_op_keylist_*} operation. The pointer is only valid if the last operation on the context was a key listing operation, and if this operation finished successfully. The returned pointer is only @@ -2166,7 +2166,7 @@ valid until the next operation is started on the context. In a simple program, for which a blocking operation is acceptable, the following function can be used to retrieve a single key. -@deftypefun GpgmeError gpgme_get_key (@w{GpgmeCtx @var{ctx}}, @w{const char *@var{fpr}}, @w{GpgmeKey *@var{r_key}}, @w{int @var{secret}}) +@deftypefun gpgme_error_t gpgme_get_key (@w{gpgme_ctx_t @var{ctx}}, @w{const char *@var{fpr}}, @w{gpgme_key_t *@var{r_key}}, @w{int @var{secret}}) The function @code{gpgme_get_key} gets the key with the fingerprint (or key ID) @var{fpr} from the crypto backend and return it in @var{r_key}. If @var{force_update} is true, force a refresh of the @@ -2192,10 +2192,10 @@ available. @cindex attributes, of a key Please see the beginning of this section for more information about -@code{GpgmeKey} objects. +@code{gpgme_key_t} objects. -@deftp {Data type} GpgmeValidity -The @code{GpgmeValidity} type is used to specify the validity of a user ID +@deftp {Data type} gpgme_validity_t +The @code{gpgme_validity_t} type is used to specify the validity of a user ID in a key. The following validities are defined: @table @code @@ -2230,8 +2230,8 @@ The following interfaces are deprecated and only provided for backward compatibility. Don't use them. They will be removed in a future version of @acronym{GPGME}. -@deftp {Data type} GpgmeAttr -The @code{GpgmeAttr} type is used to specify a key or trust item +@deftp {Data type} gpgme_attr_t +The @code{gpgme_attr_t} type is used to specify a key or trust item attribute. The following attributes are defined: @table @code @@ -2266,7 +2266,7 @@ XXX FIXME (also for trust items) @item GPGME_ATTR_USERID This is a user ID. There can be more than one user IDs in a -@var{GpgmeKey} object. The first one (with index 0) is the primary +@var{gpgme_key_t} object. The first one (with index 0) is the primary user ID. The user ID is representable as a number. For trust items, this is the user ID associated with this trust item. @@ -2362,7 +2362,7 @@ is representable as a string. @end table @end deftp -@deftypefun {const char *} gpgme_key_get_string_attr (@w{GpgmeKey @var{key}}, @w{GpgmeAttr @var{what}}, @w{const void *@var{reserved}}, @w{int @var{idx}}) +@deftypefun {const char *} gpgme_key_get_string_attr (@w{gpgme_key_t @var{key}}, @w{gpgme_attr_t @var{what}}, @w{const void *@var{reserved}}, @w{int @var{idx}}) The function @code{gpgme_key_get_string_attr} returns the value of the string-representable attribute @var{what} of key @var{key}. If the attribute is an attribute of a sub key or an user ID, @var{idx} @@ -2377,7 +2377,7 @@ string, @var{key} is not a valid pointer, @var{idx} out of range, or @var{reserved} not @code{NULL}. @end deftypefun -@deftypefun {unsigned long} gpgme_key_get_ulong_attr (@w{GpgmeKey @var{key}}, @w{GpgmeAttr @var{what}}, @w{const void *@var{reserved}}, @w{int @var{idx}}) +@deftypefun {unsigned long} gpgme_key_get_ulong_attr (@w{gpgme_key_t @var{key}}, @w{gpgme_attr_t @var{what}}, @w{const void *@var{reserved}}, @w{int @var{idx}}) The function @code{gpgme_key_get_ulong_attr} returns the value of the number-representable attribute @var{what} of key @var{key}. If the attribute is an attribute of a sub key or an user ID, @var{idx} @@ -2409,8 +2409,8 @@ key, you have to make sure that the key was listed with signatures enabled. One convenient, but blocking, way to do this is to use the function @code{gpgme_get_key}. -@deftp {Data type} GpgmeAttr -The @code{GpgmeAttr} type is used to specify a key signature +@deftp {Data type} gpgme_attr_t +The @code{gpgme_attr_t} type is used to specify a key signature attribute. The following attributes are defined: @table @code @@ -2471,7 +2471,7 @@ This is the same value as returned by @code{gpgme_get_sig_status}. @end table @end deftp -@deftypefun {const char *} gpgme_key_sig_get_string_attr (@w{GpgmeKey @var{key}}, @w{int @var{uid_idx}}, @w{GpgmeAttr @var{what}}, @w{const void *@var{reserved}}, @w{int @var{idx}}) +@deftypefun {const char *} gpgme_key_sig_get_string_attr (@w{gpgme_key_t @var{key}}, @w{int @var{uid_idx}}, @w{gpgme_attr_t @var{what}}, @w{const void *@var{reserved}}, @w{int @var{idx}}) The function @code{gpgme_key_sig_get_string_attr} returns the value of the string-representable attribute @var{what} of the signature @var{idx} on the user ID @var{uid_idx} in the key @var{key}. The @@ -2485,7 +2485,7 @@ string, @var{key} is not a valid pointer, @var{uid_idx} or @var{idx} out of range, or @var{reserved} not @code{NULL}. @end deftypefun -@deftypefun {unsigned long} gpgme_key_sig_get_ulong_attr (@w{GpgmeKey @var{key}}, @w{int @var{uid_idx}}, @w{GpgmeAttr @var{what}}, @w{const void *@var{reserved}}, @w{int @var{idx}}) +@deftypefun {unsigned long} gpgme_key_sig_get_ulong_attr (@w{gpgme_key_t @var{key}}, @w{int @var{uid_idx}}, @w{gpgme_attr_t @var{what}}, @w{const void *@var{reserved}}, @w{int @var{idx}}) The function @code{gpgme_key_sig_get_ulong_attr} returns the value of the number-representable attribute @var{what} of the signature @var{idx} on the user ID @var{uid_idx} in the key @var{key}. The @@ -2502,12 +2502,12 @@ out of range, or @var{reserved} not @code{NULL}. @subsection Manipulating Keys @cindex key, manipulation -@deftypefun void gpgme_key_ref (@w{GpgmeKey @var{key}}) +@deftypefun void gpgme_key_ref (@w{gpgme_key_t @var{key}}) The function @code{gpgme_key_ref} acquires an additional reference for the key @var{key}. @end deftypefun -@deftypefun void gpgme_key_unref (@w{GpgmeKey @var{key}}) +@deftypefun void gpgme_key_unref (@w{gpgme_key_t @var{key}}) The function @code{gpgme_key_unref} releases a reference for the key @var{key}. If this was the last reference, the key will be destroyed and all resources associated to it will be released. @@ -2518,7 +2518,7 @@ The following interface is deprecated and only provided for backward compatibility. Don't use it. It will be removed in a future version of @acronym{GPGME}. -@deftypefun void gpgme_key_release (@w{GpgmeKey @var{key}}) +@deftypefun void gpgme_key_release (@w{gpgme_key_t @var{key}}) The function @code{gpgme_key_release} is equivalent to @code{gpgme_key_unref}. @end deftypefun @@ -2529,7 +2529,7 @@ The function @code{gpgme_key_release} is equivalent to @cindex key, creation @cindex key ring, add -@deftypefun GpgmeError gpgme_op_genkey (@w{GpgmeCtx @var{ctx}}, @w{const char *@var{parms}}, @w{GpgmeData @var{public}}, @w{GpgmeData @var{secret}}) +@deftypefun gpgme_error_t gpgme_op_genkey (@w{gpgme_ctx_t @var{ctx}}, @w{const char *@var{parms}}, @w{gpgme_data_t @var{public}}, @w{gpgme_data_t @var{secret}}) The function @code{gpgme_op_genkey} generates a new key pair in the context @var{ctx}. The meaning of @var{public} and @var{secret} depends on the crypto backend. @@ -2590,7 +2590,7 @@ a valid XML string, @code{GPGME_Not_Supported} if @var{public} or was created by the backend. @end deftypefun -@deftypefun GpgmeError gpgme_op_genkey_start (@w{GpgmeCtx @var{ctx}}, @w{const char *@var{parms}}, @w{GpgmeData @var{public}}, @w{GpgmeData @var{secret}}) +@deftypefun gpgme_error_t gpgme_op_genkey_start (@w{gpgme_ctx_t @var{ctx}}, @w{const char *@var{parms}}, @w{gpgme_data_t @var{public}}, @w{gpgme_data_t @var{secret}}) The function @code{gpgme_op_genkey_start} initiates a @code{gpgme_op_genkey} operation. It can be completed by calling @code{gpgme_wait} on the context. @xref{Waiting For Completion}. @@ -2601,7 +2601,7 @@ a valid XML string, and @code{GPGME_Not_Supported} if @var{public} or @var{secret} is not @code{NULL}. @end deftypefun -@deftp {Data type} {GpgmeGenKeyResult} +@deftp {Data type} {gpgme_genkey_result_t} This is a pointer to a structure used to store the result of a @code{gpgme_op_genkey} operation. After successfully generating a key, you can retrieve the pointer to the result with @@ -2625,9 +2625,9 @@ fingerprint, @code{fpr} will be a null pointer. @end table @end deftp -@deftypefun GpgmeGenKeyResult gpgme_op_genkey_result (@w{GpgmeCtx @var{ctx}}) +@deftypefun gpgme_genkey_result_t gpgme_op_genkey_result (@w{gpgme_ctx_t @var{ctx}}) The function @code{gpgme_op_genkey_result} returns a -@code{GpgmeGenKeyResult} pointer to a structure holding the result of +@code{gpgme_genkey_result_t} pointer to a structure holding the result of a @code{gpgme_op_genkey} operation. The pointer is only valid if the last operation on the context was a @code{gpgme_op_genkey} or @code{gpgme_op_genkey_start} operation, and if this operation finished @@ -2641,7 +2641,7 @@ operation is started on the context. @cindex key, export @cindex key ring, export from -@deftypefun GpgmeError gpgme_op_export (@w{GpgmeCtx @var{ctx}}, @w{GpgmeRecipients @var{recipients}}, @w{GpgmeData @var{keydata}}) +@deftypefun gpgme_error_t gpgme_op_export (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_recipients_t @var{recipients}}, @w{gpgme_data_t @var{keydata}}) The function @code{gpgme_op_export} extracts the public keys of the user IDs in @var{recipients} and returns them in the data buffer @var{keydata}. The type of the public keys returned is determined by @@ -2654,7 +2654,7 @@ passes through any errors that are reported by the crypto engine support routines. @end deftypefun -@deftypefun GpgmeError gpgme_op_export_start (@w{GpgmeCtx @var{ctx}}, @w{GpgmeRecipients @var{recipients}}, @w{GpgmeData @var{keydata}}) +@deftypefun gpgme_error_t gpgme_op_export_start (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_recipients_t @var{recipients}}, @w{gpgme_data_t @var{keydata}}) The function @code{gpgme_op_export_start} initiates a @code{gpgme_op_export} operation. It can be completed by calling @code{gpgme_wait} on the context. @xref{Waiting For Completion}. @@ -2671,7 +2671,7 @@ data buffer. @cindex key, import @cindex key ring, import to -@deftypefun GpgmeError gpgme_op_import (@w{GpgmeCtx @var{ctx}}, @w{GpgmeData @var{keydata}}) +@deftypefun gpgme_error_t gpgme_op_import (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{keydata}}) The function @code{gpgme_op_import} adds the keys in the data buffer @var{keydata} to the key ring of the crypto engine used by @var{ctx}. The format of @var{keydata} can be @var{ASCII} armored, for example, @@ -2686,7 +2686,7 @@ or @var{keydata} is not a valid pointer, and @code{GPGME_No_Data} if @var{keydata} is an empty data buffer. @end deftypefun -@deftypefun GpgmeError gpgme_op_import_start (@w{GpgmeCtx @var{ctx}}, @w{GpgmeData @var{keydata}}) +@deftypefun gpgme_error_t gpgme_op_import_start (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{keydata}}) The function @code{gpgme_op_import_start} initiates a @code{gpgme_op_import} operation. It can be completed by calling @code{gpgme_wait} on the context. @xref{Waiting For Completion}. @@ -2697,21 +2697,21 @@ started successfully, @code{GPGME_Invalid_Value} if @var{keydata} if @code{GPGME_No_Data} if @var{keydata} is an empty data buffer. @end deftypefun -@deftp {Data type} {GpgmeImportStatus} +@deftp {Data type} {gpgme_import_status_t} This is a pointer to a structure used to store a part of the result of a @code{gpgme_op_import} operation. For each considered key one status is added that contains information about the result of the import. The structure contains the following members: @table @code -@item GpgmeImportStatus next +@item gpgme_import_status_t next This is a pointer to the next status structure in the linked list, or @code{NULL} if this is the last element. @item char *fpr This is the fingerprint of the key that was considered. -@item GpgmeError result +@item gpgme_error_t result If the import was not successful, this is the error value that caused the import to fail. Otherwise it is @code{GPGME_No_Error}. @@ -2739,7 +2739,7 @@ The key contained a secret key. @end table @end deftp -@deftp {Data type} {GpgmeImportResult} +@deftp {Data type} {gpgme_import_result_t} This is a pointer to a structure used to store the result of a @code{gpgme_op_import} operation. After a successful import operation, you can retrieve the pointer to the result with @@ -2786,15 +2786,15 @@ The number of unchanged secret keys. @item not_imported The number of keys not imported. -@item GpgmeImportStatus imports -A list of GpgmeImportStatus objects which contain more information +@item gpgme_import_status_t imports +A list of gpgme_import_status_t objects which contain more information about the keys for which an import was attempted. @end table @end deftp -@deftypefun GpgmeImportResult gpgme_op_import_result (@w{GpgmeCtx @var{ctx}}) +@deftypefun gpgme_import_result_t gpgme_op_import_result (@w{gpgme_ctx_t @var{ctx}}) The function @code{gpgme_op_import_result} returns a -@code{GpgmeImportResult} pointer to a structure holding the result of +@code{gpgme_import_result_t} pointer to a structure holding the result of a @code{gpgme_op_import} operation. The pointer is only valid if the last operation on the context was a @code{gpgme_op_import} or @code{gpgme_op_import_start} operation, and if this operation finished @@ -2806,14 +2806,14 @@ The following interface is deprecated and only provided for backward compatibility. Don't use it. It will be removed in a future version of @acronym{GPGME}. -@deftypefun GpgmeError gpgme_op_import_ext (@w{GpgmeCtx @var{ctx}}, @w{GpgmeData @var{keydata}}, @w{int *@var{nr}}) +@deftypefun gpgme_error_t gpgme_op_import_ext (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{keydata}}, @w{int *@var{nr}}) The function @code{gpgme_op_import_ext} is equivalent to: @example - GpgmeError err = gpgme_op_import (ctx, keydata); + gpgme_error_t err = gpgme_op_import (ctx, keydata); if (!err) @{ - GpgmeImportResult result = gpgme_op_import_result (ctx); + gpgme_import_result_t result = gpgme_op_import_result (ctx); *nr = result->considered; @} @end example @@ -2825,7 +2825,7 @@ The function @code{gpgme_op_import_ext} is equivalent to: @cindex key, delete @cindex key ring, delete from -@deftypefun GpgmeError gpgme_op_delete (@w{GpgmeCtx @var{ctx}}, @w{const GpgmeKey @var{key}}, @w{int @var{allow_secret}}) +@deftypefun gpgme_error_t gpgme_op_delete (@w{gpgme_ctx_t @var{ctx}}, @w{const gpgme_key_t @var{key}}, @w{int @var{allow_secret}}) The function @code{gpgme_op_delete} deletes the key @var{key} from the key ring of the crypto engine used by @var{ctx}. If @var{allow_secret} is @code{0}, only public keys are deleted, @@ -2839,7 +2839,7 @@ key was not specified unambiguously, and @code{GPGME_Conflict} if the secret key for @var{key} is available, but @var{allow_secret} is zero. @end deftypefun -@deftypefun GpgmeError gpgme_op_delete_start (@w{GpgmeCtx @var{ctx}}, @w{const GpgmeKey @var{key}}, @w{int @var{allow_secret}}) +@deftypefun gpgme_error_t gpgme_op_delete_start (@w{gpgme_ctx_t @var{ctx}}, @w{const gpgme_key_t @var{key}}, @w{int @var{allow_secret}}) The function @code{gpgme_op_delete_start} initiates a @code{gpgme_op_delete} operation. It can be completed by calling @code{gpgme_wait} on the context. @xref{Waiting For Completion}. @@ -2856,8 +2856,8 @@ started successfully, and @code{GPGME_Invalid_Value} if @var{ctx} or @strong{Caution:} The trust items interface is experimental. -@deftp {Data type} GpgmeTrustItem -The @code{GpgmeTrustItem} type is a pointer to a trust item object. +@deftp {Data type} gpgme_trust_item_t +The @code{gpgme_trust_item_t} type is a pointer to a trust item object. It has the following members: @table @code @@ -2884,7 +2884,7 @@ The user name if @code{type} is 2. @menu * Listing Trust Items:: Browsing the list of available trust items. -* Information About Trust Items:: Requesting detailed information about trust items. +* Information About Trust Items:: Requesting information about trust items. * Manipulating Trust Items:: Operations on trust items. @end menu @@ -2893,7 +2893,7 @@ The user name if @code{type} is 2. @subsection Listing Trust Items @cindex trust item list -@deftypefun GpgmeError gpgme_op_trustlist_start (@w{GpgmeCtx @var{ctx}}, @w{const char *@var{pattern}}, @w{int @var{max_level}}) +@deftypefun gpgme_error_t gpgme_op_trustlist_start (@w{gpgme_ctx_t @var{ctx}}, @w{const char *@var{pattern}}, @w{int @var{max_level}}) The function @code{gpgme_op_trustlist_start} initiates a trust item listing operation inside the context @var{ctx}. It sets everything up so that subsequent invocations of @code{gpgme_op_trustlist_next} return @@ -2914,13 +2914,13 @@ valid pointer, and passes through any errors that are reported by the crypto engine support routines. @end deftypefun -@deftypefun GpgmeError gpgme_op_trustlist_next (@w{GpgmeCtx @var{ctx}}, @w{GpgmeTrustItem *@var{r_item}}) +@deftypefun gpgme_error_t gpgme_op_trustlist_next (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_trust_item_t *@var{r_item}}) The function @code{gpgme_op_trustlist_next} returns the next trust item in the list created by a previous @code{gpgme_op_trustlist_start} operation in the context @var{ctx}. The trust item can be destroyed with @code{gpgme_trust_item_release}. @xref{Manipulating Trust Items}. -This is the only way to get at @code{GpgmeTrustItem} objects in +This is the only way to get at @code{gpgme_trust_item_t} objects in @acronym{GPGME}. If the last trust item in the list has already been returned, @@ -2931,7 +2931,7 @@ The function returns @code{GPGME_Invalid_Value} if @var{ctx} or there is not enough memory for the operation. @end deftypefun -@deftypefun GpgmeError gpgme_op_trustlist_end (@w{GpgmeCtx @var{ctx}}) +@deftypefun gpgme_error_t gpgme_op_trustlist_end (@w{gpgme_ctx_t @var{ctx}}) The function @code{gpgme_op_trustlist_next} ends a pending key list operation in the context @var{ctx}. @@ -2955,7 +2955,7 @@ Trust items have attributes which can be queried using the interfaces below. The attribute identifiers are shared with those for key attributes. @xref{Information About Keys}. -@deftypefun {const char *} gpgme_trust_item_get_string_attr (@w{GpgmeTrustItem @var{item}}, @w{GpgmeAttr @var{what}}, @w{const void *@var{reserved}}, @w{int @var{idx}}) +@deftypefun {const char *} gpgme_trust_item_get_string_attr (@w{gpgme_trust_item_t @var{item}}, @w{gpgme_attr_t @var{what}}, @w{const void *@var{reserved}}, @w{int @var{idx}}) The function @code{gpgme_trust_item_get_string_attr} returns the value of the string-representable attribute @var{what} of trust item @var{item}. The arguments @var{idx} and @var{reserved} are reserved @@ -2968,7 +2968,7 @@ string, @var{key} is not a valid pointer, @var{idx} out of range, or @var{reserved} not @code{NULL}. @end deftypefun -@deftypefun int gpgme_trust_item_get_int_attr (@w{GpgmeTrustItem @var{item}}, @w{GpgmeAttr @var{what}}, @w{const void *@var{reserved}}, @w{int @var{idx}}) +@deftypefun int gpgme_trust_item_get_int_attr (@w{gpgme_trust_item_t @var{item}}, @w{gpgme_attr_t @var{what}}, @w{const void *@var{reserved}}, @w{int @var{idx}}) The function @code{gpgme_trust_item_get_int_attr} returns the value of the number-representable attribute @var{what} of trust item @var{item}. If the attribute occurs more than once in the trust item, @@ -2986,12 +2986,12 @@ or @var{reserved} not @code{NULL}. @subsection Manipulating Trust Items @cindex trust item, manipulation -@deftypefun void gpgme_trust_item_ref (@w{GpgmeTrustItem @var{item}}) +@deftypefun void gpgme_trust_item_ref (@w{gpgme_trust_item_t @var{item}}) The function @code{gpgme_trust_item_ref} acquires an additional reference for the trust item @var{item}. @end deftypefun -@deftypefun void gpgme_trust_item_unref (@w{GpgmeTrustItem @var{item}}) +@deftypefun void gpgme_trust_item_unref (@w{gpgme_trust_item_t @var{item}}) The function @code{gpgme_trust_item_unref} releases a reference for the trust item @var{item}. If this was the last reference, the trust item will be destroyed and all resources associated to it will be @@ -3003,7 +3003,7 @@ The following interface is deprecated and only provided for backward compatibility. Don't use it. It will be removed in a future version of @acronym{GPGME}. -@deftypefun void gpgme_trust_item_release (@w{GpgmeTrustItem @var{item}}) +@deftypefun void gpgme_trust_item_release (@w{gpgme_trust_item_t @var{item}}) The function @code{gpgme_trust_item_release} is an alias for @code{gpgme_trust_item_unref}. @end deftypefun @@ -3017,20 +3017,20 @@ Sometimes, the result of a crypto operation returns a list of invalid user IDs encountered in processing the request. The following structure is used to hold information about such an user ID. -@deftp {Data type} {GpgmeInvalidUserID} +@deftp {Data type} {gpgme_invalid_user_id_t} This is a pointer to a structure used to store a part of the result of a crypto operation which takes user IDs as one input parameter. The structure contains the following members: @table @code -@item GpgmeInvalidUserID next +@item gpgme_invalid_user_id_t next This is a pointer to the next invalid user ID structure in the linked list, or @code{NULL} if this is the last element. @item char *id The invalid user ID encountered. -@item GpgmeError reason +@item gpgme_error_t reason An error code describing the reason why the user ID was found invalid. @end table @end deftp @@ -3050,7 +3050,7 @@ An error code describing the reason why the user ID was found invalid. @cindex decryption @cindex cryptographic operation, decryption -@deftypefun GpgmeError gpgme_op_decrypt (@w{GpgmeCtx @var{ctx}}, @w{GpgmeData @var{cipher}}, @w{GpgmeData @var{plain}}) +@deftypefun gpgme_error_t gpgme_op_decrypt (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{cipher}}, @w{gpgme_data_t @var{plain}}) The function @code{gpgme_op_decrypt} decrypts the ciphertext in the data object @var{cipher} and stores it into the data object @var{plain}. @@ -3065,7 +3065,7 @@ secret key could not be retrieved, and passes through any errors that are reported by the crypto engine support routines. @end deftypefun -@deftypefun GpgmeError gpgme_op_decrypt_start (@w{GpgmeCtx @var{ctx}}, @w{GpgmeData @var{cipher}}, @w{GpgmeData @var{plain}}) +@deftypefun gpgme_error_t gpgme_op_decrypt_start (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{cipher}}, @w{gpgme_data_t @var{plain}}) The function @code{gpgme_op_decrypt_start} initiates a @code{gpgme_op_decrypt} operation. It can be completed by calling @code{gpgme_wait} on the context. @xref{Waiting For Completion}. @@ -3075,7 +3075,7 @@ started successfully, and @code{GPGME_Invalid_Value} if @var{cipher} or @var{plain} is not a valid pointer. @end deftypefun -@deftp {Data type} {GpgmeDecryptResult} +@deftp {Data type} {gpgme_decrypt_result_t} This is a pointer to a structure used to store the result of a @code{gpgme_op_decrypt} operation. After successfully encrypting data, you can retrieve the pointer to the result with @@ -3089,9 +3089,9 @@ algorithm that is not supported. @end table @end deftp -@deftypefun GpgmeDecryptResult gpgme_op_decrypt_result (@w{GpgmeCtx @var{ctx}}) +@deftypefun gpgme_decrypt_result_t gpgme_op_decrypt_result (@w{gpgme_ctx_t @var{ctx}}) The function @code{gpgme_op_decrypt_result} returns a -@code{GpgmeDecryptResult} pointer to a structure holding the result of +@code{gpgme_decrypt_result_t} pointer to a structure holding the result of a @code{gpgme_op_decrypt} operation. The pointer is only valid if the last operation on the context was a @code{gpgme_op_decrypt} or @code{gpgme_op_decrypt_start} operation, and if this operation @@ -3107,7 +3107,7 @@ next operation is started on the context. @cindex cryptographic operation, verification @cindex cryptographic operation, signature check -@deftypefun GpgmeError gpgme_op_verify (@w{GpgmeCtx @var{ctx}}, @w{GpgmeData @var{sig}}, @w{GpgmeData @var{signed_text}}, @w{GpgmeData @var{plain}}) +@deftypefun gpgme_error_t gpgme_op_verify (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{sig}}, @w{gpgme_data_t @var{signed_text}}, @w{gpgme_data_t @var{plain}}) The function @code{gpgme_op_verify} verifies that the signature in the data object @var{sig} is a valid signature. If @var{sig} is a detached signature, then the signed text should be provided in @@ -3128,7 +3128,7 @@ and passes through any errors that are reported by the crypto engine support routines. @end deftypefun -@deftypefun GpgmeError gpgme_op_verify_start (@w{GpgmeCtx @var{ctx}}, @w{GpgmeData @var{sig}}, @w{GpgmeData @var{signed_text}}, @w{GpgmeData @var{plain}}) +@deftypefun gpgme_error_t gpgme_op_verify_start (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{sig}}, @w{gpgme_data_t @var{signed_text}}, @w{gpgme_data_t @var{plain}}) The function @code{gpgme_op_verify_start} initiates a @code{gpgme_op_verify} operation. It can be completed by calling @code{gpgme_wait} on the context. @xref{Waiting For Completion}. @@ -3140,13 +3140,13 @@ started successfully, @code{GPGME_Invalid_Value} if @var{ctx}, data to verify. @end deftypefun -@deftp {Data type} {GpgmeSigNotation} +@deftp {Data type} {gpgme_sig_notation_t} This is a pointer to a structure used to store a part of the result of a @code{gpgme_op_verify} operation. The structure contains the following members: @table @code -@item GpgmeSigNotation next +@item gpgme_sig_notation_t next This is a pointer to the next new signature notation structure in the linked list, or @code{NULL} if this is the last element. @@ -3160,13 +3160,13 @@ this is a policy URL. @end table @end deftp -@deftp {Data type} {GpgmeSignature} +@deftp {Data type} {gpgme_signature_t} This is a pointer to a structure used to store a part of the result of a @code{gpgme_op_verify} operation. The structure contains the following members: @table @code -@item GpgmeSignature next +@item gpgme_signature_t next This is a pointer to the next new signature structure in the linked list, or @code{NULL} if this is the last element. @@ -3220,7 +3220,7 @@ The defined bits are: @item char *fpr This is the fingerprint or key ID of the signature. -@item GpgmeError status +@item gpgme_error_t status This is the status of the signature. In particular, the following status codes are of interest: @@ -3253,7 +3253,7 @@ status codes are of interest: the signature verification. @end table -@item GpgmeSigNotation notations +@item gpgme_sig_notation_t notations This is a linked list with the notation data and policy URLs. @item unsigned long timestamp @@ -3265,13 +3265,13 @@ not expire. @item int wrong_key_usage : 1; -@item GpgmeValidity validity +@item gpgme_validity_t validity -@item GpgmeError validity_reason +@item gpgme_error_t validity_reason @end table @end deftp -@deftp {Data type} {GpgmeVerifyResult} +@deftp {Data type} {gpgme_verify_result_t} This is a pointer to a structure used to store the result of a @code{gpgme_op_verify} operation. After successfully verifying a signature, you can retrieve the pointer to the result with @@ -3279,15 +3279,15 @@ signature, you can retrieve the pointer to the result with member: @table @code -@item GpgmeSignature signatures +@item gpgme_signature_t signatures A linked list with information about all signatures for which a verification was attempted. @end table @end deftp -@deftypefun GpgmeSignResult gpgme_op_verify_result (@w{GpgmeCtx @var{ctx}}) +@deftypefun gpgme_sign_result_t gpgme_op_verify_result (@w{gpgme_ctx_t @var{ctx}}) The function @code{gpgme_op_verify_result} returns a -@code{GpgmeVerifyResult} pointer to a structure holding the result of +@code{gpgme_verify_result_t} pointer to a structure holding the result of a @code{gpgme_op_verify} operation. The pointer is only valid if the last operation on the context was a @code{gpgme_op_verify} or @code{gpgme_op_verify_start} operation, and if this operation finished @@ -3300,9 +3300,9 @@ The following interfaces are deprecated and only provided for backward compatibility. Don't use them. They will be removed in a future version of @acronym{GPGME}. -@deftp {Data type} {enum GpgmeSigStat} -@tindex GpgmeSigStat -The @code{GpgmeSigStat} type holds the result of a signature check, or +@deftp {Data type} {enum gpgme_sig_stat_t} +@tindex gpgme_sig_stat_t +The @code{gpgme_sig_stat_t} type holds the result of a signature check, or the combined result of all signatures. The following results are possible: @@ -3348,12 +3348,12 @@ have a different status. You can get each key's status with @end table @end deftp -@deftypefun {const char *} gpgme_get_sig_status (@w{GpgmeCtx @var{ctx}}, @w{int @var{idx}}, @w{GpgmeSigStat *@var{r_stat}}, @w{time_t *@var{r_created}}) +@deftypefun {const char *} gpgme_get_sig_status (@w{gpgme_ctx_t @var{ctx}}, @w{int @var{idx}}, @w{gpgme_sig_stat_t *@var{r_stat}}, @w{time_t *@var{r_created}}) The function @code{gpgme_get_sig_status} is equivalent to: @example - GpgmeVerifyResult result; - GpgmeSignature sig; + gpgme_verify_result_t result; + gpgme_signature_t sig; result = gpgme_op_verify_result (ctx); sig = result->signatures; @@ -3405,12 +3405,12 @@ The function @code{gpgme_get_sig_status} is equivalent to: @end example @end deftypefun -@deftypefun {const char *} gpgme_get_sig_string_attr (@w{GpgmeCtx @var{ctx}}, @w{int @var{idx}}, @w{GpgmeAttr @var{what}}, @w{int @var{whatidx}}) +@deftypefun {const char *} gpgme_get_sig_string_attr (@w{gpgme_ctx_t @var{ctx}}, @w{int @var{idx}}, @w{gpgme_attr_t @var{what}}, @w{int @var{whatidx}}) The function @code{gpgme_get_sig_string_attr} is equivalent to: @example - GpgmeVerifyResult result; - GpgmeSignature sig; + gpgme_verify_result_t result; + gpgme_signature_t sig; result = gpgme_op_verify_result (ctx); sig = result->signatures; @@ -3441,12 +3441,12 @@ The function @code{gpgme_get_sig_string_attr} is equivalent to: @end example @end deftypefun -@deftypefun {const char *} gpgme_get_sig_ulong_attr (@w{GpgmeCtx @var{ctx}}, @w{int @var{idx}}, @w{GpgmeAttr @var{waht}}, @w{int @var{whatidx}}) +@deftypefun {const char *} gpgme_get_sig_ulong_attr (@w{gpgme_ctx_t @var{ctx}}, @w{int @var{idx}}, @w{gpgme_attr_t @var{waht}}, @w{int @var{whatidx}}) The function @code{gpgme_get_sig_ulong_attr} is equivalent to: @example - GpgmeVerifyResult result; - GpgmeSignature sig; + gpgme_verify_result_t result; + gpgme_signature_t sig; result = gpgme_op_verify_result (ctx); sig = result->signatures; @@ -3505,12 +3505,12 @@ The function @code{gpgme_get_sig_ulong_attr} is equivalent to: @end example @end deftypefun -@deftypefun {const char *} gpgme_get_sig_key (@w{GpgmeCtx @var{ctx}}, @w{int @var{idx}}, @w{GpgmeKey *@var{r_key}}) +@deftypefun {const char *} gpgme_get_sig_key (@w{gpgme_ctx_t @var{ctx}}, @w{int @var{idx}}, @w{gpgme_key_t *@var{r_key}}) The function @code{gpgme_get_sig_key} is equivalent to: @example - GpgmeVerifyResult result; - GpgmeSignature sig; + gpgme_verify_result_t result; + gpgme_signature_t sig; result = gpgme_op_verify_result (ctx); sig = result->signatures; @@ -3535,7 +3535,7 @@ The function @code{gpgme_get_sig_key} is equivalent to: @cindex signature check @cindex cryptographic operation, decryption and verification -@deftypefun GpgmeError gpgme_op_decrypt_verify (@w{GpgmeCtx @var{ctx}}, @w{GpgmeData @var{cipher}}, @w{GpgmeData @var{plain}}) +@deftypefun gpgme_error_t gpgme_op_decrypt_verify (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{cipher}}, @w{gpgme_data_t @var{plain}}) The function @code{gpgme_op_decrypt_verify} decrypts the ciphertext in the data object @var{cipher} and stores it into the data object @var{plain}. If @var{cipher} contains signatures, they will be @@ -3555,7 +3555,7 @@ secret key could not be retrieved, and passes through any errors that are reported by the crypto engine support routines. @end deftypefun -@deftypefun GpgmeError gpgme_op_decrypt_verify (@w{GpgmeCtx @var{ctx}}, @w{GpgmeData @var{cipher}}, @w{GpgmeData @var{plain}}) +@deftypefun gpgme_error_t gpgme_op_decrypt_verify (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{cipher}}, @w{gpgme_data_t @var{plain}}) The function @code{gpgme_op_decrypt_verify_start} initiates a @code{gpgme_op_decrypt_verify} operation. It can be completed by calling @code{gpgme_wait} on the context. @xref{Waiting For @@ -3591,7 +3591,7 @@ set is changed). @cindex signature, selecting signers @cindex signers, selecting -@deftypefun void gpgme_signers_clear (@w{GpgmeCtx @var{ctx}}) +@deftypefun void gpgme_signers_clear (@w{gpgme_ctx_t @var{ctx}}) The function @code{gpgme_signers_clear} releases a reference for each key on the signers list and removes the list of signers from the context @var{ctx}. @@ -3599,14 +3599,14 @@ context @var{ctx}. Every context starts with an empty list. @end deftypefun -@deftypefun GpgmeError gpgme_signers_add (@w{GpgmeCtx @var{ctx}}, @w{const GpgmeKey @var{key}}) +@deftypefun gpgme_error_t gpgme_signers_add (@w{gpgme_ctx_t @var{ctx}}, @w{const gpgme_key_t @var{key}}) The function @code{gpgme_signers_add} adds the key @var{key} to the list of signers in the context @var{ctx}. Calling this function acquires an additional reference for the key. @end deftypefun -@deftypefun GpgmeKey gpgme_signers_enum (@w{const GpgmeCtx @var{ctx}}, @w{int @var{seq}}) +@deftypefun gpgme_key_t gpgme_signers_enum (@w{const gpgme_ctx_t @var{ctx}}, @w{int @var{seq}}) The function @code{gpgme_signers_enum} returns the @var{seq}th key in the list of signers in the context @var{ctx}. An additional reference is acquired for the user. @@ -3618,9 +3618,9 @@ If @var{seq} is out of range, @code{NULL} is returned. @node Creating a Signature @subsubsection Creating a Signature -@deftp {Data type} {enum GpgmeSigMode} -@tindex GpgmeSigMode -The @code{GpgmeSigMode} type is used to specify the desired type of a +@deftp {Data type} {enum gpgme_sig_mode_t} +@tindex gpgme_sig_mode_t +The @code{gpgme_sig_mode_t} type is used to specify the desired type of a signature. The following modes are available: @table @code @@ -3637,7 +3637,7 @@ mode settings of the context are ignored. @end table @end deftp -@deftypefun GpgmeError gpgme_op_sign (@w{GpgmeCtx @var{ctx}}, @w{GpgmeData @var{plain}}, @w{GpgmeData @var{sig}}, @w{GpgmeSigMode @var{mode}}) +@deftypefun gpgme_error_t gpgme_op_sign (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{plain}}, @w{gpgme_data_t @var{sig}}, @w{gpgme_sig_mode_t @var{mode}}) The function @code{gpgme_op_sign} creates a signature for the text in the data object @var{plain} and returns it in the data object @var{sig}. The type of the signature created is determined by the @@ -3660,7 +3660,7 @@ through any errors that are reported by the crypto engine support routines. @end deftypefun -@deftypefun GpgmeError gpgme_op_sign_start (@w{GpgmeCtx @var{ctx}}, @w{GpgmeData @var{plain}}, @w{GpgmeData @var{sig}}, @w{GpgmeSigMode @var{mode}}) +@deftypefun gpgme_error_t gpgme_op_sign_start (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{plain}}, @w{gpgme_data_t @var{sig}}, @w{gpgme_sig_mode_t @var{mode}}) The function @code{gpgme_op_sign_start} initiates a @code{gpgme_op_sign} operation. It can be completed by calling @code{gpgme_wait} on the context. @xref{Waiting For Completion}. @@ -3670,23 +3670,23 @@ started successfully, and @code{GPGME_Invalid_Value} if @var{ctx}, @var{plain} or @var{sig} is not a valid pointer. @end deftypefun -@deftp {Data type} {GpgmeNewSignature} +@deftp {Data type} {gpgme_new_signature_t} This is a pointer to a structure used to store a part of the result of a @code{gpgme_op_sign} operation. The structure contains the following members: @table @code -@item GpgmeNewSignature next +@item gpgme_new_signature_t next This is a pointer to the next new signature structure in the linked list, or @code{NULL} if this is the last element. -@item GpgmeSigMode type +@item gpgme_sig_mode_t type The type of this signature. -@item GpgmePubKeyAlgo +@item gpgme_pubkey_algo_t The public key algorithm used to create this signature. -@item GpgmeHashAlgo +@item gpgme_hash_algo_t The hash algorithm used to create this signature. @item unsigned long class @@ -3700,7 +3700,7 @@ The fingerprint of the key which was used to create this signature. @end table @end deftp -@deftp {Data type} {GpgmeSignResult} +@deftp {Data type} {gpgme_sign_result_t} This is a pointer to a structure used to store the result of a @code{gpgme_op_sign} operation. After successfully generating a signature, you can retrieve the pointer to the result with @@ -3708,18 +3708,18 @@ signature, you can retrieve the pointer to the result with members: @table @code -@item GpgmeInvalidUserID invalid_signers +@item gpgme_invalid_user_id_t invalid_signers A linked list with information about all invalid user IDs for which a signature could not be created. -@item GpgmeNewSignature signatures +@item gpgme_new_signature_t signatures A linked list with information about all signatures created. @end table @end deftp -@deftypefun GpgmeSignResult gpgme_op_sign_result (@w{GpgmeCtx @var{ctx}}) +@deftypefun gpgme_sign_result_t gpgme_op_sign_result (@w{gpgme_ctx_t @var{ctx}}) The function @code{gpgme_op_sign_result} returns a -@code{GpgmeSignResult} pointer to a structure holding the result of a +@code{gpgme_sign_result_t} pointer to a structure holding the result of a @code{gpgme_op_sign} operation. The pointer is only valid if the last operation on the context was a @code{gpgme_op_sign} or @code{gpgme_op_sign_start} operation, and if this operation finished @@ -3748,12 +3748,12 @@ and then passed to the encryption operation. @cindex encryption, selecting recipients @cindex recipients -@deftp {Data type} GpgmeRecipients -The @code{GpgmeRecipients} type is a handle for a set of recipients +@deftp {Data type} gpgme_recipients_t +The @code{gpgme_recipients_t} type is a handle for a set of recipients that can be used in an encryption process. @end deftp -@deftypefun GpgmeError gpgme_recipients_new (@w{GpgmeRecipients *@var{r_rset}}) +@deftypefun gpgme_error_t gpgme_recipients_new (@w{gpgme_recipients_t *@var{r_rset}}) The function @code{gpgme_recipients_new} creates a new, empty set of recipients and returns a handle for it in @var{r_rset}. @@ -3762,12 +3762,12 @@ be created successfully, and @code{GPGME_Out_Of_Core} if not enough memory was available. @end deftypefun -@deftypefun void gpgme_recipients_release (@w{GpgmeRecipients @var{rset}}) +@deftypefun void gpgme_recipients_release (@w{gpgme_recipients_t @var{rset}}) The function @code{gpgme_recipients_release} destroys the set of recipients @var{rset} and releases all associated resources. @end deftypefun -@deftypefun GpgmeError gpgme_recipients_add_name (@w{GpgmeRecipients @var{rset}}, @w{const char *@var{name}}) +@deftypefun gpgme_error_t gpgme_recipients_add_name (@w{gpgme_recipients_t @var{rset}}, @w{const char *@var{name}}) The function @code{gpgme_recipients_add_name} adds the recipient @var{name} to the set of recipients @var{rset}. This is equivalent to @code{gpgme_recipients_add_name_with_validity} with a validity of @@ -3779,7 +3779,7 @@ is not a valid pointer, and @code{GPGME_Out_Of_Core} if not enough memory is available. @end deftypefun -@deftypefun GpgmeError gpgme_recipients_add_name_with_validity (@w{GpgmeRecipients @var{rset}}, @w{const char *@var{name}}, @w{GpgmeValidity @var{val}}) +@deftypefun gpgme_error_t gpgme_recipients_add_name_with_validity (@w{gpgme_recipients_t @var{rset}}, @w{const char *@var{name}}, @w{gpgme_validity_t @var{val}}) The function @code{gpgme_recipients_add_name_with_validity} adds the recipient @var{name} with the validity @var{val} to the set of recipients @var{rset}. If the validity is not known, the function @@ -3792,12 +3792,12 @@ is not a valid pointer, and @code{GPGME_Out_Of_Core} if not enough memory is available. @end deftypefun -@deftypefun {unsigned int} gpgme_recipients_count (@w{const @var{GpgmeRecipients rset}}) +@deftypefun {unsigned int} gpgme_recipients_count (@w{const @var{gpgme_recipients_t rset}}) The function @code{gpgme_recipients_count} returns the number of recipients in the set @var{rset}. @end deftypefun -@deftypefun GpgmeError gpgme_recipients_enum_open (@w{const GpgmeRecipients @var{rset}}, @w{void **@var{iter}}) +@deftypefun gpgme_error_t gpgme_recipients_enum_open (@w{const gpgme_recipients_t @var{rset}}, @w{void **@var{iter}}) The function @code{gpgme_recipients_enum_open} creates a new iterator @var{iter} that can be used to walk through the set of recipients in @var{rset}, using @code{gpgme_recipients_enum_read}. @@ -3810,7 +3810,7 @@ successfully created and @code{GPGME_Invalid_Value} if @var{rset} or @var{iter} is not a valid pointer. @end deftypefun -@deftypefun {const char *} gpgme_recipients_enum_read (@w{const GpgmeRecipients @var{rset}}, @w{void **@var{iter}}) +@deftypefun {const char *} gpgme_recipients_enum_read (@w{const gpgme_recipients_t @var{rset}}, @w{void **@var{iter}}) The function @code{gpgme_recipients_enum_read} returns a string containing the name of the next recipient in the set @var{rset} for the iterator @var{iter}. The string is valid as long as @var{rset} is @@ -3818,7 +3818,7 @@ valid or the function is called the next time with the same recipient set and iterator, whatever is earlier. @end deftypefun -@deftypefun GpgmeError gpgme_recipients_enum_close (@w{const GpgmeRecipients @var{rset}}, @w{void **@var{iter}}) +@deftypefun gpgme_error_t gpgme_recipients_enum_close (@w{const gpgme_recipients_t @var{rset}}, @w{void **@var{iter}}) The function @code{gpgme_recipients_enum_close} releases the iterator @var{iter} for the recipient set @var{rset}. @end deftypefun @@ -3827,7 +3827,7 @@ The function @code{gpgme_recipients_enum_close} releases the iterator @node Encrypting a Plaintext @subsubsection Encrypting a Plaintext -@deftypefun GpgmeError gpgme_op_encrypt (@w{GpgmeCtx @var{ctx}}, @w{GpgmeRecipients @var{rset}}, @w{GpgmeData @var{plain}}, @w{GpgmeData @var{cipher}}) +@deftypefun gpgme_error_t gpgme_op_encrypt (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_recipients_t @var{rset}}, @w{gpgme_data_t @var{plain}}, @w{gpgme_data_t @var{cipher}}) The function @code{gpgme_op_encrypt} encrypts the plaintext in the data object @var{plain} for the recipients @var{rset} and stores the ciphertext in the data object @var{cipher}. The type of the @@ -3857,7 +3857,7 @@ the secret key could not be retrieved, and passes through any errors that are reported by the crypto engine support routines. @end deftypefun -@deftypefun GpgmeError gpgme_op_encrypt_start (@w{GpgmeCtx @var{ctx}}, @w{GpgmeRecipients @var{rset}}, @w{GpgmeData @var{plain}}, @w{GpgmeData @var{cipher}}) +@deftypefun gpgme_error_t gpgme_op_encrypt_start (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_recipients_t @var{rset}}, @w{gpgme_data_t @var{plain}}, @w{gpgme_data_t @var{cipher}}) The function @code{gpgme_op_encrypt_start} initiates a @code{gpgme_op_encrypt} operation. It can be completed by calling @code{gpgme_wait} on the context. @xref{Waiting For Completion}. @@ -3869,7 +3869,7 @@ started successfully, @code{GPGME_Invalid_Value} if @var{ctx}, recipients. @end deftypefun -@deftp {Data type} {GpgmeEncryptResult} +@deftp {Data type} {gpgme_encrypt_result_t} This is a pointer to a structure used to store the result of a @code{gpgme_op_encrypt} operation. After successfully encrypting data, you can retrieve the pointer to the result with @@ -3877,15 +3877,15 @@ data, you can retrieve the pointer to the result with members: @table @code -@item GpgmeInvalidUserID invalid_recipients +@item gpgme_invalid_user_id_t invalid_recipients A linked list with information about all invalid user IDs for which the data could not be encrypted. @end table @end deftp -@deftypefun GpgmeEncryptResult gpgme_op_encrypt_result (@w{GpgmeCtx @var{ctx}}) +@deftypefun gpgme_encrypt_result_t gpgme_op_encrypt_result (@w{gpgme_ctx_t @var{ctx}}) The function @code{gpgme_op_encrypt_result} returns a -@code{GpgmeEncryptResult} pointer to a structure holding the result of +@code{gpgme_encrypt_result_t} pointer to a structure holding the result of a @code{gpgme_op_encrypt} operation. The pointer is only valid if the last operation on the context was a @code{gpgme_op_encrypt} or @code{gpgme_op_encrypt_start} operation, and if this operation @@ -3894,7 +3894,7 @@ next operation is started on the context. @end deftypefun -@deftypefun GpgmeError gpgme_op_encrypt_sign (@w{GpgmeCtx @var{ctx}}, @w{GpgmeRecipients @var{rset}}, @w{GpgmeData @var{plain}}, @w{GpgmeData @var{cipher}}) +@deftypefun gpgme_error_t gpgme_op_encrypt_sign (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_recipients_t @var{rset}}, @w{gpgme_data_t @var{plain}}, @w{gpgme_data_t @var{cipher}}) The function @code{gpgme_op_encrypt_sign} does a combined encrypt and sign operation. It is used like @code{gpgme_op_encrypt}, but the ciphertext also contains signatures for the signers listed in @@ -3904,7 +3904,7 @@ The combined encrypt and sign operation is currently only available for the OpenPGP crypto engine. @end deftypefun -@deftypefun GpgmeError gpgme_op_encrypt_sign_start (@w{GpgmeCtx @var{ctx}}, @w{GpgmeRecipients @var{rset}}, @w{GpgmeData @var{plain}}, @w{GpgmeData @var{cipher}}) +@deftypefun gpgme_error_t gpgme_op_encrypt_sign_start (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_recipients_t @var{rset}}, @w{gpgme_data_t @var{plain}}, @w{gpgme_data_t @var{cipher}}) The function @code{gpgme_op_encrypt_sign_start} initiates a @code{gpgme_op_encrypt_sign} operation. It can be completed by calling @code{gpgme_wait} on the context. @xref{Waiting For @@ -3944,7 +3944,7 @@ time. @cindex cryptographic operation, wait for @cindex wait for completion -@deftypefun GpgmeCtx gpgme_wait (@w{GpgmeCtx @var{ctx}}, @w{GpgmeError *@var{status}}, @w{int @var{hang}}) +@deftypefun gpgme_ctx_t gpgme_wait (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_error_t *@var{status}}, @w{int @var{hang}}) The function @code{gpgme_wait} continues the pending operation within the context @var{ctx}. In particular, it ensures the data exchange between @acronym{GPGME} and the crypto backend and watches over the @@ -4025,11 +4025,11 @@ programs. @node I/O Callback Interface @subsubsection I/O Callback Interface -@deftp {Data type} {GpgmeError (*GpgmeIOCb) (@w{void *@var{data}}, @w{int @var{fd}})} -@tindex GpgmeIOCb -The @code{GpgmeIOCb} type is the type of functions which +@deftp {Data type} {gpgme_error_t (*gpgme_io_cb_t) (@w{void *@var{data}}, @w{int @var{fd}})} +@tindex gpgme_io_cb_t +The @code{gpgme_io_cb_t} type is the type of functions which @acronym{GPGME} wants to register as I/O callback handlers using the -@code{GpgmeRegisterIOCb} functions provided by the user. +@code{gpgme_register_io_cb_t} functions provided by the user. @var{data} and @var{fd} are provided by @acronym{GPGME} when the I/O callback handler is registered, and should be passed through to the @@ -4040,9 +4040,9 @@ The callback handler always returns @code{0}, but you should consider the return value to be reserved for later use. @end deftp -@deftp {Data type} {GpgmeError (*GpgmeRegisterIOCb) (@w{void *@var{data}}, @w{int @var{fd}}, @w{int @var{dir}}, @w{GpgmeIOCb @var{fnc}}, @w{void *@var{fnc_data}}, @w{void **@var{tag}})} -@tindex GpgmeRegisterIOCb -The @code{GpgmeRegisterIOCb} type is the type of functions which can +@deftp {Data type} {gpgme_error_t (*gpgme_register_io_cb_t) (@w{void *@var{data}}, @w{int @var{fd}}, @w{int @var{dir}}, @w{gpgme_io_cb_t @var{fnc}}, @w{void *@var{fnc_data}}, @w{void **@var{tag}})} +@tindex gpgme_register_io_cb_t +The @code{gpgme_register_io_cb_t} type is the type of functions which can be called by @acronym{GPGME} to register an I/O callback funtion @var{fnc} for the file descriptor @var{fd} with the user. @var{fnc_data} should be passed as the first argument to @var{fnc} @@ -4052,7 +4052,7 @@ If @var{dir} is 0, @var{fnc} should be called by the user when called when @var{fd} is ready for reading. @var{data} was provided by the user when registering the -@code{GpgmeRegisterIOCb} function with @acronym{GPGME} and will always +@code{gpgme_register_io_cb_t} function with @acronym{GPGME} and will always be passed as the first argument when registering a callback function. For example, the user can use this to determine the event loop to which the file descriptor should be added. @@ -4065,24 +4065,24 @@ associated to this context. The user should return a unique handle in @var{tag} identifying this I/O callback registration, which will be passed to the -@code{GpgmeRegisterIOCb} function without interpretation when the file +@code{gpgme_register_io_cb_t} function without interpretation when the file descriptor should not be monitored anymore. @end deftp -@deftp {Data type} {void (*GpgmeRemoveIOCb) (@w{void *@var{tag}})} -The @code{GpgmeRemoveIOCb} type is the type of functions which can be +@deftp {Data type} {void (*gpgme_remove_io_cb_t) (@w{void *@var{tag}})} +The @code{gpgme_remove_io_cb_t} type is the type of functions which can be called by @acronym{GPGME} to remove an I/O callback handler that was registered before. @var{tag} is the handle that was returned by the -@code{GpgmeRegisterIOCb} for this I/O callback. +@code{gpgme_register_io_cb_t} for this I/O callback. @acronym{GPGME} can call this function when a crypto operation is in an I/O callback. It will also call this function when the context is destroyed while an operation is pending. @end deftp -@deftp {Data type} {enum GpgmeEventIO} -@tindex GpgmeEventIO -The @code{GpgmeEventIO} type specifies the type of an event that is +@deftp {Data type} {enum gpgme_event_io_t} +@tindex gpgme_event_io_t +The @code{gpgme_event_io_t} type specifies the type of an event that is reported to the user by @acronym{GPGME} as a consequence of an I/O operation. The following events are defined: @@ -4096,38 +4096,38 @@ callback handlers must not be run before this event is signalled. @item GPGME_EVENT_DONE The operation is finished, the last I/O callback for this operation was removed. The accompanying @var{type_data} points to a -@code{GpgmeError} variable that contains the status of the operation +@code{gpgme_error_t} variable that contains the status of the operation that finished. This event is signalled after the last I/O callback has been removed. @item GPGME_EVENT_NEXT_KEY In a @code{gpgme_op_keylist_start} operation, the next key was received from the crypto engine. The accompanying @var{type_data} is -a @code{GpgmeKey} variable that contains the key with one reference +a @code{gpgme_key_t} variable that contains the key with one reference for the user. @item GPGME_EVENT_NEXT_TRUSTITEM In a @code{gpgme_op_trustlist_start} operation, the next trust item was received from the crypto engine. The accompanying @var{type_data} -is a @code{GpgmeTrustItem} variable that contains the trust item with +is a @code{gpgme_trust_item_t} variable that contains the trust item with one reference for the user. @end table @end deftp -@deftp {Data type} {void (*GpgmeEventIOCb) (@w{void *@var{data}}, @w{GpgmeEventIO @var{type}}, @w{void *@var{type_data}})} -The @code{GpgmeEventIOCb} type is the type of functions which can be +@deftp {Data type} {void (*gpgme_event_io_cb_t) (@w{void *@var{data}}, @w{gpgme_event_io_t @var{type}}, @w{void *@var{type_data}})} +The @code{gpgme_event_io_cb_t} type is the type of functions which can be called by @acronym{GPGME} to signal an event for an operation running in a context which has I/O callback functions registered by the user. @var{data} was provided by the user when registering the -@code{GpgmeEventIOCb} function with @acronym{GPGME} and will always be +@code{gpgme_event_io_cb_t} function with @acronym{GPGME} and will always be passed as the first argument when registering a callback function. For example, the user can use this to determine the context in which this event has occured. @var{type} will specify the type of event that has occured. @var{type_data} specifies the event further, as described in the above -list of possible @code{GpgmeEventIO} types. +list of possible @code{gpgme_event_io_t} types. @acronym{GPGME} can call this function in an I/O callback handler. @end deftp @@ -4136,13 +4136,13 @@ list of possible @code{GpgmeEventIO} types. @node Registering I/O Callbacks @subsubsection Registering I/O Callbacks -@deftp {Data type} {struct GpgmeIOCbs} -@tindex GpgmeEventIO +@deftp {Data type} {struct gpgme_io_cb_ts} +@tindex gpgme_event_io_t This structure is used to store the I/O callback interface functions described in the previous section. It has the following members: @table @code -@item GpgmeRegisterIOCb add +@item gpgme_register_io_cb_t add This is the function called by @acronym{GPGME} to register an I/O callback handler. It must be specified. @@ -4151,11 +4151,11 @@ This is passed as the first argument to the @code{add} function when it is called by @acronym{GPGME}. For example, it can be used to determine the event loop to which the file descriptor should be added. -@item GpgmeRemoveIOCb remove +@item gpgme_remove_io_cb_t remove This is the function called by @acronym{GPGME} to remove an I/O callback handler. It must be specified. -@item GpgmeEventIOCb event +@item gpgme_event_io_cb_t event This is the function called by @acronym{GPGME} to signal an event for an operation. It is optional, but if you don't specify it, you can not retrieve the return value of the operation. @@ -4167,7 +4167,7 @@ determine the context in which the event has occured. @end table @end deftp -@deftypefun void gpgme_set_io_cbs (@w{GpgmeCtx @var{ctx}}, @w{struct GpgmeIOCbs *@var{io_cbs}}) +@deftypefun void gpgme_set_io_cbs (@w{gpgme_ctx_t @var{ctx}}, @w{struct gpgme_io_cb_ts *@var{io_cbs}}) The function @code{gpgme_set_io_cbs} enables the I/O callback interface for the context @var{ctx}. The I/O callback functions are specified by @var{io_cbs}. @@ -4176,7 +4176,7 @@ If @var{io_cbs}->@code{add} is @code{NULL}, the I/O callback interface is disabled for the context, and normal operation is restored. @end deftypefun -@deftypefun void gpgme_get_io_cbs (@w{GpgmeCtx @var{ctx}}, @w{struct GpgmeIOCbs *@var{io_cbs}}) +@deftypefun void gpgme_get_io_cbs (@w{gpgme_ctx_t @var{ctx}}, @w{struct gpgme_io_cb_ts *@var{io_cbs}}) The function @code{gpgme_get_io_cbs} returns the I/O callback functions set with @code{gpgme_set_io_cbs} in @var{io_cbs}. @end deftypefun @@ -4207,7 +4207,7 @@ operation in @acronym{GPGME} is not predictable. struct op_result @{ int done; - GpgmeError err; + gpgme_error_t err; @}; /* The following structure holds the data associated with one I/O @@ -4216,7 +4216,7 @@ struct one_fd @{ int fd; int dir; - GpgmeIOCb fnc; + gpgme_io_cb_t fnc; void *fnc_data; @}; @@ -4232,8 +4232,8 @@ struct event_loop The following functions implement the I/O callback interface. @example -GpgmeError -add_io_cb (void *data, int fd, int dir, GpgmeIOCb fnc, void *fnc_data, +gpgme_error_t +add_io_cb (void *data, int fd, int dir, gpgme_io_cb_t fnc, void *fnc_data, void **r_tag) @{ struct event_loop *loop = data; @@ -4270,10 +4270,10 @@ remove_io_cb (void *tag) @} void -event_io_cb (void *data, GpgmeEventIO type, void *type_data) +event_io_cb (void *data, gpgme_event_io_t type, void *type_data) @{ struct op_result *result = data; - GpgmeError *err = data; + gpgme_error_t *err = data; /* We don't support list operations here. */ if (type == GPGME_EVENT_DONE) @@ -4357,12 +4357,12 @@ main (int argc, char *argv[]) @{ struct event_loop loop; struct op_result result; - GpgmeCtx ctx; - GpgmeError err; - GpgmeData sig, text; - GpgmeSigStat status; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t sig, text; + gpgme_sig_stat_t status; int i; - struct GpgmeIOCbs io_cbs = + struct gpgme_io_cb_ts io_cbs = @{ add_io_cb, &loop, @@ -4429,7 +4429,7 @@ because it does not require any GTK+ specific setup. struct my_gpgme_io_cb @{ - GpgmeIOCb fnc; + gpgme_io_cb_t fnc; void *fnc_data; guint input_handler_id @}; @@ -4449,7 +4449,7 @@ my_gpgme_remove_io_cb (void *data) @} void -my_gpgme_register_io_callback (void *data, int fd, int dir, GpgmeIOCb fnc, +my_gpgme_register_io_callback (void *data, int fd, int dir, gpgme_io_cb_t fnc, void *fnc_data, void **tag) @{ struct my_gpgme_io_cb *iocb = g_malloc (sizeof (struct my_gpgme_io_cb)); @@ -4484,7 +4484,7 @@ It is very similar to the GTK+ example in the previous section. struct my_gpgme_io_cb @{ - GpgmeIOCb fnc; + gpgme_io_cb_t fnc; void *fnc_data; gint tag; @}; @@ -4504,7 +4504,7 @@ my_gpgme_remove_io_cb (void *data) @} void -my_gpgme_register_io_callback (void *data, int fd, int dir, GpgmeIOCb fnc, +my_gpgme_register_io_callback (void *data, int fd, int dir, gpgme_io_cb_t fnc, void *fnc_data, void **tag) @{ struct my_gpgme_io_cb *iocb = g_malloc (sizeof (struct my_gpgme_io_cb)); diff --git a/trunk/gpgme/ChangeLog b/trunk/gpgme/ChangeLog index f597c50..3a27e8a 100644 --- a/trunk/gpgme/ChangeLog +++ b/trunk/gpgme/ChangeLog @@ -1,3 +1,61 @@ +2003-05-18 Marcus Brinkmann + + * 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 * keylist.c (finish_key): Clear OPD->tmp_uid. diff --git a/trunk/gpgme/context.h b/trunk/gpgme/context.h index ce8c336..efc0d3b 100644 --- a/trunk/gpgme/context.h +++ b/trunk/gpgme/context.h @@ -58,10 +58,10 @@ struct ctx_op_data /* The context defines an environment in which crypto operations can be performed (sequentially). */ -struct gpgme_context_s +struct gpgme_context { /* The protocol used by this context. */ - GpgmeProtocol protocol; + gpgme_protocol_t protocol; /* The running engine process. */ EngineObject engine; @@ -83,31 +83,31 @@ struct gpgme_context_s /* Size of the following array. */ unsigned int signers_size; - GpgmeKey *signers; + gpgme_key_t *signers; /* The operation data hooked into the context. */ struct ctx_op_data *op_data; /* The user provided passphrase callback and its hook value. */ - GpgmePassphraseCb passphrase_cb; + gpgme_passphrase_cb_t passphrase_cb; void *passphrase_cb_value; /* The user provided progress callback and its hook value. */ - GpgmeProgressCb progress_cb; + gpgme_progress_cb_t progress_cb; void *progress_cb_value; /* A list of file descriptors in active use by the current operation. */ 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 type for the user. */ -struct gpgme_recipients_s +struct gpgme_recipients { - GpgmeUserID list; + gpgme_user_id_t list; }; #endif /* CONTEXT_H */ diff --git a/trunk/gpgme/conversion.c b/trunk/gpgme/conversion.c index 4082a32..3706a57 100644 --- a/trunk/gpgme/conversion.c +++ b/trunk/gpgme/conversion.c @@ -63,7 +63,7 @@ _gpgme_hextobyte (const unsigned char *str) 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 large enough if LEN is not zero. */ -GpgmeError +gpgme_error_t _gpgme_decode_c_string (const char *src, char **destp, int len) { 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 is desired or not, the caller is expected to make sure that *DESTP is large enough if LEN is not zero. */ -GpgmeError +gpgme_error_t _gpgme_decode_percent_string (const char *src, char **destp, int len) { char *dest; @@ -234,7 +234,7 @@ _gpgme_decode_percent_string (const char *src, char **destp, int len) static struct { char *name; - GpgmeError err; + gpgme_error_t err; } gnupg_errors[] = { { "EOF", GPGME_EOF }, @@ -318,7 +318,7 @@ static struct }; -GpgmeError +gpgme_error_t _gpgme_map_gnupg_error (char *err) { int i; diff --git a/trunk/gpgme/data-compat.c b/trunk/gpgme/data-compat.c index 0c0d34b..f3d57dd 100644 --- a/trunk/gpgme/data-compat.c +++ b/trunk/gpgme/data-compat.c @@ -32,11 +32,11 @@ /* Create a new data buffer filled with LENGTH bytes starting from OFFSET within the file FNAME or stream STREAM (exactly one must be non-zero). */ -GpgmeError -gpgme_data_new_from_filepart (GpgmeData *dh, const char *fname, FILE *stream, - off_t offset, size_t length) +gpgme_error_t +gpgme_data_new_from_filepart (gpgme_data_t *dh, const char *fname, + FILE *stream, off_t offset, size_t length) { - GpgmeError err; + gpgme_error_t err; char *buf = NULL; 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. COPY must be non-zero (delayed reads are not supported yet). */ -GpgmeError -gpgme_data_new_from_file (GpgmeData *dh, const char *fname, int copy) +gpgme_error_t +gpgme_data_new_from_file (gpgme_data_t *dh, const char *fname, int copy) { struct stat statbuf; @@ -108,7 +108,7 @@ gpgme_data_new_from_file (GpgmeData *dh, const char *fname, int copy) static int -gpgme_error_to_errno (GpgmeError err) +gpgme_error_to_errno (gpgme_error_t err) { switch (err) { @@ -131,11 +131,11 @@ gpgme_error_to_errno (GpgmeError err) } 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; - GpgmeError err = (*dh->data.old_user.cb) (dh->data.old_user.handle, - buffer, size, &amt); + gpgme_error_t err = (*dh->data.old_user.cb) (dh->data.old_user.handle, + buffer, size, &amt); if (err) return gpgme_error_to_errno (err); return amt; @@ -143,9 +143,9 @@ old_user_read (GpgmeData dh, void *buffer, size_t size) 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) return EINVAL; 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, 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 function READ_CB. */ -GpgmeError -gpgme_data_new_with_read_cb (GpgmeData *dh, +gpgme_error_t +gpgme_data_new_with_read_cb (gpgme_data_t *dh, int (*read_cb) (void *, char *, size_t, size_t *), 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) return err; @@ -181,8 +181,8 @@ gpgme_data_new_with_read_cb (GpgmeData *dh, } -GpgmeError -gpgme_data_rewind (GpgmeData dh) +gpgme_error_t +gpgme_data_rewind (gpgme_data_t dh) { return (gpgme_data_seek (dh, 0, SEEK_SET) == -1) ? GPGME_File_Error : 0; diff --git a/trunk/gpgme/data-fd.c b/trunk/gpgme/data-fd.c index d7b96f1..b120ca0 100644 --- a/trunk/gpgme/data-fd.c +++ b/trunk/gpgme/data-fd.c @@ -28,27 +28,27 @@ 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); } 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); } 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); } -static struct gpgme_data_cbs fd_cbs = +static struct _gpgme_data_cbs fd_cbs = { fd_read, fd_write, @@ -57,10 +57,10 @@ static struct gpgme_data_cbs fd_cbs = }; -GpgmeError -gpgme_data_new_from_fd (GpgmeData *dh, int fd) +gpgme_error_t +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) return err; diff --git a/trunk/gpgme/data-mem.c b/trunk/gpgme/data-mem.c index 114d836..bb6b81d 100644 --- a/trunk/gpgme/data-mem.c +++ b/trunk/gpgme/data-mem.c @@ -32,7 +32,7 @@ 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; const char *src; @@ -51,7 +51,7 @@ mem_read (GpgmeData dh, void *buffer, size_t size) 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; @@ -104,7 +104,7 @@ mem_write (GpgmeData dh, const void *buffer, size_t size) 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) { @@ -142,14 +142,14 @@ mem_seek (GpgmeData dh, off_t offset, int whence) static void -mem_release (GpgmeData dh) +mem_release (gpgme_data_t dh) { if (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_write, @@ -158,10 +158,10 @@ static struct gpgme_data_cbs mem_cbs = }; -GpgmeError -gpgme_data_new (GpgmeData *dh) +gpgme_error_t +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) return err; @@ -172,11 +172,11 @@ gpgme_data_new (GpgmeData *dh) /* Create a new data buffer filled with SIZE bytes starting from BUFFER. If COPY is zero, copying is delayed until necessary, and the data is taken from the original location when needed. */ -GpgmeError -gpgme_data_new_from_mem (GpgmeData *dh, const char *buffer, +gpgme_error_t +gpgme_data_new_from_mem (gpgme_data_t *dh, const char *buffer, 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) return err; @@ -198,7 +198,7 @@ gpgme_data_new_from_mem (GpgmeData *dh, const char *buffer, 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; diff --git a/trunk/gpgme/data-stream.c b/trunk/gpgme/data-stream.c index a36da2d..9945e39 100644 --- a/trunk/gpgme/data-stream.c +++ b/trunk/gpgme/data-stream.c @@ -28,7 +28,7 @@ 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); if (amt > 0) @@ -38,7 +38,7 @@ stream_read (GpgmeData dh, void *buffer, size_t size) 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); if (amt > 0) @@ -48,13 +48,13 @@ stream_write (GpgmeData dh, const void *buffer, size_t size) 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); } -static struct gpgme_data_cbs stream_cbs = +static struct _gpgme_data_cbs stream_cbs = { stream_read, stream_write, @@ -63,10 +63,10 @@ static struct gpgme_data_cbs stream_cbs = }; -GpgmeError -gpgme_data_new_from_stream (GpgmeData *dh, FILE *stream) +gpgme_error_t +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) return err; diff --git a/trunk/gpgme/data-user.c b/trunk/gpgme/data-user.c index 2d3cb5d..6f12c35 100644 --- a/trunk/gpgme/data-user.c +++ b/trunk/gpgme/data-user.c @@ -27,34 +27,34 @@ 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); } 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); } 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); } static void -user_release (GpgmeData dh) +user_release (gpgme_data_t dh) { (*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_write, @@ -63,10 +63,10 @@ static struct gpgme_data_cbs user_cbs = }; -GpgmeError -gpgme_data_new_from_cbs (GpgmeData *dh, struct GpgmeDataCbs *cbs, void *handle) +gpgme_error_t +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) return err; diff --git a/trunk/gpgme/data.c b/trunk/gpgme/data.c index cd606aa..c10e89c 100644 --- a/trunk/gpgme/data.c +++ b/trunk/gpgme/data.c @@ -33,10 +33,10 @@ #include "io.h" -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) { - GpgmeData dh; + gpgme_data_t dh; if (!r_dh) return GPGME_Invalid_Value; @@ -54,7 +54,7 @@ _gpgme_data_new (GpgmeData *r_dh, struct gpgme_data_cbs *cbs) void -_gpgme_data_release (GpgmeData dh) +_gpgme_data_release (gpgme_data_t dh) { if (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 -1 on error. If an error occurs, errno is set. */ 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) { @@ -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 error. If an error occurs, errno is set. */ 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) { @@ -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 WHENCE. */ 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) { @@ -123,7 +123,7 @@ gpgme_data_seek (GpgmeData dh, off_t offset, int whence) /* Release the data object with the handle DH. */ void -gpgme_data_release (GpgmeData dh) +gpgme_data_release (gpgme_data_t dh) { if (!dh) return; @@ -136,8 +136,8 @@ gpgme_data_release (GpgmeData dh) /* Get the current encoding meta information for the data object with handle DH. */ -GpgmeDataEncoding -gpgme_data_get_encoding (GpgmeData dh) +gpgme_data_encoding_t +gpgme_data_get_encoding (gpgme_data_t dh) { 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 DH to ENC. */ -GpgmeError -gpgme_data_set_encoding (GpgmeData dh, GpgmeDataEncoding enc) +gpgme_error_t +gpgme_data_set_encoding (gpgme_data_t dh, gpgme_data_encoding_t enc) { if (!dh) return GPGME_Invalid_Value; @@ -159,10 +159,10 @@ gpgme_data_set_encoding (GpgmeData dh, GpgmeDataEncoding enc) /* Functions to support the wait interface. */ -GpgmeError +gpgme_error_t _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 *bufp = buffer; 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) { - GpgmeData dh = (GpgmeData) opaque; + gpgme_data_t dh = (gpgme_data_t) opaque; ssize_t nwritten; if (!dh->pending_len) diff --git a/trunk/gpgme/data.h b/trunk/gpgme/data.h index d2f9528..26189d0 100644 --- a/trunk/gpgme/data.h +++ b/trunk/gpgme/data.h @@ -33,24 +33,24 @@ /* 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 -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); /* 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 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); /* Set the current position from where the next read or write starts in the data object with the handle DH to OFFSET, relativ to 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. */ -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_write_cb write; @@ -58,10 +58,10 @@ struct gpgme_data_cbs gpgme_data_release_cb release; }; -struct gpgme_data_s +struct gpgme_data { - struct gpgme_data_cbs *cbs; - GpgmeDataEncoding encoding; + struct _gpgme_data_cbs *cbs; + gpgme_data_encoding_t encoding; #ifdef PIPE_BUF #define BUFFER_SIZE PIPE_BUF @@ -86,7 +86,7 @@ struct gpgme_data_s /* For gpgme_data_new_from_cbs. */ struct { - struct GpgmeDataCbs *cbs; + gpgme_data_cbs_t cbs; void *handle; } 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 */ diff --git a/trunk/gpgme/decrypt-verify.c b/trunk/gpgme/decrypt-verify.c index f365b16..0d508d0 100644 --- a/trunk/gpgme/decrypt-verify.c +++ b/trunk/gpgme/decrypt-verify.c @@ -26,19 +26,19 @@ #include "ops.h" -static GpgmeError -decrypt_verify_status_handler (void *priv, GpgmeStatusCode code, char *args) +static gpgme_error_t +decrypt_verify_status_handler (void *priv, gpgme_status_code_t code, char *args) { return _gpgme_decrypt_status_handler (priv, code, args) || _gpgme_verify_status_handler (priv, code, args); } -static GpgmeError -_gpgme_op_decrypt_verify_start (GpgmeCtx ctx, int synchronous, - GpgmeData cipher, GpgmeData plain) +static gpgme_error_t +_gpgme_op_decrypt_verify_start (gpgme_ctx_t ctx, int synchronous, + gpgme_data_t cipher, gpgme_data_t plain) { - GpgmeError err; + gpgme_error_t err; err = _gpgme_op_reset (ctx, synchronous); if (err) @@ -75,8 +75,8 @@ _gpgme_op_decrypt_verify_start (GpgmeCtx ctx, int synchronous, /* Decrypt ciphertext CIPHER and make a signature verification within CTX and store the resulting plaintext in PLAIN. */ -GpgmeError -gpgme_op_decrypt_verify_start (GpgmeCtx ctx, GpgmeData cipher, GpgmeData plain) +gpgme_error_t +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); } @@ -84,10 +84,10 @@ gpgme_op_decrypt_verify_start (GpgmeCtx ctx, GpgmeData cipher, GpgmeData plain) /* Decrypt ciphertext CIPHER and make a signature verification within CTX and store the resulting plaintext in PLAIN. */ -GpgmeError -gpgme_op_decrypt_verify (GpgmeCtx ctx, GpgmeData cipher, GpgmeData plain) +gpgme_error_t +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) err = _gpgme_wait_one (ctx); return err; diff --git a/trunk/gpgme/decrypt.c b/trunk/gpgme/decrypt.c index 5d591f6..1191655 100644 --- a/trunk/gpgme/decrypt.c +++ b/trunk/gpgme/decrypt.c @@ -49,11 +49,11 @@ release_op_data (void *hook) } -GpgmeDecryptResult -gpgme_op_decrypt_result (GpgmeCtx ctx) +gpgme_decrypt_result_t +gpgme_op_decrypt_result (gpgme_ctx_t ctx) { op_data_t opd; - GpgmeError err; + gpgme_error_t err; err = _gpgme_op_data_lookup (ctx, OPDATA_DECRYPT, (void **) &opd, -1, NULL); if (err || !opd) @@ -63,11 +63,11 @@ gpgme_op_decrypt_result (GpgmeCtx ctx) } -GpgmeError -_gpgme_decrypt_status_handler (void *priv, GpgmeStatusCode code, char *args) +gpgme_error_t +_gpgme_decrypt_status_handler (void *priv, gpgme_status_code_t code, char *args) { - GpgmeCtx ctx = (GpgmeCtx) priv; - GpgmeError err; + gpgme_ctx_t ctx = (gpgme_ctx_t) priv; + gpgme_error_t err; op_data_t opd; err = _gpgme_passphrase_status_handler (priv, code, args); @@ -136,8 +136,8 @@ _gpgme_decrypt_status_handler (void *priv, GpgmeStatusCode code, char *args) } -GpgmeError -_gpgme_op_decrypt_init_result (GpgmeCtx ctx) +gpgme_error_t +_gpgme_op_decrypt_init_result (gpgme_ctx_t ctx) { op_data_t opd; @@ -146,11 +146,11 @@ _gpgme_op_decrypt_init_result (GpgmeCtx ctx) } -static GpgmeError -decrypt_start (GpgmeCtx ctx, int synchronous, - GpgmeData cipher, GpgmeData plain) +static gpgme_error_t +decrypt_start (gpgme_ctx_t ctx, int synchronous, + gpgme_data_t cipher, gpgme_data_t plain) { - GpgmeError err; + gpgme_error_t err; err = _gpgme_op_reset (ctx, synchronous); if (err) @@ -184,8 +184,8 @@ decrypt_start (GpgmeCtx ctx, int synchronous, } -GpgmeError -gpgme_op_decrypt_start (GpgmeCtx ctx, GpgmeData cipher, GpgmeData plain) +gpgme_error_t +gpgme_op_decrypt_start (gpgme_ctx_t ctx, gpgme_data_t cipher, gpgme_data_t 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 plaintext in PLAIN. */ -GpgmeError -gpgme_op_decrypt (GpgmeCtx ctx, GpgmeData cipher, GpgmeData plain) +gpgme_error_t +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) err = _gpgme_wait_one (ctx); return err; diff --git a/trunk/gpgme/delete.c b/trunk/gpgme/delete.c index 813eb5d..cd7efb1 100644 --- a/trunk/gpgme/delete.c +++ b/trunk/gpgme/delete.c @@ -28,8 +28,8 @@ #include "ops.h" -static GpgmeError -delete_status_handler (void *priv, GpgmeStatusCode code, char *args) +static gpgme_error_t +delete_status_handler (void *priv, gpgme_status_code_t code, char *args) { if (code == GPGME_STATUS_DELETE_PROBLEM) { @@ -70,11 +70,11 @@ delete_status_handler (void *priv, GpgmeStatusCode code, char *args) } -static GpgmeError -delete_start (GpgmeCtx ctx, int synchronous, const GpgmeKey key, +static gpgme_error_t +delete_start (gpgme_ctx_t ctx, int synchronous, const gpgme_key_t key, int allow_secret) { - GpgmeError err; + gpgme_error_t err; err = _gpgme_op_reset (ctx, synchronous); 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 keys are also deleted. */ -GpgmeError -gpgme_op_delete_start (GpgmeCtx ctx, const GpgmeKey key, int allow_secret) +gpgme_error_t +gpgme_op_delete_start (gpgme_ctx_t ctx, const gpgme_key_t key, int 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 keys are also deleted. */ -GpgmeError -gpgme_op_delete (GpgmeCtx ctx, const GpgmeKey key, int allow_secret) +gpgme_error_t +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) err = _gpgme_wait_one (ctx); return err; diff --git a/trunk/gpgme/edit.c b/trunk/gpgme/edit.c index 4c8a8e9..c9c460d 100644 --- a/trunk/gpgme/edit.c +++ b/trunk/gpgme/edit.c @@ -30,15 +30,15 @@ typedef struct { /* The user callback function and its hook value. */ - GpgmeEditCb fnc; + gpgme_edit_cb_t fnc; void *fnc_value; } *op_data_t; -static GpgmeError -edit_status_handler (void *priv, GpgmeStatusCode status, char *args) +static gpgme_error_t +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; return _gpgme_passphrase_status_handler (priv, status, args) @@ -48,12 +48,12 @@ edit_status_handler (void *priv, GpgmeStatusCode status, char *args) } -static GpgmeError -command_handler (void *priv, GpgmeStatusCode status, const char *args, +static gpgme_error_t +command_handler (void *priv, gpgme_status_code_t status, const char *args, const char **result) { - GpgmeCtx ctx = (GpgmeCtx) priv; - GpgmeError err; + gpgme_ctx_t ctx = (gpgme_ctx_t) priv; + gpgme_error_t err; op_data_t opd; *result = NULL; @@ -76,11 +76,11 @@ command_handler (void *priv, GpgmeStatusCode status, const char *args, } -static GpgmeError -edit_start (GpgmeCtx ctx, int synchronous, GpgmeKey key, - GpgmeEditCb fnc, void *fnc_value, GpgmeData out) +static gpgme_error_t +edit_start (gpgme_ctx_t ctx, int synchronous, gpgme_key_t key, + gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out) { - GpgmeError err; + gpgme_error_t err; op_data_t opd; err = _gpgme_op_reset (ctx, synchronous); @@ -109,9 +109,9 @@ edit_start (GpgmeCtx ctx, int synchronous, GpgmeKey key, } -GpgmeError -gpgme_op_edit_start (GpgmeCtx ctx, GpgmeKey key, - GpgmeEditCb fnc, void *fnc_value, GpgmeData out) +gpgme_error_t +gpgme_op_edit_start (gpgme_ctx_t ctx, gpgme_key_t key, + gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t 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 output of edit commands to OUT. */ -GpgmeError -gpgme_op_edit (GpgmeCtx ctx, GpgmeKey key, - GpgmeEditCb fnc, void *fnc_value, GpgmeData out) +gpgme_error_t +gpgme_op_edit (gpgme_ctx_t ctx, gpgme_key_t key, + 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) err = _gpgme_wait_one (ctx); return err; diff --git a/trunk/gpgme/encrypt-sign.c b/trunk/gpgme/encrypt-sign.c index 466f664..ace712a 100644 --- a/trunk/gpgme/encrypt-sign.c +++ b/trunk/gpgme/encrypt-sign.c @@ -27,19 +27,19 @@ #include "ops.h" -static GpgmeError -encrypt_sign_status_handler (void *priv, GpgmeStatusCode code, char *args) +static gpgme_error_t +encrypt_sign_status_handler (void *priv, gpgme_status_code_t code, char *args) { return _gpgme_encrypt_status_handler (priv, code, args) || _gpgme_sign_status_handler (priv, code, args); } -static GpgmeError -encrypt_sign_start (GpgmeCtx ctx, int synchronous, GpgmeRecipients recp, - GpgmeData plain, GpgmeData cipher) +static gpgme_error_t +encrypt_sign_start (gpgme_ctx_t ctx, int synchronous, gpgme_recipients_t recp, + gpgme_data_t plain, gpgme_data_t cipher) { - GpgmeError err; + gpgme_error_t err; err = _gpgme_op_reset (ctx, synchronous); 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 store the resulting ciphertext in CIPHER. Also sign the ciphertext with the signers in CTX. */ -GpgmeError -gpgme_op_encrypt_sign_start (GpgmeCtx ctx, GpgmeRecipients recp, - GpgmeData plain, GpgmeData cipher) +gpgme_error_t +gpgme_op_encrypt_sign_start (gpgme_ctx_t ctx, gpgme_recipients_t recp, + gpgme_data_t plain, gpgme_data_t 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 store the resulting ciphertext in CIPHER. Also sign the ciphertext with the signers in CTX. */ -GpgmeError -gpgme_op_encrypt_sign (GpgmeCtx ctx, GpgmeRecipients recp, - GpgmeData plain, GpgmeData cipher) +gpgme_error_t +gpgme_op_encrypt_sign (gpgme_ctx_t ctx, gpgme_recipients_t recp, + 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) err = _gpgme_wait_one (ctx); return err; diff --git a/trunk/gpgme/encrypt.c b/trunk/gpgme/encrypt.c index a972080..1488239 100644 --- a/trunk/gpgme/encrypt.c +++ b/trunk/gpgme/encrypt.c @@ -37,7 +37,7 @@ typedef struct /* A pointer to the next pointer of the last invalid recipient in the list. This makes appending new invalid recipients painless while preserving the order. */ - GpgmeInvalidUserID *lastp; + gpgme_invalid_user_id_t *lastp; } *op_data_t; @@ -45,22 +45,22 @@ static void release_op_data (void *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) { - GpgmeInvalidUserID next = invalid_recipient->next; + gpgme_invalid_user_id_t next = invalid_recipient->next; free (invalid_recipient->id); invalid_recipient = next; } } -GpgmeEncryptResult -gpgme_op_encrypt_result (GpgmeCtx ctx) +gpgme_encrypt_result_t +gpgme_op_encrypt_result (gpgme_ctx_t ctx) { op_data_t opd; - GpgmeError err; + gpgme_error_t err; err = _gpgme_op_data_lookup (ctx, OPDATA_ENCRYPT, (void **) &opd, -1, NULL); if (err || !opd) @@ -70,11 +70,11 @@ gpgme_op_encrypt_result (GpgmeCtx ctx) } -GpgmeError -_gpgme_encrypt_status_handler (void *priv, GpgmeStatusCode code, char *args) +gpgme_error_t +_gpgme_encrypt_status_handler (void *priv, gpgme_status_code_t code, char *args) { - GpgmeCtx ctx = (GpgmeCtx) priv; - GpgmeError err; + gpgme_ctx_t ctx = (gpgme_ctx_t) priv; + gpgme_error_t err; op_data_t 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_encrypt_sym_status_handler (void *priv, GpgmeStatusCode code, +gpgme_error_t +_gpgme_encrypt_sym_status_handler (void *priv, gpgme_status_code_t code, char *args) { return _gpgme_passphrase_status_handler (priv, code, args); } -GpgmeError -_gpgme_op_encrypt_init_result (GpgmeCtx ctx) +gpgme_error_t +_gpgme_op_encrypt_init_result (gpgme_ctx_t ctx) { - GpgmeError err; + gpgme_error_t err; op_data_t opd; err = _gpgme_op_data_lookup (ctx, OPDATA_ENCRYPT, (void **) &opd, @@ -131,11 +131,11 @@ _gpgme_op_encrypt_init_result (GpgmeCtx ctx) } -static GpgmeError -encrypt_start (GpgmeCtx ctx, int synchronous, GpgmeRecipients recp, - GpgmeData plain, GpgmeData cipher) +static gpgme_error_t +encrypt_start (gpgme_ctx_t ctx, int synchronous, gpgme_recipients_t recp, + gpgme_data_t plain, gpgme_data_t cipher) { - GpgmeError err; + gpgme_error_t err; int symmetric = 0; err = _gpgme_op_reset (ctx, synchronous); @@ -177,9 +177,9 @@ encrypt_start (GpgmeCtx ctx, int synchronous, GpgmeRecipients recp, } -GpgmeError -gpgme_op_encrypt_start (GpgmeCtx ctx, GpgmeRecipients recp, GpgmeData plain, - GpgmeData cipher) +gpgme_error_t +gpgme_op_encrypt_start (gpgme_ctx_t ctx, gpgme_recipients_t recp, gpgme_data_t plain, + gpgme_data_t 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 store the resulting ciphertext in CIPHER. */ -GpgmeError -gpgme_op_encrypt (GpgmeCtx ctx, GpgmeRecipients recp, - GpgmeData plain, GpgmeData cipher) +gpgme_error_t +gpgme_op_encrypt (gpgme_ctx_t ctx, gpgme_recipients_t recp, + gpgme_data_t plain, gpgme_data_t cipher) { int err = encrypt_start (ctx, 1, recp, plain, cipher); if (!err) diff --git a/trunk/gpgme/engine-backend.h b/trunk/gpgme/engine-backend.h index 0262ad6..bcf9174 100644 --- a/trunk/gpgme/engine-backend.h +++ b/trunk/gpgme/engine-backend.h @@ -33,45 +33,45 @@ struct engine_ops const char *(*get_file_name) (void); const char *(*get_version) (void); const char *(*get_req_version) (void); - GpgmeError (*new) (void **r_engine); + gpgme_error_t (*new) (void **r_engine); /* Member functions. */ void (*release) (void *engine); void (*set_status_handler) (void *engine, EngineStatusHandler fnc, void *fnc_value); - GpgmeError (*set_command_handler) (void *engine, EngineCommandHandler fnc, - void *fnc_value, GpgmeData data); - GpgmeError (*set_colon_line_handler) (void *engine, + gpgme_error_t (*set_command_handler) (void *engine, EngineCommandHandler fnc, + void *fnc_value, gpgme_data_t data); + gpgme_error_t (*set_colon_line_handler) (void *engine, EngineColonLineHandler fnc, void *fnc_value); - GpgmeError (*decrypt) (void *engine, GpgmeData ciph, GpgmeData plain); - GpgmeError (*delete) (void *engine, GpgmeKey key, int allow_secret); - GpgmeError (*edit) (void *engine, GpgmeKey key, GpgmeData out, - GpgmeCtx ctx /* FIXME */); - GpgmeError (*encrypt) (void *engine, GpgmeRecipients recp, - GpgmeData plain, GpgmeData ciph, int use_armor); - GpgmeError (*encrypt_sign) (void *engine, GpgmeRecipients recp, - GpgmeData plain, GpgmeData ciph, - int use_armor, GpgmeCtx ctx /* FIXME */); - GpgmeError (*export) (void *engine, GpgmeRecipients recp, - GpgmeData keydata, int use_armor); - GpgmeError (*genkey) (void *engine, GpgmeData help_data, int use_armor, - GpgmeData pubkey, GpgmeData seckey); - GpgmeError (*import) (void *engine, GpgmeData keydata); - GpgmeError (*keylist) (void *engine, const char *pattern, + gpgme_error_t (*decrypt) (void *engine, gpgme_data_t ciph, gpgme_data_t plain); + gpgme_error_t (*delete) (void *engine, gpgme_key_t key, int allow_secret); + gpgme_error_t (*edit) (void *engine, gpgme_key_t key, gpgme_data_t out, + gpgme_ctx_t ctx /* FIXME */); + gpgme_error_t (*encrypt) (void *engine, gpgme_recipients_t recp, + gpgme_data_t plain, gpgme_data_t ciph, int use_armor); + gpgme_error_t (*encrypt_sign) (void *engine, gpgme_recipients_t recp, + gpgme_data_t plain, gpgme_data_t ciph, + int use_armor, gpgme_ctx_t ctx /* FIXME */); + gpgme_error_t (*export) (void *engine, gpgme_recipients_t recp, + gpgme_data_t keydata, int use_armor); + gpgme_error_t (*genkey) (void *engine, gpgme_data_t help_data, int use_armor, + gpgme_data_t pubkey, gpgme_data_t seckey); + gpgme_error_t (*import) (void *engine, gpgme_data_t keydata); + gpgme_error_t (*keylist) (void *engine, const char *pattern, 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 keylist_mode); - GpgmeError (*sign) (void *engine, GpgmeData in, GpgmeData out, - GpgmeSigMode mode, int use_armor, int use_textmode, - int include_certs, GpgmeCtx ctx /* FIXME */); - GpgmeError (*trustlist) (void *engine, const char *pattern); - GpgmeError (*verify) (void *engine, GpgmeData sig, GpgmeData signed_text, - GpgmeData plaintext); + gpgme_error_t (*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, gpgme_ctx_t ctx /* FIXME */); + gpgme_error_t (*trustlist) (void *engine, const char *pattern); + gpgme_error_t (*verify) (void *engine, gpgme_data_t sig, gpgme_data_t signed_text, + gpgme_data_t plaintext); - void (*set_io_cbs) (void *engine, struct GpgmeIOCbs *io_cbs); - void (*io_event) (void *engine, GpgmeEventIO type, void *type_data); + void (*set_io_cbs) (void *engine, gpgme_io_cbs_t io_cbs); + void (*io_event) (void *engine, gpgme_event_io_t type, void *type_data); }; diff --git a/trunk/gpgme/engine-gpgsm.c b/trunk/gpgme/engine-gpgsm.c index a5a0b7f..a068d44 100644 --- a/trunk/gpgme/engine-gpgsm.c +++ b/trunk/gpgme/engine-gpgsm.c @@ -87,7 +87,7 @@ struct gpgsm_object_s int any; /* any data line seen */ } colon; - struct GpgmeIOCbs io_cbs; + struct gpgme_io_cbs io_cbs; }; 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) { switch (err) @@ -273,10 +273,10 @@ gpgsm_release (void *engine) } -static GpgmeError +static gpgme_error_t gpgsm_new (void **engine) { - GpgmeError err = 0; + gpgme_error_t err = 0; GpgsmObject gpgsm; char *argv[3]; int fds[2]; @@ -538,9 +538,9 @@ gpgsm_new (void **engine) /* 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, void *status_fnc_value) { @@ -573,7 +573,7 @@ gpgsm_assuan_simple_command (ASSUAN_CONTEXT ctx, char *cmd, EngineStatusHandler && line[0] == 'S' && line[1] == ' ') { char *rest; - GpgmeStatusCode r; + gpgme_status_code_t r; rest = strchr (line + 2, ' '); if (!rest) @@ -598,7 +598,7 @@ gpgsm_assuan_simple_command (ASSUAN_CONTEXT ctx, char *cmd, EngineStatusHandler #define COMMANDLINELEN 40 -static GpgmeError +static gpgme_error_t gpgsm_set_fd (ASSUAN_CONTEXT ctx, const char *which, int fd, const char *opt) { char line[COMMANDLINELEN]; @@ -613,7 +613,7 @@ gpgsm_set_fd (ASSUAN_CONTEXT ctx, const char *which, int fd, const char *opt) static const char * -map_input_enc (GpgmeData d) +map_input_enc (gpgme_data_t 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) { 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) { AssuanError assuan_err; - GpgmeError err = 0; + gpgme_error_t err = 0; GpgsmObject gpgsm = opaque; char *line; size_t linelen; @@ -777,7 +777,7 @@ status_handler (void *opaque, int fd) && line[0] == 'S' && line[1] == ' ') { char *rest; - GpgmeStatusCode r; + gpgme_status_code_t r; rest = strchr (line + 2, ' '); if (!rest) @@ -802,10 +802,10 @@ status_handler (void *opaque, int fd) } -static GpgmeError -add_io_cb (GpgsmObject gpgsm, iocb_data_t *iocbd, GpgmeIOCb handler) +static gpgme_error_t +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, 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) { - GpgmeError err; + gpgme_error_t err; err = add_io_cb (gpgsm, &gpgsm->status_cb, status_handler); if (!err && gpgsm->input_cb.fd != -1) @@ -842,11 +842,11 @@ start (GpgsmObject gpgsm, const char *command) } -static GpgmeError -gpgsm_decrypt (void *engine, GpgmeData ciph, GpgmeData plain) +static gpgme_error_t +gpgsm_decrypt (void *engine, gpgme_data_t ciph, gpgme_data_t plain) { GpgsmObject gpgsm = engine; - GpgmeError err; + gpgme_error_t err; if (!gpgsm) return GPGME_Invalid_Value; @@ -867,11 +867,11 @@ gpgsm_decrypt (void *engine, GpgmeData ciph, GpgmeData plain) } -static GpgmeError -gpgsm_delete (void *engine, GpgmeKey key, int allow_secret) +static gpgme_error_t +gpgsm_delete (void *engine, gpgme_key_t key, int allow_secret) { GpgsmObject gpgsm = engine; - GpgmeError err; + gpgme_error_t err; char *fpr = key->subkeys ? key->subkeys->fpr : NULL; char *linep = fpr; char *line; @@ -934,14 +934,14 @@ gpgsm_delete (void *engine, GpgmeKey key, int allow_secret) } -static GpgmeError -set_recipients (GpgsmObject gpgsm, GpgmeRecipients recp) +static gpgme_error_t +set_recipients (GpgsmObject gpgsm, gpgme_recipients_t recp) { - GpgmeError err; + gpgme_error_t err; ASSUAN_CONTEXT ctx = gpgsm->assuan_ctx; char *line; int linelen; - GpgmeUserID uid; + gpgme_user_id_t uid; int invalid_recipients = 0; linelen = 10 + 40 + 1; /* "RECIPIENT " + guess + '\0'. */ @@ -980,12 +980,12 @@ set_recipients (GpgsmObject gpgsm, GpgmeRecipients recp) } -static GpgmeError -gpgsm_encrypt (void *engine, GpgmeRecipients recp, GpgmeData plain, - GpgmeData ciph, int use_armor) +static gpgme_error_t +gpgsm_encrypt (void *engine, gpgme_recipients_t recp, gpgme_data_t plain, + gpgme_data_t ciph, int use_armor) { GpgsmObject gpgsm = engine; - GpgmeError err; + gpgme_error_t err; if (!gpgsm) return GPGME_Invalid_Value; @@ -1013,12 +1013,12 @@ gpgsm_encrypt (void *engine, GpgmeRecipients recp, GpgmeData plain, } -static GpgmeError -gpgsm_export (void *engine, GpgmeRecipients recp, GpgmeData keydata, +static gpgme_error_t +gpgsm_export (void *engine, gpgme_recipients_t recp, gpgme_data_t keydata, int use_armor) { GpgsmObject gpgsm = engine; - GpgmeError err = 0; + gpgme_error_t err = 0; char *cmd = NULL; int cmdi; int cmdlen = 32; @@ -1077,12 +1077,12 @@ gpgsm_export (void *engine, GpgmeRecipients recp, GpgmeData keydata, } -static GpgmeError -gpgsm_genkey (void *engine, GpgmeData help_data, int use_armor, - GpgmeData pubkey, GpgmeData seckey) +static gpgme_error_t +gpgsm_genkey (void *engine, gpgme_data_t help_data, int use_armor, + gpgme_data_t pubkey, gpgme_data_t seckey) { GpgsmObject gpgsm = engine; - GpgmeError err; + gpgme_error_t err; if (!gpgsm || !pubkey || seckey) return GPGME_Invalid_Value; @@ -1104,11 +1104,11 @@ gpgsm_genkey (void *engine, GpgmeData help_data, int use_armor, } -static GpgmeError -gpgsm_import (void *engine, GpgmeData keydata) +static gpgme_error_t +gpgsm_import (void *engine, gpgme_data_t keydata) { GpgsmObject gpgsm = engine; - GpgmeError err; + gpgme_error_t err; if (!gpgsm) 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, int keylist_mode) { GpgsmObject gpgsm = engine; char *line; - GpgmeError err; + gpgme_error_t err; if (!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, int reserved, int keylist_mode) { GpgsmObject gpgsm = engine; char *line; - GpgmeError err; + gpgme_error_t err; /* Length is "LISTSECRETKEYS " + p + '\0'. */ int length = 15 + 1; char *linep; @@ -1270,16 +1270,16 @@ gpgsm_keylist_ext (void *engine, const char *pattern[], int secret_only, } -static GpgmeError -gpgsm_sign (void *engine, GpgmeData in, GpgmeData out, GpgmeSigMode mode, +static gpgme_error_t +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, - GpgmeCtx ctx /* FIXME */) + gpgme_ctx_t ctx /* FIXME */) { GpgsmObject gpgsm = engine; - GpgmeError err; + gpgme_error_t err; char *assuan_cmd; int i; - GpgmeKey key; + gpgme_key_t key; if (!gpgsm) 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) { /* FIXME */ @@ -1341,12 +1341,12 @@ gpgsm_trustlist (void *engine, const char *pattern) } -static GpgmeError -gpgsm_verify (void *engine, GpgmeData sig, GpgmeData signed_text, - GpgmeData plaintext) +static gpgme_error_t +gpgsm_verify (void *engine, gpgme_data_t sig, gpgme_data_t signed_text, + gpgme_data_t plaintext) { GpgsmObject gpgsm = engine; - GpgmeError err; + gpgme_error_t err; if (!gpgsm) 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, void *fnc_value) { @@ -1405,7 +1405,7 @@ gpgsm_set_colon_line_handler (void *engine, EngineColonLineHandler fnc, 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; gpgsm->io_cbs = *io_cbs; @@ -1413,7 +1413,7 @@ gpgsm_set_io_cbs (void *engine, struct GpgmeIOCbs *io_cbs) 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; diff --git a/trunk/gpgme/engine.c b/trunk/gpgme/engine.c index c3b70c2..fb22f15 100644 --- a/trunk/gpgme/engine.c +++ b/trunk/gpgme/engine.c @@ -53,7 +53,7 @@ static struct engine_ops *engine_ops[] = /* Get the file name of the engine for PROTOCOL. */ static const char * -engine_get_file_name (GpgmeProtocol proto) +engine_get_file_name (gpgme_protocol_t proto) { if (proto > DIM (engine_ops)) return NULL; @@ -67,7 +67,7 @@ engine_get_file_name (GpgmeProtocol proto) /* Get the version number of the engine for PROTOCOL. */ static const char * -engine_get_version (GpgmeProtocol proto) +engine_get_version (gpgme_protocol_t proto) { if (proto > DIM (engine_ops)) return NULL; @@ -81,7 +81,7 @@ engine_get_version (GpgmeProtocol proto) /* Get the required version number of the engine for PROTOCOL. */ static const char * -engine_get_req_version (GpgmeProtocol proto) +engine_get_req_version (gpgme_protocol_t proto) { if (proto > DIM (engine_ops)) return NULL; @@ -94,8 +94,8 @@ engine_get_req_version (GpgmeProtocol proto) /* Verify the version requirement for the engine for PROTOCOL. */ -GpgmeError -gpgme_engine_check_version (GpgmeProtocol proto) +gpgme_error_t +gpgme_engine_check_version (gpgme_protocol_t proto) { return _gpgme_compare_versions (engine_get_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 pointer to the first engine in the statically allocated linked list is returned in *INFO. If an error occurs, it is returned. */ -GpgmeError -gpgme_get_engine_info (GpgmeEngineInfo *info) +gpgme_error_t +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); LOCK (engine_info_lock); if (!engine_info) { - GpgmeEngineInfo *lastp = &engine_info; - GpgmeProtocol proto_list[] = { GPGME_PROTOCOL_OpenPGP, + gpgme_engine_info_t *lastp = &engine_info; + gpgme_protocol_t proto_list[] = { GPGME_PROTOCOL_OpenPGP, GPGME_PROTOCOL_CMS }; int proto; @@ -132,7 +132,7 @@ gpgme_get_engine_info (GpgmeEngineInfo *info) { while (engine_info) { - GpgmeEngineInfo next_info = engine_info->next; + gpgme_engine_info_t next_info = engine_info->next; free (engine_info); engine_info = next_info; } @@ -153,8 +153,8 @@ gpgme_get_engine_info (GpgmeEngineInfo *info) } -GpgmeError -_gpgme_engine_new (GpgmeProtocol proto, EngineObject *r_engine) +gpgme_error_t +_gpgme_engine_new (gpgme_protocol_t proto, EngineObject *r_engine) { EngineObject engine; @@ -179,7 +179,7 @@ _gpgme_engine_new (GpgmeProtocol proto, EngineObject *r_engine) engine->ops = engine_ops[proto]; 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) { free (engine); @@ -218,10 +218,10 @@ _gpgme_engine_set_status_handler (EngineObject engine, } -GpgmeError +gpgme_error_t _gpgme_engine_set_command_handler (EngineObject engine, EngineCommandHandler fnc, void *fnc_value, - GpgmeData linked_data) + gpgme_data_t linked_data) { if (!engine) return GPGME_Invalid_Value; @@ -233,7 +233,7 @@ _gpgme_engine_set_command_handler (EngineObject engine, 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, void *fnc_value) { @@ -247,8 +247,8 @@ GpgmeError _gpgme_engine_set_colon_line_handler (EngineObject engine, fnc, fnc_value); } -GpgmeError -_gpgme_engine_op_decrypt (EngineObject engine, GpgmeData ciph, GpgmeData plain) +gpgme_error_t +_gpgme_engine_op_decrypt (EngineObject engine, gpgme_data_t ciph, gpgme_data_t plain) { if (!engine) 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); } -GpgmeError -_gpgme_engine_op_delete (EngineObject engine, GpgmeKey key, int allow_secret) +gpgme_error_t +_gpgme_engine_op_delete (EngineObject engine, gpgme_key_t key, int allow_secret) { if (!engine) return GPGME_Invalid_Value; @@ -272,9 +272,9 @@ _gpgme_engine_op_delete (EngineObject engine, GpgmeKey key, int allow_secret) } -GpgmeError -_gpgme_engine_op_edit (EngineObject engine, GpgmeKey key, GpgmeData out, - GpgmeCtx ctx /* FIXME */) +gpgme_error_t +_gpgme_engine_op_edit (EngineObject engine, gpgme_key_t key, gpgme_data_t out, + gpgme_ctx_t ctx /* FIXME */) { if (!engine) return GPGME_Invalid_Value; @@ -286,9 +286,9 @@ _gpgme_engine_op_edit (EngineObject engine, GpgmeKey key, GpgmeData out, } -GpgmeError -_gpgme_engine_op_encrypt (EngineObject engine, GpgmeRecipients recp, - GpgmeData plain, GpgmeData ciph, int use_armor) +gpgme_error_t +_gpgme_engine_op_encrypt (EngineObject engine, gpgme_recipients_t recp, + gpgme_data_t plain, gpgme_data_t ciph, int use_armor) { if (!engine) return GPGME_Invalid_Value; @@ -301,10 +301,10 @@ _gpgme_engine_op_encrypt (EngineObject engine, GpgmeRecipients recp, } -GpgmeError -_gpgme_engine_op_encrypt_sign (EngineObject engine, GpgmeRecipients recp, - GpgmeData plain, GpgmeData ciph, int use_armor, - GpgmeCtx ctx /* FIXME */) +gpgme_error_t +_gpgme_engine_op_encrypt_sign (EngineObject engine, gpgme_recipients_t recp, + gpgme_data_t plain, gpgme_data_t ciph, int use_armor, + gpgme_ctx_t ctx /* FIXME */) { if (!engine) return GPGME_Invalid_Value; @@ -317,9 +317,9 @@ _gpgme_engine_op_encrypt_sign (EngineObject engine, GpgmeRecipients recp, } -GpgmeError -_gpgme_engine_op_export (EngineObject engine, GpgmeRecipients recp, - GpgmeData keydata, int use_armor) +gpgme_error_t +_gpgme_engine_op_export (EngineObject engine, gpgme_recipients_t recp, + gpgme_data_t keydata, int use_armor) { if (!engine) return GPGME_Invalid_Value; @@ -332,9 +332,9 @@ _gpgme_engine_op_export (EngineObject engine, GpgmeRecipients recp, } -GpgmeError -_gpgme_engine_op_genkey (EngineObject engine, GpgmeData help_data, - int use_armor, GpgmeData pubkey, GpgmeData seckey) +gpgme_error_t +_gpgme_engine_op_genkey (EngineObject engine, gpgme_data_t help_data, + int use_armor, gpgme_data_t pubkey, gpgme_data_t seckey) { if (!engine) return GPGME_Invalid_Value; @@ -347,8 +347,8 @@ _gpgme_engine_op_genkey (EngineObject engine, GpgmeData help_data, } -GpgmeError -_gpgme_engine_op_import (EngineObject engine, GpgmeData keydata) +gpgme_error_t +_gpgme_engine_op_import (EngineObject engine, gpgme_data_t keydata) { if (!engine) 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, 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[], int secret_only, int reserved, int keylist_mode) { @@ -390,11 +390,11 @@ _gpgme_engine_op_keylist_ext (EngineObject engine, const char *pattern[], } -GpgmeError -_gpgme_engine_op_sign (EngineObject engine, GpgmeData in, GpgmeData out, - GpgmeSigMode mode, int use_armor, +gpgme_error_t +_gpgme_engine_op_sign (EngineObject engine, gpgme_data_t in, gpgme_data_t out, + gpgme_sig_mode_t mode, int use_armor, int use_textmode, int include_certs, - GpgmeCtx ctx /* FIXME */) + gpgme_ctx_t ctx /* FIXME */) { if (!engine) 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) { if (!engine) @@ -420,9 +420,9 @@ _gpgme_engine_op_trustlist (EngineObject engine, const char *pattern) } -GpgmeError -_gpgme_engine_op_verify (EngineObject engine, GpgmeData sig, - GpgmeData signed_text, GpgmeData plaintext) +gpgme_error_t +_gpgme_engine_op_verify (EngineObject engine, gpgme_data_t sig, + gpgme_data_t signed_text, gpgme_data_t plaintext) { if (!engine) return GPGME_Invalid_Value; @@ -435,8 +435,7 @@ _gpgme_engine_op_verify (EngineObject engine, GpgmeData sig, void -_gpgme_engine_set_io_cbs (EngineObject engine, - struct GpgmeIOCbs *io_cbs) +_gpgme_engine_set_io_cbs (EngineObject engine, gpgme_io_cbs_t io_cbs) { if (!engine) return; @@ -447,7 +446,7 @@ _gpgme_engine_set_io_cbs (EngineObject engine, void _gpgme_engine_io_event (EngineObject engine, - GpgmeEventIO type, void *type_data) + gpgme_event_io_t type, void *type_data) { if (!engine) return; diff --git a/trunk/gpgme/engine.h b/trunk/gpgme/engine.h index 7546402..95a9d1e 100644 --- a/trunk/gpgme/engine.h +++ b/trunk/gpgme/engine.h @@ -26,67 +26,67 @@ struct engine_object_s; 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); -typedef GpgmeError (*EngineColonLineHandler) (void *priv, char *line); -typedef GpgmeError (*EngineCommandHandler) (void *priv, GpgmeStatusCode code, +typedef gpgme_error_t (*EngineColonLineHandler) (void *priv, char *line); +typedef gpgme_error_t (*EngineCommandHandler) (void *priv, gpgme_status_code_t code, const char *keyword, 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_set_status_handler (EngineObject engine, EngineStatusHandler fnc, void *fnc_value); -GpgmeError _gpgme_engine_set_command_handler (EngineObject engine, +gpgme_error_t _gpgme_engine_set_command_handler (EngineObject engine, EngineCommandHandler fnc, void *fnc_value, - GpgmeData data); -GpgmeError _gpgme_engine_set_colon_line_handler (EngineObject engine, + gpgme_data_t data); +gpgme_error_t _gpgme_engine_set_colon_line_handler (EngineObject engine, EngineColonLineHandler fnc, void *fnc_value); -GpgmeError _gpgme_engine_op_decrypt (EngineObject engine, GpgmeData ciph, - GpgmeData plain); -GpgmeError _gpgme_engine_op_delete (EngineObject engine, GpgmeKey key, +gpgme_error_t _gpgme_engine_op_decrypt (EngineObject engine, gpgme_data_t ciph, + gpgme_data_t plain); +gpgme_error_t _gpgme_engine_op_delete (EngineObject engine, gpgme_key_t key, int allow_secret); -GpgmeError _gpgme_engine_op_edit (EngineObject engine, GpgmeKey key, - GpgmeData out, GpgmeCtx ctx /* FIXME */); -GpgmeError _gpgme_engine_op_encrypt (EngineObject engine, GpgmeRecipients recp, - GpgmeData plain, GpgmeData ciph, +gpgme_error_t _gpgme_engine_op_edit (EngineObject engine, gpgme_key_t key, + gpgme_data_t out, gpgme_ctx_t ctx /* FIXME */); +gpgme_error_t _gpgme_engine_op_encrypt (EngineObject engine, gpgme_recipients_t recp, + gpgme_data_t plain, gpgme_data_t ciph, int use_armor); -GpgmeError _gpgme_engine_op_encrypt_sign (EngineObject engine, - GpgmeRecipients recp, - GpgmeData plain, GpgmeData ciph, +gpgme_error_t _gpgme_engine_op_encrypt_sign (EngineObject engine, + gpgme_recipients_t recp, + gpgme_data_t plain, gpgme_data_t ciph, int use_armor, - GpgmeCtx ctx /* FIXME */); -GpgmeError _gpgme_engine_op_export (EngineObject engine, GpgmeRecipients recp, - GpgmeData keydata, int use_armor); -GpgmeError _gpgme_engine_op_genkey (EngineObject engine, GpgmeData help_data, - int use_armor, GpgmeData pubkey, - GpgmeData seckey); -GpgmeError _gpgme_engine_op_import (EngineObject engine, GpgmeData keydata); -GpgmeError _gpgme_engine_op_keylist (EngineObject engine, const char *pattern, + gpgme_ctx_t ctx /* FIXME */); +gpgme_error_t _gpgme_engine_op_export (EngineObject engine, gpgme_recipients_t recp, + gpgme_data_t keydata, int use_armor); +gpgme_error_t _gpgme_engine_op_genkey (EngineObject engine, gpgme_data_t help_data, + int use_armor, gpgme_data_t pubkey, + gpgme_data_t seckey); +gpgme_error_t _gpgme_engine_op_import (EngineObject engine, gpgme_data_t keydata); +gpgme_error_t _gpgme_engine_op_keylist (EngineObject engine, const char *pattern, int secret_only, int keylist_mode); -GpgmeError _gpgme_engine_op_keylist_ext (EngineObject engine, +gpgme_error_t _gpgme_engine_op_keylist_ext (EngineObject engine, const char *pattern[], int secret_only, int reserved, int keylist_mode); -GpgmeError _gpgme_engine_op_sign (EngineObject engine, GpgmeData in, - GpgmeData out, GpgmeSigMode mode, +gpgme_error_t _gpgme_engine_op_sign (EngineObject engine, gpgme_data_t in, + gpgme_data_t out, gpgme_sig_mode_t mode, int use_armor, int use_textmode, int include_certs, - GpgmeCtx ctx /* FIXME */); -GpgmeError _gpgme_engine_op_trustlist (EngineObject engine, + gpgme_ctx_t ctx /* FIXME */); +gpgme_error_t _gpgme_engine_op_trustlist (EngineObject engine, const char *pattern); -GpgmeError _gpgme_engine_op_verify (EngineObject engine, GpgmeData sig, - GpgmeData signed_text, - GpgmeData plaintext); +gpgme_error_t _gpgme_engine_op_verify (EngineObject engine, gpgme_data_t sig, + gpgme_data_t signed_text, + gpgme_data_t plaintext); 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, - GpgmeEventIO type, void *type_data); + gpgme_event_io_t type, void *type_data); #endif /* ENGINE_H */ diff --git a/trunk/gpgme/export.c b/trunk/gpgme/export.c index 3657ddd..b676d90 100644 --- a/trunk/gpgme/export.c +++ b/trunk/gpgme/export.c @@ -27,18 +27,18 @@ #include "ops.h" -static GpgmeError -export_status_handler (void *priv, GpgmeStatusCode code, char *args) +static gpgme_error_t +export_status_handler (void *priv, gpgme_status_code_t code, char *args) { return 0; } -static GpgmeError -export_start (GpgmeCtx ctx, int synchronous, - GpgmeRecipients recp, GpgmeData keydata) +static gpgme_error_t +export_start (gpgme_ctx_t ctx, int synchronous, + gpgme_recipients_t recp, gpgme_data_t keydata) { - GpgmeError err; + gpgme_error_t err; if (!keydata || !recp) return GPGME_Invalid_Value; @@ -54,18 +54,18 @@ export_start (GpgmeCtx ctx, int synchronous, /* Export the keys listed in RECP into KEYDATA. */ -GpgmeError -gpgme_op_export_start (GpgmeCtx ctx, GpgmeRecipients recp, GpgmeData keydata) +gpgme_error_t +gpgme_op_export_start (gpgme_ctx_t ctx, gpgme_recipients_t recp, gpgme_data_t keydata) { return export_start (ctx, 0, recp, keydata); } /* Export the keys listed in RECP into KEYDATA. */ -GpgmeError -gpgme_op_export (GpgmeCtx ctx, GpgmeRecipients recipients, GpgmeData keydata) +gpgme_error_t +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) err = _gpgme_wait_one (ctx); return err; diff --git a/trunk/gpgme/genkey.c b/trunk/gpgme/genkey.c index 59f277e..980cd4e 100644 --- a/trunk/gpgme/genkey.c +++ b/trunk/gpgme/genkey.c @@ -34,7 +34,7 @@ typedef struct struct _gpgme_op_genkey_result result; /* The key parameters passed to the crypto engine. */ - GpgmeData key_parameter; + gpgme_data_t key_parameter; } *op_data_t; @@ -50,11 +50,11 @@ release_op_data (void *hook) } -GpgmeGenKeyResult -gpgme_op_genkey_result (GpgmeCtx ctx) +gpgme_genkey_result_t +gpgme_op_genkey_result (gpgme_ctx_t ctx) { op_data_t opd; - GpgmeError err; + gpgme_error_t err; err = _gpgme_op_data_lookup (ctx, OPDATA_GENKEY, (void **) &opd, -1, NULL); if (err || !opd) @@ -64,11 +64,11 @@ gpgme_op_genkey_result (GpgmeCtx ctx) } -static GpgmeError -genkey_status_handler (void *priv, GpgmeStatusCode code, char *args) +static gpgme_error_t +genkey_status_handler (void *priv, gpgme_status_code_t code, char *args) { - GpgmeCtx ctx = (GpgmeCtx) priv; - GpgmeError err; + gpgme_ctx_t ctx = (gpgme_ctx_t) priv; + gpgme_error_t err; op_data_t opd; /* Pipe the status code through the progress status handler. */ @@ -114,8 +114,8 @@ genkey_status_handler (void *priv, GpgmeStatusCode code, char *args) } -static GpgmeError -get_key_parameter (const char *parms, GpgmeData *key_parameter) +static gpgme_error_t +get_key_parameter (const char *parms, gpgme_data_t *key_parameter) { const char *content; const char *attrib; @@ -145,11 +145,11 @@ get_key_parameter (const char *parms, GpgmeData *key_parameter) } -static GpgmeError -genkey_start (GpgmeCtx ctx, int synchronous, const char *parms, - GpgmeData pubkey, GpgmeData seckey) +static gpgme_error_t +genkey_start (gpgme_ctx_t ctx, int synchronous, const char *parms, + gpgme_data_t pubkey, gpgme_data_t seckey) { - GpgmeError err; + gpgme_error_t err; op_data_t opd; err = _gpgme_op_reset (ctx, synchronous); 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 SECKEY should be null for now. PARMS specifies what keys should be generated. */ -GpgmeError -gpgme_op_genkey_start (GpgmeCtx ctx, const char *parms, - GpgmeData pubkey, GpgmeData seckey) +gpgme_error_t +gpgme_op_genkey_start (gpgme_ctx_t ctx, const char *parms, + gpgme_data_t pubkey, gpgme_data_t 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 SECKEY should be null for now. PARMS specifies what keys should be generated. */ -GpgmeError -gpgme_op_genkey (GpgmeCtx ctx, const char *parms, GpgmeData pubkey, - GpgmeData seckey) +gpgme_error_t +gpgme_op_genkey (gpgme_ctx_t ctx, const char *parms, gpgme_data_t pubkey, + gpgme_data_t seckey) { - GpgmeError err; + gpgme_error_t err; err = genkey_start (ctx, 1, parms, pubkey, seckey); if (!err) diff --git a/trunk/gpgme/gpgme.c b/trunk/gpgme/gpgme.c index a729e40..ae73800 100644 --- a/trunk/gpgme/gpgme.c +++ b/trunk/gpgme/gpgme.c @@ -33,10 +33,10 @@ /* Create a new context as an environment for GPGME crypto operations. */ -GpgmeError -gpgme_new (GpgmeCtx *r_ctx) +gpgme_error_t +gpgme_new (gpgme_ctx_t *r_ctx) { - GpgmeCtx ctx; + gpgme_ctx_t ctx; if (!r_ctx) return GPGME_Invalid_Value; @@ -60,7 +60,7 @@ gpgme_new (GpgmeCtx *r_ctx) * Release all resources associated with the given context. **/ void -gpgme_release (GpgmeCtx ctx) +gpgme_release (gpgme_ctx_t ctx) { if (!ctx) return; @@ -74,7 +74,7 @@ gpgme_release (GpgmeCtx ctx) } void -_gpgme_release_result (GpgmeCtx ctx) +_gpgme_release_result (gpgme_ctx_t ctx) { struct ctx_op_data *data = ctx->op_data; @@ -90,8 +90,8 @@ _gpgme_release_result (GpgmeCtx ctx) } -GpgmeError -gpgme_set_protocol (GpgmeCtx ctx, GpgmeProtocol protocol) +gpgme_error_t +gpgme_set_protocol (gpgme_ctx_t ctx, gpgme_protocol_t protocol) { if (protocol != GPGME_PROTOCOL_OpenPGP && protocol != GPGME_PROTOCOL_CMS) return GPGME_Invalid_Value; @@ -101,15 +101,15 @@ gpgme_set_protocol (GpgmeCtx ctx, GpgmeProtocol protocol) } -GpgmeProtocol -gpgme_get_protocol (GpgmeCtx ctx) +gpgme_protocol_t +gpgme_get_protocol (gpgme_ctx_t ctx) { return ctx->protocol; } const char * -gpgme_get_protocol_name (GpgmeProtocol protocol) +gpgme_get_protocol_name (gpgme_protocol_t 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. **/ void -gpgme_set_armor (GpgmeCtx ctx, int yes) +gpgme_set_armor (gpgme_ctx_t ctx, int yes) { if (!ctx) return; @@ -150,7 +150,7 @@ gpgme_set_armor (GpgmeCtx ctx, int yes) * Return value: Boolean whether armor mode is to be used. **/ int -gpgme_get_armor (GpgmeCtx ctx) +gpgme_get_armor (gpgme_ctx_t ctx) { 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. **/ void -gpgme_set_textmode (GpgmeCtx ctx, int yes) +gpgme_set_textmode (gpgme_ctx_t ctx, int yes) { if (!ctx) return; @@ -183,7 +183,7 @@ gpgme_set_textmode (GpgmeCtx ctx, int yes) * Return value: Boolean whether textmode is to be used. **/ int -gpgme_get_textmode (GpgmeCtx ctx) +gpgme_get_textmode (gpgme_ctx_t ctx) { return ctx && ctx->use_textmode; } @@ -200,7 +200,7 @@ gpgme_get_textmode (GpgmeCtx ctx) * Return value: Boolean whether textmode is to be used. **/ 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) 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. **/ int -gpgme_get_include_certs (GpgmeCtx ctx) +gpgme_get_include_certs (gpgme_ctx_t ctx) { 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 * not a valid mode. **/ -GpgmeError -gpgme_set_keylist_mode (GpgmeCtx ctx, int mode) +gpgme_error_t +gpgme_set_keylist_mode (gpgme_ctx_t ctx, int mode) { if (!ctx) return GPGME_Invalid_Value; @@ -264,7 +264,7 @@ gpgme_set_keylist_mode (GpgmeCtx ctx, int mode) * Note that 0 is never a valid mode. **/ int -gpgme_get_keylist_mode (GpgmeCtx ctx) +gpgme_get_keylist_mode (gpgme_ctx_t ctx) { if (!ctx) return 0; @@ -285,7 +285,7 @@ gpgme_get_keylist_mode (GpgmeCtx ctx) * * The callback function is defined as: * - * typedef const char *(*GpgmePassphraseCb)(void*cb_value, + * typedef const char *(*gpgme_passphrase_cb_t)(void*cb_value, * const char *desc, * void **r_hd); * @@ -300,7 +300,7 @@ gpgme_get_keylist_mode (GpgmeCtx ctx) * **/ 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) { @@ -320,7 +320,7 @@ gpgme_set_passphrase_cb (GpgmeCtx ctx, GpgmePassphraseCb cb, void *cb_value) * to the crypto engine. **/ 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) { @@ -349,7 +349,7 @@ gpgme_get_passphrase_cb (GpgmeCtx ctx, GpgmePassphraseCb *r_cb, void **r_cb_valu * * The callback function is defined as: * - * typedef void (*GpgmeProgressCb) (void *cb_value, + * typedef void (*gpgme_progress_cb_t) (void *cb_value, * const char *what, int type, * int curretn, int total); * @@ -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. **/ 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) { @@ -377,7 +377,7 @@ gpgme_set_progress_cb (GpgmeCtx ctx, GpgmeProgressCb cb, void *cb_value) * progress indicator. **/ 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) { @@ -405,7 +405,7 @@ gpgme_get_progress_cb (GpgmeCtx ctx, GpgmeProgressCb *r_cb, void **r_cb_value) * **/ 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) return; @@ -435,7 +435,7 @@ gpgme_set_io_cbs (GpgmeCtx ctx, struct GpgmeIOCbs *io_cbs) * to the crypto engine. **/ 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) *io_cbs = ctx->io_cbs; @@ -443,7 +443,7 @@ gpgme_get_io_cbs (GpgmeCtx ctx, struct GpgmeIOCbs *io_cbs) const char * -gpgme_pubkey_algo_name (GpgmePubKeyAlgo algo) +gpgme_pubkey_algo_name (gpgme_pubkey_algo_t algo) { switch (algo) { @@ -472,7 +472,7 @@ gpgme_pubkey_algo_name (GpgmePubKeyAlgo algo) const char * -gpgme_hash_algo_name (GpgmeHashAlgo algo) +gpgme_hash_algo_name (gpgme_hash_algo_t algo) { switch (algo) { diff --git a/trunk/gpgme/gpgme.h b/trunk/gpgme/gpgme.h index 8d1e0fe..1c22506 100644 --- a/trunk/gpgme/gpgme.h +++ b/trunk/gpgme/gpgme.h @@ -38,6 +38,22 @@ extern "C" { #endif #endif + +/* Check for compiler features. */ +#if __GNUC__ +#define _GPGME_GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) + +#if _GPGME_GCC_VERSION > 30100 +#define _GPGME_DEPRECATED __attribute__ ((__deprecated__)) +#endif +#endif + +#ifndef _GPGME_DEPRECATED +#define _GPGME_DEPRECATED +#endif + /* The version of this header should match the one of the library. Do not use this symbol in your application, use gpgme_check_version @@ -48,20 +64,20 @@ extern "C" { #define GPGME_VERSION "0.4.1" -/* The opaque data types used by GPGME. */ +/* Some opaque data types used by GPGME. */ /* The context holds some global state and configration options, as well as the results of a crypto operation. */ -struct gpgme_context_s; -typedef struct gpgme_context_s *GpgmeCtx; +struct gpgme_context; +typedef struct gpgme_context *gpgme_ctx_t; /* The data object is used by GPGME to exchange arbitrary data. */ -struct gpgme_data_s; -typedef struct gpgme_data_s *GpgmeData; +struct gpgme_data; +typedef struct gpgme_data *gpgme_data_t; /* A list of recipients to be used in an encryption operation. */ -struct gpgme_recipients_s; -typedef struct gpgme_recipients_s *GpgmeRecipients; +struct gpgme_recipients; +typedef struct gpgme_recipients *gpgme_recipients_t; /* Public data types provided by GPGME. */ @@ -114,20 +130,27 @@ typedef enum GPGME_Bad_Signature = 0x0302, GPGME_No_Public_Key = 0x0303, - /* Deprecated. */ - GPGME_Busy = -2, - GPGME_No_Request = -3, - GPGME_Invalid_Type = -4, - GPGME_Invalid_Mode = -5 + /* Deprecated, see below. */ + GPGME_x_Busy = -2, + GPGME_x_No_Request = -3, + GPGME_x_Invalid_Type = -4, + GPGME_x_Invalid_Mode = -5 } -GpgmeError; +gpgme_error_t; -#define GPGME_No_Recipients GPGME_No_UserID -#define GPGME_Invalid_Recipient GPGME_Invalid_UserID -#define GPGME_No_Passphrase GPGME_Bad_Passphrase +typedef gpgme_error_t _gpgme_deprecated_error_t _GPGME_DEPRECATED; +#define GPGME_Busy ((_gpgme_deprecated_error_t) GPGME_x_Busy) +#define GPGME_No_Request ((_gpgme_deprecated_error_t) GPGME_x_No_Request) +#define GPGME_Invalid_Type ((_gpgme_deprecated_error_t) GPGME_x_Invalid_Type) +#define GPGME_Invalid_Mode ((_gpgme_deprecated_error_t) GPGME_x_Invalid_Mode) +#define GPGME_No_Recipients ((_gpgme_deprecated_error_t) GPGME_No_UserID) +#define GPGME_Invalid_Recipients \ + ((_gpgme_deprecated_error_t) GPGME_Invalid_UserID) +#define GPGME_No_Passphrase ((_gpgme_deprecated_error_t) GPGME_Bad_Passphrase) -/* The possible encoding mode of GpgmeData objects. */ + +/* The possible encoding mode of gpgme_data_t objects. */ typedef enum { GPGME_DATA_ENCODING_NONE = 0, /* Not specified. */ @@ -135,9 +158,9 @@ typedef enum GPGME_DATA_ENCODING_BASE64 = 2, GPGME_DATA_ENCODING_ARMOR = 3 /* Either PEM or OpenPGP Armor. */ } -GpgmeDataEncoding; - +gpgme_data_encoding_t; + /* Public key algorithms from libgcrypt. */ typedef enum { @@ -148,7 +171,7 @@ typedef enum GPGME_PK_DSA = 17, GPGME_PK_ELG = 20 } -GpgmePubKeyAlgo; +gpgme_pubkey_algo_t; /* Hash algorithms from libgcrypt. */ @@ -169,10 +192,11 @@ typedef enum GPGME_MD_CRC32_RFC1510 = 303, GPGME_MD_CRC24_RFC2440 = 304 } -GpgmeHashAlgo; - +gpgme_hash_algo_t; -/* The possible signature stati. */ + +/* The possible signature stati. Deprecated, use error value in sig + status. */ typedef enum { GPGME_SIG_STAT_NONE = 0, @@ -185,7 +209,9 @@ typedef enum GPGME_SIG_STAT_GOOD_EXP = 7, GPGME_SIG_STAT_GOOD_EXPKEY = 8 } -GpgmeSigStat; +_gpgme_sig_stat_t; +typedef _gpgme_sig_stat_t gpgme_sig_stat_t _GPGME_DEPRECATED; + /* The available signature modes. */ typedef enum @@ -194,10 +220,11 @@ typedef enum GPGME_SIG_MODE_DETACH = 1, GPGME_SIG_MODE_CLEAR = 2 } -GpgmeSigMode; - +gpgme_sig_mode_t; -/* The available key and signature attributes. */ + +/* The available key and signature attributes. Deprecated, use the + individual result structures instead. */ typedef enum { GPGME_ATTR_KEYID = 1, @@ -233,8 +260,10 @@ typedef enum GPGME_ATTR_SIG_SUMMARY = 31, GPGME_ATTR_SIG_CLASS = 32 } -GpgmeAttr; +_gpgme_attr_t; +typedef _gpgme_attr_t gpgme_attr_t _GPGME_DEPRECATED; + /* The available validities for a trust item or key. */ typedef enum { @@ -245,16 +274,16 @@ typedef enum GPGME_VALIDITY_FULL = 4, GPGME_VALIDITY_ULTIMATE = 5 } -GpgmeValidity; - +gpgme_validity_t; + /* The available protocols. */ typedef enum { GPGME_PROTOCOL_OpenPGP = 0, /* The default mode. */ GPGME_PROTOCOL_CMS = 1, } -GpgmeProtocol; +gpgme_protocol_t; /* The possible stati for the edit operation. */ @@ -341,7 +370,7 @@ typedef enum GPGME_STATUS_TRUNCATED, GPGME_STATUS_ERROR } -GpgmeStatusCode; +gpgme_status_code_t; /* The engine information structure. */ @@ -350,7 +379,7 @@ struct _gpgme_engine_info struct _gpgme_engine_info *next; /* The protocol ID. */ - GpgmeProtocol protocol; + gpgme_protocol_t protocol; /* The file name of the engine binary. */ const char *file_name; @@ -361,7 +390,7 @@ struct _gpgme_engine_info /* The minimum version required for GPGME. */ const char *req_version; }; -typedef struct _gpgme_engine_info *GpgmeEngineInfo; +typedef struct _gpgme_engine_info *gpgme_engine_info_t; /* A subkey from a key. */ @@ -397,7 +426,7 @@ struct _gpgme_subkey unsigned int _unused : 24; /* Public key algorithm supported by this subkey. */ - GpgmePubKeyAlgo pubkey_algo; + gpgme_pubkey_algo_t pubkey_algo; /* Length of the subkey. */ unsigned int length; @@ -417,7 +446,8 @@ struct _gpgme_subkey /* The expiration timestamp, 0 if the subkey does not expire. */ long int expires; }; -typedef struct _gpgme_subkey *GpgmeSubkey; +typedef struct _gpgme_subkey *gpgme_subkey_t; + /* A signature on a user ID. */ struct _gpgme_key_sig @@ -440,7 +470,7 @@ struct _gpgme_key_sig unsigned int _unused : 28; /* The public key algorithm used to create the signature. */ - GpgmePubKeyAlgo pubkey_algo; + gpgme_pubkey_algo_t pubkey_algo; /* The key ID of key used to create the signature. */ char *keyid; @@ -454,8 +484,8 @@ struct _gpgme_key_sig /* The expiration timestamp, 0 if the subkey does not expire. */ long int expires; - /* Same as in GpgmeSignature. */ - GpgmeError status; + /* Same as in gpgme_signature_t. */ + gpgme_error_t status; /* Crypto backend specific signature class. */ unsigned int class; @@ -472,7 +502,8 @@ struct _gpgme_key_sig /* The comment part of the user ID. */ char *comment; }; -typedef struct _gpgme_key_sig *GpgmeKeySig; +typedef struct _gpgme_key_sig *gpgme_key_sig_t; + /* An user ID from a key. */ struct _gpgme_user_id @@ -489,7 +520,7 @@ struct _gpgme_user_id unsigned int _unused : 30; /* The validity of the user ID. */ - GpgmeValidity validity; + gpgme_validity_t validity; /* The user ID string. */ char *uid; @@ -504,12 +535,13 @@ struct _gpgme_user_id char *comment; /* The signatures of the user ID. */ - GpgmeKeySig signatures; + gpgme_key_sig_t signatures; /* Internal to GPGME, do not use. */ - GpgmeKeySig _last_keysig; + gpgme_key_sig_t _last_keysig; }; -typedef struct _gpgme_user_id *GpgmeUserID; +typedef struct _gpgme_user_id *gpgme_user_id_t; + /* A key from the keyring. */ struct _gpgme_key @@ -545,7 +577,7 @@ struct _gpgme_key unsigned int _unused : 24; /* This is the protocol supported by this key. */ - GpgmeProtocol protocol; + gpgme_protocol_t protocol; /* If protocol is GPGME_PROTOCOL_CMS, this string contains the issuer serial. */ @@ -561,72 +593,76 @@ struct _gpgme_key /* If protocol is GPGME_PROTOCOL_OpenPGP, this field contains the owner trust. */ - GpgmeValidity owner_trust; + gpgme_validity_t owner_trust; /* The subkeys of the key. */ - GpgmeSubkey subkeys; + gpgme_subkey_t subkeys; /* The user IDs of the key. */ - GpgmeUserID uids; + gpgme_user_id_t uids; /* Internal to GPGME, do not use. */ - GpgmeSubkey _last_subkey; + gpgme_subkey_t _last_subkey; /* Internal to GPGME, do not use. */ - GpgmeUserID _last_uid; + gpgme_user_id_t _last_uid; }; -typedef struct _gpgme_key *GpgmeKey; +typedef struct _gpgme_key *gpgme_key_t; + /* Types for callback functions. */ /* Request a passphrase from the user. */ -typedef GpgmeError (*GpgmePassphraseCb) (void *hook, const char *desc, - void **r_hd, const char **result); +typedef gpgme_error_t (*gpgme_passphrase_cb_t) (void *hook, const char *desc, + void **r_hd, + const char **result); /* Inform the user about progress made. */ -typedef void (*GpgmeProgressCb) (void *opaque, const char *what, - int type, int current, int total); +typedef void (*gpgme_progress_cb_t) (void *opaque, const char *what, + int type, int current, int total); /* Interact with the user about an edit operation. */ -typedef GpgmeError (*GpgmeEditCb) (void *opaque, GpgmeStatusCode status, - const char *args, const char **reply); +typedef gpgme_error_t (*gpgme_edit_cb_t) (void *opaque, + gpgme_status_code_t status, + const char *args, + const char **reply); /* Context management functions. */ /* Create a new context and return it in CTX. */ -GpgmeError gpgme_new (GpgmeCtx *ctx); +gpgme_error_t gpgme_new (gpgme_ctx_t *ctx); /* Release the context CTX. */ -void gpgme_release (GpgmeCtx ctx); +void gpgme_release (gpgme_ctx_t ctx); /* Set the protocol to be used by CTX to PROTO. */ -GpgmeError gpgme_set_protocol (GpgmeCtx ctx, GpgmeProtocol proto); +gpgme_error_t gpgme_set_protocol (gpgme_ctx_t ctx, gpgme_protocol_t proto); /* Get the protocol used with CTX */ -GpgmeProtocol gpgme_get_protocol (GpgmeCtx ctx); +gpgme_protocol_t gpgme_get_protocol (gpgme_ctx_t ctx); /* Get the string describing protocol PROTO, or NULL if invalid. */ -const char *gpgme_get_protocol_name (GpgmeProtocol proto); +const char *gpgme_get_protocol_name (gpgme_protocol_t proto); /* If YES is non-zero, enable armor mode in CTX, disable it otherwise. */ -void gpgme_set_armor (GpgmeCtx ctx, int yes); +void gpgme_set_armor (gpgme_ctx_t ctx, int yes); /* Return non-zero if armor mode is set in CTX. */ -int gpgme_get_armor (GpgmeCtx ctx); +int gpgme_get_armor (gpgme_ctx_t ctx); /* If YES is non-zero, enable text mode in CTX, disable it otherwise. */ -void gpgme_set_textmode (GpgmeCtx ctx, int yes); +void gpgme_set_textmode (gpgme_ctx_t ctx, int yes); /* Return non-zero if text mode is set in CTX. */ -int gpgme_get_textmode (GpgmeCtx ctx); +int gpgme_get_textmode (gpgme_ctx_t ctx); /* Include up to NR_OF_CERTS certificates in an S/MIME message. */ -void gpgme_set_include_certs (GpgmeCtx ctx, int nr_of_certs); +void gpgme_set_include_certs (gpgme_ctx_t ctx, int nr_of_certs); /* Return the number of certs to include in an S/MIME message. */ -int gpgme_get_include_certs (GpgmeCtx ctx); +int gpgme_get_include_certs (gpgme_ctx_t ctx); /* The available keylist mode flags. */ enum @@ -637,152 +673,159 @@ enum }; /* Set keylist mode in CTX to MODE. */ -GpgmeError gpgme_set_keylist_mode (GpgmeCtx ctx, int mode); +gpgme_error_t gpgme_set_keylist_mode (gpgme_ctx_t ctx, int mode); /* Get keylist mode in CTX. */ -int gpgme_get_keylist_mode (GpgmeCtx ctx); +int gpgme_get_keylist_mode (gpgme_ctx_t ctx); /* Set the passphrase callback function in CTX to CB. HOOK_VALUE is passed as first argument to the passphrase callback function. */ -void gpgme_set_passphrase_cb (GpgmeCtx ctx, - GpgmePassphraseCb cb, void *hook_value); +void gpgme_set_passphrase_cb (gpgme_ctx_t ctx, + gpgme_passphrase_cb_t cb, void *hook_value); /* Get the current passphrase callback function in *CB and the current hook value in *HOOK_VALUE. */ -void gpgme_get_passphrase_cb (GpgmeCtx ctx, GpgmePassphraseCb *cb, +void gpgme_get_passphrase_cb (gpgme_ctx_t ctx, gpgme_passphrase_cb_t *cb, void **hook_value); /* Set the progress callback function in CTX to CB. HOOK_VALUE is passed as first argument to the progress callback function. */ -void gpgme_set_progress_cb (GpgmeCtx c, GpgmeProgressCb cb, void *hook_value); +void gpgme_set_progress_cb (gpgme_ctx_t c, gpgme_progress_cb_t cb, + void *hook_value); /* Get the current progress callback function in *CB and the current hook value in *HOOK_VALUE. */ -void gpgme_get_progress_cb (GpgmeCtx ctx, GpgmeProgressCb *cb, +void gpgme_get_progress_cb (gpgme_ctx_t ctx, gpgme_progress_cb_t *cb, void **hook_value); /* Return a statically allocated string with the name of the public key algorithm ALGO, or NULL if that name is not known. */ -const char *gpgme_pubkey_algo_name (GpgmePubKeyAlgo algo); +const char *gpgme_pubkey_algo_name (gpgme_pubkey_algo_t algo); /* Return a statically allocated string with the name of the hash algorithm ALGO, or NULL if that name is not known. */ -const char *gpgme_hash_algo_name (GpgmeHashAlgo algo); +const char *gpgme_hash_algo_name (gpgme_hash_algo_t algo); /* Delete all signers from CTX. */ -void gpgme_signers_clear (GpgmeCtx ctx); +void gpgme_signers_clear (gpgme_ctx_t ctx); /* Add KEY to list of signers in CTX. */ -GpgmeError gpgme_signers_add (GpgmeCtx ctx, const GpgmeKey key); +gpgme_error_t gpgme_signers_add (gpgme_ctx_t ctx, const gpgme_key_t key); /* Return the SEQth signer's key in CTX. */ -GpgmeKey gpgme_signers_enum (const GpgmeCtx ctx, int seq); +gpgme_key_t gpgme_signers_enum (const gpgme_ctx_t ctx, int seq); /* Retrieve the signature status of signature IDX in CTX after a successful verify operation in R_STAT (if non-null). The creation time stamp of the signature is returned in R_CREATED (if non-null). - The function returns a string containing the fingerprint. */ -const char *gpgme_get_sig_status (GpgmeCtx ctx, int idx, - GpgmeSigStat *r_stat, time_t *r_created); + The function returns a string containing the fingerprint. + Deprecated, use verify result directly. */ +const char *gpgme_get_sig_status (gpgme_ctx_t ctx, int idx, + _gpgme_sig_stat_t *r_stat, + time_t *r_created) _GPGME_DEPRECATED; /* Retrieve certain attributes of a signature. IDX is the index number of the signature after a successful verify operation. WHAT is an attribute where GPGME_ATTR_EXPIRE is probably the most useful one. WHATIDX is to be passed as 0 for most attributes . */ -unsigned long gpgme_get_sig_ulong_attr (GpgmeCtx c, int idx, - GpgmeAttr what, int whatidx); -const char *gpgme_get_sig_string_attr (GpgmeCtx c, int idx, - GpgmeAttr what, int whatidx); +unsigned long gpgme_get_sig_ulong_attr (gpgme_ctx_t c, int idx, + _gpgme_attr_t what, int whatidx) + _GPGME_DEPRECATED; +const char *gpgme_get_sig_string_attr (gpgme_ctx_t c, int idx, + _gpgme_attr_t what, int whatidx) + _GPGME_DEPRECATED; /* Get the key used to create signature IDX in CTX and return it in R_KEY. */ -GpgmeError gpgme_get_sig_key (GpgmeCtx ctx, int idx, GpgmeKey *r_key); +gpgme_error_t gpgme_get_sig_key (gpgme_ctx_t ctx, int idx, gpgme_key_t *r_key) + _GPGME_DEPRECATED; /* Run control. */ /* The type of an I/O callback function. */ -typedef GpgmeError (*GpgmeIOCb) (void *data, int fd); +typedef gpgme_error_t (*gpgme_io_cb_t) (void *data, int fd); /* The type of a function that can register FNC as the I/O callback function for the file descriptor FD with direction dir (0: for writing, 1: for reading). FNC_DATA should be passed as DATA to FNC. The function should return a TAG suitable for the corresponding - GpgmeRemoveIOCb, and an error value. */ -typedef GpgmeError (*GpgmeRegisterIOCb) (void *data, int fd, int dir, - GpgmeIOCb fnc, void *fnc_data, - void **tag); + gpgme_remove_io_cb_t, and an error value. */ +typedef gpgme_error_t (*gpgme_register_io_cb_t) (void *data, int fd, int dir, + gpgme_io_cb_t fnc, + void *fnc_data, void **tag); /* The type of a function that can remove a previously registered I/O callback function given TAG as returned by the register function. */ -typedef void (*GpgmeRemoveIOCb) (void *tag); +typedef void (*gpgme_remove_io_cb_t) (void *tag); typedef enum { GPGME_EVENT_START, GPGME_EVENT_DONE, GPGME_EVENT_NEXT_KEY, - GPGME_EVENT_NEXT_TRUSTITEM } GpgmeEventIO; + GPGME_EVENT_NEXT_TRUSTITEM } gpgme_event_io_t; /* The type of a function that is called when a context finished an operation. */ -typedef void (*GpgmeEventIOCb) (void *data, GpgmeEventIO type, - void *type_data); +typedef void (*gpgme_event_io_cb_t) (void *data, gpgme_event_io_t type, + void *type_data); -struct GpgmeIOCbs +struct gpgme_io_cbs { - GpgmeRegisterIOCb add; + gpgme_register_io_cb_t add; void *add_priv; - GpgmeRemoveIOCb remove; - GpgmeEventIOCb event; + gpgme_remove_io_cb_t remove; + gpgme_event_io_cb_t event; void *event_priv; }; +typedef struct gpgme_io_cbs *gpgme_io_cbs_t; /* Set the I/O callback functions in CTX to IO_CBS. */ -void gpgme_set_io_cbs (GpgmeCtx ctx, struct GpgmeIOCbs *io_cbs); +void gpgme_set_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs); /* Get the current I/O callback functions. */ -void gpgme_get_io_cbs (GpgmeCtx ctx, struct GpgmeIOCbs *io_cbs); +void gpgme_get_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs); /* Process the pending operation and, if HANG is non-zero, wait for the pending operation to finish. */ -GpgmeCtx gpgme_wait (GpgmeCtx ctx, GpgmeError *status, int hang); +gpgme_ctx_t gpgme_wait (gpgme_ctx_t ctx, gpgme_error_t *status, int hang); /* Functions to handle recipients. */ /* Create a new recipients set and return it in R_RSET. */ -GpgmeError gpgme_recipients_new (GpgmeRecipients *r_rset); +gpgme_error_t gpgme_recipients_new (gpgme_recipients_t *r_rset); /* Release the recipients set RSET. */ -void gpgme_recipients_release (GpgmeRecipients rset); +void gpgme_recipients_release (gpgme_recipients_t rset); /* Add NAME to the recipients set RSET. */ -GpgmeError gpgme_recipients_add_name (GpgmeRecipients rset, const char *name); +gpgme_error_t gpgme_recipients_add_name (gpgme_recipients_t rset, const char *name); /* Add NAME with validity AL to the recipients set RSET. */ -GpgmeError gpgme_recipients_add_name_with_validity (GpgmeRecipients rset, - const char *name, - GpgmeValidity val); +gpgme_error_t gpgme_recipients_add_name_with_validity (gpgme_recipients_t rset, + const char *name, + gpgme_validity_t val); /* Return the number of recipients in RSET. */ -unsigned int gpgme_recipients_count (const GpgmeRecipients rset); +unsigned int gpgme_recipients_count (const gpgme_recipients_t rset); /* Create a new enumeration handle for the recipients set RSET and return it in ITER. */ -GpgmeError gpgme_recipients_enum_open (const GpgmeRecipients rset, - void **iter); +gpgme_error_t gpgme_recipients_enum_open (const gpgme_recipients_t rset, + void **iter); /* Return the next recipient from the recipient set RSET in the enumerator ITER. */ -const char *gpgme_recipients_enum_read (const GpgmeRecipients rset, +const char *gpgme_recipients_enum_read (const gpgme_recipients_t rset, void **iter); /* Destroy the enumerator ITER for the recipient set RSET. */ -GpgmeError gpgme_recipients_enum_close (const GpgmeRecipients rset, - void **iter); +gpgme_error_t gpgme_recipients_enum_close (const gpgme_recipients_t rset, + void **iter); /* Functions to handle data objects. */ @@ -790,145 +833,158 @@ GpgmeError gpgme_recipients_enum_close (const GpgmeRecipients rset, /* Read up to SIZE bytes into buffer BUFFER from the data object with the handle HANDLE. Return the number of characters read, 0 on EOF and -1 on error. If an error occurs, errno is set. */ -typedef ssize_t (*GpgmeDataReadCb) (void *handle, void *buffer, size_t size); +typedef ssize_t (*gpgme_data_read_cb_t) (void *handle, void *buffer, + size_t size); /* Write up to SIZE bytes from buffer BUFFER to the data object with the handle HANDLE. Return the number of characters written, or -1 on error. If an error occurs, errno is set. */ -typedef ssize_t (*GpgmeDataWriteCb) (void *handle, const void *buffer, - size_t size); +typedef ssize_t (*gpgme_data_write_cb_t) (void *handle, const void *buffer, + size_t size); /* Set the current position from where the next read or write starts in the data object with the handle HANDLE to OFFSET, relativ to WHENCE. */ -typedef off_t (*GpgmeDataSeekCb) (void *handle, off_t offset, int whence); +typedef off_t (*gpgme_data_seek_cb_t) (void *handle, off_t offset, int whence); /* Close the data object with the handle DL. */ -typedef void (*GpgmeDataReleaseCb) (void *handle); +typedef void (*gpgme_data_release_cb_t) (void *handle); -struct GpgmeDataCbs +struct gpgme_data_cbs { - GpgmeDataReadCb read; - GpgmeDataWriteCb write; - GpgmeDataSeekCb seek; - GpgmeDataReleaseCb release; + gpgme_data_read_cb_t read; + gpgme_data_write_cb_t write; + gpgme_data_seek_cb_t seek; + gpgme_data_release_cb_t release; }; +typedef struct gpgme_data_cbs *gpgme_data_cbs_t; /* 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 -1 on error. If an error occurs, errno is set. */ -ssize_t gpgme_data_read (GpgmeData dh, void *buffer, size_t size); +ssize_t gpgme_data_read (gpgme_data_t dh, void *buffer, size_t size); /* 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 error. If an error occurs, errno is set. */ -ssize_t gpgme_data_write (GpgmeData dh, const void *buffer, size_t size); +ssize_t gpgme_data_write (gpgme_data_t dh, const void *buffer, size_t size); /* Set the current position from where the next read or write starts in the data object with the handle DH to OFFSET, relativ to WHENCE. */ -off_t gpgme_data_seek (GpgmeData dh, off_t offset, int whence); +off_t gpgme_data_seek (gpgme_data_t dh, off_t offset, int whence); /* Create a new data buffer and return it in R_DH. */ -GpgmeError gpgme_data_new (GpgmeData *r_dh); +gpgme_error_t gpgme_data_new (gpgme_data_t *r_dh); /* Destroy the data buffer DH. */ -void gpgme_data_release (GpgmeData dh); +void gpgme_data_release (gpgme_data_t dh); /* Create a new data buffer filled with SIZE bytes starting from BUFFER. If COPY is zero, copying is delayed until necessary, and the data is taken from the original location when needed. */ -GpgmeError gpgme_data_new_from_mem (GpgmeData *r_dh, - const char *buffer, size_t size, - int copy); +gpgme_error_t gpgme_data_new_from_mem (gpgme_data_t *r_dh, + const char *buffer, size_t size, + int copy); /* Destroy the data buffer DH and return a pointer to its content. The memory has be to released with free by the user. It's size is returned in R_LEN. */ -char *gpgme_data_release_and_get_mem (GpgmeData dh, size_t *r_len); +char *gpgme_data_release_and_get_mem (gpgme_data_t dh, size_t *r_len); -GpgmeError gpgme_data_new_from_cbs (GpgmeData *dh, - struct GpgmeDataCbs *cbs, - void *handle); +gpgme_error_t gpgme_data_new_from_cbs (gpgme_data_t *dh, + gpgme_data_cbs_t cbs, + void *handle); -GpgmeError gpgme_data_new_from_fd (GpgmeData *dh, int fd); +gpgme_error_t gpgme_data_new_from_fd (gpgme_data_t *dh, int fd); -GpgmeError gpgme_data_new_from_stream (GpgmeData *dh, FILE *stream); +gpgme_error_t gpgme_data_new_from_stream (gpgme_data_t *dh, FILE *stream); /* Return the encoding attribute of the data buffer DH */ -GpgmeDataEncoding gpgme_data_get_encoding (GpgmeData dh); +gpgme_data_encoding_t gpgme_data_get_encoding (gpgme_data_t dh); /* Set the encoding attribute of data buffer DH to ENC */ -GpgmeError gpgme_data_set_encoding (GpgmeData dh, GpgmeDataEncoding enc); +gpgme_error_t gpgme_data_set_encoding (gpgme_data_t dh, + gpgme_data_encoding_t enc); /* Create a new data buffer which retrieves the data from the callback function READ_CB. Deprecated, please use gpgme_data_new_from_cbs instead. */ -GpgmeError gpgme_data_new_with_read_cb (GpgmeData *r_dh, - int (*read_cb) (void*,char *,size_t,size_t*), - void *read_cb_value); +gpgme_error_t gpgme_data_new_with_read_cb (gpgme_data_t *r_dh, + int (*read_cb) (void*,char *, + size_t,size_t*), + void *read_cb_value) + _GPGME_DEPRECATED; /* Create a new data buffer filled with the content of file FNAME. COPY must be non-zero. For delayed read, please use gpgme_data_new_from_fd or gpgme_data_new_from stream instead. */ -GpgmeError gpgme_data_new_from_file (GpgmeData *r_dh, - const char *fname, - int copy); +gpgme_error_t gpgme_data_new_from_file (gpgme_data_t *r_dh, + const char *fname, + int copy); /* Create a new data buffer filled with LENGTH bytes starting from OFFSET within the file FNAME or stream FP (exactly one must be non-zero). */ -GpgmeError gpgme_data_new_from_filepart (GpgmeData *r_dh, - const char *fname, FILE *fp, - off_t offset, size_t length); +gpgme_error_t gpgme_data_new_from_filepart (gpgme_data_t *r_dh, + const char *fname, FILE *fp, + off_t offset, size_t length); /* Reset the read pointer in DH. Deprecated, please use gpgme_data_seek instead. */ -GpgmeError gpgme_data_rewind (GpgmeData dh); +gpgme_error_t gpgme_data_rewind (gpgme_data_t dh) _GPGME_DEPRECATED; /* Key and trust functions. */ /* Get the key with the fingerprint FPR from the crypto backend. If SECRET is true, get the secret key. */ -GpgmeError gpgme_get_key (GpgmeCtx ctx, const char *fpr, GpgmeKey *r_key, - int secret); +gpgme_error_t gpgme_get_key (gpgme_ctx_t ctx, const char *fpr, + gpgme_key_t *r_key, int secret); /* Acquire a reference to KEY. */ -void gpgme_key_ref (GpgmeKey key); +void gpgme_key_ref (gpgme_key_t key); /* Release a reference to KEY. If this was the last one the key is destroyed. */ -void gpgme_key_unref (GpgmeKey key); -void gpgme_key_release (GpgmeKey key); +void gpgme_key_unref (gpgme_key_t key); +void gpgme_key_release (gpgme_key_t key); /* Return the value of the attribute WHAT of KEY, which has to be - representable by a string. IDX specifies the sub key or - user ID for attributes related to sub keys or user IDs. */ -const char *gpgme_key_get_string_attr (GpgmeKey key, GpgmeAttr what, - const void *reserved, int idx); + representable by a string. IDX specifies the sub key or user ID + for attributes related to sub keys or user IDs. Deprecated, use + key structure directly instead. */ +const char *gpgme_key_get_string_attr (gpgme_key_t key, _gpgme_attr_t what, + const void *reserved, int idx) + _GPGME_DEPRECATED; /* Return the value of the attribute WHAT of KEY, which has to be representable by an unsigned integer. IDX specifies the sub key or - user ID for attributes related to sub keys or user IDs. */ -unsigned long gpgme_key_get_ulong_attr (GpgmeKey key, GpgmeAttr what, - const void *reserved, int idx); + user ID for attributes related to sub keys or user IDs. + Deprecated, use key structure directly instead. */ +unsigned long gpgme_key_get_ulong_attr (gpgme_key_t key, _gpgme_attr_t what, + const void *reserved, int idx) + _GPGME_DEPRECATED; /* Return the value of the attribute WHAT of a signature on user ID UID_IDX in KEY, which has to be representable by a string. IDX - specifies the signature. */ -const char *gpgme_key_sig_get_string_attr (GpgmeKey key, int uid_idx, - GpgmeAttr what, - const void *reserved, int idx); + specifies the signature. Deprecated, use key structure directly + instead. */ +const char *gpgme_key_sig_get_string_attr (gpgme_key_t key, int uid_idx, + _gpgme_attr_t what, + const void *reserved, int idx) + _GPGME_DEPRECATED; /* Return the value of the attribute WHAT of a signature on user ID UID_IDX in KEY, which has to be representable by an unsigned - integer string. IDX specifies the signature. */ -unsigned long gpgme_key_sig_get_ulong_attr (GpgmeKey key, int uid_idx, - GpgmeAttr what, - const void *reserved, int idx); + integer string. IDX specifies the signature. Deprecated, use key + structure directly instead. */ +unsigned long gpgme_key_sig_get_ulong_attr (gpgme_key_t key, int uid_idx, + _gpgme_attr_t what, + const void *reserved, int idx) + _GPGME_DEPRECATED; /* Crypto Operations. */ @@ -937,40 +993,38 @@ struct _gpgme_invalid_user_id { struct _gpgme_invalid_user_id *next; char *id; - GpgmeError reason; + gpgme_error_t reason; }; -typedef struct _gpgme_invalid_user_id *GpgmeInvalidUserID; +typedef struct _gpgme_invalid_user_id *gpgme_invalid_user_id_t; /* Encryption. */ struct _gpgme_op_encrypt_result { /* The list of invalid recipients. */ - GpgmeInvalidUserID invalid_recipients; + gpgme_invalid_user_id_t invalid_recipients; }; -typedef struct _gpgme_op_encrypt_result *GpgmeEncryptResult; +typedef struct _gpgme_op_encrypt_result *gpgme_encrypt_result_t; /* Retrieve a pointer to the result of the encrypt operation. */ -GpgmeEncryptResult gpgme_op_encrypt_result (GpgmeCtx ctx); +gpgme_encrypt_result_t gpgme_op_encrypt_result (gpgme_ctx_t ctx); /* Encrypt plaintext PLAIN within CTX for the recipients RECP and store the resulting ciphertext in CIPHER. */ -GpgmeError gpgme_op_encrypt_start (GpgmeCtx ctx, - GpgmeRecipients recp, - GpgmeData plain, GpgmeData cipher); -GpgmeError gpgme_op_encrypt (GpgmeCtx ctx, - GpgmeRecipients recp, - GpgmeData plain, GpgmeData cipher); +gpgme_error_t gpgme_op_encrypt_start (gpgme_ctx_t ctx, gpgme_recipients_t recp, + gpgme_data_t plain, gpgme_data_t cipher); +gpgme_error_t gpgme_op_encrypt (gpgme_ctx_t ctx, gpgme_recipients_t recp, + gpgme_data_t plain, gpgme_data_t cipher); /* Encrypt plaintext PLAIN within CTX for the recipients RECP and store the resulting ciphertext in CIPHER. Also sign the ciphertext with the signers in CTX. */ -GpgmeError gpgme_op_encrypt_sign_start (GpgmeCtx ctx, - GpgmeRecipients recp, - GpgmeData plain, GpgmeData cipher); -GpgmeError gpgme_op_encrypt_sign (GpgmeCtx ctx, - GpgmeRecipients recp, - GpgmeData plain, GpgmeData cipher); +gpgme_error_t gpgme_op_encrypt_sign_start (gpgme_ctx_t ctx, + gpgme_recipients_t recp, + gpgme_data_t plain, + gpgme_data_t cipher); +gpgme_error_t gpgme_op_encrypt_sign (gpgme_ctx_t ctx, gpgme_recipients_t recp, + gpgme_data_t plain, gpgme_data_t cipher); /* Decryption. */ @@ -978,57 +1032,58 @@ struct _gpgme_op_decrypt_result { char *unsupported_algorithm; }; -typedef struct _gpgme_op_decrypt_result *GpgmeDecryptResult; +typedef struct _gpgme_op_decrypt_result *gpgme_decrypt_result_t; /* Retrieve a pointer to the result of the decrypt operation. */ -GpgmeDecryptResult gpgme_op_decrypt_result (GpgmeCtx ctx); +gpgme_decrypt_result_t gpgme_op_decrypt_result (gpgme_ctx_t ctx); /* Decrypt ciphertext CIPHER within CTX and store the resulting plaintext in PLAIN. */ -GpgmeError gpgme_op_decrypt_start (GpgmeCtx ctx, - GpgmeData cipher, GpgmeData plain); -GpgmeError gpgme_op_decrypt (GpgmeCtx ctx, - GpgmeData cipher, GpgmeData plain); +gpgme_error_t gpgme_op_decrypt_start (gpgme_ctx_t ctx, gpgme_data_t cipher, + gpgme_data_t plain); +gpgme_error_t gpgme_op_decrypt (gpgme_ctx_t ctx, + gpgme_data_t cipher, gpgme_data_t plain); /* Decrypt ciphertext CIPHER and make a signature verification within CTX and store the resulting plaintext in PLAIN. */ -GpgmeError gpgme_op_decrypt_verify_start (GpgmeCtx ctx, - GpgmeData cipher, GpgmeData plain); -GpgmeError gpgme_op_decrypt_verify (GpgmeCtx ctx, - GpgmeData cipher, GpgmeData plain); +gpgme_error_t gpgme_op_decrypt_verify_start (gpgme_ctx_t ctx, + gpgme_data_t cipher, + gpgme_data_t plain); +gpgme_error_t gpgme_op_decrypt_verify (gpgme_ctx_t ctx, gpgme_data_t cipher, + gpgme_data_t plain); /* Signing. */ struct _gpgme_new_signature { struct _gpgme_new_signature *next; - GpgmeSigMode type; - GpgmePubKeyAlgo pubkey_algo; - GpgmeHashAlgo hash_algo; + gpgme_sig_mode_t type; + gpgme_pubkey_algo_t pubkey_algo; + gpgme_hash_algo_t hash_algo; unsigned long class; long int timestamp; char *fpr; }; -typedef struct _gpgme_new_signature *GpgmeNewSignature; +typedef struct _gpgme_new_signature *gpgme_new_signature_t; struct _gpgme_op_sign_result { /* The list of invalid signers. */ - GpgmeInvalidUserID invalid_signers; - GpgmeNewSignature signatures; + gpgme_invalid_user_id_t invalid_signers; + gpgme_new_signature_t signatures; }; -typedef struct _gpgme_op_sign_result *GpgmeSignResult; +typedef struct _gpgme_op_sign_result *gpgme_sign_result_t; /* Retrieve a pointer to the result of the signing operation. */ -GpgmeSignResult gpgme_op_sign_result (GpgmeCtx ctx); +gpgme_sign_result_t gpgme_op_sign_result (gpgme_ctx_t ctx); /* Sign the plaintext PLAIN and store the signature in SIG. */ -GpgmeError gpgme_op_sign_start (GpgmeCtx ctx, - GpgmeData plain, GpgmeData sig, - GpgmeSigMode mode); -GpgmeError gpgme_op_sign (GpgmeCtx ctx, - GpgmeData plain, GpgmeData sig, - GpgmeSigMode mode); +gpgme_error_t gpgme_op_sign_start (gpgme_ctx_t ctx, + gpgme_data_t plain, gpgme_data_t sig, + gpgme_sig_mode_t mode); +gpgme_error_t gpgme_op_sign (gpgme_ctx_t ctx, + gpgme_data_t plain, gpgme_data_t sig, + gpgme_sig_mode_t mode); /* Verify. */ @@ -1041,10 +1096,10 @@ struct _gpgme_sig_notation char *name; char *value; }; -typedef struct _gpgme_sig_notation *GpgmeSigNotation; +typedef struct _gpgme_sig_notation *gpgme_sig_notation_t; -/* Flags used for the SUMMARY field in a GpgmeSignature. */ -enum +/* Flags used for the SUMMARY field in a gpgme_signature_t. */ +enum { GPGME_SIGSUM_VALID = 0x0001, /* The signature is fully valid. */ GPGME_SIGSUM_GREEN = 0x0002, /* The signature is good. */ @@ -1070,10 +1125,10 @@ struct _gpgme_signature char *fpr; /* The status of the signature. */ - GpgmeError status; + gpgme_error_t status; /* Notation data and policy URLs. */ - GpgmeSigNotation notations; + gpgme_sig_notation_t notations; /* Signature creation time. */ unsigned long timestamp; @@ -1086,25 +1141,27 @@ struct _gpgme_signature /* Internal to GPGME, do not use. */ int _unused : 31; - GpgmeValidity validity; - GpgmeError validity_reason; + gpgme_validity_t validity; + gpgme_error_t validity_reason; }; -typedef struct _gpgme_signature *GpgmeSignature; +typedef struct _gpgme_signature *gpgme_signature_t; struct _gpgme_op_verify_result { - GpgmeSignature signatures; + gpgme_signature_t signatures; }; -typedef struct _gpgme_op_verify_result *GpgmeVerifyResult; +typedef struct _gpgme_op_verify_result *gpgme_verify_result_t; /* Retrieve a pointer to the result of the verify operation. */ -GpgmeVerifyResult gpgme_op_verify_result (GpgmeCtx ctx); +gpgme_verify_result_t gpgme_op_verify_result (gpgme_ctx_t ctx); /* Verify within CTX that SIG is a valid signature for TEXT. */ -GpgmeError gpgme_op_verify_start (GpgmeCtx ctx, GpgmeData sig, - GpgmeData signed_text, GpgmeData plaintext); -GpgmeError gpgme_op_verify (GpgmeCtx ctx, GpgmeData sig, - GpgmeData signed_text, GpgmeData plaintext); +gpgme_error_t gpgme_op_verify_start (gpgme_ctx_t ctx, gpgme_data_t sig, + gpgme_data_t signed_text, + gpgme_data_t plaintext); +gpgme_error_t gpgme_op_verify (gpgme_ctx_t ctx, gpgme_data_t sig, + gpgme_data_t signed_text, + gpgme_data_t plaintext); /* Import. */ @@ -1135,14 +1192,14 @@ struct _gpgme_import_status /* If a problem occured, the reason why the key could not be imported. Otherwise GPGME_No_Error. */ - GpgmeError result; + gpgme_error_t result; /* The result of the import, the GPGME_IMPORT_* values bit-wise ORed. 0 means the key was already known and no new components have been added. */ unsigned int status; }; -typedef struct _gpgme_import_status *GpgmeImportStatus; +typedef struct _gpgme_import_status *gpgme_import_status_t; /* Import. */ struct _gpgme_op_import_result @@ -1187,24 +1244,25 @@ struct _gpgme_op_import_result int not_imported; /* List of keys for which an import was attempted. */ - GpgmeImportStatus imports; + gpgme_import_status_t imports; }; -typedef struct _gpgme_op_import_result *GpgmeImportResult; +typedef struct _gpgme_op_import_result *gpgme_import_result_t; /* Retrieve a pointer to the result of the import operation. */ -GpgmeImportResult gpgme_op_import_result (GpgmeCtx ctx); +gpgme_import_result_t gpgme_op_import_result (gpgme_ctx_t ctx); /* Import the key in KEYDATA into the keyring. */ -GpgmeError gpgme_op_import_start (GpgmeCtx ctx, GpgmeData keydata); -GpgmeError gpgme_op_import (GpgmeCtx ctx, GpgmeData keydata); -GpgmeError gpgme_op_import_ext (GpgmeCtx ctx, GpgmeData keydata, int *nr); +gpgme_error_t gpgme_op_import_start (gpgme_ctx_t ctx, gpgme_data_t keydata); +gpgme_error_t gpgme_op_import (gpgme_ctx_t ctx, gpgme_data_t keydata); +gpgme_error_t gpgme_op_import_ext (gpgme_ctx_t ctx, gpgme_data_t keydata, + int *nr) _GPGME_DEPRECATED; /* Export the keys listed in RECP into KEYDATA. */ -GpgmeError gpgme_op_export_start (GpgmeCtx ctx, GpgmeRecipients recp, - GpgmeData keydata); -GpgmeError gpgme_op_export (GpgmeCtx ctx, GpgmeRecipients recp, - GpgmeData keydata); +gpgme_error_t gpgme_op_export_start (gpgme_ctx_t ctx, gpgme_recipients_t recp, + gpgme_data_t keydata); +gpgme_error_t gpgme_op_export (gpgme_ctx_t ctx, gpgme_recipients_t recp, + gpgme_data_t keydata); /* Key generation. */ @@ -1222,35 +1280,36 @@ struct _gpgme_op_genkey_result /* The fingerprint of the generated key. */ char *fpr; }; -typedef struct _gpgme_op_genkey_result *GpgmeGenKeyResult; +typedef struct _gpgme_op_genkey_result *gpgme_genkey_result_t; /* Generate a new keypair and add it to the keyring. PUBKEY and SECKEY should be null for now. PARMS specifies what keys should be generated. */ -GpgmeError gpgme_op_genkey_start (GpgmeCtx ctx, const char *parms, - GpgmeData pubkey, GpgmeData seckey); -GpgmeError gpgme_op_genkey (GpgmeCtx ctx, const char *parms, - GpgmeData pubkey, GpgmeData seckey); +gpgme_error_t gpgme_op_genkey_start (gpgme_ctx_t ctx, const char *parms, + gpgme_data_t pubkey, gpgme_data_t seckey); +gpgme_error_t gpgme_op_genkey (gpgme_ctx_t ctx, const char *parms, + gpgme_data_t pubkey, gpgme_data_t seckey); /* Retrieve a pointer to the result of the genkey operation. */ -GpgmeGenKeyResult gpgme_op_genkey_result (GpgmeCtx ctx); +gpgme_genkey_result_t gpgme_op_genkey_result (gpgme_ctx_t ctx); /* Delete KEY from the keyring. If ALLOW_SECRET is non-zero, secret keys are also deleted. */ -GpgmeError gpgme_op_delete_start (GpgmeCtx ctx, const GpgmeKey key, - int allow_secret); -GpgmeError gpgme_op_delete (GpgmeCtx ctx, const GpgmeKey key, - int allow_secret); +gpgme_error_t gpgme_op_delete_start (gpgme_ctx_t ctx, const gpgme_key_t key, + int allow_secret); +gpgme_error_t gpgme_op_delete (gpgme_ctx_t ctx, const gpgme_key_t key, + int allow_secret); + /* Edit the key KEY. Send status and command requests to FNC and output of edit commands to OUT. */ -GpgmeError gpgme_op_edit_start (GpgmeCtx ctx, GpgmeKey key, - GpgmeEditCb fnc, void *fnc_value, - GpgmeData out); -GpgmeError gpgme_op_edit (GpgmeCtx ctx, GpgmeKey key, - GpgmeEditCb fnc, void *fnc_value, - GpgmeData out); +gpgme_error_t gpgme_op_edit_start (gpgme_ctx_t ctx, gpgme_key_t key, + gpgme_edit_cb_t fnc, void *fnc_value, + gpgme_data_t out); +gpgme_error_t gpgme_op_edit (gpgme_ctx_t ctx, gpgme_key_t key, + gpgme_edit_cb_t fnc, void *fnc_value, + gpgme_data_t out); /* Key management functions */ @@ -1261,24 +1320,25 @@ struct _gpgme_op_keylist_result /* Internal to GPGME, do not use. */ unsigned int _unused : 31; }; -typedef struct _gpgme_op_keylist_result *GpgmeKeyListResult; +typedef struct _gpgme_op_keylist_result *gpgme_keylist_result_t; /* Retrieve a pointer to the result of the key listing operation. */ -GpgmeKeyListResult gpgme_op_keylist_result (GpgmeCtx ctx); +gpgme_keylist_result_t gpgme_op_keylist_result (gpgme_ctx_t ctx); /* Start a keylist operation within CTX, searching for keys which match PATTERN. If SECRET_ONLY is true, only secret keys are returned. */ -GpgmeError gpgme_op_keylist_start (GpgmeCtx ctx, - const char *pattern, int secret_only); -GpgmeError gpgme_op_keylist_ext_start (GpgmeCtx ctx, const char *pattern[], - int secret_only, int reserved); +gpgme_error_t gpgme_op_keylist_start (gpgme_ctx_t ctx, const char *pattern, + int secret_only); +gpgme_error_t gpgme_op_keylist_ext_start (gpgme_ctx_t ctx, + const char *pattern[], + int secret_only, int reserved); /* Return the next key from the keylist in R_KEY. */ -GpgmeError gpgme_op_keylist_next (GpgmeCtx ctx, GpgmeKey *r_key); +gpgme_error_t gpgme_op_keylist_next (gpgme_ctx_t ctx, gpgme_key_t *r_key); /* Terminate a pending keylist operation within CTX. */ -GpgmeError gpgme_op_keylist_end (GpgmeCtx ctx); +gpgme_error_t gpgme_op_keylist_end (gpgme_ctx_t ctx); /* Trust items and operations. */ @@ -1315,40 +1375,46 @@ struct _gpgme_trust_item /* The user name if TYPE is 2. */ char *name; }; -typedef struct _gpgme_trust_item *GpgmeTrustItem; +typedef struct _gpgme_trust_item *gpgme_trust_item_t; /* Start a trustlist operation within CTX, searching for trust items which match PATTERN. */ -GpgmeError gpgme_op_trustlist_start (GpgmeCtx ctx, - const char *pattern, int max_level); +gpgme_error_t gpgme_op_trustlist_start (gpgme_ctx_t ctx, + const char *pattern, int max_level); /* Return the next trust item from the trustlist in R_ITEM. */ -GpgmeError gpgme_op_trustlist_next (GpgmeCtx ctx, GpgmeTrustItem *r_item); +gpgme_error_t gpgme_op_trustlist_next (gpgme_ctx_t ctx, + gpgme_trust_item_t *r_item); /* Terminate a pending trustlist operation within CTX. */ -GpgmeError gpgme_op_trustlist_end (GpgmeCtx ctx); +gpgme_error_t gpgme_op_trustlist_end (gpgme_ctx_t ctx); /* Acquire a reference to ITEM. */ -void gpgme_trust_item_ref (GpgmeTrustItem item); +void gpgme_trust_item_ref (gpgme_trust_item_t item); /* Release a reference to ITEM. If this was the last one the trust item is destroyed. */ -void gpgme_trust_item_unref (GpgmeTrustItem item); +void gpgme_trust_item_unref (gpgme_trust_item_t item); -/* Release the trust item ITEM. */ -void gpgme_trust_item_release (GpgmeTrustItem item); +/* Release the trust item ITEM. Deprecated, use + gpgme_trust_item_unref. */ +void gpgme_trust_item_release (gpgme_trust_item_t item) _GPGME_DEPRECATED; /* Return the value of the attribute WHAT of ITEM, which has to be - representable by a string. */ -const char *gpgme_trust_item_get_string_attr (GpgmeTrustItem item, - GpgmeAttr what, - const void *reserved, int idx); + representable by a string. Deprecated, use trust item structure + directly. */ +const char *gpgme_trust_item_get_string_attr (gpgme_trust_item_t item, + _gpgme_attr_t what, + const void *reserved, int idx) + _GPGME_DEPRECATED; /* Return the value of the attribute WHAT of KEY, which has to be representable by an integer. IDX specifies a running index if the - attribute appears more than once in the key. */ -int gpgme_trust_item_get_int_attr (GpgmeTrustItem item, GpgmeAttr what, - const void *reserved, int idx); + attribute appears more than once in the key. Deprecated, use trust + item structure directly. */ +int gpgme_trust_item_get_int_attr (gpgme_trust_item_t item, _gpgme_attr_t what, + const void *reserved, int idx) + _GPGME_DEPRECATED; /* Various functions. */ @@ -1357,18 +1423,60 @@ int gpgme_trust_item_get_int_attr (GpgmeTrustItem item, GpgmeAttr what, const char *gpgme_check_version (const char *req_version); /* Retrieve information about the backend engines. */ -GpgmeError gpgme_get_engine_info (GpgmeEngineInfo *engine_info); +gpgme_error_t gpgme_get_engine_info (gpgme_engine_info_t *engine_info); /* Return a string describing ERR. */ -const char *gpgme_strerror (GpgmeError err); +const char *gpgme_strerror (gpgme_error_t err); /* Engine support functions. */ /* Verify that the engine implementing PROTO is installed and available. */ -GpgmeError gpgme_engine_check_version (GpgmeProtocol proto); +gpgme_error_t gpgme_engine_check_version (gpgme_protocol_t proto); + +/* Deprecated types. */ +typedef gpgme_ctx_t GpgmeCtx _GPGME_DEPRECATED; +typedef gpgme_data_t GpgmeData _GPGME_DEPRECATED; +typedef gpgme_recipients_t GpgmeRecipients _GPGME_DEPRECATED; +typedef gpgme_error_t GpgmeError _GPGME_DEPRECATED; +typedef gpgme_data_encoding_t GpgmeDataEncoding _GPGME_DEPRECATED; +typedef gpgme_pubkey_algo_t GpgmePubKeyAlgo _GPGME_DEPRECATED; +typedef gpgme_hash_algo_t GpgmeHashAlgo _GPGME_DEPRECATED; +typedef gpgme_sig_stat_t GpgmeSigStat _GPGME_DEPRECATED; +typedef gpgme_sig_mode_t GpgmeSigMode _GPGME_DEPRECATED; +typedef gpgme_attr_t GpgmeAttr _GPGME_DEPRECATED; +typedef gpgme_validity_t GpgmeValidity _GPGME_DEPRECATED; +typedef gpgme_protocol_t GpgmeProtocol _GPGME_DEPRECATED; +typedef gpgme_engine_info_t GpgmeEngineInfo _GPGME_DEPRECATED; +typedef gpgme_subkey_t GpgmeSubkey _GPGME_DEPRECATED; +typedef gpgme_key_sig_t GpgmeKeySig _GPGME_DEPRECATED; +typedef gpgme_user_id_t GpgmeUserID _GPGME_DEPRECATED; +typedef gpgme_key_t GpgmeKey _GPGME_DEPRECATED; +typedef gpgme_passphrase_cb_t GpgmePassphraseCb _GPGME_DEPRECATED; +typedef gpgme_progress_cb_t GpgmeProgressCb _GPGME_DEPRECATED; +typedef gpgme_io_cb_t GpgmeIOCb _GPGME_DEPRECATED; +typedef gpgme_register_io_cb_t GpgmeRegisterIOCb _GPGME_DEPRECATED; +typedef gpgme_remove_io_cb_t GpgmeRemoveIOCb _GPGME_DEPRECATED; +typedef gpgme_event_io_t GpgmeEventIO _GPGME_DEPRECATED; +typedef gpgme_event_io_cb_t GpgmeEventIOCb _GPGME_DEPRECATED; +#define GpgmeIOCbs gpgme_io_cbs +typedef gpgme_data_read_cb_t GpgmeDataReadCb _GPGME_DEPRECATED; +typedef gpgme_data_write_cb_t GpgmeDataWriteCb _GPGME_DEPRECATED; +typedef gpgme_data_seek_cb_t GpgmeDataSeekCb _GPGME_DEPRECATED; +typedef gpgme_data_release_cb_t GpgmeDataReleaseCb _GPGME_DEPRECATED; +#define GpgmeDataCbs gpgme_data_cbs +typedef gpgme_invalid_user_id_t GpgmeInvalidUserID _GPGME_DEPRECATED; +typedef gpgme_encrypt_result_t GpgmeEncryptResult _GPGME_DEPRECATED; +typedef gpgme_sig_notation_t GpgmeSigNotation _GPGME_DEPRECATED; +typedef gpgme_signature_t GpgmeSignature _GPGME_DEPRECATED; +typedef gpgme_verify_result_t GpgmeVerifyResult _GPGME_DEPRECATED; +typedef gpgme_import_status_t GpgmeImportStatus _GPGME_DEPRECATED; +typedef gpgme_import_result_t GpgmeImportResult _GPGME_DEPRECATED; +typedef gpgme_genkey_result_t GpgmeGenKeyResult _GPGME_DEPRECATED; +typedef gpgme_trust_item_t GpgmeTrustItem _GPGME_DEPRECATED; +typedef gpgme_status_code_t GpgmeStatusCode _GPGME_DEPRECATED; #ifdef __cplusplus } diff --git a/trunk/gpgme/import.c b/trunk/gpgme/import.c index 90a6e36..8d95aff 100644 --- a/trunk/gpgme/import.c +++ b/trunk/gpgme/import.c @@ -37,7 +37,7 @@ typedef struct /* A pointer to the next pointer of the last import status in the list. This makes appending new imports painless while preserving the order. */ - GpgmeImportStatus *lastp; + gpgme_import_status_t *lastp; } *op_data_t; @@ -45,11 +45,11 @@ static void release_op_data (void *hook) { op_data_t opd = (op_data_t) hook; - GpgmeImportStatus import = opd->result.imports; + gpgme_import_status_t import = opd->result.imports; while (import) { - GpgmeImportStatus next = import->next; + gpgme_import_status_t next = import->next; free (import->fpr); free (import); import = next; @@ -57,11 +57,11 @@ release_op_data (void *hook) } -GpgmeImportResult -gpgme_op_import_result (GpgmeCtx ctx) +gpgme_import_result_t +gpgme_op_import_result (gpgme_ctx_t ctx) { op_data_t opd; - GpgmeError err; + gpgme_error_t err; err = _gpgme_op_data_lookup (ctx, OPDATA_IMPORT, (void **) &opd, -1, NULL); if (err || !opd) @@ -71,10 +71,10 @@ gpgme_op_import_result (GpgmeCtx ctx) } -static GpgmeError -parse_import (char *args, GpgmeImportStatus *import_status, int problem) +static gpgme_error_t +parse_import (char *args, gpgme_import_status_t *import_status, int problem) { - GpgmeImportStatus import; + gpgme_import_status_t import; char *tail; long int nr; @@ -142,8 +142,8 @@ parse_import (char *args, GpgmeImportStatus *import_status, int problem) -GpgmeError -parse_import_res (char *args, GpgmeImportResult result) +gpgme_error_t +parse_import_res (char *args, gpgme_import_result_t result) { char *tail; @@ -174,11 +174,11 @@ parse_import_res (char *args, GpgmeImportResult result) } -static GpgmeError -import_status_handler (void *priv, GpgmeStatusCode code, char *args) +static gpgme_error_t +import_status_handler (void *priv, gpgme_status_code_t code, char *args) { - GpgmeCtx ctx = (GpgmeCtx) priv; - GpgmeError err; + gpgme_ctx_t ctx = (gpgme_ctx_t) priv; + gpgme_error_t err; op_data_t 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 -_gpgme_op_import_start (GpgmeCtx ctx, int synchronous, GpgmeData keydata) +static gpgme_error_t +_gpgme_op_import_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t keydata) { - GpgmeError err; + gpgme_error_t err; op_data_t opd; err = _gpgme_op_reset (ctx, synchronous); @@ -234,31 +234,31 @@ _gpgme_op_import_start (GpgmeCtx ctx, int synchronous, GpgmeData keydata) } -GpgmeError -gpgme_op_import_start (GpgmeCtx ctx, GpgmeData keydata) +gpgme_error_t +gpgme_op_import_start (gpgme_ctx_t ctx, gpgme_data_t keydata) { return _gpgme_op_import_start (ctx, 0, keydata); } /* Import the key in KEYDATA into the keyring. */ -GpgmeError -gpgme_op_import (GpgmeCtx ctx, GpgmeData keydata) +gpgme_error_t +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) err = _gpgme_wait_one (ctx); return err; } -GpgmeError -gpgme_op_import_ext (GpgmeCtx ctx, GpgmeData keydata, int *nr) +gpgme_error_t +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) { - GpgmeImportResult result = gpgme_op_import_result (ctx); + gpgme_import_result_t result = gpgme_op_import_result (ctx); *nr = result->considered; } return err; diff --git a/trunk/gpgme/key.c b/trunk/gpgme/key.c index 97deb98..509b76f 100644 --- a/trunk/gpgme/key.c +++ b/trunk/gpgme/key.c @@ -37,10 +37,10 @@ DEFINE_STATIC_LOCK (key_ref_lock); /* Create a new key. */ -GpgmeError -_gpgme_key_new (GpgmeKey *r_key) +gpgme_error_t +_gpgme_key_new (gpgme_key_t *r_key) { - GpgmeKey key; + gpgme_key_t key; key = calloc (1, sizeof *key); if (!key) @@ -52,10 +52,10 @@ _gpgme_key_new (GpgmeKey *r_key) } -GpgmeError -_gpgme_key_add_subkey (GpgmeKey key, GpgmeSubkey *r_subkey) +gpgme_error_t +_gpgme_key_add_subkey (gpgme_key_t key, gpgme_subkey_t *r_subkey) { - GpgmeSubkey subkey; + gpgme_subkey_t subkey; subkey = calloc (1, sizeof *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 sequences sequences and put it into the list of UIDs. */ -GpgmeError -_gpgme_key_append_name (GpgmeKey key, char *src) +gpgme_error_t +_gpgme_key_append_name (gpgme_key_t key, char *src) { - GpgmeUserID uid; + gpgme_user_id_t uid; char *dst; int src_len = strlen (src); @@ -238,12 +238,12 @@ _gpgme_key_append_name (GpgmeKey key, char *src) } -GpgmeKeySig -_gpgme_key_add_sig (GpgmeKey key, char *src) +gpgme_key_sig_t +_gpgme_key_add_sig (gpgme_key_t key, char *src) { int src_len = src ? strlen (src) : 0; - GpgmeUserID uid; - GpgmeKeySig sig; + gpgme_user_id_t uid; + gpgme_key_sig_t sig; assert (key); /* XXX */ @@ -285,7 +285,7 @@ _gpgme_key_add_sig (GpgmeKey key, char *src) /* Acquire a reference to KEY. */ void -gpgme_key_ref (GpgmeKey key) +gpgme_key_ref (gpgme_key_t key) { LOCK (key_ref_lock); 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 key object. */ void -gpgme_key_unref (GpgmeKey key) +gpgme_key_unref (gpgme_key_t key) { - GpgmeUserID uid; - GpgmeSubkey subkey; + gpgme_user_id_t uid; + gpgme_subkey_t subkey; LOCK (key_ref_lock); assert (key->_refs > 0); @@ -316,7 +316,7 @@ gpgme_key_unref (GpgmeKey key) subkey = key->subkeys; while (subkey) { - GpgmeSubkey next = subkey->next; + gpgme_subkey_t next = subkey->next; if (subkey->fpr) free (subkey->fpr); free (subkey); @@ -326,12 +326,12 @@ gpgme_key_unref (GpgmeKey key) uid = key->uids; while (uid) { - GpgmeUserID next_uid = uid->next; - GpgmeKeySig keysig = uid->signatures; + gpgme_user_id_t next_uid = uid->next; + gpgme_key_sig_t keysig = uid->signatures; while (keysig) { - GpgmeKeySig next = keysig->next; + gpgme_key_sig_t next = keysig->next; free (keysig); keysig = next; } @@ -354,7 +354,7 @@ gpgme_key_unref (GpgmeKey key) /* Compatibility interfaces. */ void -gpgme_key_release (GpgmeKey key) +gpgme_key_release (gpgme_key_t key) { gpgme_key_unref (key); } @@ -411,7 +411,7 @@ validity_to_string (int validity) static const char * -capabilities_to_string (GpgmeSubkey subkey) +capabilities_to_string (gpgme_subkey_t subkey) { 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 representable by a string. */ 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) { - GpgmeSubkey subkey; - GpgmeUserID uid; + gpgme_subkey_t subkey; + gpgme_user_id_t uid; int i; if (!key || reserved || idx < 0) @@ -512,11 +512,11 @@ gpgme_key_get_string_attr (GpgmeKey key, GpgmeAttr what, 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) { - GpgmeSubkey subkey; - GpgmeUserID uid; + gpgme_subkey_t subkey; + gpgme_user_id_t uid; int i; if (!key || reserved || idx < 0) @@ -601,11 +601,11 @@ gpgme_key_get_ulong_attr (GpgmeKey key, GpgmeAttr what, } -static GpgmeKeySig -get_keysig (GpgmeKey key, int uid_idx, int idx) +static gpgme_key_sig_t +get_keysig (gpgme_key_t key, int uid_idx, int idx) { - GpgmeUserID uid; - GpgmeKeySig sig; + gpgme_user_id_t uid; + gpgme_key_sig_t sig; if (!key || uid_idx < 0 || idx < 0) return NULL; @@ -630,10 +630,10 @@ get_keysig (GpgmeKey key, int uid_idx, int idx) 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) { - GpgmeKeySig certsig = get_keysig (key, uid_idx, idx); + gpgme_key_sig_t certsig = get_keysig (key, uid_idx, idx); if (!certsig || reserved) return NULL; @@ -665,10 +665,10 @@ gpgme_key_sig_get_string_attr (GpgmeKey key, int uid_idx, GpgmeAttr what, 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) { - GpgmeKeySig certsig = get_keysig (key, uid_idx, idx); + gpgme_key_sig_t certsig = get_keysig (key, uid_idx, idx); if (!certsig || reserved) return 0; diff --git a/trunk/gpgme/keylist.c b/trunk/gpgme/keylist.c index 8483c49..6edadee 100644 --- a/trunk/gpgme/keylist.c +++ b/trunk/gpgme/keylist.c @@ -38,15 +38,15 @@ struct key_queue_item_s { struct key_queue_item_s *next; - GpgmeKey key; + gpgme_key_t key; }; typedef struct { struct _gpgme_op_keylist_result result; - GpgmeKey tmp_key; - GpgmeUserID tmp_uid; + gpgme_key_t tmp_key; + gpgme_user_id_t tmp_uid; /* Something new is available. */ int key_cond; struct key_queue_item_s *key_queue; @@ -73,11 +73,11 @@ release_op_data (void *hook) } -GpgmeKeyListResult -gpgme_op_keylist_result (GpgmeCtx ctx) +gpgme_keylist_result_t +gpgme_op_keylist_result (gpgme_ctx_t ctx) { op_data_t opd; - GpgmeError err; + gpgme_error_t err; err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, (void **) &opd, -1, NULL); if (err || !opd) @@ -87,11 +87,11 @@ gpgme_op_keylist_result (GpgmeCtx ctx) } -static GpgmeError -keylist_status_handler (void *priv, GpgmeStatusCode code, char *args) +static gpgme_error_t +keylist_status_handler (void *priv, gpgme_status_code_t code, char *args) { - GpgmeCtx ctx = (GpgmeCtx) priv; - GpgmeError err; + gpgme_ctx_t ctx = (gpgme_ctx_t) priv; + gpgme_error_t err; op_data_t opd; err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, (void **) &opd, -1, NULL); @@ -122,7 +122,7 @@ parse_timestamp (char *timestamp) 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. */ while (*src && !isdigit (*src)) @@ -153,9 +153,9 @@ set_mainkey_trust_info (GpgmeKey key, const char *src) 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); /* Look at letters and stop at the first digit. */ @@ -193,7 +193,7 @@ set_userid_flags (GpgmeKey key, const char *src) 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. */ while (*src && !isdigit (*src)) @@ -222,7 +222,7 @@ set_subkey_trust_info (GpgmeSubkey subkey, const char *src) static void -set_mainkey_capability (GpgmeKey key, const char *src) +set_mainkey_capability (gpgme_key_t key, const char *src) { while (*src) { @@ -268,7 +268,7 @@ set_mainkey_capability (GpgmeKey key, const char *src) static void -set_subkey_capability (GpgmeSubkey subkey, const char *src) +set_subkey_capability (gpgme_subkey_t subkey, const char *src) { while (*src) { @@ -291,7 +291,7 @@ set_subkey_capability (GpgmeSubkey subkey, const char *src) } 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. */ 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. It is assumed that this releases tmp_key. */ 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_uid = NULL; @@ -339,10 +339,10 @@ finish_key (GpgmeCtx ctx, op_data_t opd) /* Note: We are allowed to modify LINE. */ -static GpgmeError +static gpgme_error_t keylist_colon_handler (void *priv, char *line) { - GpgmeCtx ctx = (GpgmeCtx) priv; + gpgme_ctx_t ctx = (gpgme_ctx_t) priv; enum { 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]; int fields = 0; op_data_t opd; - GpgmeError err; - GpgmeKey key; - GpgmeSubkey subkey = NULL; - GpgmeKeySig keysig = NULL; + gpgme_error_t err; + gpgme_key_t key; + gpgme_subkey_t subkey = NULL; + gpgme_key_sig_t keysig = NULL; DEBUG3 ("keylist_colon_handler ctx = %p, key = %p, line = %s\n", ctx, key, line ? line : "(null)"); @@ -661,11 +661,11 @@ keylist_colon_handler (void *priv, char *line) 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; - GpgmeCtx ctx = (GpgmeCtx) data; - GpgmeKey key = (GpgmeKey) type_data; + gpgme_error_t err; + gpgme_ctx_t ctx = (gpgme_ctx_t) data; + gpgme_key_t key = (gpgme_key_t) type_data; op_data_t opd; 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 match PATTERN. If SECRET_ONLY is true, only secret keys are returned. */ -GpgmeError -gpgme_op_keylist_start (GpgmeCtx ctx, const char *pattern, int secret_only) +gpgme_error_t +gpgme_op_keylist_start (gpgme_ctx_t ctx, const char *pattern, int secret_only) { - GpgmeError err; + gpgme_error_t err; op_data_t opd; 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 match PATTERN. If SECRET_ONLY is true, only secret keys are returned. */ -GpgmeError -gpgme_op_keylist_ext_start (GpgmeCtx ctx, const char *pattern[], +gpgme_error_t +gpgme_op_keylist_ext_start (gpgme_ctx_t ctx, const char *pattern[], int secret_only, int reserved) { - GpgmeError err; + gpgme_error_t err; op_data_t opd; 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. */ -GpgmeError -gpgme_op_keylist_next (GpgmeCtx ctx, GpgmeKey *r_key) +gpgme_error_t +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; op_data_t opd; @@ -799,8 +799,8 @@ gpgme_op_keylist_next (GpgmeCtx ctx, GpgmeKey *r_key) /* Terminate a pending keylist operation within CTX. */ -GpgmeError -gpgme_op_keylist_end (GpgmeCtx ctx) +gpgme_error_t +gpgme_op_keylist_end (gpgme_ctx_t ctx) { if (!ctx) 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 SECRET is true, get the secret key. */ -GpgmeError -gpgme_get_key (GpgmeCtx ctx, const char *fpr, GpgmeKey *r_key, +gpgme_error_t +gpgme_get_key (gpgme_ctx_t ctx, const char *fpr, gpgme_key_t *r_key, int secret) { - GpgmeCtx listctx; - GpgmeError err; + gpgme_ctx_t listctx; + gpgme_error_t err; if (!ctx || !r_key) return GPGME_Invalid_Value; diff --git a/trunk/gpgme/mkerrors b/trunk/gpgme/mkerrors index c5e1281..4cccfbe 100755 --- a/trunk/gpgme/mkerrors +++ b/trunk/gpgme/mkerrors @@ -38,7 +38,7 @@ cat <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). 2: asynchronous private operation (use private or user event loop). */ -GpgmeError -_gpgme_op_reset (GpgmeCtx ctx, int type) +gpgme_error_t +_gpgme_op_reset (gpgme_ctx_t ctx, int type) { - GpgmeError err = 0; - struct GpgmeIOCbs io_cbs; + gpgme_error_t err = 0; + struct gpgme_io_cbs io_cbs; _gpgme_release_result (ctx); @@ -109,10 +109,10 @@ _gpgme_op_reset (GpgmeCtx ctx, int type) } -GpgmeError -_gpgme_parse_inv_userid (char *args, GpgmeInvalidUserID *userid) +gpgme_error_t +_gpgme_parse_inv_userid (char *args, gpgme_invalid_user_id_t *userid) { - GpgmeInvalidUserID inv_userid; + gpgme_invalid_user_id_t inv_userid; char *tail; long int reason; diff --git a/trunk/gpgme/ops.h b/trunk/gpgme/ops.h index 5c8dac9..4a61a6b 100644 --- a/trunk/gpgme/ops.h +++ b/trunk/gpgme/ops.h @@ -26,103 +26,114 @@ /* From gpgme.c. */ -void _gpgme_release_result (GpgmeCtx ctx); +void _gpgme_release_result (gpgme_ctx_t ctx); /* From wait.c. */ -GpgmeError _gpgme_wait_one (GpgmeCtx ctx); -GpgmeError _gpgme_wait_on_condition (GpgmeCtx ctx, volatile int *cond); +gpgme_error_t _gpgme_wait_one (gpgme_ctx_t ctx); +gpgme_error_t _gpgme_wait_on_condition (gpgme_ctx_t ctx, volatile int *cond); /* From recipient.c. */ -int _gpgme_recipients_all_valid ( const GpgmeRecipients rset ); +int _gpgme_recipients_all_valid ( const gpgme_recipients_t rset ); /* From data.c. */ -GpgmeError _gpgme_data_inbound_handler (void *opaque, int fd); -GpgmeError _gpgme_data_outbound_handler (void *opaque, int fd); +gpgme_error_t _gpgme_data_inbound_handler (void *opaque, int fd); +gpgme_error_t _gpgme_data_outbound_handler (void *opaque, int fd); /* From op-support.c. */ /* Find or create the op data object of type TYPE. */ -GpgmeError _gpgme_op_data_lookup (GpgmeCtx ctx, ctx_op_data_type type, - void **hook, int size, - void (*cleanup) (void *)); +gpgme_error_t _gpgme_op_data_lookup (gpgme_ctx_t ctx, ctx_op_data_type type, + void **hook, int size, + void (*cleanup) (void *)); /* 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 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. */ -GpgmeError _gpgme_op_verify_init_result (GpgmeCtx ctx); -GpgmeError _gpgme_verify_status_handler (void *priv, GpgmeStatusCode code, - char *args); +gpgme_error_t _gpgme_op_verify_init_result (gpgme_ctx_t ctx); +gpgme_error_t _gpgme_verify_status_handler (void *priv, + gpgme_status_code_t code, + char *args); /* From decrypt.c. */ -GpgmeError _gpgme_op_decrypt_init_result (GpgmeCtx ctx); -GpgmeError _gpgme_decrypt_status_handler (void *priv, GpgmeStatusCode code, - char *args); +gpgme_error_t _gpgme_op_decrypt_init_result (gpgme_ctx_t ctx); +gpgme_error_t _gpgme_decrypt_status_handler (void *priv, + gpgme_status_code_t code, + char *args); /* From sign.c. */ /* Create an initial op data object for signing. Needs to be called 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. */ -GpgmeError _gpgme_sign_status_handler (void *priv, GpgmeStatusCode code, - char *args); +gpgme_error_t _gpgme_sign_status_handler (void *priv, + gpgme_status_code_t code, + char *args); /* From encrypt.c. */ /* Create an initial op data object for encrypt. Needs to be called 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. */ -GpgmeError _gpgme_encrypt_status_handler (void *priv, GpgmeStatusCode code, - char *args); +gpgme_error_t _gpgme_encrypt_status_handler (void *priv, + gpgme_status_code_t code, + char *args); /* From passphrase.c. */ -GpgmeError _gpgme_passphrase_status_handler (void *priv, GpgmeStatusCode code, - char *args); -GpgmeError _gpgme_passphrase_command_handler (void *opaque, - GpgmeStatusCode code, - const char *key, const char **result); +gpgme_error_t _gpgme_passphrase_status_handler (void *priv, + gpgme_status_code_t code, + char *args); +gpgme_error_t _gpgme_passphrase_command_handler (void *opaque, + gpgme_status_code_t code, + const char *key, + const char **result); /* From progress.c. */ -GpgmeError _gpgme_progress_status_handler (void *priv, GpgmeStatusCode code, - char *args); +gpgme_error_t _gpgme_progress_status_handler (void *priv, + gpgme_status_code_t code, + char *args); /* From key.c. */ -GpgmeError _gpgme_key_new (GpgmeKey *r_key); -GpgmeError _gpgme_key_add_subkey (GpgmeKey key, GpgmeSubkey *r_subkey); -GpgmeError _gpgme_key_append_name (GpgmeKey key, char *src); -GpgmeKeySig _gpgme_key_add_sig (GpgmeKey key, char *src); +gpgme_error_t _gpgme_key_new (gpgme_key_t *r_key); +gpgme_error_t _gpgme_key_add_subkey (gpgme_key_t key, + gpgme_subkey_t *r_subkey); +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. */ -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. */ /* 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. */ -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 --*/ diff --git a/trunk/gpgme/passphrase.c b/trunk/gpgme/passphrase.c index 4493d5b..a5bd4dd 100644 --- a/trunk/gpgme/passphrase.c +++ b/trunk/gpgme/passphrase.c @@ -50,11 +50,11 @@ release_op_data (void *hook) } -GpgmeError -_gpgme_passphrase_status_handler (void *priv, GpgmeStatusCode code, char *args) +gpgme_error_t +_gpgme_passphrase_status_handler (void *priv, gpgme_status_code_t code, char *args) { - GpgmeCtx ctx = (GpgmeCtx) priv; - GpgmeError err; + gpgme_ctx_t ctx = (gpgme_ctx_t) priv; + gpgme_error_t err; op_data_t opd; if (!ctx->passphrase_cb) @@ -110,12 +110,12 @@ _gpgme_passphrase_status_handler (void *priv, GpgmeStatusCode code, char *args) } -GpgmeError -_gpgme_passphrase_command_handler (void *priv, GpgmeStatusCode code, +gpgme_error_t +_gpgme_passphrase_command_handler (void *priv, gpgme_status_code_t code, const char *key, const char **result) { - GpgmeCtx ctx = (GpgmeCtx) priv; - GpgmeError err; + gpgme_ctx_t ctx = (gpgme_ctx_t) priv; + gpgme_error_t err; op_data_t opd; if (!ctx->passphrase_cb) diff --git a/trunk/gpgme/progress.c b/trunk/gpgme/progress.c index d322052..b393631 100644 --- a/trunk/gpgme/progress.c +++ b/trunk/gpgme/progress.c @@ -28,10 +28,10 @@ #include "context.h" -GpgmeError -_gpgme_progress_status_handler (void *priv, GpgmeStatusCode code, char *args) +gpgme_error_t +_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 *args_cpy; int type = 0; diff --git a/trunk/gpgme/recipient.c b/trunk/gpgme/recipient.c index 693a486..51d4734 100644 --- a/trunk/gpgme/recipient.c +++ b/trunk/gpgme/recipient.c @@ -28,10 +28,10 @@ /* Create a new uninitialized recipient object and return it in R_RSET. */ -GpgmeError -gpgme_recipients_new (GpgmeRecipients *r_rset) +gpgme_error_t +gpgme_recipients_new (gpgme_recipients_t *r_rset) { - GpgmeRecipients rset; + gpgme_recipients_t rset; rset = calloc (1, sizeof *rset); if (!rset) @@ -43,13 +43,13 @@ gpgme_recipients_new (GpgmeRecipients *r_rset) /* Release the recipient object RSET. */ 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) { - GpgmeUserID next_uid = uid->next; + gpgme_user_id_t next_uid = uid->next; free (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 validity VALIDITY. */ -GpgmeError -gpgme_recipients_add_name_with_validity (GpgmeRecipients rset, +gpgme_error_t +gpgme_recipients_add_name_with_validity (gpgme_recipients_t rset, const char *name, - GpgmeValidity validity) + gpgme_validity_t validity) { - GpgmeUserID uid; + gpgme_user_id_t uid; if (!name || !rset) 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 gpgme_recipients_add_name_with_validity with validitiy GPGME_VALIDITY_UNKNOWN. */ -GpgmeError -gpgme_recipients_add_name (GpgmeRecipients rset, const char *name) +gpgme_error_t +gpgme_recipients_add_name (gpgme_recipients_t rset, const char *name) { return gpgme_recipients_add_name_with_validity (rset, name, GPGME_VALIDITY_UNKNOWN); @@ -97,9 +97,9 @@ gpgme_recipients_add_name (GpgmeRecipients rset, const char *name) /* Return the number of recipients in the set. */ 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; while (uid) @@ -115,8 +115,8 @@ gpgme_recipients_count (const GpgmeRecipients rset) /* Start an enumeration on the recipient set RSET. The caller must pass the address of a void pointer which is used as the iterator object. */ -GpgmeError -gpgme_recipients_enum_open (const GpgmeRecipients rset, void **iter) +gpgme_error_t +gpgme_recipients_enum_open (const gpgme_recipients_t rset, void **iter) { *iter = rset->list; 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. */ 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; if (!uid) @@ -137,8 +137,8 @@ gpgme_recipients_enum_read (const GpgmeRecipients rset, void **iter) } /* Release the iterator for this object. */ -GpgmeError -gpgme_recipients_enum_close (const GpgmeRecipients rset, void **iter) +gpgme_error_t +gpgme_recipients_enum_close (const gpgme_recipients_t rset, void **iter) { /* Not really needed, but might catch the occasional mistake. */ *iter = NULL; @@ -148,9 +148,9 @@ gpgme_recipients_enum_close (const GpgmeRecipients rset, void **iter) 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) { diff --git a/trunk/gpgme/rungpg.c b/trunk/gpgme/rungpg.c index ab13726..ff47bc8 100644 --- a/trunk/gpgme/rungpg.c +++ b/trunk/gpgme/rungpg.c @@ -51,7 +51,7 @@ struct arg_and_data_s { 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 dup_to; 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 { - GpgmeData data; + gpgme_data_t data; int inbound; /* true if this is used for reading from gpg */ int dup_to; int fd; /* the fd to use */ @@ -110,25 +110,25 @@ struct gpg_object_s int used; int fd; int idx; /* Index in fd_data_map */ - GpgmeData cb_data; /* hack to get init the above idx later */ - GpgmeStatusCode code; /* last code */ + gpgme_data_t cb_data; /* hack to get init the above idx later */ + gpgme_status_code_t code; /* last code */ char *keyword; /* what has been requested (malloced) */ EngineCommandHandler fnc; void *fnc_value; /* The kludges never end. This is used to couple command handlers with output data in edit key mode. */ - GpgmeData linked_data; + gpgme_data_t linked_data; int linked_idx; } cmd; - struct GpgmeIOCbs io_cbs; + struct gpgme_io_cbs io_cbs; }; typedef struct gpg_object_s *GpgObject; 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; @@ -181,7 +181,7 @@ close_notify_handler (int fd, void *opaque) } } -static GpgmeError +static gpgme_error_t add_arg (GpgObject gpg, const char *arg) { struct arg_and_data_s *a; @@ -204,8 +204,8 @@ add_arg (GpgObject gpg, const char *arg) return 0; } -static GpgmeError -add_data (GpgObject gpg, GpgmeData data, int dup_to, int inbound) +static gpgme_error_t +add_data (GpgObject gpg, gpgme_data_t data, int dup_to, int inbound) { struct arg_and_data_s *a; @@ -327,7 +327,7 @@ gpg_release (void *engine) } -static GpgmeError +static gpgme_error_t gpg_new (void **engine) { GpgObject gpg; @@ -360,7 +360,7 @@ gpg_new (void **engine) goto leave; } /* 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) { 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. */ -static GpgmeError +static gpgme_error_t gpg_set_colon_line_handler (void *engine, EngineColonLineHandler fnc, 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 status handler. */ -static GpgmeError +static gpgme_error_t command_cb (void *opaque, char *buffer, size_t length, size_t *nread) { - GpgmeError err; + gpgme_error_t err; GpgObject gpg = opaque; const char *value; 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 match such a second call to a first call, the returned value from the first call is passed as keyword. */ -static GpgmeError +static gpgme_error_t 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; - GpgmeData tmp; - GpgmeError err; + gpgme_data_t tmp; + gpgme_error_t err; err = gpgme_data_new_with_read_cb (&tmp, command_cb, gpg); if (err) @@ -529,7 +529,7 @@ gpg_set_command_handler (void *engine, EngineCommandHandler fnc, } -static GpgmeError +static gpgme_error_t build_argv (GpgObject gpg) { struct arg_and_data_s *a; @@ -740,11 +740,11 @@ build_argv (GpgObject gpg) } -static GpgmeError -add_io_cb (GpgObject gpg, int fd, int dir, GpgmeIOCb handler, void *data, +static gpgme_error_t +add_io_cb (GpgObject gpg, int fd, int dir, gpgme_io_cb_t handler, void *data, void **tag) { - GpgmeError err; + gpgme_error_t err; err = (*gpg->io_cbs.add) (gpg->io_cbs.add_priv, fd, dir, handler, data, tag); 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 with status line code we know about and skip all other stuff without buffering (i.e. without extending the buffer). */ -static GpgmeError +static gpgme_error_t read_status (GpgObject gpg) { char *p; @@ -802,7 +802,7 @@ read_status (GpgObject gpg) gpg->status.eof = 1; if (gpg->status.fnc) { - GpgmeError err; + gpgme_error_t err; err = gpg->status.fnc (gpg->status.fnc_value, GPGME_STATUS_EOF, ""); if (err) return err; @@ -884,7 +884,7 @@ read_status (GpgObject gpg) } else if (gpg->status.fnc) { - GpgmeError err; + gpgme_error_t err; err = gpg->status.fnc (gpg->status.fnc_value, r->code, rest); if (err) @@ -931,7 +931,7 @@ read_status (GpgObject gpg) } -static GpgmeError +static gpgme_error_t status_handler (void *opaque, int fd) { GpgObject gpg = opaque; @@ -947,7 +947,7 @@ status_handler (void *opaque, int fd) } -static GpgmeError +static gpgme_error_t read_colon_line (GpgObject gpg) { char *p; @@ -1022,14 +1022,14 @@ read_colon_line (GpgObject gpg) /* 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 this thing here because it is easier to implement. */ -static GpgmeError +static gpgme_error_t colon_line_handler (void *opaque, int fd) { GpgObject gpg = opaque; - GpgmeError rc = 0; + gpgme_error_t rc = 0; assert (fd == gpg->colon.fd[0]); 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) { - GpgmeError rc; + gpgme_error_t rc; int i, n; int status; struct spawn_fd_item_s *fd_child_list, *fd_parent_list; @@ -1169,11 +1169,11 @@ start (GpgObject gpg) } -static GpgmeError -gpg_decrypt (void *engine, GpgmeData ciph, GpgmeData plain) +static gpgme_error_t +gpg_decrypt (void *engine, gpgme_data_t ciph, gpgme_data_t plain) { GpgObject gpg = engine; - GpgmeError err; + gpgme_error_t err; err = add_arg (gpg, "--decrypt"); @@ -1192,11 +1192,11 @@ gpg_decrypt (void *engine, GpgmeData ciph, GpgmeData plain) return err; } -static GpgmeError -gpg_delete (void *engine, GpgmeKey key, int allow_secret) +static gpgme_error_t +gpg_delete (void *engine, gpgme_key_t key, int allow_secret) { GpgObject gpg = engine; - GpgmeError err; + gpgme_error_t err; err = add_arg (gpg, allow_secret ? "--delete-secret-and-public-key" : "--delete-key"); @@ -1216,12 +1216,12 @@ gpg_delete (void *engine, GpgmeKey key, int allow_secret) } -static GpgmeError -append_args_from_signers (GpgObject gpg, GpgmeCtx ctx /* FIXME */) +static gpgme_error_t +append_args_from_signers (GpgObject gpg, gpgme_ctx_t ctx /* FIXME */) { - GpgmeError err = 0; + gpgme_error_t err = 0; int i; - GpgmeKey key; + gpgme_key_t key; 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 -gpg_edit (void *engine, GpgmeKey key, GpgmeData out, GpgmeCtx ctx /* FIXME */) +static gpgme_error_t +gpg_edit (void *engine, gpgme_key_t key, gpgme_data_t out, gpgme_ctx_t ctx /* FIXME */) { GpgObject gpg = engine; - GpgmeError err; + gpgme_error_t err; err = add_arg (gpg, "--with-colons"); if (!err) @@ -1270,11 +1270,11 @@ gpg_edit (void *engine, GpgmeKey key, GpgmeData out, GpgmeCtx ctx /* FIXME */) } -static GpgmeError -append_args_from_recipients (GpgObject gpg, const GpgmeRecipients rset) +static gpgme_error_t +append_args_from_recipients (GpgObject gpg, const gpgme_recipients_t rset) { - GpgmeError err = 0; - GpgmeUserID uid; + gpgme_error_t err = 0; + gpgme_user_id_t uid; assert (rset); for (uid = rset->list; uid; uid = uid->next) @@ -1289,12 +1289,12 @@ append_args_from_recipients (GpgObject gpg, const GpgmeRecipients rset) } -static GpgmeError -gpg_encrypt (void *engine, GpgmeRecipients recp, GpgmeData plain, - GpgmeData ciph, int use_armor) +static gpgme_error_t +gpg_encrypt (void *engine, gpgme_recipients_t recp, gpgme_data_t plain, + gpgme_data_t ciph, int use_armor) { GpgObject gpg = engine; - GpgmeError err; + gpgme_error_t err; int symmetric = !recp; err = add_arg (gpg, symmetric ? "--symmetric" : "--encrypt"); @@ -1332,12 +1332,12 @@ gpg_encrypt (void *engine, GpgmeRecipients recp, GpgmeData plain, } -static GpgmeError -gpg_encrypt_sign (void *engine, GpgmeRecipients recp, GpgmeData plain, - GpgmeData ciph, int use_armor, GpgmeCtx ctx /* FIXME */) +static gpgme_error_t +gpg_encrypt_sign (void *engine, gpgme_recipients_t recp, gpgme_data_t plain, + gpgme_data_t ciph, int use_armor, gpgme_ctx_t ctx /* FIXME */) { GpgObject gpg = engine; - GpgmeError err; + gpgme_error_t err; err = add_arg (gpg, "--encrypt"); if (!err) @@ -1375,12 +1375,12 @@ gpg_encrypt_sign (void *engine, GpgmeRecipients recp, GpgmeData plain, } -static GpgmeError -gpg_export (void *engine, GpgmeRecipients recp, GpgmeData keydata, +static gpgme_error_t +gpg_export (void *engine, gpgme_recipients_t recp, gpgme_data_t keydata, int use_armor) { GpgObject gpg = engine; - GpgmeError err; + gpgme_error_t err; err = add_arg (gpg, "--export"); if (!err && use_armor) @@ -1409,12 +1409,12 @@ gpg_export (void *engine, GpgmeRecipients recp, GpgmeData keydata, } -static GpgmeError -gpg_genkey (void *engine, GpgmeData help_data, int use_armor, - GpgmeData pubkey, GpgmeData seckey) +static gpgme_error_t +gpg_genkey (void *engine, gpgme_data_t help_data, int use_armor, + gpgme_data_t pubkey, gpgme_data_t seckey) { GpgObject gpg = engine; - GpgmeError err; + gpgme_error_t err; if (!gpg) return GPGME_Invalid_Value; @@ -1439,11 +1439,11 @@ gpg_genkey (void *engine, GpgmeData help_data, int use_armor, } -static GpgmeError -gpg_import (void *engine, GpgmeData keydata) +static gpgme_error_t +gpg_import (void *engine, gpgme_data_t keydata) { GpgObject gpg = engine; - GpgmeError err; + gpgme_error_t err; err = add_arg (gpg, "--import"); 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, int keylist_mode) { GpgObject gpg = engine; - GpgmeError err; + gpgme_error_t err; err = add_arg (gpg, "--with-colons"); 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, int reserved, int keylist_mode) { GpgObject gpg = engine; - GpgmeError err; + gpgme_error_t err; if (reserved) return GPGME_Invalid_Value; @@ -1526,13 +1526,13 @@ gpg_keylist_ext (void *engine, const char *pattern[], int secret_only, } -static GpgmeError -gpg_sign (void *engine, GpgmeData in, GpgmeData out, GpgmeSigMode mode, +static gpgme_error_t +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, - GpgmeCtx ctx /* FIXME */) + gpgme_ctx_t ctx /* FIXME */) { GpgObject gpg = engine; - GpgmeError err; + gpgme_error_t err; if (mode == GPGME_SIG_MODE_CLEAR) err = add_arg (gpg, "--clearsign"); @@ -1562,11 +1562,11 @@ gpg_sign (void *engine, GpgmeData in, GpgmeData out, GpgmeSigMode mode, return err; } -static GpgmeError +static gpgme_error_t gpg_trustlist (void *engine, const char *pattern) { GpgObject gpg = engine; - GpgmeError err; + gpgme_error_t err; err = add_arg (gpg, "--with-colons"); if (!err) @@ -1585,12 +1585,12 @@ gpg_trustlist (void *engine, const char *pattern) } -static GpgmeError -gpg_verify (void *engine, GpgmeData sig, GpgmeData signed_text, - GpgmeData plaintext) +static gpgme_error_t +gpg_verify (void *engine, gpgme_data_t sig, gpgme_data_t signed_text, + gpgme_data_t plaintext) { GpgObject gpg = engine; - GpgmeError err = 0; + gpgme_error_t err = 0; if (plaintext) { @@ -1630,7 +1630,7 @@ gpg_verify (void *engine, GpgmeData sig, GpgmeData signed_text, 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; diff --git a/trunk/gpgme/sign.c b/trunk/gpgme/sign.c index 413865d..ceac1b0 100644 --- a/trunk/gpgme/sign.c +++ b/trunk/gpgme/sign.c @@ -37,10 +37,10 @@ typedef struct /* A pointer to the next pointer of the last invalid signer in the list. This makes appending new invalid signers painless while preserving the order. */ - GpgmeInvalidUserID *last_signer_p; + gpgme_invalid_user_id_t *last_signer_p; /* Likewise for signature information. */ - GpgmeNewSignature *last_sig_p; + gpgme_new_signature_t *last_sig_p; } *op_data_t; @@ -48,12 +48,12 @@ static void release_op_data (void *hook) { op_data_t opd = (op_data_t) hook; - GpgmeInvalidUserID invalid_signer = opd->result.invalid_signers; - GpgmeNewSignature sig = opd->result.signatures; + gpgme_invalid_user_id_t invalid_signer = opd->result.invalid_signers; + gpgme_new_signature_t sig = opd->result.signatures; while (invalid_signer) { - GpgmeInvalidUserID next = invalid_signer->next; + gpgme_invalid_user_id_t next = invalid_signer->next; free (invalid_signer->id); free (invalid_signer); invalid_signer = next; @@ -61,7 +61,7 @@ release_op_data (void *hook) while (sig) { - GpgmeNewSignature next = sig->next; + gpgme_new_signature_t next = sig->next; free (sig->fpr); free (sig); sig = next; @@ -69,11 +69,11 @@ release_op_data (void *hook) } -GpgmeSignResult -gpgme_op_sign_result (GpgmeCtx ctx) +gpgme_sign_result_t +gpgme_op_sign_result (gpgme_ctx_t ctx) { op_data_t opd; - GpgmeError err; + gpgme_error_t err; err = _gpgme_op_data_lookup (ctx, OPDATA_SIGN, (void **) &opd, -1, NULL); if (err || !opd) @@ -83,10 +83,10 @@ gpgme_op_sign_result (GpgmeCtx ctx) } -static GpgmeError -parse_sig_created (char *args, GpgmeNewSignature *sigp) +static gpgme_error_t +parse_sig_created (char *args, gpgme_new_signature_t *sigp) { - GpgmeNewSignature sig; + gpgme_new_signature_t sig; char *tail; sig = malloc (sizeof (*sig)); @@ -182,11 +182,11 @@ parse_sig_created (char *args, GpgmeNewSignature *sigp) } -GpgmeError -_gpgme_sign_status_handler (void *priv, GpgmeStatusCode code, char *args) +gpgme_error_t +_gpgme_sign_status_handler (void *priv, gpgme_status_code_t code, char *args) { - GpgmeCtx ctx = (GpgmeCtx) priv; - GpgmeError err; + gpgme_ctx_t ctx = (gpgme_ctx_t) priv; + gpgme_error_t err; op_data_t opd; err = _gpgme_passphrase_status_handler (priv, code, args); @@ -227,10 +227,10 @@ _gpgme_sign_status_handler (void *priv, GpgmeStatusCode code, char *args) } -GpgmeError -_gpgme_op_sign_init_result (GpgmeCtx ctx) +gpgme_error_t +_gpgme_op_sign_init_result (gpgme_ctx_t ctx) { - GpgmeError err; + gpgme_error_t err; op_data_t opd; err = _gpgme_op_data_lookup (ctx, OPDATA_SIGN, (void **) &opd, @@ -243,11 +243,11 @@ _gpgme_op_sign_init_result (GpgmeCtx ctx) } -static GpgmeError -sign_start (GpgmeCtx ctx, int synchronous, GpgmeData plain, GpgmeData sig, - GpgmeSigMode mode) +static gpgme_error_t +sign_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t plain, gpgme_data_t sig, + gpgme_sig_mode_t mode) { - GpgmeError err; + gpgme_error_t err; err = _gpgme_op_reset (ctx, synchronous); 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. */ -GpgmeError -gpgme_op_sign_start (GpgmeCtx ctx, GpgmeData plain, GpgmeData sig, - GpgmeSigMode mode) +gpgme_error_t +gpgme_op_sign_start (gpgme_ctx_t ctx, gpgme_data_t plain, gpgme_data_t sig, + gpgme_sig_mode_t mode) { return sign_start (ctx, 0, plain, sig, mode); } /* Sign the plaintext PLAIN and store the signature in SIG. */ -GpgmeError -gpgme_op_sign (GpgmeCtx ctx, GpgmeData plain, GpgmeData sig, GpgmeSigMode mode) +gpgme_error_t +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) err = _gpgme_wait_one (ctx); return err; diff --git a/trunk/gpgme/signers.c b/trunk/gpgme/signers.c index 8d39a1e..4ed384b 100644 --- a/trunk/gpgme/signers.c +++ b/trunk/gpgme/signers.c @@ -35,7 +35,7 @@ /* Delete all signers from CTX. */ void -gpgme_signers_clear (GpgmeCtx ctx) +gpgme_signers_clear (gpgme_ctx_t ctx) { int i; @@ -52,15 +52,15 @@ gpgme_signers_clear (GpgmeCtx ctx) } /* Add KEY to list of signers in CTX. */ -GpgmeError -gpgme_signers_add (GpgmeCtx ctx, const GpgmeKey key) +gpgme_error_t +gpgme_signers_add (gpgme_ctx_t ctx, const gpgme_key_t key) { if (!ctx || !key) return GPGME_Invalid_Value; if (ctx->signers_len == ctx->signers_size) { - GpgmeKey *newarr; + gpgme_key_t *newarr; int n = ctx->signers_size + 5; 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. */ -GpgmeKey -gpgme_signers_enum (const GpgmeCtx ctx, int seq) +gpgme_key_t +gpgme_signers_enum (const gpgme_ctx_t ctx, int seq) { if (!ctx || seq < 0) return NULL; diff --git a/trunk/gpgme/trust-item.c b/trunk/gpgme/trust-item.c index c30a6dc..49cc010 100644 --- a/trunk/gpgme/trust-item.c +++ b/trunk/gpgme/trust-item.c @@ -37,10 +37,10 @@ DEFINE_STATIC_LOCK (trust_item_ref_lock); /* 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) { - GpgmeTrustItem item; + gpgme_trust_item_t item; item = calloc (1, sizeof *item); if (!item) @@ -59,7 +59,7 @@ _gpgme_trust_item_new (GpgmeTrustItem *r_item) /* Acquire a reference to ITEM. */ void -gpgme_trust_item_ref (GpgmeTrustItem item) +gpgme_trust_item_ref (gpgme_trust_item_t item) { LOCK (trust_item_ref_lock); item->_refs++; @@ -73,7 +73,7 @@ gpgme_trust_item_ref (GpgmeTrustItem item) every newly created trust item object as well as for every gpgme_trust_item_ref() done on the trust item object. */ void -gpgme_trust_item_unref (GpgmeTrustItem item) +gpgme_trust_item_unref (gpgme_trust_item_t item) { LOCK (trust_item_ref_lock); assert (item->_refs > 0); @@ -92,15 +92,15 @@ gpgme_trust_item_unref (GpgmeTrustItem item) /* Compatibility interfaces. */ void -gpgme_trust_item_release (GpgmeTrustItem item) +gpgme_trust_item_release (gpgme_trust_item_t item) { gpgme_trust_item_unref (item); } /* Return the value of the attribute WHAT of ITEM, which has to be representable by a string. */ -const char *gpgme_trust_item_get_string_attr (GpgmeTrustItem item, - GpgmeAttr what, +const char *gpgme_trust_item_get_string_attr (gpgme_trust_item_t item, + _gpgme_attr_t what, const void *reserved, int idx) { 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 representable by an integer. IDX specifies a running index if the 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) { int val = 0; diff --git a/trunk/gpgme/trustlist.c b/trunk/gpgme/trustlist.c index 974f6cc..2f2ef98 100644 --- a/trunk/gpgme/trustlist.c +++ b/trunk/gpgme/trustlist.c @@ -34,7 +34,7 @@ struct trust_queue_item_s { struct trust_queue_item_s *next; - GpgmeTrustItem item; + gpgme_trust_item_t item; }; typedef struct @@ -46,8 +46,8 @@ typedef struct -static GpgmeError -trustlist_status_handler (void *priv, GpgmeStatusCode code, char *args) +static gpgme_error_t +trustlist_status_handler (void *priv, gpgme_status_code_t code, char *args) { 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 complete count NAME ist the username and only printed on U lines. */ -static GpgmeError +static gpgme_error_t trustlist_colon_handler (void *priv, char *line) { - GpgmeCtx ctx = (GpgmeCtx) priv; - GpgmeError err; + gpgme_ctx_t ctx = (gpgme_ctx_t) priv; + gpgme_error_t err; char *p, *pend; int field = 0; - GpgmeTrustItem item = NULL; + gpgme_trust_item_t item = NULL; if (!line) return 0; /* EOF */ @@ -121,12 +121,12 @@ trustlist_colon_handler (void *priv, char *line) 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; - GpgmeError err; + gpgme_ctx_t ctx = (gpgme_ctx_t) data; + gpgme_error_t err; 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; assert (type == GPGME_EVENT_NEXT_TRUSTITEM); @@ -160,10 +160,10 @@ _gpgme_op_trustlist_event_cb (void *data, GpgmeEventIO type, void *type_data) } -GpgmeError -gpgme_op_trustlist_start (GpgmeCtx ctx, const char *pattern, int max_level) +gpgme_error_t +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; if (!pattern || !*pattern) @@ -189,10 +189,10 @@ gpgme_op_trustlist_start (GpgmeCtx ctx, const char *pattern, int max_level) } -GpgmeError -gpgme_op_trustlist_next (GpgmeCtx ctx, GpgmeTrustItem *r_item) +gpgme_error_t +gpgme_op_trustlist_next (gpgme_ctx_t ctx, gpgme_trust_item_t *r_item) { - GpgmeError err; + gpgme_error_t err; op_data_t opd; 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. */ -GpgmeError -gpgme_op_trustlist_end (GpgmeCtx ctx) +gpgme_error_t +gpgme_op_trustlist_end (gpgme_ctx_t ctx) { if (!ctx) return GPGME_Invalid_Value; diff --git a/trunk/gpgme/util.h b/trunk/gpgme/util.h index 70b7de9..21164f0 100644 --- a/trunk/gpgme/util.h +++ b/trunk/gpgme/util.h @@ -72,7 +72,7 @@ int _gpgme_hextobyte (const unsigned char *str); 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 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 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 is desired or not, the caller is expected to make sure that *DESTP 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); -GpgmeError _gpgme_map_gnupg_error (char *err); +gpgme_error_t _gpgme_map_gnupg_error (char *err); #endif /* UTIL_H */ diff --git a/trunk/gpgme/verify.c b/trunk/gpgme/verify.c index 946f66e..68c6fc5 100644 --- a/trunk/gpgme/verify.c +++ b/trunk/gpgme/verify.c @@ -35,7 +35,7 @@ typedef struct { struct _gpgme_op_verify_result result; - GpgmeSignature current_sig; + gpgme_signature_t current_sig; } *op_data_t; @@ -43,16 +43,16 @@ static void release_op_data (void *hook) { op_data_t opd = (op_data_t) hook; - GpgmeSignature sig = opd->result.signatures; + gpgme_signature_t sig = opd->result.signatures; while (sig) { - GpgmeSignature next = sig->next; - GpgmeSigNotation notation = sig->notations; + gpgme_signature_t next = sig->next; + gpgme_sig_notation_t notation = sig->notations; while (notation) { - GpgmeSigNotation next_nota = notation->next; + gpgme_sig_notation_t next_nota = notation->next; if (notation->name) free (notation->name); @@ -69,11 +69,11 @@ release_op_data (void *hook) } -GpgmeVerifyResult -gpgme_op_verify_result (GpgmeCtx ctx) +gpgme_verify_result_t +gpgme_op_verify_result (gpgme_ctx_t ctx) { op_data_t opd; - GpgmeError err; + gpgme_error_t err; err = _gpgme_op_data_lookup (ctx, OPDATA_VERIFY, (void **) &opd, -1, NULL); if (err || !opd) @@ -85,7 +85,7 @@ gpgme_op_verify_result (GpgmeCtx ctx) /* Build a summary vector from RESULT. */ static void -calc_sig_summary (GpgmeSignature sig) +calc_sig_summary (gpgme_signature_t sig) { unsigned long sum = 0; @@ -143,10 +143,10 @@ calc_sig_summary (GpgmeSignature sig) } -static GpgmeError -parse_new_sig (op_data_t opd, GpgmeStatusCode code, char *args) +static gpgme_error_t +parse_new_sig (op_data_t opd, gpgme_status_code_t code, char *args) { - GpgmeSignature sig; + gpgme_signature_t sig; char *end = strchr (args, ' '); if (end) @@ -225,8 +225,8 @@ parse_new_sig (op_data_t opd, GpgmeStatusCode code, char *args) } -static GpgmeError -parse_valid_sig (GpgmeSignature sig, char *args) +static gpgme_error_t +parse_valid_sig (gpgme_signature_t sig, char *args) { char *end = strchr (args, ' '); @@ -264,12 +264,12 @@ parse_valid_sig (GpgmeSignature sig, char *args) } -static GpgmeError -parse_notation (GpgmeSignature sig, GpgmeStatusCode code, char *args) +static gpgme_error_t +parse_notation (gpgme_signature_t sig, gpgme_status_code_t code, char *args) { - GpgmeError err; - GpgmeSigNotation *lastp = &sig->notations; - GpgmeSigNotation notation = sig->notations; + gpgme_error_t err; + gpgme_sig_notation_t *lastp = &sig->notations; + gpgme_sig_notation_t notation = sig->notations; char *end = strchr (args, ' '); if (end) @@ -370,8 +370,8 @@ parse_notation (GpgmeSignature sig, GpgmeStatusCode code, char *args) } -static GpgmeError -parse_trust (GpgmeSignature sig, GpgmeStatusCode code, char *args) +static gpgme_error_t +parse_trust (gpgme_signature_t sig, gpgme_status_code_t code, char *args) { char *end = strchr (args, ' '); @@ -406,10 +406,10 @@ parse_trust (GpgmeSignature sig, GpgmeStatusCode code, char *args) } -static GpgmeError -parse_error (GpgmeSignature sig, char *args) +static gpgme_error_t +parse_error (gpgme_signature_t sig, char *args) { - GpgmeError err; + gpgme_error_t err; char *where = strchr (args, ' '); char *which; @@ -438,13 +438,13 @@ parse_error (GpgmeSignature sig, char *args) } -GpgmeError -_gpgme_verify_status_handler (void *priv, GpgmeStatusCode code, char *args) +gpgme_error_t +_gpgme_verify_status_handler (void *priv, gpgme_status_code_t code, char *args) { - GpgmeCtx ctx = (GpgmeCtx) priv; - GpgmeError err; + gpgme_ctx_t ctx = (gpgme_ctx_t) priv; + gpgme_error_t err; op_data_t opd; - GpgmeSignature sig; + gpgme_signature_t sig; err = _gpgme_op_data_lookup (ctx, OPDATA_VERIFY, (void **) &opd, -1, NULL); if (err) @@ -505,8 +505,8 @@ _gpgme_verify_status_handler (void *priv, GpgmeStatusCode code, char *args) } -GpgmeError -_gpgme_op_verify_init_result (GpgmeCtx ctx) +gpgme_error_t +_gpgme_op_verify_init_result (gpgme_ctx_t ctx) { op_data_t opd; @@ -515,11 +515,11 @@ _gpgme_op_verify_init_result (GpgmeCtx ctx) } -static GpgmeError -_gpgme_op_verify_start (GpgmeCtx ctx, int synchronous, GpgmeData sig, - GpgmeData signed_text, GpgmeData plaintext) +static gpgme_error_t +_gpgme_op_verify_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t sig, + gpgme_data_t signed_text, gpgme_data_t plaintext) { - GpgmeError err; + gpgme_error_t err; err = _gpgme_op_reset (ctx, synchronous); 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 CTX and store the resulting plaintext in PLAIN. */ -GpgmeError -gpgme_op_verify_start (GpgmeCtx ctx, GpgmeData sig, GpgmeData signed_text, - GpgmeData plaintext) +gpgme_error_t +gpgme_op_verify_start (gpgme_ctx_t ctx, gpgme_data_t sig, gpgme_data_t signed_text, + gpgme_data_t 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 CTX and store the resulting plaintext in PLAIN. */ -GpgmeError -gpgme_op_verify (GpgmeCtx ctx, GpgmeData sig, GpgmeData signed_text, - GpgmeData plaintext) +gpgme_error_t +gpgme_op_verify (gpgme_ctx_t ctx, gpgme_data_t sig, gpgme_data_t signed_text, + gpgme_data_t plaintext) { - GpgmeError err; + gpgme_error_t err; err = _gpgme_op_verify_start (ctx, 1, sig, signed_text, plaintext); 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 R_KEY. */ -GpgmeError -gpgme_get_sig_key (GpgmeCtx ctx, int idx, GpgmeKey *r_key) +gpgme_error_t +gpgme_get_sig_key (gpgme_ctx_t ctx, int idx, gpgme_key_t *r_key) { - GpgmeVerifyResult result; - GpgmeSignature sig; + gpgme_verify_result_t result; + gpgme_signature_t sig; result = gpgme_op_verify_result (ctx); 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 time stamp of the signature is returned in R_CREATED (if non-null). The function returns a string containing the fingerprint. */ -const char *gpgme_get_sig_status (GpgmeCtx ctx, int idx, - GpgmeSigStat *r_stat, time_t *r_created) +const char *gpgme_get_sig_status (gpgme_ctx_t ctx, int idx, + _gpgme_sig_stat_t *r_stat, time_t *r_created) { - GpgmeVerifyResult result; - GpgmeSignature sig; + gpgme_verify_result_t result; + gpgme_signature_t sig; result = gpgme_op_verify_result (ctx); 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 is an attribute where GPGME_ATTR_EXPIRE is probably the most useful one. WHATIDX is to be passed as 0 for most attributes . */ -unsigned long gpgme_get_sig_ulong_attr (GpgmeCtx ctx, int idx, - GpgmeAttr what, int whatidx) +unsigned long gpgme_get_sig_ulong_attr (gpgme_ctx_t ctx, int idx, + _gpgme_attr_t what, int whatidx) { - GpgmeVerifyResult result; - GpgmeSignature sig; + gpgme_verify_result_t result; + gpgme_signature_t sig; result = gpgme_op_verify_result (ctx); 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, - GpgmeAttr what, int whatidx) +const char *gpgme_get_sig_string_attr (gpgme_ctx_t ctx, int idx, + _gpgme_attr_t what, int whatidx) { - GpgmeVerifyResult result; - GpgmeSignature sig; + gpgme_verify_result_t result; + gpgme_signature_t sig; result = gpgme_op_verify_result (ctx); sig = result->signatures; diff --git a/trunk/gpgme/wait-global.c b/trunk/gpgme/wait-global.c index 8f11b7d..02b90b5 100644 --- a/trunk/gpgme/wait-global.c +++ b/trunk/gpgme/wait-global.c @@ -68,9 +68,9 @@ struct ctx_list_item struct ctx_list_item *next; struct ctx_list_item *prev; - GpgmeCtx ctx; + gpgme_ctx_t ctx; /* 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 @@ -87,8 +87,8 @@ static struct ctx_list_item *ctx_done_list; /* Enter the context CTX into the active list. */ -static GpgmeError -ctx_active (GpgmeCtx ctx) +static gpgme_error_t +ctx_active (gpgme_ctx_t ctx) { struct ctx_list_item *li = malloc (sizeof (struct ctx_list_item)); if (!li) @@ -109,7 +109,7 @@ ctx_active (GpgmeCtx ctx) /* Enter the context CTX into the done list with status STATUS. */ static void -ctx_done (GpgmeCtx ctx, GpgmeError status) +ctx_done (gpgme_ctx_t ctx, gpgme_error_t status) { 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. If a matching context could be found, return it. Return NULL if no context could be found. */ -static GpgmeCtx -ctx_wait (GpgmeCtx ctx, GpgmeError *status) +static gpgme_ctx_t +ctx_wait (gpgme_ctx_t ctx, gpgme_error_t *status) { struct ctx_list_item *li; @@ -184,9 +184,9 @@ ctx_wait (GpgmeCtx ctx, GpgmeError *status) event loops. */ 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); @@ -194,7 +194,7 @@ _gpgme_wait_global_event_cb (void *data, GpgmeEventIO type, void *type_data) { case GPGME_EVENT_START: { - GpgmeError err = ctx_active (ctx); + gpgme_error_t err = ctx_active (ctx); if (err) { @@ -212,7 +212,7 @@ _gpgme_wait_global_event_cb (void *data, GpgmeEventIO type, void *type_data) case GPGME_EVENT_DONE: { - GpgmeError *errp = (GpgmeError *) type_data; + gpgme_error_t *errp = (gpgme_error_t *) type_data; assert (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 error occurs, NULL is returned and *STATUS is set to the error value. */ -GpgmeCtx -gpgme_wait (GpgmeCtx ctx, GpgmeError *status, int hang) +gpgme_ctx_t +gpgme_wait (gpgme_ctx_t ctx, gpgme_error_t *status, int hang) { do { @@ -293,8 +293,8 @@ gpgme_wait (GpgmeCtx ctx, GpgmeError *status, int hang) { if (fdt.fds[i].fd != -1 && fdt.fds[i].signaled) { - GpgmeCtx ictx; - GpgmeError err; + gpgme_ctx_t ictx; + gpgme_error_t err; struct wait_item_s *item; assert (nr); @@ -330,14 +330,14 @@ gpgme_wait (GpgmeCtx ctx, GpgmeError *status, int hang) break; if (i == ctx->fdt.size) { - GpgmeError err = 0; + gpgme_error_t err = 0; _gpgme_engine_io_event (ctx->engine, GPGME_EVENT_DONE, &err); } } UNLOCK (ctx_list_lock); { - GpgmeCtx dctx = ctx_wait (ctx, status); + gpgme_ctx_t dctx = ctx_wait (ctx, status); if (dctx) { diff --git a/trunk/gpgme/wait-private.c b/trunk/gpgme/wait-private.c index 32ee311..af27a9b 100644 --- a/trunk/gpgme/wait-private.c +++ b/trunk/gpgme/wait-private.c @@ -42,7 +42,7 @@ event loops. */ 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) { @@ -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 finished and return its error value. Otherwise, wait until COND is satisfied or the operation finished. */ -GpgmeError -_gpgme_wait_on_condition (GpgmeCtx ctx, volatile int *cond) +gpgme_error_t +_gpgme_wait_on_condition (gpgme_ctx_t ctx, volatile int *cond) { - GpgmeError err = 0; + gpgme_error_t err = 0; int hang = 1; 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 return the error value. */ -GpgmeError -_gpgme_wait_one (GpgmeCtx ctx) +gpgme_error_t +_gpgme_wait_one (gpgme_ctx_t ctx) { return _gpgme_wait_on_condition (ctx, NULL); } diff --git a/trunk/gpgme/wait-user.c b/trunk/gpgme/wait-user.c index d3d789a..1ea3db0 100644 --- a/trunk/gpgme/wait-user.c +++ b/trunk/gpgme/wait-user.c @@ -35,12 +35,12 @@ /* Internal I/O Callbacks. */ -GpgmeError +gpgme_error_t _gpgme_user_io_cb_handler (void *data, int fd) { - GpgmeError err; + gpgme_error_t err; struct tag *tag = (struct tag *) data; - GpgmeCtx ctx; + gpgme_ctx_t ctx; struct wait_item_s *item; 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 be the context for which the fd is added. R_TAG will hold the tag that can be used to remove the fd. */ -GpgmeError -_gpgme_wait_user_add_io_cb (void *data, int fd, int dir, GpgmeIOCb fnc, +gpgme_error_t +_gpgme_wait_user_add_io_cb (void *data, int fd, int dir, gpgme_io_cb_t fnc, void *fnc_data, void **r_tag) { - GpgmeCtx ctx = (GpgmeCtx) data; + gpgme_ctx_t ctx = (gpgme_ctx_t) data; struct tag *tag; - GpgmeError err; + gpgme_error_t err; assert (ctx); 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) { struct tag *tag = (struct tag *) data; - GpgmeCtx ctx; + gpgme_ctx_t ctx; assert (tag); ctx = tag->ctx; @@ -115,9 +115,9 @@ _gpgme_wait_user_remove_io_cb (void *data) 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) (*ctx->io_cbs.event) (ctx->io_cbs.event_priv, type, type_data); diff --git a/trunk/gpgme/wait.c b/trunk/gpgme/wait.c index c70efa1..28c6000 100644 --- a/trunk/gpgme/wait.c +++ b/trunk/gpgme/wait.c @@ -53,7 +53,7 @@ _gpgme_fd_table_deinit (fd_table_t fdt) /* 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) { 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 be the context for which the fd is added. R_TAG will hold the tag that can be used to remove the fd. */ -GpgmeError -_gpgme_add_io_cb (void *data, int fd, int dir, GpgmeIOCb fnc, void *fnc_data, - void **r_tag) +gpgme_error_t +_gpgme_add_io_cb (void *data, int fd, int dir, gpgme_io_cb_t fnc, + void *fnc_data, void **r_tag) { - GpgmeError err; - GpgmeCtx ctx = (GpgmeCtx) data; + gpgme_error_t err; + gpgme_ctx_t ctx = (gpgme_ctx_t) data; fd_table_t fdt; struct wait_item_s *item; struct tag *tag; @@ -143,7 +143,7 @@ void _gpgme_remove_io_cb (void *data) { struct tag *tag = data; - GpgmeCtx ctx; + gpgme_ctx_t ctx; fd_table_t fdt; int idx; diff --git a/trunk/gpgme/wait.h b/trunk/gpgme/wait.h index d58dfb3..6f61fb1 100644 --- a/trunk/gpgme/wait.h +++ b/trunk/gpgme/wait.h @@ -35,8 +35,8 @@ typedef struct fd_table *fd_table_t; a callback handler. */ struct wait_item_s { - GpgmeCtx ctx; - GpgmeIOCb handler; + gpgme_ctx_t ctx; + gpgme_io_cb_t handler; void *handler_value; int dir; }; @@ -46,7 +46,7 @@ struct wait_item_s struct tag { /* The context for which the fd was registered. */ - GpgmeCtx ctx; + gpgme_ctx_t ctx; /* The index into the fd table for this context. */ int idx; @@ -59,17 +59,18 @@ struct tag void _gpgme_fd_table_init (fd_table_t fdt); void _gpgme_fd_table_deinit (fd_table_t fdt); -GpgmeError _gpgme_add_io_cb (void *data, int fd, int dir, - GpgmeIOCb fnc, void *fnc_data, void **r_tag); +gpgme_error_t _gpgme_add_io_cb (void *data, int fd, int dir, + gpgme_io_cb_t fnc, void *fnc_data, void **r_tag); void _gpgme_remove_io_cb (void *tag); -void _gpgme_wait_private_event_cb (void *data, GpgmeEventIO type, void *type_data); -void _gpgme_wait_global_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, gpgme_event_io_t type, void *type_data); -GpgmeError _gpgme_wait_user_add_io_cb (void *data, int fd, int dir, - GpgmeIOCb fnc, void *fnc_data, void **r_tag); +gpgme_error_t _gpgme_wait_user_add_io_cb (void *data, int fd, int dir, + gpgme_io_cb_t fnc, void *fnc_data, + void **r_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 */ diff --git a/trunk/tests/gpg/t-decrypt-verify.c b/trunk/tests/gpg/t-decrypt-verify.c index 2cb7f72..fb8a079 100644 --- a/trunk/tests/gpg/t-decrypt-verify.c +++ b/trunk/tests/gpg/t-decrypt-verify.c @@ -31,7 +31,7 @@ { \ if (err) \ { \ - fprintf (stderr, "%s:%d: GpgmeError %s\n", \ + fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \ __FILE__, __LINE__, gpgme_strerror (err)); \ exit (1); \ } \ @@ -40,7 +40,7 @@ static void -print_data (GpgmeData dh) +print_data (gpgme_data_t dh) { #define BUF_SIZE 512 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) { /* Cleanup by looking at *hd. */ @@ -91,10 +91,10 @@ make_filename (const char *fname) static void -check_verify_result (GpgmeVerifyResult result, int summary, char *fpr, - GpgmeError status) +check_verify_result (gpgme_verify_result_t result, int summary, char *fpr, + gpgme_error_t status) { - GpgmeSignature sig; + gpgme_signature_t sig; sig = result->signatures; if (!sig || sig->next) @@ -151,11 +151,11 @@ check_verify_result (GpgmeVerifyResult result, int summary, char *fpr, int main (int argc, char *argv[]) { - GpgmeCtx ctx; - GpgmeError err; - GpgmeData in, out; - GpgmeDecryptResult decrypt_result; - GpgmeVerifyResult verify_result; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t in, out; + gpgme_decrypt_result_t decrypt_result; + gpgme_verify_result_t verify_result; const char *cipher_2_asc = make_filename ("cipher-2.asc"); char *agent_info; diff --git a/trunk/tests/gpg/t-decrypt.c b/trunk/tests/gpg/t-decrypt.c index 6aaacab..b674653 100644 --- a/trunk/tests/gpg/t-decrypt.c +++ b/trunk/tests/gpg/t-decrypt.c @@ -30,7 +30,7 @@ { \ if (err) \ { \ - fprintf (stderr, "%s:%d: GpgmeError %s\n", \ + fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \ __FILE__, __LINE__, gpgme_strerror (err)); \ exit (1); \ } \ @@ -39,7 +39,7 @@ static void -print_data (GpgmeData dh) +print_data (gpgme_data_t dh) { #define BUF_SIZE 512 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) { /* Cleanup by looking at *hd. */ @@ -92,10 +92,10 @@ make_filename (const char *fname) int main (int argc, char *argv[]) { - GpgmeCtx ctx; - GpgmeError err; - GpgmeData in, out; - GpgmeDecryptResult result; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t in, out; + gpgme_decrypt_result_t result; const char *cipher_1_asc = make_filename ("cipher-1.asc"); char *agent_info; diff --git a/trunk/tests/gpg/t-edit.c b/trunk/tests/gpg/t-edit.c index 8963832..a90ebff 100644 --- a/trunk/tests/gpg/t-edit.c +++ b/trunk/tests/gpg/t-edit.c @@ -28,13 +28,13 @@ #include struct passphrase_cb_info_s { - GpgmeCtx c; + gpgme_ctx_t c; int did_it; }; #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)); \ if ((a) == GPGME_File_Error) \ fprintf (stderr, "\terrno=`%s'\n", strerror (my_errno)); \ @@ -42,7 +42,7 @@ struct passphrase_cb_info_s { } while(0) static void -flush_data (GpgmeData dh) +flush_data (gpgme_data_t dh) { char buf[100]; int ret; @@ -57,7 +57,7 @@ flush_data (GpgmeData dh) } -static GpgmeError +static gpgme_error_t passphrase_cb (void *opaque, const char *desc, void **r_hd, const char **result) { @@ -73,10 +73,10 @@ passphrase_cb (void *opaque, const char *desc, } -GpgmeError -edit_fnc (void *opaque, GpgmeStatusCode status, const char *args, const char **result) +gpgme_error_t +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); flush_data (out); @@ -120,10 +120,10 @@ edit_fnc (void *opaque, GpgmeStatusCode status, const char *args, const char **r int main (int argc, char **argv) { - GpgmeCtx ctx; - GpgmeError err; - GpgmeData out = NULL; - GpgmeKey key = NULL; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t out = NULL; + gpgme_key_t key = NULL; struct passphrase_cb_info_s info; const char *pattern = "Alpha"; char *p; diff --git a/trunk/tests/gpg/t-encrypt-sign.c b/trunk/tests/gpg/t-encrypt-sign.c index 3093afb..d92d6ff 100644 --- a/trunk/tests/gpg/t-encrypt-sign.c +++ b/trunk/tests/gpg/t-encrypt-sign.c @@ -29,7 +29,7 @@ { \ if (err) \ { \ - fprintf (stderr, "%s:%d: GpgmeError %s\n", \ + fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \ __FILE__, __LINE__, gpgme_strerror (err)); \ exit (1); \ } \ @@ -38,7 +38,7 @@ static void -print_data (GpgmeData dh) +print_data (gpgme_data_t dh) { #define BUF_SIZE 512 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) { /* Cleanup by looking at *hd. */ @@ -67,7 +67,7 @@ passphrase_cb (void *opaque, const char *desc, void **hd, const char **result) static void -check_result (GpgmeSignResult result, GpgmeSigMode type) +check_result (gpgme_sign_result_t result, gpgme_sig_mode_t type) { if (result->invalid_signers) { @@ -116,12 +116,12 @@ check_result (GpgmeSignResult result, GpgmeSigMode type) int main (int argc, char **argv) { - GpgmeCtx ctx; - GpgmeError err; - GpgmeData in, out; - GpgmeRecipients rset; - GpgmeEncryptResult result; - GpgmeSignResult sign_result; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t in, out; + gpgme_recipients_t rset; + gpgme_encrypt_result_t result; + gpgme_sign_result_t sign_result; char *agent_info; err = gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP); diff --git a/trunk/tests/gpg/t-encrypt-sym.c b/trunk/tests/gpg/t-encrypt-sym.c index 520005c..7ebd397 100644 --- a/trunk/tests/gpg/t-encrypt-sym.c +++ b/trunk/tests/gpg/t-encrypt-sym.c @@ -27,13 +27,13 @@ #include #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)); \ exit (1); } \ } while(0) static void -print_data (GpgmeData dh) +print_data (gpgme_data_t dh) { char buf[100]; int ret; @@ -47,7 +47,7 @@ print_data (GpgmeData dh) fail_if_err (GPGME_File_Error); } -static GpgmeError +static gpgme_error_t passphrase_cb (void *opaque, const char *desc, void **r_hd, const char **result) { @@ -66,9 +66,9 @@ passphrase_cb (void *opaque, const char *desc, int main (int argc, char **argv) { - GpgmeCtx ctx; - GpgmeError err; - GpgmeData plain, cipher; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t plain, cipher; const char *text = "Hallo Leute\n"; char *text2; char *p; @@ -101,8 +101,7 @@ main (int argc, char **argv) print_data (cipher); fputs ("End Result.\n", stdout); - err = gpgme_data_rewind (cipher); - fail_if_err (err); + gpgme_data_seek (cipher, 0, SEEK_SET); gpgme_data_release (plain); err = gpgme_data_new (&plain); diff --git a/trunk/tests/gpg/t-encrypt.c b/trunk/tests/gpg/t-encrypt.c index d5359b9..1bd7bbf 100644 --- a/trunk/tests/gpg/t-encrypt.c +++ b/trunk/tests/gpg/t-encrypt.c @@ -29,7 +29,7 @@ { \ if (err) \ { \ - fprintf (stderr, "%s:%d: GpgmeError %s\n", \ + fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \ __FILE__, __LINE__, gpgme_strerror (err)); \ exit (1); \ } \ @@ -38,7 +38,7 @@ static void -print_data (GpgmeData dh) +print_data (gpgme_data_t dh) { #define BUF_SIZE 512 char buf[BUF_SIZE + 1]; @@ -57,11 +57,11 @@ print_data (GpgmeData dh) int main (int argc, char **argv) { - GpgmeCtx ctx; - GpgmeError err; - GpgmeData in, out; - GpgmeRecipients rset; - GpgmeEncryptResult result; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t in, out; + gpgme_recipients_t rset; + gpgme_encrypt_result_t result; err = gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP); fail_if_err (err); diff --git a/trunk/tests/gpg/t-eventloop.c b/trunk/tests/gpg/t-eventloop.c index b168ef8..66dce7f 100644 --- a/trunk/tests/gpg/t-eventloop.c +++ b/trunk/tests/gpg/t-eventloop.c @@ -28,13 +28,13 @@ #include #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)); \ exit (1); } \ } while(0) static void -print_data (GpgmeData dh) +print_data (gpgme_data_t dh) { char buf[100]; int ret; @@ -54,7 +54,7 @@ print_data (GpgmeData dh) struct op_result { int done; - GpgmeError err; + gpgme_error_t err; }; struct op_result op_result; @@ -63,15 +63,15 @@ struct one_fd { int fd; int dir; - GpgmeIOCb fnc; + gpgme_io_cb_t fnc; void *fnc_data; }; #define FDLIST_MAX 32 struct one_fd fdlist[FDLIST_MAX]; -GpgmeError -add_io_cb (void *data, int fd, int dir, GpgmeIOCb fnc, void *fnc_data, +gpgme_error_t +add_io_cb (void *data, int fd, int dir, gpgme_io_cb_t fnc, void *fnc_data, void **r_tag) { struct one_fd *fds = data; @@ -103,14 +103,14 @@ remove_io_cb (void *tag) } 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; if (type == GPGME_EVENT_DONE) { result->done = 1; - result->err = * (GpgmeError *) type_data; + result->err = * (gpgme_error_t *) type_data; } } @@ -166,7 +166,7 @@ my_wait (void) return 0; } -struct GpgmeIOCbs io_cbs = +struct gpgme_io_cbs io_cbs = { add_io_cb, fdlist, @@ -178,10 +178,10 @@ struct GpgmeIOCbs io_cbs = int main (int argc, char *argv[]) { - GpgmeCtx ctx; - GpgmeError err; - GpgmeData in, out; - GpgmeRecipients rset; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t in, out; + gpgme_recipients_t rset; int i; for (i = 0; i < FDLIST_MAX; i++) diff --git a/trunk/tests/gpg/t-export.c b/trunk/tests/gpg/t-export.c index dbcdd88..520a3d3 100644 --- a/trunk/tests/gpg/t-export.c +++ b/trunk/tests/gpg/t-export.c @@ -27,14 +27,14 @@ #include #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)); \ exit (1); } \ } while(0) static void -print_data (GpgmeData dh) +print_data (gpgme_data_t dh) { char buf[100]; int ret; @@ -51,10 +51,10 @@ print_data (GpgmeData dh) int main (int argc, char **argv ) { - GpgmeCtx ctx; - GpgmeError err; - GpgmeData out; - GpgmeRecipients rset; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t out; + gpgme_recipients_t rset; do { err = gpgme_new (&ctx); diff --git a/trunk/tests/gpg/t-genkey.c b/trunk/tests/gpg/t-genkey.c index 3e13f02..40aa303 100644 --- a/trunk/tests/gpg/t-genkey.c +++ b/trunk/tests/gpg/t-genkey.c @@ -29,7 +29,7 @@ { \ if (err) \ { \ - fprintf (stderr, "%s:%d: GpgmeError %s\n", \ + fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \ __FILE__, __LINE__, gpgme_strerror (err)); \ exit (1); \ } \ @@ -62,8 +62,8 @@ progress (void *self, const char *what, int type, int current, int total) int main (int argc, char **argv) { - GpgmeCtx ctx; - GpgmeError err; + gpgme_ctx_t ctx; + gpgme_error_t err; const char *parms = "\n" "Key-Type: DSA\n" "Key-Length: 1024\n" @@ -75,7 +75,7 @@ main (int argc, char **argv) "Expire-Date: 0\n" "Passphrase: abc\n" "\n"; - GpgmeGenKeyResult result; + gpgme_genkey_result_t result; err = gpgme_new (&ctx); fail_if_err (err); diff --git a/trunk/tests/gpg/t-import.c b/trunk/tests/gpg/t-import.c index bce9fd3..3f500a2 100644 --- a/trunk/tests/gpg/t-import.c +++ b/trunk/tests/gpg/t-import.c @@ -31,7 +31,7 @@ { \ if (err) \ { \ - fprintf (stderr, "%s:%d: GpgmeError %s\n", \ + fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \ __FILE__, __LINE__, gpgme_strerror (err)); \ exit (1); \ } \ @@ -58,7 +58,7 @@ mk_fname (const char *fname) void -check_result (GpgmeImportResult result, char *fpr, int secret) +check_result (gpgme_import_result_t result, char *fpr, int secret) { if (result->considered != 1) { @@ -183,10 +183,10 @@ check_result (GpgmeImportResult result, char *fpr, int secret) int main (int argc, char **argv) { - GpgmeCtx ctx; - GpgmeError err; - GpgmeData in; - GpgmeImportResult result; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t in; + gpgme_import_result_t result; const char *pubkey_1_asc = mk_fname ("pubkey-1.asc"); const char *seckey_1_asc = mk_fname ("seckey-1.asc"); diff --git a/trunk/tests/gpg/t-keylist-sig.c b/trunk/tests/gpg/t-keylist-sig.c index 66b26a3..46260bf 100644 --- a/trunk/tests/gpg/t-keylist-sig.c +++ b/trunk/tests/gpg/t-keylist-sig.c @@ -30,7 +30,7 @@ { \ if (err) \ { \ - fprintf (stderr, "%s:%d: GpgmeError %s\n", \ + fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \ __FILE__, __LINE__, gpgme_strerror (err)); \ exit (1); \ } \ @@ -49,7 +49,7 @@ struct char *email; struct { - GpgmePubKeyAlgo algo; + gpgme_pubkey_algo_t algo; char *keyid; char *name; char *comment; @@ -77,10 +77,10 @@ keys[] = int main (int argc, char **argv) { - GpgmeError err; - GpgmeCtx ctx; - GpgmeKey key; - GpgmeKeyListResult result; + gpgme_error_t err; + gpgme_ctx_t ctx; + gpgme_key_t key; + gpgme_keylist_result_t result; int mode; int i = 0; diff --git a/trunk/tests/gpg/t-keylist.c b/trunk/tests/gpg/t-keylist.c index 7084e37..45e46a0 100644 --- a/trunk/tests/gpg/t-keylist.c +++ b/trunk/tests/gpg/t-keylist.c @@ -30,7 +30,7 @@ { \ if (err) \ { \ - fprintf (stderr, "%s:%d: GpgmeError %s\n", \ + fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \ __FILE__, __LINE__, gpgme_strerror (err)); \ exit (1); \ } \ @@ -118,10 +118,10 @@ keys[] = int main (int argc, char **argv) { - GpgmeError err; - GpgmeCtx ctx; - GpgmeKey key; - GpgmeKeyListResult result; + gpgme_error_t err; + gpgme_ctx_t ctx; + gpgme_key_t key; + gpgme_keylist_result_t result; int i = 0; err = gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP); diff --git a/trunk/tests/gpg/t-sign.c b/trunk/tests/gpg/t-sign.c index 94747a8..e225215 100644 --- a/trunk/tests/gpg/t-sign.c +++ b/trunk/tests/gpg/t-sign.c @@ -29,7 +29,7 @@ { \ if (err) \ { \ - fprintf (stderr, "%s:%d: GpgmeError %s\n", \ + fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \ __FILE__, __LINE__, gpgme_strerror (err)); \ exit (1); \ } \ @@ -38,7 +38,7 @@ static void -print_data (GpgmeData dh) +print_data (gpgme_data_t dh) { #define BUF_SIZE 512 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) { /* Cleanup by looking at *hd. */ @@ -67,7 +67,7 @@ passphrase_cb (void *opaque, const char *desc, void **hd, const char **result) static void -check_result (GpgmeSignResult result, GpgmeSigMode type) +check_result (gpgme_sign_result_t result, gpgme_sig_mode_t type) { if (result->invalid_signers) { @@ -116,10 +116,10 @@ check_result (GpgmeSignResult result, GpgmeSigMode type) int main (int argc, char **argv) { - GpgmeCtx ctx; - GpgmeError err; - GpgmeData in, out; - GpgmeSignResult result; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t in, out; + gpgme_sign_result_t result; char *agent_info; err = gpgme_new (&ctx); @@ -146,7 +146,7 @@ main (int argc, char **argv) gpgme_data_release (out); /* Now a detached signature. */ - gpgme_data_rewind (in); + gpgme_data_seek (in, 0, SEEK_SET); err = gpgme_data_new (&out); fail_if_err (err); err = gpgme_op_sign (ctx, in, out, GPGME_SIG_MODE_DETACH); @@ -157,7 +157,7 @@ main (int argc, char **argv) gpgme_data_release (out); /* And finally a cleartext signature. */ - gpgme_data_rewind (in); + gpgme_data_seek (in, 0, SEEK_SET); err = gpgme_data_new (&out); fail_if_err (err); err = gpgme_op_sign (ctx, in, out, GPGME_SIG_MODE_CLEAR); diff --git a/trunk/tests/gpg/t-signers.c b/trunk/tests/gpg/t-signers.c index de492b4..512da59 100644 --- a/trunk/tests/gpg/t-signers.c +++ b/trunk/tests/gpg/t-signers.c @@ -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) 2001, 2003 g10 Code GmbH @@ -29,7 +29,7 @@ { \ if (err) \ { \ - fprintf (stderr, "%s:%d: GpgmeError %s\n", \ + fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \ __FILE__, __LINE__, gpgme_strerror (err)); \ exit (1); \ } \ @@ -38,7 +38,7 @@ static void -print_data (GpgmeData dh) +print_data (gpgme_data_t dh) { #define BUF_SIZE 512 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) { /* Cleanup by looking at *hd. */ @@ -67,9 +67,9 @@ passphrase_cb (void *opaque, const char *desc, void **hd, const char **result) 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) { @@ -127,11 +127,11 @@ check_result (GpgmeSignResult result, GpgmeSigMode type) int main (int argc, char *argv[]) { - GpgmeCtx ctx; - GpgmeError err; - GpgmeData in, out; - GpgmeKey key[2]; - GpgmeSignResult result; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t in, out; + gpgme_key_t key[2]; + gpgme_sign_result_t result; char *agent_info; err = gpgme_new (&ctx); @@ -172,7 +172,7 @@ main (int argc, char *argv[]) gpgme_data_release (out); /* Now a detached signature. */ - gpgme_data_rewind (in); + gpgme_data_seek (in, 0, SEEK_SET); err = gpgme_data_new (&out); fail_if_err (err); err = gpgme_op_sign (ctx, in, out, GPGME_SIG_MODE_DETACH); @@ -183,7 +183,7 @@ main (int argc, char *argv[]) gpgme_data_release (out); /* And finally a cleartext signature. */ - gpgme_data_rewind (in); + gpgme_data_seek (in, 0, SEEK_SET); err = gpgme_data_new (&out); fail_if_err (err); 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); print_data (out); gpgme_data_release (out); - gpgme_data_rewind (in); + gpgme_data_seek (in, 0, SEEK_SET); gpgme_data_release (in); gpgme_release (ctx); diff --git a/trunk/tests/gpg/t-trustlist.c b/trunk/tests/gpg/t-trustlist.c index 874ac08..cc4bbf3 100644 --- a/trunk/tests/gpg/t-trustlist.c +++ b/trunk/tests/gpg/t-trustlist.c @@ -30,7 +30,7 @@ { \ if (err) \ { \ - fprintf (stderr, "%s:%d: GpgmeError %s\n", \ + fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \ __FILE__, __LINE__, gpgme_strerror (err)); \ exit (1); \ } \ @@ -41,9 +41,9 @@ int main (int argc, char *argv[]) { - GpgmeCtx ctx; - GpgmeError err; - GpgmeTrustItem item; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_trust_item_t item; err = gpgme_new (&ctx); fail_if_err (err); diff --git a/trunk/tests/gpg/t-verify.c b/trunk/tests/gpg/t-verify.c index 28b4304..df0c9df 100644 --- a/trunk/tests/gpg/t-verify.c +++ b/trunk/tests/gpg/t-verify.c @@ -30,7 +30,7 @@ { \ if (err) \ { \ - fprintf (stderr, "%s:%d: GpgmeError %s\n", \ + fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \ __FILE__, __LINE__, gpgme_strerror (err)); \ exit (1); \ } \ @@ -82,10 +82,10 @@ static const char test_sig2[] = static void -check_result (GpgmeVerifyResult result, int summary, char *fpr, - GpgmeError status, int notation) +check_result (gpgme_verify_result_t result, int summary, char *fpr, + gpgme_error_t status, int notation) { - GpgmeSignature sig; + gpgme_signature_t sig; sig = result->signatures; if (!sig || sig->next) @@ -157,10 +157,10 @@ check_result (GpgmeVerifyResult result, int summary, char *fpr, int main (int argc, char *argv[]) { - GpgmeCtx ctx; - GpgmeError err; - GpgmeData sig, text; - GpgmeVerifyResult result; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t sig, text; + gpgme_verify_result_t result; err = gpgme_new (&ctx); fail_if_err (err); @@ -180,7 +180,7 @@ main (int argc, char *argv[]) gpgme_data_release (text); err = gpgme_data_new_from_mem (&text, test_text1f, strlen (test_text1f), 0); fail_if_err (err); - gpgme_data_rewind (sig); + gpgme_data_seek (sig, 0, SEEK_SET); err = gpgme_op_verify (ctx, sig, text, NULL); fail_if_err (err); result = gpgme_op_verify_result (ctx); diff --git a/trunk/tests/gpgsm/t-decrypt.c b/trunk/tests/gpgsm/t-decrypt.c index 499d82e..f3dc976 100644 --- a/trunk/tests/gpgsm/t-decrypt.c +++ b/trunk/tests/gpgsm/t-decrypt.c @@ -40,7 +40,7 @@ static const char test_cip1[] = "-----END CMS OBJECT-----\n"; #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)); \ if ((a) == GPGME_File_Error) \ fprintf (stderr, "\terrno=`%s'\n", strerror (my_errno)); \ @@ -48,7 +48,7 @@ static const char test_cip1[] = } while(0) static void -print_data (GpgmeData dh) +print_data (gpgme_data_t dh) { #define BUF_SIZE 512 char buf[BUF_SIZE + 1]; @@ -67,10 +67,10 @@ print_data (GpgmeData dh) int main (int argc, char *argv[]) { - GpgmeCtx ctx; - GpgmeError err; - GpgmeData in, out; - GpgmeDecryptResult result; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t in, out; + gpgme_decrypt_result_t result; err = gpgme_new (&ctx); fail_if_err (err); diff --git a/trunk/tests/gpgsm/t-encrypt.c b/trunk/tests/gpgsm/t-encrypt.c index 0783a9c..1daa772 100644 --- a/trunk/tests/gpgsm/t-encrypt.c +++ b/trunk/tests/gpgsm/t-encrypt.c @@ -29,7 +29,7 @@ { \ if (err) \ { \ - fprintf (stderr, "%s:%d: GpgmeError %s\n", \ + fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \ __FILE__, __LINE__, gpgme_strerror (err)); \ exit (1); \ } \ @@ -38,7 +38,7 @@ static void -print_data (GpgmeData dh) +print_data (gpgme_data_t dh) { #define BUF_SIZE 512 char buf[BUF_SIZE + 1]; @@ -57,11 +57,11 @@ print_data (GpgmeData dh) int main (int argc, char **argv) { - GpgmeCtx ctx; - GpgmeError err; - GpgmeData in, out; - GpgmeRecipients rset; - GpgmeEncryptResult result; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t in, out; + gpgme_recipients_t rset; + gpgme_encrypt_result_t result; err = gpgme_engine_check_version (GPGME_PROTOCOL_CMS); fail_if_err (err); diff --git a/trunk/tests/gpgsm/t-export.c b/trunk/tests/gpgsm/t-export.c index dd2ac54..b83c060 100644 --- a/trunk/tests/gpgsm/t-export.c +++ b/trunk/tests/gpgsm/t-export.c @@ -27,13 +27,13 @@ #include #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)); \ exit (1); } \ } while(0) static void -print_data (GpgmeData dh) +print_data (gpgme_data_t dh) { char buf[100]; int ret; @@ -51,10 +51,10 @@ print_data (GpgmeData dh) int main (int argc, char **argv ) { - GpgmeCtx ctx; - GpgmeError err; - GpgmeData out; - GpgmeRecipients rset; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t out; + gpgme_recipients_t rset; do { err = gpgme_new (&ctx); diff --git a/trunk/tests/gpgsm/t-genkey.c b/trunk/tests/gpgsm/t-genkey.c index a7530ba..d5df2c6 100644 --- a/trunk/tests/gpgsm/t-genkey.c +++ b/trunk/tests/gpgsm/t-genkey.c @@ -30,7 +30,7 @@ { \ if (err) \ { \ - fprintf (stderr, "%s:%d: GpgmeError %s\n", \ + fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \ __FILE__, __LINE__, gpgme_strerror (err)); \ exit (1); \ } \ @@ -39,7 +39,7 @@ static void -print_data (GpgmeData dh) +print_data (gpgme_data_t dh) { #define BUF_SIZE 512 char buf[BUF_SIZE + 1]; @@ -81,16 +81,16 @@ progress (void *self, const char *what, int type, int current, int total) int main (int argc, char **argv) { - GpgmeCtx ctx; - GpgmeError err; + gpgme_ctx_t ctx; + gpgme_error_t err; const char *parms = "\n" "Key-Type: RSA\n" "Key-Length: 1024\n" "Name-DN: C=de,O=g10 code,OU=Testlab,CN=Joe 2 Tester\n" "Name-Email: joe@foo.bar\n" "\n"; - GpgmeGenKeyResult result; - GpgmeData certreq; + gpgme_genkey_result_t result; + gpgme_data_t certreq; err = gpgme_engine_check_version (GPGME_PROTOCOL_CMS); fail_if_err (err); diff --git a/trunk/tests/gpgsm/t-import.c b/trunk/tests/gpgsm/t-import.c index 219ce95..2b50e10 100644 --- a/trunk/tests/gpgsm/t-import.c +++ b/trunk/tests/gpgsm/t-import.c @@ -31,7 +31,7 @@ { \ if (err) \ { \ - fprintf (stderr, "%s:%d: GpgmeError %s\n", \ + fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \ __FILE__, __LINE__, gpgme_strerror (err)); \ exit (1); \ } \ @@ -62,7 +62,7 @@ make_filename (const char *fname) void -check_result (GpgmeImportResult result, char *fpr, int total) +check_result (gpgme_import_result_t result, char *fpr, int total) { if (result->considered != total) { @@ -154,10 +154,10 @@ check_result (GpgmeImportResult result, char *fpr, int total) int main (int argc, char **argv) { - GpgmeCtx ctx; - GpgmeError err; - GpgmeData in; - GpgmeImportResult result; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t in; + gpgme_import_result_t result; const char *cert_1 = make_filename ("cert_dfn_pca01.der"); const char *cert_2 = make_filename ("cert_dfn_pca15.der"); diff --git a/trunk/tests/gpgsm/t-keylist.c b/trunk/tests/gpgsm/t-keylist.c index 704776f..215f1e4 100644 --- a/trunk/tests/gpgsm/t-keylist.c +++ b/trunk/tests/gpgsm/t-keylist.c @@ -30,7 +30,7 @@ { \ if (err) \ { \ - fprintf (stderr, "%s:%d: GpgmeError %s\n", \ + fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \ __FILE__, __LINE__, gpgme_strerror (err)); \ exit (1); \ } \ @@ -76,10 +76,10 @@ keys[] = int main (int argc, char **argv) { - GpgmeError err; - GpgmeCtx ctx; - GpgmeKey key; - GpgmeKeyListResult result; + gpgme_error_t err; + gpgme_ctx_t ctx; + gpgme_key_t key; + gpgme_keylist_result_t result; int i = 0; err = gpgme_engine_check_version (GPGME_PROTOCOL_CMS); diff --git a/trunk/tests/gpgsm/t-sign.c b/trunk/tests/gpgsm/t-sign.c index a9af38f..3c557cf 100644 --- a/trunk/tests/gpgsm/t-sign.c +++ b/trunk/tests/gpgsm/t-sign.c @@ -29,7 +29,7 @@ { \ if (err) \ { \ - fprintf (stderr, "%s:%d: GpgmeError %s\n", \ + fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \ __FILE__, __LINE__, gpgme_strerror (err)); \ exit (1); \ } \ @@ -38,7 +38,7 @@ static void -print_data (GpgmeData dh) +print_data (gpgme_data_t dh) { #define BUF_SIZE 512 char buf[BUF_SIZE + 1]; @@ -55,7 +55,7 @@ print_data (GpgmeData dh) static void -check_result (GpgmeSignResult result, GpgmeSigMode type) +check_result (gpgme_sign_result_t result, gpgme_sig_mode_t type) { if (result->invalid_signers) { @@ -104,10 +104,10 @@ check_result (GpgmeSignResult result, GpgmeSigMode type) int main (int argc, char **argv) { - GpgmeCtx ctx; - GpgmeError err; - GpgmeData in, out; - GpgmeSignResult result; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t in, out; + gpgme_sign_result_t result; err = gpgme_engine_check_version (GPGME_PROTOCOL_CMS); fail_if_err (err); @@ -133,7 +133,7 @@ main (int argc, char **argv) gpgme_data_release (out); /* Now a detached signature. */ - gpgme_data_rewind (in); + gpgme_data_seek (in, 0, SEEK_SET); err = gpgme_data_new (&out); fail_if_err (err); err = gpgme_op_sign (ctx, in, out, GPGME_SIG_MODE_DETACH); diff --git a/trunk/tests/gpgsm/t-verify.c b/trunk/tests/gpgsm/t-verify.c index 48e0ce9..de36073 100644 --- a/trunk/tests/gpgsm/t-verify.c +++ b/trunk/tests/gpgsm/t-verify.c @@ -30,7 +30,7 @@ { \ if (err) \ { \ - fprintf (stderr, "%s:%d: GpgmeError %s\n", \ + fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \ __FILE__, __LINE__, gpgme_strerror (err)); \ exit (1); \ } \ @@ -54,10 +54,10 @@ static const char test_sig1[] = static void -check_result (GpgmeVerifyResult result, int summary, char *fpr, - GpgmeError status, GpgmeValidity validity) +check_result (gpgme_verify_result_t result, int summary, char *fpr, + gpgme_error_t status, gpgme_validity_t validity) { - GpgmeSignature sig; + gpgme_signature_t sig; sig = result->signatures; if (!sig || sig->next) @@ -114,10 +114,10 @@ check_result (GpgmeVerifyResult result, int summary, char *fpr, int main (int argc, char **argv) { - GpgmeCtx ctx; - GpgmeError err; - GpgmeData sig, text; - GpgmeVerifyResult result; + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t sig, text; + gpgme_verify_result_t result; err = gpgme_new (&ctx); fail_if_err (err); @@ -139,7 +139,7 @@ main (int argc, char **argv) gpgme_data_release (text); err = gpgme_data_new_from_mem (&text, test_text1f, strlen (test_text1f), 0); fail_if_err (err); - gpgme_data_rewind (sig); + gpgme_data_seek (sig, 0, SEEK_SET); err = gpgme_op_verify (ctx, sig, text, NULL); fail_if_err (err); result = gpgme_op_verify_result (ctx); diff --git a/trunk/tests/t-data.c b/trunk/tests/t-data.c index 3135dbd..d235596 100644 --- a/trunk/tests/t-data.c +++ b/trunk/tests/t-data.c @@ -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 * * This file is part of GPGME. @@ -26,11 +26,11 @@ #include -#define fail_if_err(a) do { if(a) { \ - fprintf (stderr, "%s:%d: (%i) GpgmeError " \ - "%s\n", __FILE__, __LINE__, round, \ - gpgme_strerror(a)); \ - exit (1); } \ +#define fail_if_err(a) do { if(a) { \ + fprintf (stderr, "%s:%d: (%i) gpgme_error_t " \ + "%s\n", __FILE__, __LINE__, round, \ + gpgme_strerror(a)); \ + exit (1); } \ } while(0) static char * @@ -104,7 +104,7 @@ read_cb (void *cb_value, char *buffer, size_t count, size_t *nread) } void -read_once_test (round_t round, GpgmeData data) +read_once_test (round_t round, gpgme_data_t data) { char buffer[1024]; size_t read; @@ -128,9 +128,8 @@ read_once_test (round_t round, GpgmeData data) } void -read_test (round_t round, GpgmeData data) +read_test (round_t round, gpgme_data_t data) { - GpgmeError err; char buffer[1024]; size_t read; @@ -147,15 +146,13 @@ read_test (round_t round, GpgmeData data) } read_once_test (round, data); - err = gpgme_data_rewind (data); - fail_if_err (err); + gpgme_data_seek (data, 0, SEEK_SET); read_once_test (round, data); } void -write_test (round_t round, GpgmeData data) +write_test (round_t round, gpgme_data_t data) { - GpgmeError err; char buffer[1024]; size_t amt; @@ -163,8 +160,7 @@ write_test (round_t round, GpgmeData data) if (amt != strlen (text)) fail_if_err (GPGME_File_Error); - err = gpgme_data_rewind (data); - fail_if_err (err); + gpgme_data_seek (data, 0, SEEK_SET); if (round == TEST_INOUT_NONE) 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 *longer_text_filename = make_filename ("t-data-2.txt"); const char *missing_filename = "this-file-surely-does-not-exist"; - GpgmeError err = GPGME_No_Error; - GpgmeData data; + gpgme_error_t err = GPGME_No_Error; + gpgme_data_t data; while (++round) { diff --git a/trunk/tests/t-engine-info.c b/trunk/tests/t-engine-info.c index ef69b1f..2705b48 100644 --- a/trunk/tests/t-engine-info.c +++ b/trunk/tests/t-engine-info.c @@ -33,7 +33,7 @@ { \ if (err) \ { \ - fprintf (stderr, "%s:%d: GpgmeError %s\n", \ + fprintf (stderr, "%s:%d: gpgme_error_t %s\n", \ __FILE__, __LINE__, gpgme_strerror (err)); \ exit (1); \ } \ @@ -42,7 +42,7 @@ 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) { if (info->protocol != protocol) @@ -69,8 +69,8 @@ check_engine_info (GpgmeEngineInfo info, GpgmeProtocol protocol, int main (int argc, char **argv ) { - GpgmeEngineInfo info; - GpgmeError err; + gpgme_engine_info_t info; + gpgme_error_t err; err = gpgme_get_engine_info (&info); fail_if_err (err); diff --git a/trunk/tests/t-version.c b/trunk/tests/t-version.c index 1bdeb46..04cb174 100644 --- a/trunk/tests/t-version.c +++ b/trunk/tests/t-version.c @@ -29,7 +29,7 @@ static const char version[] = VERSION; int -main (int argc, char **argv ) +main (int argc, char **argv) { const char *null_result; const char *current_result;