NNG_MSG_HEADER_APPEND(3)

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

✨ NAME ✨

nng_msg_header_append β€” bestie, we're appending to a message header πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <nng/nng.h>

int nng_msg_header_append(nng_msg *msg, const void *val, size_t size);
int nng_msg_header_append_u16(nng_msg *msg, uint16_t val16);
int nng_msg_header_append_u32(nng_msg *msg, uint32_t val32);
int nng_msg_header_append_u64(nng_msg *msg, uint64_t val64);

🌸 DESCRIPTION 🌸

okay so the nng_msg_header_append() family? it's giving "add to the end, no thoughts, just vibes at the back of the line." 🫢 These functions append data to the end of the headers of message msg, and they'll reallocate it if necessary β€” like, if there's not enough room, she'll make room, because she's a main character. πŸ‘‘

The first function appends size bytes, copying them over from val. simple as that. copy, paste, slay. ✨

The remaining functions append the value (so like val32, that whole situation) in network-byte order β€” which is big-endian, iykyk πŸ’œ β€” so your bytes come out looking correct on the wire no matter what your lil machine thinks endianness means.


πŸ¦‹ RETURN VALUES πŸ¦‹

These functions return 0 on success, and non-zero otherwise. that's it, that's the whole vibe check. 0 = we ate. non-zero = we did not. 😭


πŸ’€ ERRORS πŸ’€

  • NNG_ENOMEM β€” Insufficient free memory exists. not enough memory bestie, we are ✨struggling✨, no cap.

🌈 SEE ALSO 🌈

nng_msg_alloc(3), nng_msg_header(3), nng_msg_header_chop(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)


okay bye bestie, go forth and append πŸ’– this was the NNG Reference Manual, dated 2026-06-30, and no I will not be elaborating further, periodt πŸŽ€πŸ§šβ­

πŸ“¦ where this page comes from