---
name: "ixp_pstring"
section: "3"
platform: "linux"
package: "libixp-dev"
version: "0.6~20121202+hg148-5"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/ixp_pstring"
---

# 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 *msg*-\>mode is MsgPack, the string pointed to by *s* is packed into the buffer at *msg*-\>pos. If *msg*-\>mode is MsgUnpack, the address pointed to by *s* is loaded with a [malloc(3)](/malloc/3.md) allocated, nul-terminated representation of the string packed at *msg*-\>pos. In either case, *msg*-\>pos is advanced by the number of bytes read or written. If the action would advance *msg*-\>pos beyond *msg*-\>end, *msg*-\>pos is still advanced but no other action is taken.

## SEE ALSO

[IxpMsg(3)](/IxpMsg/3.md), [ixp\_pstrings(3)](/ixp_pstrings/3.md), [ixp\_pdata(3)](/ixp_pdata/3.md)
