summaryrefslogtreecommitdiffstats
path: root/doc/man3/BIO_s_mem.pod
diff options
context:
space:
mode:
authorBeat Bolli <dev@drbeat.li>2017-01-20 19:58:49 +0100
committerMatt Caswell <matt@openssl.org>2017-06-08 11:54:16 +0100
commite9b77246879071308130cda42336338ddb63cbb4 (patch)
treefc69eee78ddd45bc873d1d6ee103139bdaf27674 /doc/man3/BIO_s_mem.pod
parent61ced34f8d7a7f1dedaa5a5b3554c4dcdec610df (diff)
doc/man3: reformat the function prototypes in the synopses
I tried hard to keep the lines at 80 characters or less, but in a few cases I had to punt and just indented the subsequent lines by 4 spaces. A few well-placed typedefs for callback functions would really help, but these would be part of the API, so that's probably for later. I also took the liberty of inserting empty lines in overlong blocks to provide some visual space. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1956)
Diffstat (limited to 'doc/man3/BIO_s_mem.pod')
-rw-r--r--doc/man3/BIO_s_mem.pod9
1 files changed, 5 insertions, 4 deletions
diff --git a/doc/man3/BIO_s_mem.pod b/doc/man3/BIO_s_mem.pod
index b272c410a0..0b559e57a5 100644
--- a/doc/man3/BIO_s_mem.pod
+++ b/doc/man3/BIO_s_mem.pod
@@ -10,8 +10,8 @@ BIO_get_mem_ptr, BIO_new_mem_buf - memory BIO
#include <openssl/bio.h>
- const BIO_METHOD * BIO_s_mem(void);
- const BIO_METHOD * BIO_s_secmem(void);
+ const BIO_METHOD *BIO_s_mem(void);
+ const BIO_METHOD *BIO_s_secmem(void);
BIO_set_mem_eof_return(BIO *b, int v)
long BIO_get_mem_data(BIO *b, char **pp)
@@ -97,17 +97,18 @@ There should be an option to set the maximum size of a memory BIO.
Create a memory BIO and write some data to it:
BIO *mem = BIO_new(BIO_s_mem());
+
BIO_puts(mem, "Hello World\n");
Create a read only memory BIO:
char data[] = "Hello World";
- BIO *mem;
- mem = BIO_new_mem_buf(data, -1);
+ BIO *mem = BIO_new_mem_buf(data, -1);
Extract the BUF_MEM structure from a memory BIO and then free up the BIO:
BUF_MEM *bptr;
+
BIO_get_mem_ptr(mem, &bptr);
BIO_set_close(mem, BIO_NOCLOSE); /* So BIO_free() leaves BUF_MEM alone */
BIO_free(mem);