summaryrefslogtreecommitdiffstats
path: root/openpgp-ffi/examples
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-01-29 15:44:42 +0100
committerJustus Winter <justus@sequoia-pgp.org>2019-01-29 17:41:26 +0100
commit6b06c05cb99d2e7396fdf3d3d1c2e6f92d954dad (patch)
tree2e85b193992224fcca9cfea358b70118ab2f5378 /openpgp-ffi/examples
parent009bb9b5267930b4898240d5405d73df81b9ae22 (diff)
openpgp-ffi: Use generated to_string() function.
Diffstat (limited to 'openpgp-ffi/examples')
-rw-r--r--openpgp-ffi/examples/armor.c4
-rw-r--r--openpgp-ffi/examples/encrypt-for.c10
-rw-r--r--openpgp-ffi/examples/example.c2
-rw-r--r--openpgp-ffi/examples/parser.c4
-rw-r--r--openpgp-ffi/examples/reader.c2
5 files changed, 11 insertions, 11 deletions
diff --git a/openpgp-ffi/examples/armor.c b/openpgp-ffi/examples/armor.c
index 4c47be6c..00873761 100644
--- a/openpgp-ffi/examples/armor.c
+++ b/openpgp-ffi/examples/armor.c
@@ -32,7 +32,7 @@ main (int argc, char **argv)
header = pgp_armor_reader_headers (&err, armor, &header_len);
if (header == NULL)
- error (1, 0, "Getting headers failed: %s", pgp_error_string (err));
+ error (1, 0, "Getting headers failed: %s", pgp_error_to_string (err));
assert (header_len == 2);
assert (strcmp (header[0].key, "Key0") == 0
@@ -50,7 +50,7 @@ main (int argc, char **argv)
assert (kind == PGP_ARMOR_KIND_FILE);
if (pgp_reader_read (&err, armor, (uint8_t *) message, 12) < 0)
- error (1, 0, "Reading failed: %s", pgp_error_string (err));
+ error (1, 0, "Reading failed: %s", pgp_error_to_string (err));
assert (memcmp (message, "Hello world!", 12) == 0);
diff --git a/openpgp-ffi/examples/encrypt-for.c b/openpgp-ffi/examples/encrypt-for.c
index b34d3a9f..16295678 100644
--- a/openpgp-ffi/examples/encrypt-for.c
+++ b/openpgp-ffi/examples/encrypt-for.c
@@ -46,7 +46,7 @@ main (int argc, char **argv)
tpk = pgp_tpk_from_bytes (&err, b, st.st_size);
if (tpk == NULL)
- error (1, 0, "pgp_packet_parser_from_bytes: %s", pgp_error_string (err));
+ error (1, 0, "pgp_packet_parser_from_bytes: %s", pgp_error_to_string (err));
sink = pgp_writer_alloc (&cipher, &cipher_bytes);
@@ -61,11 +61,11 @@ main (int argc, char **argv)
&tpk, 1,
PGP_ENCRYPTION_MODE_FOR_TRANSPORT);
if (writer == NULL)
- error (1, 0, "pgp_encryptor_new: %s", pgp_error_string (err));
+ error (1, 0, "pgp_encryptor_new: %s", pgp_error_to_string (err));
writer = pgp_literal_writer_new (&err, writer);
if (writer == NULL)
- error (1, 0, "pgp_literal_writer_new: %s", pgp_error_string (err));
+ error (1, 0, "pgp_literal_writer_new: %s", pgp_error_to_string (err));
size_t nread;
uint8_t buf[4096];
@@ -77,7 +77,7 @@ main (int argc, char **argv)
ssize_t written;
written = pgp_writer_stack_write (&err, writer, b, nread);
if (written < 0)
- error (1, 0, "pgp_writer_stack_write: %s", pgp_error_string (err));
+ error (1, 0, "pgp_writer_stack_write: %s", pgp_error_to_string (err));
b += written;
nread -= written;
@@ -87,7 +87,7 @@ main (int argc, char **argv)
rc = pgp_writer_stack_finalize (&err, writer);
writer = NULL;
if (rc)
- error (1, 0, "pgp_writer_stack_write: %s", pgp_error_string (err));
+ error (1, 0, "pgp_writer_stack_write: %s", pgp_error_to_string (err));
fwrite (cipher, 1, cipher_bytes, stdout);
diff --git a/openpgp-ffi/examples/example.c b/openpgp-ffi/examples/example.c
index c23b4381..5b114d8f 100644
--- a/openpgp-ffi/examples/example.c
+++ b/openpgp-ffi/examples/example.c
@@ -36,7 +36,7 @@ main (int argc, char **argv)
tpk = pgp_tpk_from_bytes (&err, b, st.st_size);
if (tpk == NULL)
- error (1, 0, "pgp_tpk_from_bytes: %s", pgp_error_string (err));
+ error (1, 0, "pgp_tpk_from_bytes: %s", pgp_error_to_string (err));
char *debug = pgp_tpk_debug (tpk);
printf ("%s", debug);
diff --git a/openpgp-ffi/examples/parser.c b/openpgp-ffi/examples/parser.c
index 3f9d90ab..db6a95d7 100644
--- a/openpgp-ffi/examples/parser.c
+++ b/openpgp-ffi/examples/parser.c
@@ -61,7 +61,7 @@ main (int argc, char **argv)
rc = pgp_packet_parser_next (&err, pp, &p, &ppr);
if (rc)
error (1, 0, "pgp_packet_parser_from_bytes: %s",
- pgp_error_string (err));
+ pgp_error_to_string (err));
// We now own p. If we want, we can save it in some structure.
// This would be useful when collecting PKESK packets. Either
@@ -82,7 +82,7 @@ main (int argc, char **argv)
}
}
if (ppr == NULL)
- error (1, 0, "pgp_packet_parser_from_bytes: %s", pgp_error_string (err));
+ error (1, 0, "pgp_packet_parser_from_bytes: %s", pgp_error_to_string (err));
fprintf (stderr, "Parsed %ld packets in %ld seconds, %.2f packets/s.\n",
n, elapsed, (double) n / (double) elapsed);
diff --git a/openpgp-ffi/examples/reader.c b/openpgp-ffi/examples/reader.c
index 125b0e37..a293bd80 100644
--- a/openpgp-ffi/examples/reader.c
+++ b/openpgp-ffi/examples/reader.c
@@ -38,7 +38,7 @@ main (int argc, char **argv)
reader = pgp_reader_from_bytes (b, st.st_size);
tpk = pgp_tpk_from_reader (&err, reader);
if (tpk == NULL)
- error (1, 0, "pgp_tpk_from_reader: %s", pgp_error_string (err));
+ error (1, 0, "pgp_tpk_from_reader: %s", pgp_error_to_string (err));
char *debug = pgp_tpk_debug (tpk);
printf ("%s", debug);