The detailed result of an operation is returned in operation-specific
structures such as gpgme_decrypt_result_t. The corresponding
retrieval functions such as gpgme_op_decrypt_result provide
static access to the results after an operation completes. The
following interfaces make it possible to detach a result structure
from its associated context and give it a lifetime beyond that of the
current operation or context.
The function
gpgme_result_refacquires an additional reference for the result result, which may be of any typegpgme_*_result_t. As long as the user holds a reference, the result structure is guaranteed to be valid and unmodified.
The function
gpgme_result_unrefreleases a reference for the result result. If this was the last reference, the result structure will be destroyed and all resources associated to it will be released.
Note that a context may hold its own references to result structures,
typically until the context is destroyed or the next operation is
started. In fact, these references are accessed through the
gpgme_op_*_result functions.