-
Notifications
You must be signed in to change notification settings - Fork 5
/
IxpMsg.3
59 lines (44 loc) · 1.55 KB
/
IxpMsg.3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.TH "IXPMSG" 3 "2012 Dec" "libixp Manual"
.SH NAME
.P
IxpMsg, IxpMsgMode, ixp_message
.SH SYNOPSIS
.nf
#include <ixp.h>
typedef struct IxpMsg IxpMsg;
struct IxpMsg {
char* data; /* Begining of buffer. */
char* pos; /* Current position in buffer. */
char* end; /* End of message. */
uint size; /* Size of buffer. */
uint mode; /* MsgPack or MsgUnpack. */
}
enum IxpMsgMode {
MsgPack,
MsgUnpack,
}
IxpMsg ixp_message(char *data, uint length, uint mode);
.fi
.SH DESCRIPTION
.P
The IxpMsg struct represents a binary message, and is used
extensively by libixp for converting messages to and from
wire format. The location and size of a buffer are stored in
\fIdata\fR and \fIsize\fR, respectively. \fIpos\fR points to the
location in the message currently being packed or unpacked,
while \fIend\fR points to the end of the message. The packing
functions advance \fIpos\fR as they go, always ensuring that
they don't read or write past \fIend\fR. When a message is
entirely packed or unpacked, \fIpos\fR whould be less than or
equal to \fIend\fR. Any other state indicates error.
.P
ixp_message is a convenience function to pack a construct an
IxpMsg from a buffer of a given \fIlength\fR and a given
\fImode\fR. \fIpos\fR and \fIdata\fR are set to \fIdata\fR and \fIend\fR is
set to \fIdata\fR + \fIlength\fR.
.SH SEE ALSO
.P
ixp_pu8(3), ixp_pu16(3), ixp_pu32(3), ixp_pu64(3),
ixp_pstring(3), ixp_pstrings(3)
.\" man code generated by txt2tags 2.6 (http://txt2tags.org)
.\" cmdline: txt2tags -o- IxpMsg.man3