NNG_MSG_HEADER_INSERT(3)
β¨ NNG_MSG_HEADER_INSERT(3) β¨
okay bestie, so this is the NNG Reference Manual page for nng_msg_header_insert β and ngl, it's a whole vibe. it's the "prepend to message header" one π
πΈ NAME πΈ
nng_msg_header_insert β prepend to message header π
π¦ SYNOPSIS π¦
#include <nng/nng.h>
int nng_msg_header_insert(nng_msg *msg, const void *val, size_t size);
int nng_msg_header_insert_u16(nng_msg *msg, uint16_t val16);
int nng_msg_header_insert_u32(nng_msg *msg, uint32_t val32);
int nng_msg_header_insert_u64(nng_msg *msg, uint64_t val64);
π DESCRIPTION π
so the nng_msg_header_insert() family are the girls who go to the front of the line. they prepend data to the front of the headers of message msg, and they'll reallocate if they need to, because obvi they're gonna make it work. π₯
here's the breakdown, bestie:
- the first function prepends
sizebytes, copying them over fromval. - the rest of them prepend the specified value (like
val32) in network-byte order (that's big-endian, iykyk).
that's it. that's the whole function. iconic behaviour, no notes. π
β RETURN VALUES β
these functions return 0 on success, and non-zero otherwise. slay when it's 0, uh-oh when it's not. π
π ERRORS π
NNG_ENOMEMβ insufficient free memory exists. like, there's just no room left in the group chat, bestie. π«Ά
π SEE ALSO π
nng_msg_alloc(3)nng_msg_header(3)nng_msg_header_append(3)nng_msg_header_chop(3)nng_msg_header_len(3)nng_msg_header_trim(3)nng_msg_free(3)nng_msg_capacity(3)nng_msg_reserve(3)nng_msg_realloc(3)nng_strerror(3)nng(7)
and that's a wrap, babes π this was the NNG Reference Manual page for NNG_MSG_HEADER_INSERT(3), dated 2026-06-30 β go prepend something cute at the front of your header, you absolute main character. periodt. πβ¨
π¦ 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