]> WPIA git - cassiopeia.git/blob - src/io/bios.cpp
31f1cb0eb934669415d73bc8431b0525d6ad5625
[cassiopeia.git] / src / io / bios.cpp
1 #include "bios.h"
2
3 #include <string.h>
4
5 namespace BIOWrapper {
6
7     int write( BIO *b, const char *buf, int num ) {
8         return static_cast<OpensslBIO *>( b->ptr )->write( buf, num );
9     }
10
11     int read( BIO *b, char *buf, int size ) {
12         return static_cast<OpensslBIO *>( b->ptr )->read( buf, size );
13     }
14
15     int puts( BIO *b, const char *str ) {
16         return static_cast<OpensslBIO *>( b->ptr )->puts( str );
17     }
18
19     int gets( BIO *b, char *str, int size ) {
20         return static_cast<OpensslBIO *>( b->ptr )->gets( str, size );
21     }
22
23     long ctrl( BIO *b, int cmod, long arg1, void *arg2 ) {
24         return static_cast<OpensslBIO *>( b->ptr )->ctrl( cmod, arg1, arg2 );
25     }
26
27     int free( BIO *b ) {
28         delete static_cast<OpensslBIO *>( b->ptr );
29         b->ptr = 0;
30         return 0;
31     }
32
33 }
34
35 OpensslBIO::~OpensslBIO() {}
36
37 int OpensslBIO::puts( const char *str ) {
38     ( void ) str;
39     return -1;
40 }
41 int OpensslBIO::gets( char *str, int size ) {
42     ( void ) str;
43     ( void ) size;
44     return -1;
45 }