Next: , Previous: , Up: Miscellaneous operations   [Contents][Index]


7.7.2 Using the Assuan protocol

The Assuan protocol can be used to talk to arbitrary Assuan servers. By default it is connected to the GnuPG agent, but it may be connected to arbitrary servers by using gpgme_ctx_set_engine_info, passing the location of the servers socket as file_name argument, and an empty string as home_dir argument.

The Assuan protocol functions use three kinds of callbacks to transfer data:

Data type: gpgme_error_t (*gpgme_assuan_data_cb_t) (void *opaque, const void *data, size_t datalen)

SINCE: 1.2.0

This callback receives any data sent by the server. opaque is the pointer passed to gpgme_op_assuan_transact_start, data of length datalen refers to the data sent.

Data type: gpgme_error_t (*gpgme_assuan_inquire_cb_t) (void *opaque, const char *name, const char *args, gpgme_data_t *r_data)

SINCE: 1.2.0

This callback is used to provide additional data to the Assuan server. opaque is the pointer passed to gpgme_op_assuan_transact_start, name and args specify what kind of data the server requested, and r_data is used to return the actual data.

Note: Returning data is currently not implemented in GPGME.

Data type: gpgme_error_t (*gpgme_assuan_status_cb_t) (void *opaque, const char *status, const char *args)

SINCE: 1.2.0

This callback receives any status lines sent by the server. opaque is the pointer passed to gpgme_op_assuan_transact_start, status and args denote the status update sent.

Function: gpgme_error_t gpgme_op_assuan_transact_start (gpgme_ctx_t ctx, const char *command, gpgme_assuan_data_cb_t data_cb, void * data_cb_value, gpgme_assuan_inquire_cb_t inquire_cb, void * inquire_cb_value, gpgme_assuan_status_cb_t status_cb, void * status_cb_value)

SINCE: 1.2.0

Send the Assuan command and return results via the callbacks. Any callback may be NULL. The result of the operation may be retrieved using gpgme_wait_ext.

Asynchronous variant.

Function: gpgme_error_t gpgme_op_assuan_transact_ext (gpgme_ctx_t ctx, const char *command, gpgme_assuan_data_cb_t data_cb, void * data_cb_value, gpgme_assuan_inquire_cb_t inquire_cb, void * inquire_cb_value, gpgme_assuan_status_cb_t status_cb, void * status_cb_value, gpgme_error_t *op_err)

Send the Assuan command and return results via the callbacks. The result of the operation is returned in op_err.

Synchronous variant.


Next: How to check for software updates, Previous: Running other Programs, Up: Miscellaneous operations   [Contents][Index]