1 .TH LBER_TYPES 3 "RELEASEDATE" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2002 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 ber_int_t, ber_uint_t, ber_len_t, ber_slen_t, ber_tag_t \- LBER types
12 typedef impl_tag_t ber_tag_t;
13 typedef impl_int_t ber_int_t;
14 typedef impl_uint_t ber_uint_t;
15 typedef impl_len_t ber_len_t;
16 typedef impl_slen_t ber_slen_t;
18 typedef struct berval {
21 } BerValue, *BerVarray;
23 typedef struct berelement BerElement;
27 .BI "void ber_bvfree(struct berval *" bv ");"
29 .BI "void ber_bvecfree(struct berval **" bvec ");"
31 .BI "void ber_bvecadd(struct berval ***" bvec ", struct berval *" bv ");"
33 .BI "void ber_bvarray_free(struct berval *" bvarray ");"
35 .BI "void ber_bvarray_add(BerVarray *" bvarray ", BerValue *" bv ");"
37 .BI "struct berval *ber_bvdup(const struct berval *" bv ");"
39 .BI "struct berval *ber_dupbv(const struct berval *" dst ", struct berval *" src ");"
41 .BI "struct berval *ber_bvstr(const char *" str ");"
43 .BI "struct berval *ber_bvstrdup(const char *" str ");"
45 .BI "struct berval *ber_str2bv(const char *" str ", ber_len_t " len ", int " dup ", struct berval *" bv ");"
47 .BI "void ber_free(BerElement *" ber ", int " freebuf ");"
50 The following are the basic types and structures defined for use
51 with the Lightweight BER library.
54 is a signed integer of at least 32 bits. It is commonly equivalent to
57 is the unsigned variant of
61 is an unsigned integer of at least 32 bits used to represent a length.
62 It is commonly equivalent to a
65 is the signed variant to
69 is an unsigned integer of at least 32 bits used to represent a
70 BER tag. It is commonly equivalent to a
73 The actual definitions of the integral impl_TYPE_t types are platform
79 is used to hold an arbitrary sequence of octets.
85 is not necessarly terminated by a NUL (zero) octet.
87 frees a BerValue, pointed to by \fIbv\fP, returned from this API. If \fIbv\fP
88 is NULL, the routine does nothing.
91 frees an array of BerValues (and the array), pointed to by \fIbvec\fP,
92 returned from this API. If \fIbvec\fP is NULL, the routine does nothing.
94 appends the \fIbv\fP pointer to the \fIbvec\fP array. Space for the array
95 is allocated as needed. The end of the array is marked by a NULL pointer.
97 .BR ber_bvarray_free ()
98 frees an array of BerValues (and the array), pointed to by \fIbvarray\fP,
99 returned from this API. If \fIbvarray\fP is NULL, the routine does nothing.
100 .BR ber_bvarray_add ()
101 appends the contents of the BerValue pointed to by \fIbv\fP to the
102 \fIbvarray\fP array. Space for the new element is allocated as needed.
103 The end of the array is marked by a BerValue with a NULL bv_val field.
106 returns a copy of a BerValue. The routine returns NULL upon error
107 (e.g. out of memory). The caller should use
109 to deallocate the resulting BerValue.
111 copies a BerValue from \fIsrc\fP to \fIdst\fP. If \fIdst\fP is NULL a
112 new BerValue will be allocated to hold the copy. The routine returns NULL
113 upon error, otherwise it returns a pointer to the copy. If \fIdst\fP is
114 NULL the caller should use
116 to deallocate the resulting BerValue, otherwise
118 should be used to deallocate the \fIdst->bv_val\fP. (The
120 function is internally implemented as ber_dupbv(NULL, bv).
122 is provided only for compatibility with an expired draft of the LDAP C API;
124 is the preferred interface.)
127 returns a BerValue containing the string pointed to by \fIstr\fP.
129 returns a BerValue containing a copy of the string pointed to by \fIstr\fP.
131 returns a BerValue containing the string pointed to by \fIstr\fP, whose
132 length may be optionally specified in \fIlen\fP. If \fIdup\fP is non-zero,
133 the BerValue will contain a copy of \fIstr\fP. If \fIlen\fP is zero, the
134 number of bytes to copy will be determined by
136 otherwise \fIlen\fP bytes will be copied. If \fIbv\fP is non-NULL, the result
137 will be stored in the given BerValue, otherwise a new BerValue will be
138 allocated to store the result. NOTE: Both
142 are implemented as macros using
144 in this version of the library.
147 is an opaque structure used to maintain state information used in
148 encoding and decoding. BerElement structures are created using
153 frees a BerElement pointed to by \fIber\fP. If \fIber\fP is NULL, the routine
154 does nothing. If \fIfreebuf\fP is zero, the internal buffer is not freed.
162 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
164 is derived from University of Michigan LDAP 3.3 Release.