2 * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the OpenSSL license (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
12 BIO_METHOD *BIO_meth_new(int type, const char *name)
14 BIO_METHOD *biom = OPENSSL_zalloc(sizeof(BIO_METHOD));
23 void BIO_meth_free(BIO_METHOD *biom)
28 int (*BIO_meth_get_write(BIO_METHOD *biom)) (BIO *, const char *, int)
33 int BIO_meth_set_write(BIO_METHOD *biom,
34 int (*bwrite) (BIO *, const char *, int))
36 biom->bwrite = bwrite;
40 int (*BIO_meth_get_read(BIO_METHOD *biom)) (BIO *, char *, int)
45 int BIO_meth_set_read(BIO_METHOD *biom,
46 int (*bread) (BIO *, char *, int))
52 int (*BIO_meth_get_puts(BIO_METHOD *biom)) (BIO *, const char *)
57 int BIO_meth_set_puts(BIO_METHOD *biom,
58 int (*bputs) (BIO *, const char *))
64 int (*BIO_meth_get_gets(BIO_METHOD *biom)) (BIO *, char *, int)
69 int BIO_meth_set_gets(BIO_METHOD *biom,
70 int (*bgets) (BIO *, char *, int))
76 long (*BIO_meth_get_ctrl(BIO_METHOD *biom)) (BIO *, int, long, void *)
81 int BIO_meth_set_ctrl(BIO_METHOD *biom,
82 long (*ctrl) (BIO *, int, long, void *))
88 int (*BIO_meth_get_create(BIO_METHOD *biom)) (BIO *)
93 int BIO_meth_set_create(BIO_METHOD *biom, int (*create) (BIO *))
95 biom->create = create;
99 int (*BIO_meth_get_destroy(BIO_METHOD *biom)) (BIO *)
101 return biom->destroy;
104 int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *))
106 biom->destroy = destroy;
110 long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom)) (BIO *, int, bio_info_cb *)
112 return biom->callback_ctrl;
115 int BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
116 long (*callback_ctrl) (BIO *, int,
119 biom->callback_ctrl = callback_ctrl;