NNG_MSG_HEADER_CHOP(3)
π nng_msg_header_chop(3) π
okay bestie, buckle up, we're talking about nng_msg_header_chop β straight outta the NNG Reference Manual β aka remove data from end of message header. yes she's a chopper, she chops the end of a header, and she does it with main character energy. π
β¨ NAME β¨
nng_msg_header_chop β literally just remove data from the end of a message header. that's it, that's the tweet. π
πΈ SYNOPSIS πΈ
#include <nng/nng.h>
int nng_msg_header_chop(nng_msg *msg, size_t size);
int nng_msg_header_chop_u16(nng_msg *msg, uint16_t *val16);
int nng_msg_header_chop_u32(nng_msg *msg, uint32_t *val32);
int nng_msg_header_chop_u64(nng_msg *msg, uint64_t *val64);
four little functions, one whole squad. π«Ά
π¦ DESCRIPTION π¦
so the nng_msg_header_chop() family removes data from the end of the header of message msg. not the front, not the middle β the end. chopping from the end is the vibe, iykyk.
- the first one,
nng_msg_header_chop(), just yeetssizebytes. gone. poof. π - the rest of the girlies β
nng_msg_header_chop_u16(),nng_msg_header_chop_u32(), andnng_msg_header_chop_u64()β remove 2, 4, or 8 bytes respectively, and then store what they yoinked into the value (likeval32), after converting it from network-byte order (big-endian) to native byte order. she's bilingual fr fr. π
β RETURN VALUES β
these functions return 0 on success, and non-zero otherwise. iconic when it's 0, sad when it's not. π
π ERRORS π
NNG_EINVALβ the message header is too short to remove the requested data. like bestie there is nothing there, you cannot chop an empty header, it's giving delulu. π
π SEE ALSO π
nng_msg_alloc(3), nng_msg_header(3), nng_msg_header_append(3), nng_msg_header_insert(3), nng_msg_header_len(3), nng_msg_header_trim(3), nng_msg_free(3), nng_strerror(3), nng(7)
the whole friend group, go say hi. π
mwah π that's a wrap on this one β page dropped on 2026-06-30 as part of the NNG_MSG_HEADER_CHOP(3) era. chop responsibly, bestie. πβ¨
π¦ where this page comes from
- ubuntu stonking: libnng-dev 1.12.0-1 Β· MIT OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms