diff options
| author | schwarze <> | 2015-05-24 15:44:52 +0000 |
|---|---|---|
| committer | schwarze <> | 2015-05-24 15:44:52 +0000 |
| commit | 72138e7dd9423eb110e858e00b54b32be6b5aa87 (patch) | |
| tree | f40277888d65df9cdaf3fcbb7af8a4259f7f36f1 /src/lib/libssl | |
| parent | fa94b8e0a497408306ccc4012ef60535fc46200a (diff) | |
| download | openbsd-72138e7dd9423eb110e858e00b54b32be6b5aa87.tar.gz openbsd-72138e7dd9423eb110e858e00b54b32be6b5aa87.tar.bz2 openbsd-72138e7dd9423eb110e858e00b54b32be6b5aa87.zip | |
Maximilian dot Fillinger at uni-duesseldorf dot de
starts helping with the pod2mdoc(1)-based conversion
of LibreSSL crypto manuals from perlpod(1) to mdoc(7).
Here comes the first file, slightly tweaked by me.
Diffstat (limited to 'src/lib/libssl')
| -rw-r--r-- | src/lib/libssl/src/doc/crypto/BUF_MEM_new.pod | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/src/lib/libssl/src/doc/crypto/BUF_MEM_new.pod b/src/lib/libssl/src/doc/crypto/BUF_MEM_new.pod deleted file mode 100644 index 2805755869..0000000000 --- a/src/lib/libssl/src/doc/crypto/BUF_MEM_new.pod +++ /dev/null | |||
| @@ -1,72 +0,0 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | BUF_MEM_new, BUF_MEM_free, BUF_MEM_grow, BUF_strdup - simple | ||
| 6 | character arrays structure | ||
| 7 | |||
| 8 | =head1 SYNOPSIS | ||
| 9 | |||
| 10 | #include <openssl/buffer.h> | ||
| 11 | |||
| 12 | BUF_MEM *BUF_MEM_new(void); | ||
| 13 | |||
| 14 | void BUF_MEM_free(BUF_MEM *a); | ||
| 15 | |||
| 16 | int BUF_MEM_grow(BUF_MEM *str, size_t len); | ||
| 17 | |||
| 18 | char * BUF_strdup(const char *str); | ||
| 19 | |||
| 20 | =head1 DESCRIPTION | ||
| 21 | |||
| 22 | The buffer library handles simple character arrays. Buffers are used for | ||
| 23 | various purposes in the library, most notably memory BIOs. | ||
| 24 | |||
| 25 | The library uses the BUF_MEM structure defined in buffer.h: | ||
| 26 | |||
| 27 | typedef struct buf_mem_st | ||
| 28 | { | ||
| 29 | size_t length; /* current number of bytes */ | ||
| 30 | char *data; | ||
| 31 | size_t max; /* size of buffer */ | ||
| 32 | } BUF_MEM; | ||
| 33 | |||
| 34 | B<length> is the current size of the buffer in bytes, B<max> is the amount of | ||
| 35 | memory allocated to the buffer. There are three functions which handle these | ||
| 36 | and one "miscellaneous" function. | ||
| 37 | |||
| 38 | BUF_MEM_new() allocates a new buffer of zero size. | ||
| 39 | |||
| 40 | BUF_MEM_free() frees up an already existing buffer. The data is zeroed | ||
| 41 | before freeing up in case the buffer contains sensitive data. | ||
| 42 | |||
| 43 | BUF_MEM_grow() changes the size of an already existing buffer to | ||
| 44 | B<len>. Any data already in the buffer is preserved if it increases in | ||
| 45 | size. | ||
| 46 | |||
| 47 | BUF_strdup() copies a null terminated string into a block of allocated memory | ||
| 48 | and returns a pointer to the allocated block. Unlike the system strdup() | ||
| 49 | function, BUF_strdup() will accept a NULL argument and will return NULL in | ||
| 50 | that case. Its use in new programes is discouraged. | ||
| 51 | |||
| 52 | The memory allocated from BUF_strdup() should be freed up using the | ||
| 53 | free() function. | ||
| 54 | |||
| 55 | =head1 RETURN VALUES | ||
| 56 | |||
| 57 | BUF_MEM_new() returns the buffer or NULL on error. | ||
| 58 | |||
| 59 | BUF_MEM_free() has no return value. | ||
| 60 | |||
| 61 | BUF_MEM_grow() returns zero on error or the new size (i.e. B<len>). | ||
| 62 | |||
| 63 | =head1 SEE ALSO | ||
| 64 | |||
| 65 | L<bio(3)|bio(3)> | ||
| 66 | |||
| 67 | =head1 HISTORY | ||
| 68 | |||
| 69 | BUF_MEM_new(), BUF_MEM_free() and BUF_MEM_grow() are available in all | ||
| 70 | versions of SSLeay and OpenSSL. BUF_strdup() was added in SSLeay 0.8. | ||
| 71 | |||
| 72 | =cut | ||
