3 #include <openssl/bio.h>
5 #define BIO_TYPE_CUSTOM 0xff
9 static const int typeID = BIO_TYPE_CUSTOM;
10 virtual ~OpensslBIO();
12 virtual int write( const char* buf, int num ) = 0;
13 virtual int read( char* buf, int size ) = 0;
14 virtual int puts( const char* str );
15 virtual int gets( char* str, int size );
16 virtual long ctrl( int cmod, long arg1, void* arg2 ) = 0;
19 namespace BIOWrapper {
21 int write( BIO* b, const char* buf, int num );
22 int read( BIO* b, char* buf, int size );
23 int puts( BIO* b, const char* str );
24 int gets( BIO* b, char* str, int size );
25 long ctrl( BIO* b, int cmod, long arg1, void* arg2 );
28 int bio_new( BIO* b ) {
41 static BIO_METHOD new_method = {
49 BIOWrapper::bio_new<T>,