Blame doc/man3/BUF_MEM_new.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
BUF_MEM_new, BUF_MEM_new_ex, BUF_MEM_free, BUF_MEM_grow,
Packit c4476c
BUF_MEM_grow_clean, BUF_reverse
Packit c4476c
- simple character array structure
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/buffer.h>
Packit c4476c
Packit c4476c
 BUF_MEM *BUF_MEM_new(void);
Packit c4476c
Packit c4476c
 BUF_MEM *BUF_MEM_new_ex(unsigned long flags);
Packit c4476c
Packit c4476c
 void BUF_MEM_free(BUF_MEM *a);
Packit c4476c
Packit c4476c
 int BUF_MEM_grow(BUF_MEM *str, int len);
Packit c4476c
 size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
Packit c4476c
Packit c4476c
 void BUF_reverse(unsigned char *out, const unsigned char *in, size_t size);
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
The buffer library handles simple character arrays. Buffers are used for
Packit c4476c
various purposes in the library, most notably memory BIOs.
Packit c4476c
Packit c4476c
BUF_MEM_new() allocates a new buffer of zero size.
Packit c4476c
Packit c4476c
BUF_MEM_new_ex() allocates a buffer with the specified flags.
Packit c4476c
The flag B<BUF_MEM_FLAG_SECURE> specifies that the B<data> pointer
Packit c4476c
should be allocated on the secure heap; see L<CRYPTO_secure_malloc(3)>.
Packit c4476c
Packit c4476c
BUF_MEM_free() frees up an already existing buffer. The data is zeroed
Packit c4476c
before freeing up in case the buffer contains sensitive data.
Packit c4476c
Packit c4476c
BUF_MEM_grow() changes the size of an already existing buffer to
Packit c4476c
B<len>. Any data already in the buffer is preserved if it increases in
Packit c4476c
size.
Packit c4476c
Packit c4476c
BUF_MEM_grow_clean() is similar to BUF_MEM_grow() but it sets any free'd
Packit c4476c
or additionally-allocated memory to zero.
Packit c4476c
Packit c4476c
BUF_reverse() reverses B<size> bytes at B<in> into B<out>.  If B<in>
Packit c4476c
is NULL, the array is reversed in-place.
Packit c4476c
Packit c4476c
=head1 RETURN VALUES
Packit c4476c
Packit c4476c
BUF_MEM_new() returns the buffer or NULL on error.
Packit c4476c
Packit c4476c
BUF_MEM_free() has no return value.
Packit c4476c
Packit c4476c
BUF_MEM_grow() and BUF_MEM_grow_clean() return
Packit c4476c
zero on error or the new size (i.e., B<len>).
Packit c4476c
Packit c4476c
=head1 SEE ALSO
Packit c4476c
Packit c4476c
L<bio(7)>,
Packit c4476c
L<CRYPTO_secure_malloc(3)>.
Packit c4476c
Packit c4476c
=head1 HISTORY
Packit c4476c
Packit c4476c
The BUF_MEM_new_ex() function was added in OpenSSL 1.1.0.
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
Packit c4476c
Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
this file except in compliance with the License.  You can obtain a copy
Packit c4476c
in the file LICENSE in the source distribution or at
Packit c4476c
L<https://www.openssl.org/source/license.html>.
Packit c4476c
Packit c4476c
=cut