ber_flatten

Allocates a berval structure whose contents are a BER encoding of the specified BerElement.

Library:*ldapsdk.*
NDS Version:7.xx or higher
Platform:NLM, Windows (NT, 95, 98, 2000, XP, Vista 32-bit and 64-bit ), Linux (32-bit and 64-bit), Solaris, AIX, and HP-UX

Syntax

  #include <ldap.h> or <lber.h>
  
  int ber_flatten (
     BerElement       *ber,
     struct berval   **bvPtr);
  
  

Parameters

ber

(IN) Points to the encoded contents for a BerElement.

bvPtr

(OUT) Points to the returned berval structure.

Return Values

Returns zero on success; otherwise, returns -1 on failure.

Remarks

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.

See Also

ber_bvfree, ber_init