IXP_PSTRING(3)

NAME

ixp_pstring

SYNOPSIS
  #include <ixp.h>

  void ixp_pstring(IxpMsg *msg, char **s);

DESCRIPTION

Packs or unpacks a UTF-8 encoded string. The packed representation of the string consists of a 16-bit unsigned integer followed by the contents of the string. The unpacked representation is a nul-terminated character array.

If ImsgR->mode is MsgPack, the string pointed to by IsR is packed into the buffer at ImsgR->pos. If ImsgR->mode is MsgUnpack, the address pointed to by IsR is loaded with a malloc(3) allocated, nul-terminated representation of the string packed at ImsgR->pos. In either case, ImsgR->pos is advanced by the number of bytes read or written. If the action would advance ImsgR->pos beyond ImsgR->end, ImsgR->pos is still advanced but no other action is taken.

SEE ALSO

IxpMsg(3), ixp_pstrings(3), ixp_pdata(3)