Sortix cross-nightly manual
This manual documents Sortix cross-nightly. You can instead view this document in the latest official manual.
NAME
BIO_s_mem, BIO_set_mem_eof_return, BIO_get_mem_data, BIO_set_mem_buf, BIO_get_mem_ptr, BIO_new_mem_buf — memory BIOSYNOPSIS
#include <openssl/bio.h>BIO_s_mem(void);
BIO_set_mem_eof_return(BIO *b, int v);
BIO_get_mem_data(BIO *b, char **pp);
BIO_set_mem_buf(BIO *b, BUF_MEM *bm, int c);
BIO_get_mem_ptr(BIO *b, BUF_MEM **pp);
BIO_new_mem_buf(const void *buf, int len);
DESCRIPTION
BIO_s_mem() returns the memory BIO method function.
cmd constant |
corresponding macro |
BIO_C_GET_BUF_MEM_PTR | BIO_get_mem_ptr() |
BIO_C_SET_BUF_MEM | BIO_set_mem_buf() |
BIO_C_SET_BUF_MEM_EOF_RETURN | BIO_set_mem_eof_return() |
BIO_CTRL_EOF | BIO_eof(3) |
BIO_CTRL_GET_CLOSE | BIO_get_close(3) |
BIO_CTRL_INFO | BIO_get_mem_data() |
BIO_CTRL_PENDING | BIO_pending(3) |
BIO_CTRL_RESET | BIO_reset(3) |
BIO_CTRL_SET_CLOSE | BIO_set_close(3) |
BIO_CTRL_WPENDING | BIO_wpending(3) |
RETURN VALUES
BIO_s_mem() returns a pointer to a static object.EXAMPLES
Create a memory BIO and write some data to it:BIO *mem = BIO_new(BIO_s_mem()); BIO_puts(mem, "Hello World\n");
char data[] = "Hello World"; BIO *mem; mem = BIO_new_mem_buf(data, -1);
BUF_MEM *bptr; BIO_get_mem_ptr(mem, &bptr); /* Make sure BIO_free() leaves BUF_MEM alone. */ BIO_set_close(mem, BIO_NOCLOSE); BIO_free(mem);