[Pkg-gnupg-commit] [gnupg2] 84/205: common: Provide a function for mapping packet types to strings.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed May 11 08:38:20 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch experimental
in repository gnupg2.

commit 24e0f1d56e6f56e7fb52b5c6bdb100131e12dfe3
Author: Neal H. Walfield <neal at g10code.com>
Date:   Wed Mar 2 15:45:39 2016 +0100

    common: Provide a function for mapping packet types to strings.
    
    * common/openpgpdefs.h (pkttype_str): New function.
    
    --
    Signed-off-by: Neal H. Walfield <neal at g10code.com>
---
 common/openpgpdefs.h | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/common/openpgpdefs.h b/common/openpgpdefs.h
index c81109a..e200d6b 100644
--- a/common/openpgpdefs.h
+++ b/common/openpgpdefs.h
@@ -56,6 +56,34 @@ typedef enum
   }
 pkttype_t;
 
+static inline const char *
+pkttype_str (pkttype_t type)
+{
+  switch (type)
+    {
+    case PKT_PUBKEY_ENC: return "PUBKEY_ENC";
+    case PKT_SIGNATURE: return "SIGNATURE";
+    case PKT_SYMKEY_ENC: return "SYMKEY_ENC";
+    case PKT_ONEPASS_SIG: return "ONEPASS_SIG";
+    case PKT_SECRET_KEY: return "SECRET_KEY";
+    case PKT_PUBLIC_KEY: return "PUBLIC_KEY";
+    case PKT_SECRET_SUBKEY: return "SECRET_SUBKEY";
+    case PKT_COMPRESSED: return "COMPRESSED";
+    case PKT_ENCRYPTED: return "ENCRYPTED";
+    case PKT_MARKER: return "MARKER";
+    case PKT_PLAINTEXT: return "PLAINTEXT";
+    case PKT_RING_TRUST: return "RING_TRUST";
+    case PKT_USER_ID: return "USER_ID";
+    case PKT_PUBLIC_SUBKEY: return "PUBLIC_SUBKEY";
+    case PKT_OLD_COMMENT: return "OLD_COMMENT";
+    case PKT_ATTRIBUTE: return "ATTRIBUTE";
+    case PKT_ENCRYPTED_MDC: return "ENCRYPTED_MDC";
+    case PKT_MDC: return "MDC";
+    case PKT_COMMENT: return "COMMENT";
+    case PKT_GPG_CONTROL: return "GPG_CONTROL";
+    default: return "unknown packet type";
+    }
+}
 
 typedef enum
   {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list