1 #ifndef OPENSSL_BIO_COMPAT_H
2 #define OPENSSL_BIO_COMPAT_H
4 #include <openssl/opensslv.h>
5 #if OPENSSL_VERSION_NUMBER < 0x10100000L
7 #include <openssl/bio.h>
10 #define BIO_get_data(b) (b->ptr)
11 #define BIO_set_data(b, v) (b->ptr = v)
12 #define BIO_set_init(b, v) (b->init = v)
13 #define BIO_meth_set_write(m, f) (m->bwrite = f)
14 #define BIO_meth_set_read(m, f) (m->bread = f)
15 #define BIO_meth_set_puts(m, f) (m->bputs = f)
16 #define BIO_meth_set_gets(m, f) (m->bgets = f)
17 #define BIO_meth_set_ctrl(m, f) (m->ctrl = f)
18 #define BIO_meth_set_create(m, f) (m->create = f)
19 #define BIO_meth_set_destroy(m, f) (m->destroy = f)
21 static inline BIO_METHOD
*BIO_meth_new(int type
, const char *name
)
23 BIO_METHOD
*bm
= calloc(1, sizeof(BIO_METHOD
));
31 #endif /* OPENSSL_VERSION_NUMBER */
33 #endif /* OPENSSL_BIO_COMPAT_H */