NNG_MSG_APPEND(3)

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

πŸ’– NNG_MSG_APPEND πŸ’–

okay bestie, gather round, because this is the manual page for nng_msg_append(3) from the NNG Reference Manual and it is lowkey one of the most useful little functions in the whole family 🫢


✨ NAME ✨

nng_msg_append β€” append to message body

like, that's it, that's the vibe. you're adding stuff onto the end of a message body. iconic behavior honestly πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <nng/nng.h>

int nng_msg_append(nng_msg *msg, const void *val, size_t size);
int nng_msg_append_u16(nng_msg *msg, uint16_t val16);
int nng_msg_append_u32(nng_msg *msg, uint32_t val32);
int nng_msg_append_u64(nng_msg *msg, uint64_t val64);

four whole besties in one family, and they all do the same little dance: put data at the end of your message. no cap 🌸


🌈 DESCRIPTION 🌈

so the nng_msg_append() family of functions appends data to the end of the body of message msg, and it will reallocate it if necessary. the way that it just handles the realloc for you?? main character energy fr fr πŸ’œ

here's the breakdown, bestie:

  • the first function appends size bytes, and it copies them from val. byte for byte, no notes. πŸŽ€
  • the remaining functions append the value specified (such as val32) in network-byte order (that's big-endian, for the girlies keeping track) ✨
ngl, if you're the kind of person who forgets endianness exists, these _u16/_u32/_u64 versions are literally here to save you. they do the byte-flipping so you don't have to bestie 😭

⭐ RETURN VALUES ⭐

these functions return 0 on success, and non-zero otherwise. that's it, that's the whole return value situation πŸ”₯


πŸ’€ ERRORS πŸ’€

  • NNG_ENOMEM β€” there is not enough free memory. insufficient free memory exists. the malloc said no ma'am πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page bestie!! go forth and append responsibly, you absolute icon πŸ’–βœ¨

this has been NNG_MSG_APPEND(3), dated 2026-06-30, straight out of the NNG Reference Manual β€” slay, bye πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from