libixp

git clone git://oldgit.suckless.org/libixp/
Log | Files | Refs | LICENSE

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 IdataR and IsizeR, respectively. IposR points to the
     34 location in the message currently being packed or unpacked,
     35 while IendR points to the end of the message. The packing
     36 functions advance IposR as they go, always ensuring that
     37 they don't read or write past IendR.  When a message is
     38 entirely packed or unpacked, IposR whould be less than or
     39 equal to IendR. 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 IlengthR and a given
     44 ImodeR. IposR and IdataR are set to IdataR and IendR is
     45 set to IdataR + IlengthR.
     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