aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/gpgme.i
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-05-31 14:21:06 +0000
committerJustus Winter <[email protected]>2016-05-31 14:22:31 +0000
commitafa0dd56e1cce64fe08bff3c64b12aecce54fd2d (patch)
treec0bb97f2ab319e192a09b4b918a77926d7b477aa /lang/python/gpgme.i
parentbuild: Fix URL. (diff)
downloadgpgme-afa0dd56e1cce64fe08bff3c64b12aecce54fd2d.tar.gz
gpgme-afa0dd56e1cce64fe08bff3c64b12aecce54fd2d.zip
python: Port more tests.
* lang/python/gpgme.i: Hide length fields of notations. * lang/python/tests/Makefile.am (pytests): Add new tests. * lang/python/tests/t-decrypt-verify.py: New file. * lang/python/tests/t-sig-notation.py: Likewise. * lang/python/tests/t-verify.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'lang/python/gpgme.i')
-rw-r--r--lang/python/gpgme.i36
1 files changed, 31 insertions, 5 deletions
diff --git a/lang/python/gpgme.i b/lang/python/gpgme.i
index 5b3c193b..87fe90d2 100644
--- a/lang/python/gpgme.i
+++ b/lang/python/gpgme.i
@@ -255,11 +255,37 @@ PyObject* object_to_gpgme_t(PyObject* input, const char* objtype, int argnum) {
$2 = $input;
}
-// Include the header file both for cc (first) and for swig (second)
-// Include for swig locally since we need to fix 'class' usage there.
-%{
-#include <gpgme.h>
-%}
+/* Include the unmodified <gpgme.h> for cc, and the cleaned-up local
+ version for SWIG. We do, however, want to hide certain fields on
+ some structs, which we provide prior to including the version for
+ SWIG. */
+ %{ #include <gpgme.h> %}
+
+/* This is for notations, where we want to hide the length fields, and
+ the unused bit field block. */
+struct _gpgme_sig_notation
+{
+ struct _gpgme_sig_notation *next;
+
+ /* If NAME is a null pointer, then VALUE contains a policy URL
+ rather than a notation. */
+ char *name;
+
+ /* The value of the notation data. */
+ char *value;
+
+ /* The accumulated flags. */
+ gpgme_sig_notation_flags_t flags;
+
+ /* Notation data is human-readable. */
+ unsigned int human_readable : 1;
+
+ /* Notation data is critical. */
+ unsigned int critical : 1;
+};
+
+/* Now include our local modified version. Any structs defined above
+ are ignored. */
%include "gpgme.h"
%include "errors.i"