]> git.sur5r.net Git - openldap/blob - doc/man/man3/lber-types.3
More updates.
[openldap] / doc / man / man3 / lber-types.3
1 .TH LBER_TYPES 3 "29 August 2001" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2000 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
5 .SH NAME
6 ber_int_t, ber_uint_t, ber_len_t, ber_slen_t, ber_tag_t \- LBER types
7 .SH SYNOPSIS
8 .nf
9 .ft B
10 #include <lber.h>
11 .ft
12 .fi
13 .LP
14 .nf
15 .ft B
16 typedef impl_tag_t ber_tag_t;
17 typedef impl_int_t ber_int_t;
18 typedef impl_uint_t ber_uint_t;
19 typedef impl_len_t ber_len_t;
20 typedef impl_slen_t ber_slen_t;
21
22
23 typedef struct berval {
24     ber_len_t bv_len;
25     char *bv_val;
26 } BerValue;
27
28 void ber_bvfree( struct berval *bv );
29
30 void ber_bvecfree( struct berval **bvec );
31
32 struct berval *ber_bvdup( const struct berval *bv );
33
34 struct berval *ber_bvstr( const char *str );
35
36 struct berval *ber_bvstrdup( const char *str );
37
38
39 typedef struct berelement BerElement;
40
41 void ber_free( BerElement *ber, int freebuf );
42
43 .ft
44 .fi
45 .SH DESCRIPTION
46 .LP
47 The following are the basic types and structures defined for use
48 with the Lightweight BER library.  
49 .LP
50 .B ber_int_t
51 is a signed integer of at least 32 bits.  It is commonly equivalent to
52 .BR int .
53 .B ber_uint_t
54 is the unsigned variant of
55 .BR ber_int_t .
56 .LP
57 .B ber_len_t
58 is a unsigned integer of at least 32 bits used to represent a length.  
59 It is commonly equivalent to a
60 .BR size_t .
61 .B ber_slen_t
62 is the signed variant to
63 .BR ber_len_t .
64 .LP
65 .B ber_tag_t
66 is a unsigned integer of at least 32 bits used to represent a
67 BER tag.  It is commonly equivalent to a
68 .BR unsigned\ long .
69 .LP
70 The actual definitions of the integal impl_TYPE_t types are platform
71 specific.
72 .LP
73 .BR BerValue ,
74 commonly used as
75 .BR struct\ berval ,
76 is used to holds an arbitrary sequence of octets.
77 .B bv_val
78 points to
79 .B bv_len
80 octets.
81 .B bv_val
82 is not necessarly terminated by a NULL (zero) octet.
83 .BR ber_bvfree ()
84 frees a BerValue, pointed to by bv, returned from this API.  If bv
85 is NULL, the routine does nothing.
86 .BR ber_bvecfree ()
87 frees an array of BerValues (and the array), pointed to by bvec,
88 returned from this API.  If bvec is NULL, the routine does nothing.
89 .BR ber_bvdup ()
90 returns a copy of a BerValue.  The routine returns NULL upon error
91 (e.g. out of memory).
92 .BR ber_bvstr ()
93 returns a BerValue containing the string pointed to by str.
94 .BR ber_bvstrdup ()
95 returns a BerValue containing a copy of the string pointed to by str.
96 .LP
97 .B BerElement
98 is an opaque structure used to maintain state information used in
99 encoding and decoding.  BerElement structures are created using
100 .BR ber_alloc_t (3)
101 and
102 .BR ber_init (3).
103 .BR ber_free ()
104 frees a BerElement pointed to by ber.  If ber is NULL, the routine
105 does nothing.  If freebuf is zero, the internal buffer is not freed.
106 .SH SEE ALSO
107 .BR lber-encode (3)
108 .BR lber-decode (3)
109 .BR lber-memory (3)
110 .LP
111 .SH ACKNOWLEDGEMENTS
112 .B      OpenLDAP
113 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
114 .B      OpenLDAP
115 is derived from University of Michigan LDAP 3.3 Release.