lib: Define and use cleanup functions for gpgme

Just a cleanup in preparation for future work.

Closes: #575
Approved by: giuseppe
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2016-11-17 09:44:07 +00:00
1 parent bd45e7ac19
commit a6cfe62eb8
3 files changed
+12 -23

No files matched your search

+6
View File
@@ -22,9 +22,15 @@
#include <gpgme.h>
#include <gio/gio.h>
#include "libglnx.h"
G_BEGIN_DECLS
GLNX_DEFINE_CLEANUP_FUNCTION0(gpgme_data_t, ot_cleanup_gpgme_data, gpgme_data_release)
#define ot_auto_gpgme_data __attribute__((cleanup(ot_cleanup_gpgme_data)))
GLNX_DEFINE_CLEANUP_FUNCTION0(gpgme_ctx_t, ot_cleanup_gpgme_ctx, gpgme_release)
#define ot_auto_gpgme_ctx __attribute__((cleanup(ot_cleanup_gpgme_ctx)))
void ot_gpgme_error_to_gio_error (gpgme_error_t gpg_error, GError **error);
gboolean ot_gpgme_ctx_tmp_home_dir (gpgme_ctx_t gpgme_ctx,