1 .TH LBER_TYPES 3 "2008/07/16" "OpenLDAP 2.4.11"
2 .\" $OpenLDAP: pkg/ldap/doc/man/man3/lber-types.3,v 1.19.2.3 2008/02/11 23:26:39 kurt Exp $
3 .\" Copyright 1998-2008 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, struct berval, BerValue, BerVarray, BerElement, ber_bvfree, ber_bvecfree, ber_bvecadd, ber_bvarray_free, ber_bvarray_add, ber_bvdup, ber_dupbv, ber_bvstr, ber_bvstrdup, ber_str2bv, ber_alloc_t, ber_init, ber_init2, ber_free \- OpenLDAP LBER types and allocation functions
8 OpenLDAP LBER (liblber, -llber)
14 typedef impl_tag_t ber_tag_t;
15 typedef impl_int_t ber_int_t;
16 typedef impl_uint_t ber_uint_t;
17 typedef impl_len_t ber_len_t;
18 typedef impl_slen_t ber_slen_t;
20 typedef struct berval {
23 } BerValue, *BerVarray;
25 typedef struct berelement BerElement;
29 .BI "void ber_bvfree(struct berval *" bv ");"
31 .BI "void ber_bvecfree(struct berval **" bvec ");"
33 .BI "void ber_bvecadd(struct berval ***" bvec ", struct berval *" bv ");"
35 .BI "void ber_bvarray_free(struct berval *" bvarray ");"
37 .BI "void ber_bvarray_add(BerVarray *" bvarray ", BerValue *" bv ");"
39 .BI "struct berval *ber_bvdup(const struct berval *" bv ");"
41 .BI "struct berval *ber_dupbv(const struct berval *" dst ", struct berval *" src ");"
43 .BI "struct berval *ber_bvstr(const char *" str ");"
45 .BI "struct berval *ber_bvstrdup(const char *" str ");"
47 .BI "struct berval *ber_str2bv(const char *" str ", ber_len_t " len ", int " dup ", struct berval *" bv ");"
49 .BI "BerElement *ber_alloc_t(int " options ");"
51 .BI "BerElement *ber_init(struct berval *" bv ");"
53 .BI "void ber_init2(BerElement *" ber ", struct berval *" bv ", int " options ");"
55 .BI "void ber_free(BerElement *" ber ", int " freebuf ");"
58 The following are the basic types and structures defined for use
59 with the Lightweight BER library.
62 is a signed integer of at least 32 bits. It is commonly equivalent to
65 is the unsigned variant of
69 is an unsigned integer of at least 32 bits used to represent a length.
70 It is commonly equivalent to a
73 is the signed variant to
77 is an unsigned integer of at least 32 bits used to represent a
78 BER tag. It is commonly equivalent to a
81 The actual definitions of the integral impl_TYPE_t types are platform
87 is used to hold an arbitrary sequence of octets.
93 is not necessarily terminated by a NULL (zero) octet.
95 frees a BerValue, pointed to by \fIbv\fP, returned from this API. If \fIbv\fP
96 is NULL, the routine does nothing.
99 frees an array of BerValues (and the array), pointed to by \fIbvec\fP,
100 returned from this API. If \fIbvec\fP is NULL, the routine does nothing.
102 appends the \fIbv\fP pointer to the \fIbvec\fP array. Space for the array
103 is allocated as needed. The end of the array is marked by a NULL pointer.
105 .BR ber_bvarray_free ()
106 frees an array of BerValues (and the array), pointed to by \fIbvarray\fP,
107 returned from this API. If \fIbvarray\fP is NULL, the routine does nothing.
108 .BR ber_bvarray_add ()
109 appends the contents of the BerValue pointed to by \fIbv\fP to the
110 \fIbvarray\fP array. Space for the new element is allocated as needed.
111 The end of the array is marked by a BerValue with a NULL bv_val field.
114 returns a copy of a BerValue. The routine returns NULL upon error
115 (e.g. out of memory). The caller should use
117 to deallocate the resulting BerValue.
119 copies a BerValue from \fIsrc\fP to \fIdst\fP. If \fIdst\fP is NULL a
120 new BerValue will be allocated to hold the copy. The routine returns NULL
121 upon error, otherwise it returns a pointer to the copy. If \fIdst\fP is
122 NULL the caller should use
124 to deallocate the resulting BerValue, otherwise
126 should be used to deallocate the \fIdst->bv_val\fP. (The
128 function is internally implemented as ber_dupbv(NULL, bv).
130 is provided only for compatibility with an expired draft of the LDAP C API;
132 is the preferred interface.)
135 returns a BerValue containing the string pointed to by \fIstr\fP.
137 returns a BerValue containing a copy of the string pointed to by \fIstr\fP.
139 returns a BerValue containing the string pointed to by \fIstr\fP, whose
140 length may be optionally specified in \fIlen\fP. If \fIdup\fP is non-zero,
141 the BerValue will contain a copy of \fIstr\fP. If \fIlen\fP is zero, the
142 number of bytes to copy will be determined by
144 otherwise \fIlen\fP bytes will be copied. If \fIbv\fP is non-NULL, the result
145 will be stored in the given BerValue, otherwise a new BerValue will be
146 allocated to store the result. NOTE: Both
150 are implemented as macros using
152 in this version of the library.
155 is an opaque structure used to maintain state information used in
156 encoding and decoding.
158 is used to create an empty BerElement structure. If
162 parameter then data lengths for data written to the BerElement will be
163 encoded in the minimal number of octets required, otherwise they will
164 always be written as four byte values.
166 creates a BerElement structure that is initialized with a copy of the
171 initializes an existing BerElement
173 using the data in the
175 parameter. The data is referenced directly, not copied. The
177 parameter is the same as for
180 frees a BerElement pointed to by \fIber\fP. If \fIber\fP is NULL, the routine
181 does nothing. If \fIfreebuf\fP is zero, the internal buffer is not freed.
188 .\" Shared Project Acknowledgement Text
189 .B "OpenLDAP Software"
190 is developed and maintained by The OpenLDAP Project <http://www.openldap.org/>.
191 .B "OpenLDAP Software"
192 is derived from University of Michigan LDAP 3.3 Release.