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