1LBER_TYPES(3)              Library Functions Manual              LBER_TYPES(3)
2
3
4

NAME

6       ber_int_t, ber_uint_t, ber_len_t, ber_slen_t, ber_tag_t, struct berval,
7       BerValue, BerVarray, BerElement, ber_bvfree, ber_bvecfree, ber_bvecadd,
8       ber_bvarray_free,  ber_bvarray_add,  ber_bvdup,  ber_dupbv,  ber_bvstr,
9       ber_bvstrdup, ber_str2bv, ber_alloc_t, ber_init, ber_init2, ber_free  -
10       OpenLDAP LBER types and allocation functions
11

LIBRARY

13       OpenLDAP LBER (liblber, -llber)
14

SYNOPSIS

16       #include <lber.h>
17
18       typedef impl_tag_t ber_tag_t;
19       typedef impl_int_t ber_int_t;
20       typedef impl_uint_t ber_uint_t;
21       typedef impl_len_t ber_len_t;
22       typedef impl_slen_t ber_slen_t;
23
24       typedef struct berval {
25           ber_len_t bv_len;
26           char *bv_val;
27       } BerValue, *BerVarray;
28
29       typedef struct berelement BerElement;
30
31       void ber_bvfree(struct berval *bv);
32
33       void ber_bvecfree(struct berval **bvec);
34
35       void ber_bvecadd(struct berval ***bvec, struct berval *bv);
36
37       void ber_bvarray_free(struct berval *bvarray);
38
39       void ber_bvarray_add(BerVarray *bvarray, BerValue *bv);
40
41       struct berval *ber_bvdup(const struct berval *bv);
42
43       struct berval *ber_dupbv(const struct berval *dst, struct berval *src);
44
45       struct berval *ber_bvstr(const char *str);
46
47       struct berval *ber_bvstrdup(const char *str);
48
49       struct  berval  *ber_str2bv(const  char  *str,  ber_len_t len, int dup,
50       struct berval *bv);
51
52       BerElement *ber_alloc_t(int options);
53
54       BerElement *ber_init(struct berval *bv);
55
56       void ber_init2(BerElement *ber, struct berval *bv, int options);
57
58       void ber_free(BerElement *ber, int freebuf);
59

DESCRIPTION

61       The following are the basic types and structures defined for  use  with
62       the Lightweight BER library.
63
64       ber_int_t  is  a  signed  integer  of at least 32 bits.  It is commonly
65       equivalent to int.  ber_uint_t is the unsigned variant of ber_int_t.
66
67       ber_len_t is an unsigned integer of at least 32 bits used to  represent
68       a  length.   It  is commonly equivalent to a size_t.  ber_slen_t is the
69       signed variant to ber_len_t.
70
71       ber_tag_t is an unsigned integer of at least 32 bits used to  represent
72       a BER tag.  It is commonly equivalent to a unsigned long.
73
74       The  actual  definitions of the integral impl_TYPE_t types are platform
75       specific.
76
77       BerValue, commonly used as struct berval, is used to hold an  arbitrary
78       sequence  of  octets.   bv_val  points to bv_len octets.  bv_val is not
79       necessarily terminated by a NULL (zero) octet.   ber_bvfree()  frees  a
80       BerValue, pointed to by bv, returned from this API.  If bv is NULL, the
81       routine does nothing.
82
83       ber_bvecfree() frees an array of BerValues (and the array), pointed  to
84       by  bvec,  returned  from  this API.  If bvec is NULL, the routine does
85       nothing.  ber_bvecadd() appends the  bv  pointer  to  the  bvec  array.
86       Space  for  the  array is allocated as needed.  The end of the array is
87       marked by a NULL pointer.
88
89       ber_bvarray_free() frees an array of BerValues (and the array), pointed
90       to by bvarray, returned from this API.  If bvarray is NULL, the routine
91       does nothing.  ber_bvarray_add() appends the contents of  the  BerValue
92       pointed  to  by  bv to the bvarray array.  Space for the new element is
93       allocated as needed.  The end of the array is marked by a BerValue with