| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
from __future__ import absolute_import, division, print_function |
| 6 |
|
| 7 |
INCLUDES = """ |
| 8 |
#include <openssl/bio.h> |
| 9 |
""" |
| 10 |
|
| 11 |
TYPES = """ |
| 12 |
typedef ... BIO; |
| 13 |
typedef ... BIO_METHOD; |
| 14 |
static const long BIO_CLOSE; |
| 15 |
static const long BIO_FP_TEXT; |
| 16 |
""" |
| 17 |
|
| 18 |
FUNCTIONS = """ |
| 19 |
int BIO_free(BIO *); |
| 20 |
void BIO_free_all(BIO *); |
| 21 |
BIO *BIO_new_file(const char *, const char *); |
| 22 |
BIO *BIO_new_dgram(int, int); |
| 23 |
BIO *BIO_new_fp(FILE *stream, int flags); |
| 24 |
size_t BIO_ctrl_pending(BIO *); |
| 25 |
int BIO_read(BIO *, void *, int); |
| 26 |
int BIO_gets(BIO *, char *, int); |
| 27 |
int BIO_write(BIO *, const void *, int); |
| 28 |
int BIO_tell(BIO *b); |
| 29 |
int BIO_flush(BIO *b); |
| 30 |
int BIO_puts(BIO *b, const char *buf); |
| 31 |
int BIO_printf(BIO *bio, const char *format, ...); |
| 32 |
/* Added in 1.1.0 */ |
| 33 |
int BIO_up_ref(BIO *); |
| 34 |
|
| 35 |
BIO *BIO_new(BIO_METHOD *); |
| 36 |
const BIO_METHOD *BIO_s_mem(void); |
| 37 |
const BIO_METHOD *BIO_s_file(void); |
| 38 |
const BIO_METHOD *BIO_s_datagram(void); |
| 39 |
BIO *BIO_new_mem_buf(const void *, int); |
| 40 |
long BIO_set_mem_eof_return(BIO *, int); |
| 41 |
long BIO_get_mem_data(BIO *, char **); |
| 42 |
long BIO_read_filename(BIO *, char *); |
| 43 |
int BIO_should_read(BIO *); |
| 44 |
int BIO_should_write(BIO *); |
| 45 |
int BIO_should_io_special(BIO *); |
| 46 |
int BIO_should_retry(BIO *); |
| 47 |
int BIO_reset(BIO *); |
| 48 |
long BIO_set_nbio(BIO *, long); |
| 49 |
void BIO_set_retry_read(BIO *); |
| 50 |
void BIO_clear_retry_flags(BIO *); |
| 51 |
""" |
| 52 |
|
| 53 |
CUSTOMIZATIONS = """ |
| 54 |
#if CRYPTOGRAPHY_OPENSSL_LESS_THAN_110 && !CRYPTOGRAPHY_LIBRESSL_27_OR_GREATER |
| 55 |
int BIO_up_ref(BIO *b) { |
| 56 |
CRYPTO_add(&b->references, 1, CRYPTO_LOCK_BIO); |
| 57 |
return 1; |
| 58 |
} |
| 59 |
#endif |
| 60 |
""" |