+2003-05-18 Marcus Brinkmann <marcus@g10code.de>
+
+ In all files, replace the Gpgme* type names with the new gpgme_*
+ type names.
+
2003-02-01 Marcus Brinkmann <marcus@g10code.de>
* assuan/: Update files to 2002-11-10 version of assuan.
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
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.
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.
you should now do:
- GpgmeGenKeyResult result;
+ gpgme_genkey_result_t result;
err = gpgme_op_genkey (ctx, NULL, NULL);
if (!err)
{
* 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
* 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.
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.
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
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
*** 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
+2003-05-18 Marcus Brinkmann <marcus@g10code.de>
+
+ * gpgme.texi (Header): Remove Gpgme as namespace prefix. Add
+ _GPGME to namespace prefix.
+ * gpgme.texi (Multi Threading): Add note about link order.
+
2003-05-04 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Listing Keys): Document what happens if key is not
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
#include <gpgme.h>
@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_*}
@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.
@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.
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:
@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.
@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}.
@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.
@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.
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)
@{
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:
@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
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
@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
@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
@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.
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
@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
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",
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
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.
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
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
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
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).
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).
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
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
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.
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
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.
@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.
@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}.
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.
/* 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.
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
@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
@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
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
@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
@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
@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.
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
@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.
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.
@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.
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.
@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
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
@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:
@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}
@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
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
@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
@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
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
@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
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.
@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
@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
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.
@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
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
@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.
@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
@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
@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
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
@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
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
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,
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}.
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)
@{
@}
@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
@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
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
@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
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
@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.
@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}
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}
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
@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
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
@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.
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
@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.
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}.
@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
@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
@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
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}.
@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,
@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}.
@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}.
@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
@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
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
@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,
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}.
@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
@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
@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
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,
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}.
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
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,
@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
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
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
@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}.
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}.
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
@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
@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
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}.
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.
@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.
@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:
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
@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
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
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:
@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;
@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;
@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;
@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;
@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
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
@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}.
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.
@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
@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
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}.
@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
@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
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
@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}.
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
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
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}.
@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
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
@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
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}.
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
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
@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
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
@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
@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
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}
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.
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:
@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
@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.
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.
@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}.
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
struct op_result
@{
int done;
- GpgmeError err;
+ gpgme_error_t err;
@};
/* The following structure holds the data associated with one I/O
@{
int fd;
int dir;
- GpgmeIOCb fnc;
+ gpgme_io_cb_t fnc;
void *fnc_data;
@};
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;
@}
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)
@{
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,
struct my_gpgme_io_cb
@{
- GpgmeIOCb fnc;
+ gpgme_io_cb_t fnc;
void *fnc_data;
guint input_handler_id
@};
@}
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));
struct my_gpgme_io_cb
@{
- GpgmeIOCb fnc;
+ gpgme_io_cb_t fnc;
void *fnc_data;
gint tag;
@};
@}
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));
+2003-05-18 Marcus Brinkmann <marcus@g10code.de>
+
+ * gpgme.h: The following types are renamed. The old name is kept
+ as a deprecated typedef.
+ (GpgmeCtx): Rename to gpgme_ctx_t.
+ (GpgmeData): Rename to gpgme_data_t.
+ (GpgmeRecipients): Rename to gpgme_recipients_t.
+ (GpgmeError): Rename to gpgme_error_t.
+ (GpgmeDataEncoding): Rename to gpgme_data_encoding_t.
+ (GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t.
+ (GpgmeHashAlgo): Rename to gpgme_hash_algo_t.
+ (GpgmeSigStat): Rename to gpgme_sig_stat_t.
+ (GpgmeSigMode): Rename to gpgme_sig_mode_t.
+ (GpgmeAttr): Rename to gpgme_attr_t.
+ (GpgmeValidity): Rename to gpgme_validity_t.
+ (GpgmeProtocol): Rename to gpgme_protocol_t.
+ (GpgmeStatusCode): Rename to gpgme_status_code_t.
+ (GpgmeEngineInfo): Rename to gpgme_engine_info_t.
+ (GpgmeSubkey): Rename to gpgme_subkey_t.
+ (GpgmeKeySig): Rename to gpgme_keysig_t.
+ (GpgmeUserID): Rename to gpgme_user_id_t.
+ (GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t.
+ (GpgmeProgressCb): Rename to gpgme_progress_cb_t.
+ (GpgmeEditCb): Rename to gpgme_edit_cb_t.
+ (GpgmeIOCb): Rename to gpgme_io_cb_t.
+ (GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t.
+ (GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t.
+ (GpgmeEventIO): Rename to gpgme_event_io_t.
+ (GpgmeEventIOCb): Rename to gpgme_event_io_cb_t.
+ (GpgmeIOCbs): Rename to gpgme_io_cbs.
+ (gpgme_io_cbs_t): New type.
+ (GpgmeDataReadCb): Rename to gpgme_data_read_cb_t.
+ (GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t.
+ (GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t.
+ (GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t.
+ (GpgmeDataCbs): Rename to gpgme_data_cbs.
+ (gpgme_data_cbs_t): New type.
+ (GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t.
+ (GpgmeEncryptResult): Rename to gpgme_encrypt_result_t.
+ (GpgmeDecryptResult): Rename to gpgme_decrypt_result_t.
+ (GpgmeNewSignature): Rename to gpgme_new_signature_t.
+ (GpgmeSignResult): Rename to gpgme_sign_result_t.
+ (GpgmeSigNotation): Rename to gpgme_sig_notation_t.
+ (GpgmeSignature): Rename to gpgme_signature_t.
+ (GpgmeVerifyResult): Rename to gpgme_verify_result_t.
+ (GpgmeImportStatus): Rename to gpgme_import_status_t.
+ (GpgmeImportResult): Rename to gpgme_import_result_t.
+ (GpgmeGenKeyResult): Rename to gpgme_genkey_result_t.
+ (GpgmeKeyListResult): Rename to gpgme_keylist_result_t.
+ (GpgmeTrustItem): Rename to gpgme_trust_item_t.
+ * gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros
+ GPGME_No_Recipients, GPGME_Invalid_Recipient and
+ GPGME_No_Passphrase.
+ * data.h (struct gpgme_data_s): Rename to struct gpgme_data.
+ * context.h (struct gpgme_context_s): Rename to struct
+ gpgme_context.
+ (struct gpgme_recipients_s): Rename to gpgme_recipients.
+
2003-05-18 Marcus Brinkmann <marcus@g10code.de>
* keylist.c (finish_key): Clear OPD->tmp_uid.
\f
/* 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;
/* 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 */
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;
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;
static struct
{
char *name;
- GpgmeError err;
+ gpgme_error_t err;
} gnupg_errors[] =
{
{ "EOF", GPGME_EOF },
};
-GpgmeError
+gpgme_error_t
_gpgme_map_gnupg_error (char *err)
{
int i;
/* 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)
\f
/* 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;
\f
static int
-gpgme_error_to_errno (GpgmeError err)
+gpgme_error_to_errno (gpgme_error_t err)
{
switch (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;
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);
}
-static struct gpgme_data_cbs old_user_cbs =
+static struct _gpgme_data_cbs old_user_cbs =
{
old_user_read,
NULL,
/* 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;
}
\f
-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;
\f
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,
};
\f
-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;
\f
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;
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;
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)
{
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,
};
\f
-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;
/* 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;
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;
\f
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)
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)
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,
};
\f
-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;
\f
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,
};
\f
-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;
#include "io.h"
\f
-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;
void
-_gpgme_data_release (GpgmeData dh)
+_gpgme_data_release (gpgme_data_t dh)
{
if (dh)
free (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)
{
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)
{
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)
{
/* Release the data object with the handle DH. */
void
-gpgme_data_release (GpgmeData dh)
+gpgme_data_release (gpgme_data_t dh)
{
if (!dh)
return;
/* 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;
}
/* 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;
\f
/* 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;
}
-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)
/* 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;
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
/* For gpgme_data_new_from_cbs. */
struct
{
- struct GpgmeDataCbs *cbs;
+ gpgme_data_cbs_t cbs;
void *handle;
} user;
};
\f
-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 */
#include "ops.h"
\f
-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)
/* 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);
}
/* 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;
}
-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)
}
\f
-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);
}
-GpgmeError
-_gpgme_op_decrypt_init_result (GpgmeCtx ctx)
+gpgme_error_t
+_gpgme_op_decrypt_init_result (gpgme_ctx_t ctx)
{
op_data_t opd;
}
-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)
}
-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);
}
/* 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;
#include "ops.h"
\f
-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)
{
}
-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)
/* 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);
}
/* 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;
typedef struct
{
/* The user callback function and its hook value. */
- GpgmeEditCb fnc;
+ gpgme_edit_cb_t fnc;
void *fnc_value;
} *op_data_t;
\f
-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)
}
-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;
}
-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);
}
-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);
}
/* 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;
#include "ops.h"
\f
-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)
/* 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);
}
/* 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;
/* 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;
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)
}
\f
-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,
}
-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,
}
-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);
}
-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);
}
/* 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)
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);
};
int any; /* any data line seen */
} colon;
- struct GpgmeIOCbs io_cbs;
+ struct gpgme_io_cbs io_cbs;
};
typedef struct gpgsm_object_s *GpgsmObject;
}
-static GpgmeError
+static gpgme_error_t
map_assuan_error (AssuanError err)
{
switch (err)
}
-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];
/* 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)
{
&& line[0] == 'S' && line[1] == ' ')
{
char *rest;
- GpgmeStatusCode r;
+ gpgme_status_code_t r;
rest = strchr (line + 2, ' ');
if (!rest)
#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];
static const char *
-map_input_enc (GpgmeData d)
+map_input_enc (gpgme_data_t d)
{
switch (gpgme_data_get_encoding (d))
{
}
-static GpgmeStatusCode
+static gpgme_status_code_t
parse_status (const char *name)
{
struct status_table_s t, *r;
}
-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;
&& line[0] == 'S' && line[1] == ' ')
{
char *rest;
- GpgmeStatusCode r;
+ gpgme_status_code_t r;
rest = strchr (line + 2, ' ');
if (!rest)
}
-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,
}
-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)
}
-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;
}
-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;
}
-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'. */
}
-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;
}
-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;
}
-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;
}
-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;
}
-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 = "";
}
-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;
}
-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;
}
-static GpgmeError
+static gpgme_error_t
gpgsm_trustlist (void *engine, const char *pattern)
{
/* FIXME */
}
-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;
}
-static GpgmeError
+static gpgme_error_t
gpgsm_set_colon_line_handler (void *engine, EngineColonLineHandler fnc,
void *fnc_value)
{
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;
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;
\f
/* 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;
/* 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;
/* 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;
/* 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))
/* 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;
{
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;
}
}
\f
-GpgmeError
-_gpgme_engine_new (GpgmeProtocol proto, EngineObject *r_engine)
+gpgme_error_t
+_gpgme_engine_new (gpgme_protocol_t proto, EngineObject *r_engine)
{
EngineObject 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);
}
-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;
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)
{
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;
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;
}
-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;
}
-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;
}
-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;
}
-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;
}
-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;
}
-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;
}
-GpgmeError
+gpgme_error_t
_gpgme_engine_op_keylist (EngineObject engine, const char *pattern,
int secret_only, int keylist_mode)
{
}
-GpgmeError
+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, 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;
}
-GpgmeError
+gpgme_error_t
_gpgme_engine_op_trustlist (EngineObject engine, const char *pattern)
{
if (!engine)
}
-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;
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;
void
_gpgme_engine_io_event (EngineObject engine,
- GpgmeEventIO type, void *type_data)
+ gpgme_event_io_t type, void *type_data)
{
if (!engine)
return;
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 */
#include "ops.h"
\f
-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;
/* 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;
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;
}
-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)
}
\f
-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. */
}
-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;
}
-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)
/* 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);
}
/* 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)
/* 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;
* Release all resources associated with the given context.
**/
void
-gpgme_release (GpgmeCtx ctx)
+gpgme_release (gpgme_ctx_t ctx)
{
if (!ctx)
return;
}
void
-_gpgme_release_result (GpgmeCtx ctx)
+_gpgme_release_result (gpgme_ctx_t ctx)
{
struct ctx_op_data *data = ctx->op_data;
}
-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;
}
-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)
{
* 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;
* 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;
}
* 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;
* 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;
}
* 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;
* 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;
}
* 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;
* 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;
*
* The callback function is defined as:
* <literal>
- * typedef const char *(*GpgmePassphraseCb)(void*cb_value,
+ * typedef const char *(*gpgme_passphrase_cb_t)(void*cb_value,
* const char *desc,
* void **r_hd);
* </literal>
*
**/
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)
{
* 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)
{
*
* The callback function is defined as:
* <literal>
- * typedef void (*GpgmeProgressCb) (void *cb_value,
+ * typedef void (*gpgme_progress_cb_t) (void *cb_value,
* const char *what, int type,
* int curretn, int total);
* </literal>
* 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)
{
* 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)
{
*
**/
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;
* 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;
const char *
-gpgme_pubkey_algo_name (GpgmePubKeyAlgo algo)
+gpgme_pubkey_algo_name (gpgme_pubkey_algo_t algo)
{
switch (algo)
{
const char *
-gpgme_hash_algo_name (GpgmeHashAlgo algo)
+gpgme_hash_algo_name (gpgme_hash_algo_t algo)
{
switch (algo)
{
#endif
#endif
+\f
+/* 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
+
\f
/* The version of this header should match the one of the library. Do
not use this symbol in your application, use gpgme_check_version
#define GPGME_VERSION "0.4.1"
\f
-/* 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;
\f
/* Public data types provided by GPGME. */
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. */
+\f
+/* The possible encoding mode of gpgme_data_t objects. */
typedef enum
{
GPGME_DATA_ENCODING_NONE = 0, /* Not specified. */
GPGME_DATA_ENCODING_BASE64 = 2,
GPGME_DATA_ENCODING_ARMOR = 3 /* Either PEM or OpenPGP Armor. */
}
-GpgmeDataEncoding;
-
+gpgme_data_encoding_t;
+\f
/* Public key algorithms from libgcrypt. */
typedef enum
{
GPGME_PK_DSA = 17,
GPGME_PK_ELG = 20
}
-GpgmePubKeyAlgo;
+gpgme_pubkey_algo_t;
/* Hash algorithms from libgcrypt. */
GPGME_MD_CRC32_RFC1510 = 303,
GPGME_MD_CRC24_RFC2440 = 304
}
-GpgmeHashAlgo;
-
+gpgme_hash_algo_t;
-/* The possible signature stati. */
+\f
+/* The possible signature stati. Deprecated, use error value in sig
+ status. */
typedef enum
{
GPGME_SIG_STAT_NONE = 0,
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
GPGME_SIG_MODE_DETACH = 1,
GPGME_SIG_MODE_CLEAR = 2
}
-GpgmeSigMode;
-
+gpgme_sig_mode_t;
-/* The available key and signature attributes. */
+\f
+/* The available key and signature attributes. Deprecated, use the
+ individual result structures instead. */
typedef enum
{
GPGME_ATTR_KEYID = 1,
GPGME_ATTR_SIG_SUMMARY = 31,
GPGME_ATTR_SIG_CLASS = 32
}
-GpgmeAttr;
+_gpgme_attr_t;
+typedef _gpgme_attr_t gpgme_attr_t _GPGME_DEPRECATED;
+\f
/* The available validities for a trust item or key. */
typedef enum
{
GPGME_VALIDITY_FULL = 4,
GPGME_VALIDITY_ULTIMATE = 5
}
-GpgmeValidity;
-
+gpgme_validity_t;
+\f
/* The available protocols. */
typedef enum
{
GPGME_PROTOCOL_OpenPGP = 0, /* The default mode. */
GPGME_PROTOCOL_CMS = 1,
}
-GpgmeProtocol;
+gpgme_protocol_t;
\f
/* The possible stati for the edit operation. */
GPGME_STATUS_TRUNCATED,
GPGME_STATUS_ERROR
}
-GpgmeStatusCode;
+gpgme_status_code_t;
\f
/* The engine information structure. */
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;
/* 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;
\f
/* A subkey from a key. */
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;
/* 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
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;
/* 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;
/* 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
unsigned int _unused : 30;
/* The validity of the user ID. */
- GpgmeValidity validity;
+ gpgme_validity_t validity;
/* The user ID string. */
char *uid;
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
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. */
/* 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;
+
\f
/* 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);
\f
/* 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
};
/* 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);
\f
/* 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);
\f
/* 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;
\f
/* 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);
\f
/* 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);
\f
/* Functions to handle data objects. */
/* 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;
\f
/* 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;
\f
/* Crypto Operations. */
{
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;
\f
/* 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);
\f
/* Decryption. */
{
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);
\f
/* 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);
\f
/* Verify. */
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. */
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;
/* 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);
\f
/* Import. */
/* 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
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;
\f
/* 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);
\f
/* Key generation. */
/* 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);
\f
/* 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);
+\f
/* 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);
\f
/* Key management functions */
/* 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);
\f
/* Trust items and operations. */
/* 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;
\f
/* Various functions. */
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);
\f
/* 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);
+\f
+/* 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
}
/* 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;
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;
}
-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)
}
\f
-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;
-GpgmeError
-parse_import_res (char *args, GpgmeImportResult result)
+gpgme_error_t
+parse_import_res (char *args, gpgme_import_result_t result)
{
char *tail;
}
-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,
}
-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);
}
-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;
/* 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)
}
-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)
/* 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);
}
-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 */
\f
/* Acquire a reference to KEY. */
void
-gpgme_key_ref (GpgmeKey key)
+gpgme_key_ref (gpgme_key_t key)
{
LOCK (key_ref_lock);
key->_refs++;
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);
subkey = key->subkeys;
while (subkey)
{
- GpgmeSubkey next = subkey->next;
+ gpgme_subkey_t next = subkey->next;
if (subkey->fpr)
free (subkey->fpr);
free (subkey);
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;
}
/* Compatibility interfaces. */
void
-gpgme_key_release (GpgmeKey key)
+gpgme_key_release (gpgme_key_t key)
{
gpgme_key_unref (key);
}
static const char *
-capabilities_to_string (GpgmeSubkey subkey)
+capabilities_to_string (gpgme_subkey_t subkey)
{
static const char *const strings[8] =
{
/* 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)
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)
}
-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;
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;
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;
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;
}
-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)
}
\f
-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);
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))
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. */
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))
static void
-set_mainkey_capability (GpgmeKey key, const char *src)
+set_mainkey_capability (gpgme_key_t key, const char *src)
{
while (*src)
{
static void
-set_subkey_capability (GpgmeSubkey subkey, const char *src)
+set_subkey_capability (gpgme_subkey_t subkey, const char *src)
{
while (*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))
/* 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;
/* 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,
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)");
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;
/* 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);
/* 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);
/* 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;
/* 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;
\f
/* 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;
* Return value: String with the error description.
**/
const char *
-gpgme_strerror (GpgmeError err)
+gpgme_strerror (gpgme_error_t err)
{
const char *s;
static char buf[25];
struct status_table_s {
const char *name;
- GpgmeStatusCode code;
+ gpgme_status_code_t code;
};
static struct status_table_s status_table[] =
#include "ops.h"
\f
-GpgmeError
-_gpgme_op_data_lookup (GpgmeCtx ctx, ctx_op_data_type type, void **hook,
+gpgme_error_t
+_gpgme_op_data_lookup (gpgme_ctx_t ctx, ctx_op_data_type type, void **hook,
int size, void (*cleanup) (void *))
{
struct ctx_op_data *data = ctx->op_data;
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);
}
\f
-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;
\f
/* From gpgme.c. */
-void _gpgme_release_result (GpgmeCtx ctx);
+void _gpgme_release_result (gpgme_ctx_t ctx);
\f
/* 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 );
\f
/* 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);
\f
/* 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);
\f
/* 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);
\f
/* 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);
\f
/* 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);
\f
/* 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);
\f
/* 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);
\f
/* 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);
\f
/* 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);
\f
/* 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);
\f
/* 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);
\f
/* 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);
\f
/*-- version.c --*/
}
\f
-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)
}
-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)
#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;
\f
/* 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)
/* 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;
/* 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;
/* 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);
/* 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)
/* 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;
/* 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)
}
/* 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;
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)
{
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. */
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 */
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;
\f
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;
}
}
-static GpgmeError
+static gpgme_error_t
add_arg (GpgObject gpg, const char *arg)
{
struct arg_and_data_s *a;
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;
}
-static GpgmeError
+static gpgme_error_t
gpg_new (void **engine)
{
GpgObject gpg;
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;
}
/* Kludge to process --with-colon output. */
-static GpgmeError
+static gpgme_error_t
gpg_set_colon_line_handler (void *engine, EngineColonLineHandler fnc,
void *fnc_value)
{
/* 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;
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)
}
-static GpgmeError
+static gpgme_error_t
build_argv (GpgObject gpg)
{
struct arg_and_data_s *a;
}
-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)
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;
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;
}
else if (gpg->status.fnc)
{
- GpgmeError err;
+ gpgme_error_t err;
err = gpg->status.fnc (gpg->status.fnc_value,
r->code, rest);
if (err)
}
-static GpgmeError
+static gpgme_error_t
status_handler (void *opaque, int fd)
{
GpgObject gpg = opaque;
}
-static GpgmeError
+static gpgme_error_t
read_colon_line (GpgObject gpg)
{
char *p;
/* 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);
}
-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;
}
-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");
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");
}
-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++)
{
}
-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)
}
-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)
}
-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");
}
-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)
}
-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)
}
-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;
}
-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)
}
-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)
}
-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;
}
-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");
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)
}
-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)
{
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;
/* 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;
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;
while (sig)
{
- GpgmeNewSignature next = sig->next;
+ gpgme_new_signature_t next = sig->next;
free (sig->fpr);
free (sig);
sig = next;
}
-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)
}
\f
-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));
}
-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);
}
-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,
}
-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)
/* 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;
/* Delete all signers from CTX. */
void
-gpgme_signers_clear (GpgmeCtx ctx)
+gpgme_signers_clear (gpgme_ctx_t ctx)
{
int i;
}
/* 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;
/* 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;
\f
/* 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)
\f
/* 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++;
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);
\f
/* 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;
/* 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;
struct trust_queue_item_s
{
struct trust_queue_item_s *next;
- GpgmeTrustItem item;
+ gpgme_trust_item_t item;
};
typedef struct
\f
-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;
}
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 */
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);
}
-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)
}
-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;
/* 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;
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
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 */
{
struct _gpgme_op_verify_result result;
- GpgmeSignature current_sig;
+ gpgme_signature_t current_sig;
} *op_data_t;
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);
}
-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)
\f
/* Build a summary vector from RESULT. */
static void
-calc_sig_summary (GpgmeSignature sig)
+calc_sig_summary (gpgme_signature_t sig)
{
unsigned long sum = 0;
}
-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)
}
-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, ' ');
}
-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)
}
-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, ' ');
}
-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;
}
-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)
}
-GpgmeError
-_gpgme_op_verify_init_result (GpgmeCtx ctx)
+gpgme_error_t
+_gpgme_op_verify_init_result (gpgme_ctx_t ctx)
{
op_data_t opd;
}
-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)
/* 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);
}
/* 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)
/* 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;
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;
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;
}
-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;
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
\f
/* 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)
/* 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;
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;
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);
{
case GPGME_EVENT_START:
{
- GpgmeError err = ctx_active (ctx);
+ gpgme_error_t err = ctx_active (ctx);
if (err)
{
case GPGME_EVENT_DONE:
{
- GpgmeError *errp = (GpgmeError *) type_data;
+ gpgme_error_t *errp = (gpgme_error_t *) type_data;
assert (errp);
ctx_done (ctx, *errp);
}
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
{
{
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);
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)
{
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)
{
/* 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
/* 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);
}
\f
/* 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);
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);
_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;
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);
/* 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;
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;
_gpgme_remove_io_cb (void *data)
{
struct tag *tag = data;
- GpgmeCtx ctx;
+ gpgme_ctx_t ctx;
fd_table_t fdt;
int idx;
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;
};
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;
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 */
{ \
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); \
} \
static void
-print_data (GpgmeData dh)
+print_data (gpgme_data_t dh)
{
#define BUF_SIZE 512
char buf[BUF_SIZE + 1];
}
-static GpgmeError
+static gpgme_error_t
passphrase_cb (void *opaque, const char *desc, void **hd, const char **result)
{
/* Cleanup by looking at *hd. */
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)
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;
{ \
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); \
} \
static void
-print_data (GpgmeData dh)
+print_data (gpgme_data_t dh)
{
#define BUF_SIZE 512
char buf[BUF_SIZE + 1];
}
-static GpgmeError
+static gpgme_error_t
passphrase_cb (void *opaque, const char *desc, void **hd, const char **result)
{
/* Cleanup by looking at *hd. */
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;
#include <gpgme.h>
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)); \
} while(0)
static void
-flush_data (GpgmeData dh)
+flush_data (gpgme_data_t dh)
{
char buf[100];
int ret;
}
-static GpgmeError
+static gpgme_error_t
passphrase_cb (void *opaque, const char *desc,
void **r_hd, const char **result)
{
}
-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);
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;
{ \
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); \
} \
static void
-print_data (GpgmeData dh)
+print_data (gpgme_data_t dh)
{
#define BUF_SIZE 512
char buf[BUF_SIZE + 1];
}
-static GpgmeError
+static gpgme_error_t
passphrase_cb (void *opaque, const char *desc, void **hd, const char **result)
{
/* Cleanup by looking at *hd. */
static void
-check_result (GpgmeSignResult result, GpgmeSigMode type)
+check_result (gpgme_sign_result_t result, gpgme_sig_mode_t type)
{
if (result->invalid_signers)
{
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);
#include <gpgme.h>
#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;
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)
{
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;
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);
{ \
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); \
} \
static void
-print_data (GpgmeData dh)
+print_data (gpgme_data_t dh)
{
#define BUF_SIZE 512
char buf[BUF_SIZE + 1];
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);
#include <gpgme.h>
#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;
struct op_result
{
int done;
- GpgmeError err;
+ gpgme_error_t err;
};
struct op_result op_result;
{
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;
}
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;
}
}
return 0;
}
-struct GpgmeIOCbs io_cbs =
+struct gpgme_io_cbs io_cbs =
{
add_io_cb,
fdlist,
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++)
#include <gpgme.h>
#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;
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);
{ \
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); \
} \
int
main (int argc, char **argv)
{
- GpgmeCtx ctx;
- GpgmeError err;
+ gpgme_ctx_t ctx;
+ gpgme_error_t err;
const char *parms = "<GnupgKeyParms format=\"internal\">\n"
"Key-Type: DSA\n"
"Key-Length: 1024\n"
"Expire-Date: 0\n"
"Passphrase: abc\n"
"</GnupgKeyParms>\n";
- GpgmeGenKeyResult result;
+ gpgme_genkey_result_t result;
err = gpgme_new (&ctx);
fail_if_err (err);
{ \
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); \
} \
void
-check_result (GpgmeImportResult result, char *fpr, int secret)
+check_result (gpgme_import_result_t result, char *fpr, int secret)
{
if (result->considered != 1)
{
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");
{ \
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); \
} \
char *email;
struct
{
- GpgmePubKeyAlgo algo;
+ gpgme_pubkey_algo_t algo;
char *keyid;
char *name;
char *comment;
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;
{ \
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); \
} \
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);
{ \
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); \
} \
static void
-print_data (GpgmeData dh)
+print_data (gpgme_data_t dh)
{
#define BUF_SIZE 512
char buf[BUF_SIZE + 1];
}
-static GpgmeError
+static gpgme_error_t
passphrase_cb (void *opaque, const char *desc, void **hd, const char **result)
{
/* Cleanup by looking at *hd. */
static void
-check_result (GpgmeSignResult result, GpgmeSigMode type)
+check_result (gpgme_sign_result_t result, gpgme_sig_mode_t type)
{
if (result->invalid_signers)
{
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);
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);
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);
-/* 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
{ \
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); \
} \
static void
-print_data (GpgmeData dh)
+print_data (gpgme_data_t dh)
{
#define BUF_SIZE 512
char buf[BUF_SIZE + 1];
}
-static GpgmeError
+static gpgme_error_t
passphrase_cb (void *opaque, const char *desc, void **hd, const char **result)
{
/* Cleanup by looking at *hd. */
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)
{
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);
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);
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);
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);
{ \
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); \
} \
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);
{ \
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); \
} \
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)
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);
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);
"-----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)); \
} while(0)
static void
-print_data (GpgmeData dh)
+print_data (gpgme_data_t dh)
{
#define BUF_SIZE 512
char buf[BUF_SIZE + 1];
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);
{ \
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); \
} \
static void
-print_data (GpgmeData dh)
+print_data (gpgme_data_t dh)
{
#define BUF_SIZE 512
char buf[BUF_SIZE + 1];
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);
#include <gpgme.h>
#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;
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);
{ \
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); \
} \
static void
-print_data (GpgmeData dh)
+print_data (gpgme_data_t dh)
{
#define BUF_SIZE 512
char buf[BUF_SIZE + 1];
int
main (int argc, char **argv)
{
- GpgmeCtx ctx;
- GpgmeError err;
+ gpgme_ctx_t ctx;
+ gpgme_error_t err;
const char *parms = "<GnupgKeyParms format=\"internal\">\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"
"</GnupgKeyParms>\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);
{ \
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); \
} \
void
-check_result (GpgmeImportResult result, char *fpr, int total)
+check_result (gpgme_import_result_t result, char *fpr, int total)
{
if (result->considered != 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");
{ \
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); \
} \
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);
{ \
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); \
} \
static void
-print_data (GpgmeData dh)
+print_data (gpgme_data_t dh)
{
#define BUF_SIZE 512
char buf[BUF_SIZE + 1];
static void
-check_result (GpgmeSignResult result, GpgmeSigMode type)
+check_result (gpgme_sign_result_t result, gpgme_sig_mode_t type)
{
if (result->invalid_signers)
{
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);
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);
{ \
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); \
} \
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)
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);
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);
-/* 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.
#include <gpgme.h>
-#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 *
}
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;
}
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;
}
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;
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);
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)
{
{ \
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); \
} \
\f
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)
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);
static const char version[] = VERSION;
int
-main (int argc, char **argv )
+main (int argc, char **argv)
{
const char *null_result;
const char *current_result;