summaryrefslogtreecommitdiffstats
path: root/openpgp-ffi
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-04-29 14:12:42 +0200
committerJustus Winter <justus@sequoia-pgp.org>2019-04-29 14:37:23 +0200
commit36ed0f847c4f033c67fca9f2a332598b5effc107 (patch)
treecbc351bfaad086d7f359a3f43de995b0769e6df6 /openpgp-ffi
parent1bba42e5f1e6b6d4f399a019a31ec4b889919faa (diff)
openpgp-ffi: Move packet prototypes to a new file.
Diffstat (limited to 'openpgp-ffi')
-rw-r--r--openpgp-ffi/include/sequoia/openpgp.h34
-rw-r--r--openpgp-ffi/include/sequoia/openpgp/packet.h40
2 files changed, 41 insertions, 33 deletions
diff --git a/openpgp-ffi/include/sequoia/openpgp.h b/openpgp-ffi/include/sequoia/openpgp.h
index aa7e117c..ae005999 100644
--- a/openpgp-ffi/include/sequoia/openpgp.h
+++ b/openpgp-ffi/include/sequoia/openpgp.h
@@ -12,6 +12,7 @@
#include <sequoia/openpgp/types.h>
#include <sequoia/openpgp/error.h>
#include <sequoia/openpgp/crypto.h>
+#include <sequoia/openpgp/packet.h>
/* sequoia::openpgp::KeyID. */
@@ -51,8 +52,6 @@ char *pgp_keyid_to_string (const pgp_keyid_t fp);
/*/
char *pgp_keyid_debug (const pgp_keyid_t fp);
-char *pgp_packet_debug (const pgp_packet_t fp);
-
/*/
/// Converts the KeyID to a hexadecimal number.
/*/
@@ -199,37 +198,6 @@ pgp_writer_t pgp_armor_writer_new (pgp_error_t *errp, pgp_writer_t inner,
pgp_armor_header_t header, size_t header_len);
-
-/*/
-/// Returns a human-readable tag name.
-/*/
-const char *pgp_tag_to_string (pgp_tag_t tag);
-
-/*/
-/// Frees the Packet.
-/*/
-void pgp_packet_free (pgp_packet_t p);
-
-/*/
-/// Returns the `Packet's` corresponding OpenPGP tag.
-///
-/// Tags are explained in [Section 4.3 of RFC 4880].
-///
-/// [Section 4.3 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-4.3
-/*/
-pgp_tag_t pgp_packet_tag (pgp_packet_t p);
-
-/*/
-/// Returns the parsed `Packet's` corresponding OpenPGP tag.
-///
-/// Returns the packets tag, but only if it was successfully
-/// parsed into the corresponding packet type. If e.g. a
-/// Signature Packet uses some unsupported methods, it is parsed
-/// into an `Packet::Unknown`. `tag()` returns `PGP_TAG_SIGNATURE`,
-/// whereas `kind()` returns `0`.
-/*/
-pgp_tag_t pgp_packet_kind (pgp_packet_t p);
-
/* openpgp::PacketPile. */
/*/
diff --git a/openpgp-ffi/include/sequoia/openpgp/packet.h b/openpgp-ffi/include/sequoia/openpgp/packet.h
new file mode 100644
index 00000000..7d9f3f07
--- /dev/null
+++ b/openpgp-ffi/include/sequoia/openpgp/packet.h
@@ -0,0 +1,40 @@
+#ifndef SEQUOIA_OPENPGP_PACKET_H
+#define SEQUOIA_OPENPGP_PACKET_H
+
+/*/
+/// Returns a human-readable tag name.
+/*/
+const char *pgp_tag_to_string (pgp_tag_t tag);
+
+/*/
+/// Frees the Packet.
+/*/
+void pgp_packet_free (pgp_packet_t p);
+
+/*/
+/// Returns a human readable description of this object suitable for
+/// debugging.
+/*/
+char *pgp_packet_debug (const pgp_packet_t fp);
+
+/*/
+/// Returns the `Packet's` corresponding OpenPGP tag.
+///
+/// Tags are explained in [Section 4.3 of RFC 4880].
+///
+/// [Section 4.3 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-4.3
+/*/
+pgp_tag_t pgp_packet_tag (pgp_packet_t p);
+
+/*/
+/// Returns the parsed `Packet's` corresponding OpenPGP tag.
+///
+/// Returns the packets tag, but only if it was successfully
+/// parsed into the corresponding packet type. If e.g. a
+/// Signature Packet uses some unsupported methods, it is parsed
+/// into an `Packet::Unknown`. `tag()` returns `PGP_TAG_SIGNATURE`,
+/// whereas `kind()` returns `0`.
+/*/
+pgp_tag_t pgp_packet_kind (pgp_packet_t p);
+
+#endif