IXP_PSTRING(3)
NAME π
ixp_pstring β okay bestie, this is the ixp_pstring page from the IXP_PSTRING(3) manual in the Library Functions Manual, and it's lowkey just the string packer/unpacker.
SYNOPSIS β¨
#include <ixp.h>
void ixp_pstring(IxpMsg *msg, char **s);
DESCRIPTION π¦
Okay so ixp_pstring packs or unpacks a UTF-8 encoded string. That's the whole gig, and it ate. π
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. Slay.
- If
msg->modeisMsgPack, the string pointed to bysis packed into the buffer atmsg->pos. - If
msg->modeisMsgUnpack, the address pointed to bysis loaded with amalloc(3)allocated, nul-terminated representation of the string packed atmsg->pos.
In either case, msg->pos is advanced by the number of bytes read or written. π₯
β οΈ caveat bestie: if the action would advancemsg->posbeyondmsg->end,msg->posis still advanced but no other action is taken. So the position moves forward, but nothing else happens β that's literally the documented behavior, no cap. π
SEE ALSO π
π cute little sign-off: this page is from the libixp Manual, dated 2012 Dec. Bye bestie, go pack some strings responsibly π«Ά
π¦ where this page comes from
- nixos 26.05: libixp 0-unstable-2022-04-04
- nixpkgs unstable: libixp 0-unstable-2022-04-04
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms