diff options
author | Justus Winter <justus@pep-project.org> | 2017-12-12 14:51:11 +0100 |
---|---|---|
committer | Justus Winter <justus@pep-project.org> | 2017-12-12 14:56:29 +0100 |
commit | 5b0d38acf656edb2b9f35e64ccc82ad555c67d30 (patch) | |
tree | 72319054e4dc7ae7a5a04dfbb94ed107156fb653 /src | |
parent | 79bf350ea260356842b7005fba955a30b082fdcd (diff) |
Fix formatting and improve documentation.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/mod.rs | 2 | ||||
-rw-r--r-- | src/sequoia.h | 28 |
2 files changed, 26 insertions, 4 deletions
diff --git a/src/net/mod.rs b/src/net/mod.rs index c224f199..139530af 100644 --- a/src/net/mod.rs +++ b/src/net/mod.rs @@ -254,7 +254,7 @@ impl From<hyper::StatusCode> for Error { } } - impl From<io::Error> for Error { +impl From<io::Error> for Error { fn from(error: io::Error) -> Self { Error::IoError(error) } diff --git a/src/sequoia.h b/src/sequoia.h index 4755658a..09ce1ab3 100644 --- a/src/sequoia.h +++ b/src/sequoia.h @@ -4,19 +4,23 @@ #include <stddef.h> #include <stdint.h> + +/* sequoia::Context. */ + /*/ -/// A `&Context` is required for many operations. +/// A `struct sq_context *` is required for many operations. /// /// # Example /// /// ```c /// struct sq_context *ctx sq_context_new("org.sequoia-pgp.example"); -/// if (ctx == 0) { ... } +/// if (ctx == NULL) { ... } /// ``` /*/ struct sq_context; /*/ +/// Represents a `Context` configuration. /*/ struct sq_config; @@ -64,7 +68,8 @@ const char *sq_context_home(const struct sq_context *ctx); /*/ const char *sq_context_lib(const struct sq_context *ctx); -/* sequoia::Config. */ + +/* sequoia::Config. */ /*/ /// Finalizes the configuration and return a `Context`. @@ -83,9 +88,26 @@ void sq_config_home(struct sq_config *cfg, const char *home); /*/ void sq_config_lib(struct sq_config *cfg, const char *lib); +/* sequoia::openpgp::types. */ + +/*/ +/// Uniquely identifies OpenPGP keys. +/*/ struct sq_keyid; + +/*/ +/// Returns a KeyID with the given `id`. +/*/ struct sq_keyid *sq_keyid_new (uint64_t id); + +/*/ +/// Returns a KeyID with the given `id` encoded as hexadecimal string. +/*/ struct sq_keyid *sq_keyid_from_hex (const char *id); + +/*/ +/// Frees a keyid object. +/*/ void sq_keyid_free (struct sq_keyid *keyid); struct sq_tpk; |