LC_CTX_NEW(3)
π LC_CTX_NEW(3) β Librecast Programmer's Manual π
okay bestie, sit down, hydrate, and let's talk about the absolute foundation of everything Librecast: making a context and then, when you're done, letting it go. it's giving main character energy but make it memory management. π¦
β¨ NAME β¨
lc_ctx_new, lc_ctx_free β create and free Librecast contexts π
π LIBRARY π
Librecast library (liblibrecast, -llibrecast) β yeah you gotta link it, no cap.
πΈ SYNOPSIS πΈ
#include <librecast/net.h>
lc_ctx_t *lc_ctx_new(void);
void lc_ctx_free(lc_ctx_t *ctx);
Compile and link with -llibrecast.
π DESCRIPTION π
so lc_ctx_new() is the moment. it creates a brand new Librecast context and sets up the environment for you. think of it as the getting-ready montage before the actual plot. once you're done with it, call lc_ctx_free(3) β that's not a suggestion, that's the law. π«Ά
and lc_ctx_free()? it invalidates and frees a Librecast context that you made with lc_ctx_new(3). it's the graceful exit. the closing credits. β¨
π― RETURN VALUE π―
lc_ctx_new() hands you back a pointer to a lc_ctx_t handle. that's your baby now. π
but if things go sideways, it returns NULL and sets errno to ENOMEM. yes, that ENOMEM. π
the lc_ctx_free() function returns no value. literally nothing. it just does the thing and dips. π
π ERRORS π
lc_ctx_new() can fail with this one:
ENOMEMβ Out of memory. Possibly, the application hit theRLIMIT_ASorRLIMIT_DATAlimit described ingetrlimit(2). not me getting rate-limited by the kernel itself π
π EXAMPLE π
Program source
lc_ctx_t *lctx;
lctx = lc_ctx_new();
/* your Librecast program here */
lc_ctx_free(lctx); /* free context when done */
see? create, do your lil thing, free. the whole cycle. iconic. π
π₯ SEE ALSO π₯
and that's the whole page, bestie!! this lil gem came to you from the LIBRECAST crew, dated 2020-08-01, page LC_CTX_NEW(3) β stay hydrated, free your contexts, and slay πβ¨
π¦ where this page comes from
- debian trixie: liblibrecast-dev 0.9.1-1 Β· GPL-2.0-only OR GPL-3.0-only
- nixos 26.05: librecast 0.11.2
- nixpkgs unstable: librecast 0.11.2
- ubuntu noble: liblibrecast-dev 0.8.0-1.1build1 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu questing: liblibrecast-dev 0.9.1-1
- ubuntu resolute: liblibrecast-dev 0.11.2-2 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu stonking: liblibrecast-dev 0.11.2-2build1 Β· GPL-2.0-only OR GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms