Update ASN1 printing code and add a -print option to 'pkcs7' utility for
[openssl.git] / crypto / asn1 / asn1t.h
index 9f5d60947e33e3c79cc47aa01dc8d94dd2dbc18d..b44f75c2341c972afccddc508725ecfc71957c5f 100644 (file)
@@ -832,6 +832,17 @@ typedef struct ASN1_AUX_st {
         return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
         }
 
+#define IMPLEMENT_ASN1_PRINT_FUNCTION(stname) \
+       IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, stname, stname)
+
+#define IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, itname, fname) \
+       int fname##_print(BIO *out, stname *x, int indent, \
+                                               const ASN1_PCTX *pctx) \
+       { \
+               return ASN1_item_print(out, (ASN1_VALUE *)x, indent, \
+                       ASN1_ITEM_rptr(itname), pctx); \
+       } 
+
 #define IMPLEMENT_ASN1_FUNCTIONS_const(name) \
                IMPLEMENT_ASN1_FUNCTIONS_const_fname(name, name, name)