Allocates a berval structure whose contents are a BER encoding of the specified BerElement.
#include <ldap.h> or <lber.h>
int ber_flatten (
BerElement *ber,
struct berval **bvPtr);
(IN) Points to the encoded contents for a BerElement.
(OUT) Points to the returned berval structure.
Returns zero on success; otherwise, returns -1 on failure.
The berval structure should be freed by calling the ber_bvfree function.
The ber_flatten function returns -1 if all '{' and '}' format modifiers are not properly matched.
Ber_init and ber_flatten are opposite functions. Ber_init converts a berval to a BerElement, and ber_flatten converts a BerElement to a berval.