1 .TH "event2/tag.h" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
7 Helper functions for reading and writing tagged data onto buffers\&.
12 \fC#include <event2/event-config\&.h>\fP
14 \fC#include <event2/util\&.h>\fP
21 .RI "int \fBevtag_consume\fP (struct \fBevbuffer\fP *evbuf)"
24 .RI "void \fBevtag_encode_int\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t number)"
26 .RI "\fIEncode an integer and store it in an evbuffer\&. \fP"
28 .RI "void \fBevtag_encode_int64\fP (struct \fBevbuffer\fP *evbuf, ev_uint64_t number)"
31 .RI "void \fBevtag_init\fP (void)"
34 .RI "void \fBevtag_marshal\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t tag, const void *data, ev_uint32_t len)"
37 .RI "void \fBevtag_marshal_buffer\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t tag, struct \fBevbuffer\fP *data)"
40 .RI "void \fBevtag_marshal_int\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t tag, ev_uint32_t integer)"
43 .RI "void \fBevtag_marshal_int64\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t tag, ev_uint64_t integer)"
46 .RI "void \fBevtag_marshal_string\fP (struct \fBevbuffer\fP *buf, ev_uint32_t tag, const char *string)"
49 .RI "void \fBevtag_marshal_timeval\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t tag, struct timeval *tv)"
52 .RI "int \fBevtag_payload_length\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t *plength)"
55 .RI "int \fBevtag_peek\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t *ptag)"
58 .RI "int \fBevtag_peek_length\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t *plength)"
61 .RI "int \fBevtag_unmarshal\fP (struct \fBevbuffer\fP *src, ev_uint32_t *ptag, struct \fBevbuffer\fP *dst)"
64 .RI "int \fBevtag_unmarshal_fixed\fP (struct \fBevbuffer\fP *src, ev_uint32_t need_tag, void *data, size_t len)"
67 .RI "int \fBevtag_unmarshal_header\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t *ptag)"
69 .RI "\fIUnmarshals the header and returns the length of the payload\&. \fP"
71 .RI "int \fBevtag_unmarshal_int\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t need_tag, ev_uint32_t *pinteger)"
74 .RI "int \fBevtag_unmarshal_int64\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t need_tag, ev_uint64_t *pinteger)"
77 .RI "int \fBevtag_unmarshal_string\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t need_tag, char **pstring)"
80 .RI "int \fBevtag_unmarshal_timeval\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t need_tag, struct timeval *ptv)"
83 .SH "Detailed Description"
85 Helper functions for reading and writing tagged data onto buffers\&.
88 .SH "Function Documentation"
90 .SS "void evtag_encode_int (struct \fBevbuffer\fP *evbuf, ev_uint32_tnumber)"
93 Encode an integer and store it in an evbuffer\&. We encode integers by nybbles; the first nibble contains the number of significant nibbles - 1; this allows us to encode up to 64-bit integers\&. This function is byte-order independent\&.
97 \fIevbuf\fP evbuffer to store the encoded number
99 \fInumber\fP a 32-bit integer
103 .SS "int evtag_unmarshal_header (struct \fBevbuffer\fP *evbuf, ev_uint32_t *ptag)"
106 Unmarshals the header and returns the length of the payload\&.
110 \fIevbuf\fP the buffer from which to unmarshal data
112 \fIptag\fP a pointer in which the tag id is being stored
117 -1 on failure or the number of bytes in the remaining payload\&.
123 Generated automatically by Doxygen for libevent from the source code\&.