diff options
author | Justus Winter <justus@pep-project.org> | 2017-11-30 18:52:45 +0100 |
---|---|---|
committer | Justus Winter <justus@pep-project.org> | 2017-12-01 13:54:28 +0100 |
commit | 8659731e6ecd694e7fa87799497aeb0338b7292c (patch) | |
tree | c5a9f0b6a30a6052ae063945506c90d890409bab /examples | |
parent | e55151e501270875731cb89e83dd4e16402de025 (diff) |
Create context objects.
- Context objects can be used to tweak the library configuration.
Currently, a home and lib directory can be set. Reasonable
defaults are provided.
- Add ffi functions.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/example.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/example.c b/examples/example.c index ae727b43..81209a7e 100644 --- a/examples/example.c +++ b/examples/example.c @@ -16,11 +16,16 @@ main (int argc, char **argv) struct stat st; int fd; char *b; + struct sq_context *ctx; struct sq_tpk *tpk; if (argc != 2) error (1, 0, "Usage: %s <file>", argv[0]); + ctx = sq_context_new(NULL, NULL); + if (ctx == NULL) + error (1, 0, "Initializing sequoia failed."); + if (stat (argv[1], &st)) error (1, errno, "%s", argv[1]); @@ -38,6 +43,7 @@ main (int argc, char **argv) sq_tpk_dump (tpk); sq_tpk_free (tpk); + sq_context_free (ctx); munmap (b, st.st_size); close (fd); return 0; |