summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/asn1t.h
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2007-05-10 17:34:42 +0000
committerDr. Stephen Henson <steve@openssl.org>2007-05-10 17:34:42 +0000
commitf8492ffeaa9fa1587c8aae9b816fb61cd5eaa83c (patch)
tree638052ac15f22921aed80bc0196ea05e5f5a0ce5 /crypto/asn1/asn1t.h
parent308595638a32b3f8fe7e4823c227bdc795f6480c (diff)
More useful ASN1 macros for static allocation functions.
Diffstat (limited to 'crypto/asn1/asn1t.h')
-rw-r--r--crypto/asn1/asn1t.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/crypto/asn1/asn1t.h b/crypto/asn1/asn1t.h
index 16a1db24aa..c7e394bfe3 100644
--- a/crypto/asn1/asn1t.h
+++ b/crypto/asn1/asn1t.h
@@ -368,6 +368,10 @@ extern "C" {
#define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
+/* EXPLICIT using indefinite length constructed form */
+#define ASN1_NDEF_EXP(stname, field, type, tag) \
+ ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_NDEF)
+
/* EXPLICIT OPTIONAL using indefinite length constructed form */
#define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF)
@@ -790,19 +794,25 @@ typedef struct ASN1_PRINT_ARG_st {
#define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \
IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname)
+#define IMPLEMENT_STATIC_ASN1_ALLOC_FUNCTIONS(stname) \
+ IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(static, stname, stname, stname)
+
#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS(stname) \
IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname)
-#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \
- stname *fname##_new(void) \
+#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(pre, stname, itname, fname) \
+ pre stname *fname##_new(void) \
{ \
return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
} \
- void fname##_free(stname *a) \
+ pre void fname##_free(stname *a) \
{ \
ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
}
+#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \
+ IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(/**/, stname, itname, fname)
+
#define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname) \
IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)