1 .TH LBER_TYPES 3 "RELEASEDATE" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2007 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,
7 struct berval, BerValue, BerVarray, BerElement,
8 ber_bvfree, ber_bvecfree, ber_bvecadd, ber_bvarray_free, ber_bvarray_add,
9 ber_bvdup, ber_dupbv, ber_bvstr, ber_bvstrdup, ber_str2bv,
10 ber_alloc_t, ber_init, ber_init2, ber_free
11 \- LBER types and allocation functions
13 OpenLDAP LBER (liblber, -llber)
19 typedef impl_tag_t ber_tag_t;
20 typedef impl_int_t ber_int_t;
21 typedef impl_uint_t ber_uint_t;
22 typedef impl_len_t ber_len_t;
23 typedef impl_slen_t ber_slen_t;
25 typedef struct berval {
28 } BerValue, *BerVarray;
30 typedef struct berelement BerElement;
34 .BI "void ber_bvfree(struct berval *" bv ");"
36 .BI "void ber_bvecfree(struct berval **" bvec ");"
38 .BI "void ber_bvecadd(struct berval ***" bvec ", struct berval *" bv ");"
40 .BI "void ber_bvarray_free(struct berval *" bvarray ");"
42 .BI "void ber_bvarray_add(BerVarray *" bvarray ", BerValue *" bv ");"
44 .BI "struct berval *ber_bvdup(const struct berval *" bv ");"
46 .BI "struct berval *ber_dupbv(const struct berval *" dst ", struct berval *" src ");"
48 .BI "struct berval *ber_bvstr(const char *" str ");"
50 .BI "struct berval *ber_bvstrdup(const char *" str ");"
52 .BI "struct berval *ber_str2bv(const char *" str ", ber_len_t " len ", int " dup ", struct berval *" bv ");"
54 .BI "BerElement *ber_alloc_t(int " options ");"
56 .BI "BerElement *ber_init(struct berval *" bv ");"
58 .BI "void ber_init2(BerElement *" ber ", struct berval *" bv ", int " options ");"
60 .BI "void ber_free(BerElement *" ber ", int " freebuf ");"
63 The following are the basic types and structures defined for use
64 with the Lightweight BER library.
67 is a signed integer of at least 32 bits. It is commonly equivalent to
70 is the unsigned variant of
74 is an unsigned integer of at least 32 bits used to represent a length.
75 It is commonly equivalent to a
78 is the signed variant to
82 is an unsigned integer of at least 32 bits used to represent a
83 BER tag. It is commonly equivalent to a
86 The actual definitions of the integral impl_TYPE_t types are platform
92 is used to hold an arbitrary sequence of octets.
98 is not necessarily terminated by a NUL (zero) octet.
100 frees a BerValue, pointed to by \fIbv\fP, returned from this API. If \fIbv\fP
101 is NULL, the routine does nothing.
104 frees an array of BerValues (and the array), pointed to by \fIbvec\fP,
105 returned from this API. If \fIbvec\fP is NULL, the routine does nothing.
107 appends the \fIbv\fP pointer to the \fIbvec\fP array. Space for the array
108 is allocated as needed. The end of the array is marked by a NULL pointer.
110 .BR ber_bvarray_free ()
111 frees an array of BerValues (and the array), pointed to by \fIbvarray\fP,
112 returned from this API. If \fIbvarray\fP is NULL, the routine does nothing.
113 .BR ber_bvarray_add ()
114 appends the contents of the BerValue pointed to by \fIbv\fP to the
115 \fIbvarray\fP array. Space for the new element is allocated as needed.
116 The end of the array is marked by a BerValue with a NULL bv_val field.
119 returns a copy of a BerValue. The routine returns NULL upon error
120 (e.g. out of memory). The caller should use
122 to deallocate the resulting BerValue.
124 copies a BerValue from \fIsrc\fP to \fIdst\fP. If \fIdst\fP is NULL a
125 new BerValue will be allocated to hold the copy. The routine returns NULL
126 upon error, otherwise it returns a pointer to the copy. If \fIdst\fP is
127 NULL the caller should use
129 to deallocate the resulting BerValue, otherwise
131 should be used to deallocate the \fIdst->bv_val\fP. (The
133 function is internally implemented as ber_dupbv(NULL, bv).
135 is provided only for compatibility with an expired draft of the LDAP C API;
137 is the preferred interface.)
140 returns a BerValue containing the string pointed to by \fIstr\fP.
142 returns a BerValue containing a copy of the string pointed to by \fIstr\fP.
144 returns a BerValue containing the string pointed to by \fIstr\fP, whose
145 length may be optionally specified in \fIlen\fP. If \fIdup\fP is non-zero,
146 the BerValue will contain a copy of \fIstr\fP. If \fIlen\fP is zero, the
147 number of bytes to copy will be determined by
149 otherwise \fIlen\fP bytes will be copied. If \fIbv\fP is non-NULL, the result
150 will be stored in the given BerValue, otherwise a new BerValue will be
151 allocated to store the result. NOTE: Both
155 are implemented as macros using
157 in this version of the library.
160 is an opaque structure used to maintain state information used in
161 encoding and decoding.
163 is used to create an empty BerElement structure. If
167 parameter then data lengths for data written to the BerElement will be
168 encoded in the minimal number of octets required, otherwise they will
169 always be written as four byte values.
171 creates a BerElement structure that is initialized with a copy of the
176 initializes an existing BerElement
178 using the data in the
180 parameter. The data is referenced directly, not copied. The
182 parameter is the same as for
185 frees a BerElement pointed to by \fIber\fP. If \fIber\fP is NULL, the routine
186 does nothing. If \fIfreebuf\fP is zero, the internal buffer is not freed.