1ldns(3) Library Functions Manual ldns(3)
2
3
4
6 ldns_buffer_limit, ldns_buffer_set_limit, ldns_buffer_capacity,
7 ldns_buffer_set_capacity, ldns_buffer_reserve, ldns_buffer_at,
8 ldns_buffer_begin, ldns_buffer_end, ldns_buffer_current - buffer limits
9 and pointers
10
11
13 #include <stdint.h>
14 #include <stdbool.h>
15
16 #include <ldns/ldns.h>
17
18 size_t ldns_buffer_limit(const ldns_buffer *buffer);
19
20 void ldns_buffer_set_limit(ldns_buffer *buffer, size_t limit);
21
22 size_t ldns_buffer_capacity(const ldns_buffer *buffer);
23
24 bool ldns_buffer_set_capacity(ldns_buffer *buffer, size_t capacity);
25
26 bool ldns_buffer_reserve(ldns_buffer *buffer, size_t amount);
27
28 uint8_t * ldns_buffer_at(const ldns_buffer *buffer, size_t at);
29
30 uint8_t * ldns_buffer_begin(const ldns_buffer *buffer);
31
32 uint8_t * ldns_buffer_end(const ldns_buffer *buffer);
33
34 uint8_t * ldns_buffer_current(const ldns_buffer *buffer);
35
37 ldns_buffer_limit() returns the maximum size of the buffer \param[in]
38 buffer
39 Returns the size
40
41 ldns_buffer_set_limit() changes the buffer's limit. If the buffer's
42 position is greater than the new limit the position is set to
43 the limit.
44 buffer: the buffer
45 limit: the new limit
46
47 ldns_buffer_capacity() returns the number of bytes the buffer can hold.
48 buffer: the buffer
49 Returns the number of bytes
50
51 ldns_buffer_set_capacity() changes the buffer's capacity. The data is
52 reallocated so any pointers to the data may become invalid. The
53 buffer's limit is set to the buffer's new capacity.
54 buffer: the buffer
55 capacity: the capacity to use
56 Returns whether this failed or succeeded
57
58 ldns_buffer_reserve() ensures BUFFER can contain at least AMOUNT more
59 bytes. The buffer's capacity is increased if necessary using
60 buffer_set_capacity().
61
62 The buffer's limit is always set to the (possibly increased) ca‐
63 pacity.
64 buffer: the buffer
65 amount: amount to use
66 Returns whether this failed or succeeded
67
68 ldns_buffer_at() returns a pointer to the data at the indicated posi‐
69 tion.
70 buffer: the buffer
71 at: position
72 Returns the pointer to the data
73
74 ldns_buffer_begin() returns a pointer to the beginning of the buffer
75 (the data at position 0).
76 buffer: the buffer
77 Returns the pointer
78
79 ldns_buffer_end() returns a pointer to the end of the buffer (the data
80 at the buffer's limit).
81 buffer: the buffer
82 Returns the pointer
83
84 ldns_buffer_current() returns a pointer to the data at the buffer's
85 current position.
86 buffer: the buffer
87 Returns the pointer
88
90 The ldns team at NLnet Labs.
91
92
94 Please report bugs to ldns-team@nlnetlabs.nl or in our bugzilla at
95 http://www.nlnetlabs.nl/bugs/index.html
96
97
99 Copyright (c) 2004 - 2006 NLnet Labs.
100
101 Licensed under the BSD License. There is NO warranty; not even for MER‐
102 CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
103
104
106 ldns_buffer. And perldoc Net::DNS, RFC1034, RFC1035, RFC4033, RFC4034
107 and RFC4035.
108
110 This manpage was automatically generated from the ldns source code.
111
112
113
114 30 May 2006 ldns(3)