diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-01-22 13:23:54 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-01-22 17:47:45 +0100 |
commit | ebb0d43ba773ec13e47d74b7baf035aaf7f0fb17 (patch) | |
tree | 2c7f55f52486c9e5ca9cb51663d9d3301d810abc /ffi | |
parent | 20e89f09aa9cae3dd56ffff1b45d88ddbf3d0acd (diff) |
openpgp-ffi: Wrap Fingerprint.
Diffstat (limited to 'ffi')
-rw-r--r-- | ffi/lang/python/sequoia/glue.py | 7 | ||||
-rw-r--r-- | ffi/lang/python/sequoia/openpgp.py | 1 | ||||
-rw-r--r-- | ffi/src/lib.rs | 5 |
3 files changed, 12 insertions, 1 deletions
diff --git a/ffi/lang/python/sequoia/glue.py b/ffi/lang/python/sequoia/glue.py index 11468dfd..ea40d20c 100644 --- a/ffi/lang/python/sequoia/glue.py +++ b/ffi/lang/python/sequoia/glue.py @@ -28,6 +28,7 @@ class SQObject(object): _clone = None _eq = None _str = None + _debug = None _hash = None def __init__(self, o, context=None, owner=None, references=None): @@ -96,6 +97,12 @@ class SQObject(object): def __hash__(self): return self._hash(self.ref()) + def debug(self): + if self._debug: + return _str(self._debug(self.ref())) + else: + raise NotImplementedError() + def sq_str(s): t = ffi.string(s).decode() lib.free(s) diff --git a/ffi/lang/python/sequoia/openpgp.py b/ffi/lang/python/sequoia/openpgp.py index 46cf50b5..4689baea 100644 --- a/ffi/lang/python/sequoia/openpgp.py +++ b/ffi/lang/python/sequoia/openpgp.py @@ -30,6 +30,7 @@ class Fingerprint(SQObject): _del = lib.pgp_fingerprint_free _clone = lib.pgp_fingerprint_clone _str = lib.pgp_fingerprint_to_string + _debug = lib.pgp_fingerprint_debug _eq = lib.pgp_fingerprint_equal _hash = lib.pgp_fingerprint_hash diff --git a/ffi/src/lib.rs b/ffi/src/lib.rs index 38b719f9..f183f9cc 100644 --- a/ffi/src/lib.rs +++ b/ffi/src/lib.rs @@ -114,7 +114,10 @@ extern crate libc; extern crate native_tls; extern crate sequoia_ffi_macros; -use sequoia_ffi_macros::ffi_catch_abort; +use sequoia_ffi_macros::{ + ffi_catch_abort, + ffi_wrapper_type, +}; extern crate sequoia_core; extern crate sequoia_net; extern crate sequoia_store; |