Update HPUX config, work around HPUX library incompatibility.
[openssl.git] / crypto / asn1 / asn1.h
index 7ce7eb3fe2270d404818eb32503a6afef0cf67bf..5050d572e47dd3810377aab8e840fb77dc99a2b3 100644 (file)
@@ -66,6 +66,7 @@ extern "C" {
 #include <time.h>
 #include <openssl/bn.h>
 #include <openssl/stack.h>
+#include <openssl/safestack.h>
 
 #define V_ASN1_UNIVERSAL               0x00
 #define        V_ASN1_APPLICATION              0x40
@@ -127,6 +128,33 @@ extern "C" {
 #define B_ASN1_UNKNOWN         0x1000
 #define B_ASN1_UTF8STRING      0x2000
 
+#define DECLARE_ASN1_SET_OF(type) \
+int i2d_ASN1_SET_OF_##type(STACK_OF(type) *a,unsigned char **pp, \
+                          int (*func)(type *,unsigned char **), int ex_tag, \
+                          int ex_class, int is_set); \
+STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \
+                                      long length, \
+                                      type *(*func)(type **, \
+                                                    unsigned char **,long), \
+                                      void (*free_func)(type *), \
+                                      int ex_tag,int ex_class);
+
+#define IMPLEMENT_ASN1_SET_OF(type) \
+int i2d_ASN1_SET_OF_##type(STACK_OF(type) *a,unsigned char **pp, \
+                          int (*func)(type *,unsigned char **), int ex_tag, \
+                          int ex_class, int is_set) \
+    { return i2d_ASN1_SET((STACK *)a,pp,func,ex_tag,ex_class,is_set); } \
+STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \
+                                      long length, \
+                                      type *(*func)(type **, \
+                                                    unsigned char **,long), \
+                                      void (*free_func)(type *), \
+                                      int ex_tag,int ex_class) \
+    { return (STACK_OF(type) *)d2i_ASN1_SET((STACK **)a,pp,length, \
+                                           (char *(*)())func, \
+                                           (void (*)())free_func, \
+                                           ex_tag,ex_class); }
+
 typedef struct asn1_ctx_st
        {
        unsigned char *p;/* work char pointer */
@@ -233,6 +261,9 @@ typedef struct asn1_type_st
                } value;
        } ASN1_TYPE;
 
+DECLARE_STACK_OF(ASN1_TYPE)
+DECLARE_ASN1_SET_OF(ASN1_TYPE)
+
 typedef struct asn1_method_st
        {
        int (*i2d)();
@@ -553,33 +584,6 @@ STACK *            d2i_ASN1_SET(STACK **a, unsigned char **pp, long length,
                        char *(*func)(), void (*free_func)(),
                        int ex_tag, int ex_class);
 
-#define DECLARE_ASN1_SET_OF(type) \
-int i2d_ASN1_SET_OF_##type(STACK_OF(type) *a,unsigned char **pp, \
-                          int (*func)(type *,unsigned char **), int ex_tag, \
-                          int ex_class, int is_set); \
-STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \
-                                      long length, \
-                                      type *(*func)(type **, \
-                                                    unsigned char **,long), \
-                                      void (*free_func)(type *), \
-                                      int ex_tag,int ex_class);
-
-#define IMPLEMENT_ASN1_SET_OF(type) \
-int i2d_ASN1_SET_OF_##type(STACK_OF(type) *a,unsigned char **pp, \
-                          int (*func)(type *,unsigned char **), int ex_tag, \
-                          int ex_class, int is_set) \
-    { return i2d_ASN1_SET((STACK *)a,pp,func,ex_tag,ex_class,is_set); } \
-STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \
-                                      long length, \
-                                      type *(*func)(type **, \
-                                                    unsigned char **,long), \
-                                      void (*free_func)(type *), \
-                                      int ex_tag,int ex_class) \
-    { return (STACK_OF(type) *)d2i_ASN1_SET((STACK **)a,pp,length, \
-                                           (char *(*)())func, \
-                                           (void (*)())free_func, \
-                                           ex_tag,ex_class); }
-
 #ifdef HEADER_BIO_H
 int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a);
 int a2i_ASN1_INTEGER(BIO *bp,ASN1_INTEGER *bs,char *buf,int size);