NNG_MSG_HEADER_APPEND(3)
β¨ 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
- 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