IXP_PSTRINGS(3)

NAME

ixp_pstrings

SYNOPSIS
  #include <ixp.h>

  void ixp_pstrings(IxpMsg *msg, uint16_t *num, char *strings[], uint max);

DESCRIPTION

Packs or unpacks an array of UTF-8 encoded strings. The packed representation consists of a 16-bit element count followed by an array of strings as packed by ixp_pstring(3). The unpacked representation is an array of nul-terminated character arrays.

If ImsgR->mode is MsgPack, I*numR strings in the array pointed to by IstringsR are packed into the buffer at ImsgR->pos. If ImsgR->mode is MsgUnpack, I*numR is loaded with the number of strings unpacked, the array at I*stringsR is loaded with pointers to the unpacked strings, and I(*strings)[0]R must be freed by the user. 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. If I*numR is greater than ImaxR, ImsgR->pos is set beyond ImsgR->end and no other action is taken.

SEE ALSO

IIxpMsgR, Iixp_pstringR, Iixp_pdataR