NNG_CTX_ID(3)
β¨ NAME β¨
nng_ctx_id β bestie, it hands you back the numeric id of a context π
It's a lil function from the NNG Reference Manual, and it is genuinely so simple it's giving main character energy.
πΈ SYNOPSIS πΈ
#include <nng/nng.h>
int nng_ctx_id(nng_ctx c);
π DESCRIPTION π
okay so. nng_ctx_id() gives you a positive identifier for the context c β but ONLY if that context is valid, no cap. If it's not valid? It returns -1. that's it, that's the whole vibe π¦
Note π A context counts as valid if it was ever opened with thenng_ctx_open()function. So if you've got contexts chillin' on the stack or declared statically, you should initialize them with the macroNNG_CTX_INITIALIZERso they literally cannot get confused with a valid context before they've been opened. protect your peace (and your ids) π«Ά
π RETURN VALUES π
- It returns the positive value of the context identifier π
- Or
-1if the context is invalid π
π ERRORS π
None. not a single one. flawless. iconic. zero problems. periodt β¨
π SEE ALSO π
that's the whole page, bestie β short, sweet, and it ate ππ
signing off with the receipts: this was the NNG Reference Manual, dated 2026-06-30 π tysm for reading, mwah π
π¦ 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