Lines Matching defs:bio

24 #include <openssl/bio.h>
36 BIO *bio = NULL;
48 if ((bio = BIO_new(BIO_s_mem())) == NULL) {
52 if ((ret = BIO_write(bio, data, data_len)) != (int)data_len) {
57 if ((rodata_len = BIO_get_mem_data(bio, &rodata)) != (long)data_len) {
72 if (!BIO_get_mem_ptr(bio, &pbuf)) {
91 if (!BIO_set_mem_buf(bio, buf, BIO_NOCLOSE)) {
95 if ((ret = BIO_puts(bio, "Hello\n")) != 6) {
99 if ((ret = BIO_puts(bio, "World\n")) != 6) {
109 if ((ret = BIO_gets(bio, data, data_len)) != 6) {
118 if ((ret = BIO_gets(bio, data, data_len)) != 5) {
128 if (!BIO_eof(bio)) {
132 if ((ret = BIO_read(bio, data, data_len)) != -1) {
136 if (!BIO_set_mem_eof_return(bio, -2)) {
140 if ((ret = BIO_read(bio, data, data_len)) != -2) {
150 BIO_free(bio);
160 BIO *bio;
165 if ((bio = BIO_new(BIO_s_mem())) == NULL) {
171 if (!BIO_reset(bio)) {
176 ret = BIO_write(bio, buf, sizeof(buf));
184 ret = BIO_read(bio, buf, sizeof(buf));
190 ret = BIO_write(bio, buf, sizeof(buf));
198 ret = BIO_read(bio, buf, sizeof(buf));
205 if (!BIO_eof(bio)) {
220 BIO_free(bio);
231 BIO *bio = NULL;
243 if ((bio = BIO_new_mem_buf(data, data_len)) == NULL) {
247 if ((ret = BIO_read(bio, buf, 1)) != 1) {
256 if ((ret = BIO_read(bio, buf, sizeof(buf))) != sizeof(buf)) {
265 if ((ret = BIO_write(bio, buf, 1)) != -1) {
269 if (BIO_eof(bio)) {
273 if (BIO_ctrl_pending(bio) != 2047) {
275 BIO_ctrl_pending(bio));
278 if ((ret = BIO_read(bio, buf, sizeof(buf))) != 2047) {
290 if (!BIO_eof(bio)) {
294 if (BIO_ctrl_pending(bio) != 0) {
296 BIO_ctrl_pending(bio));
300 if (!BIO_reset(bio)) {
301 fprintf(stderr, "FAIL: failed to reset bio\n");
304 if (BIO_eof(bio)) {
308 if (BIO_ctrl_pending(bio) != 4096) {
310 BIO_ctrl_pending(bio));
313 if ((ret = BIO_read(bio, buf, 2)) != 2) {
329 BIO_free(bio);