summaryrefslogtreecommitdiffstats
path: root/ffi/include/sequoia/core.h
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2018-03-15 12:13:04 +0100
committerJustus Winter <justus@sequoia-pgp.org>2018-03-15 12:13:04 +0100
commit8e7d1fb864520425006363fbfdff6b96a5015ed2 (patch)
tree75bd927c22936a51d2f7b3a8ab7bee7085926a79 /ffi/include/sequoia/core.h
parentdd257663217d6d2c098d5a57d8a3f8c5a830310f (diff)
ffi: Improve error reporting when creating contexts.
- Usually, we report complex errors by attaching them to the ffi context. However, when we create the contexts, there is no context to attach the error to. Therefore, we add an explicit error argument here.
Diffstat (limited to 'ffi/include/sequoia/core.h')
-rw-r--r--ffi/include/sequoia/core.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/ffi/include/sequoia/core.h b/ffi/include/sequoia/core.h
index da6732aa..d693bb0c 100644
--- a/ffi/include/sequoia/core.h
+++ b/ffi/include/sequoia/core.h
@@ -134,9 +134,10 @@ typedef enum sq_ipc_policy {
/// suggested to use a reversed fully qualified domain name that is
/// associated with your application. `domain` must not be `NULL`.
///
-/// Returns `NULL` on errors.
+/// Returns `NULL` on errors. If `errp` is not `NULL`, the error is
+/// stored there.
/*/
-sq_context_t sq_context_new(const char *domain);
+sq_context_t sq_context_new(const char *domain, sq_error_t *errp);
/*/
/// Frees a context.
@@ -192,9 +193,10 @@ uint8_t sq_context_ephemeral(const sq_context_t ctx);
/*/
/// Finalizes the configuration and return a `Context`.
///
-/// Consumes `cfg`. Returns `NULL` on errors.
+/// Consumes `cfg`. Returns `NULL` on errors. Returns `NULL` on
+/// errors. If `errp` is not `NULL`, the error is stored there.
/*/
-sq_context_t sq_config_build(sq_config_t cfg);
+sq_context_t sq_config_build(sq_config_t cfg, sq_error_t *errp);
/*/
/// Sets the directory containing shared state.