NNG_MSG_HEADER_INSERT(3)

πŸ“¦
version 1.12.0 Β· 4 versions
, in ubuntu stonking

✨ 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 size bytes, copying them over from val.
  • 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 🌈


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