LC_CTX_GETKEY(3)

πŸ’– LC_CTX_GETKEY β€” Librecast Programmer's Manual, section 3 πŸ’–

okay bestie, sit down, hydrate, and let's talk keys πŸ”‘ this one's from the Librecast Programmer's Manual, section 3 (you know, the C library section, we love her), and it's all about getting and setting keys on Librecast contexts and channels. no cap.


✨ NAME ✨

lc_ctx_getkey, lc_ctx_setkey, lc_channel_getkey, lc_channel_setkey β€” set Librecast channel encoding options πŸŽ€


πŸ“š LIBRARY πŸ“š

Librecast library (liblibrecast, -llibrecast) β€” link her and she's yours 🫢


🌸 SYNOPSIS 🌸

#include <librecast/net.h>

int lc_ctx_getkey(lc_ctx_t *ctx, lc_key_t *key, int type);
int lc_ctx_setkey(lc_ctx_t *ctx, lc_key_t *key, int type);
int lc_channel_getkey(lc_channel_t *chan, lc_key_t *key, int type);
int lc_channel_setkey(lc_channel_t *chan, lc_key_t *key, int type);

Compile and link with -llibrecast. yes literally just that. compile. link. slay. πŸ’…


πŸ’… DESCRIPTION πŸ’…

So these four functions get or set keys for a Librecast context ctx or channel chan. That's the whole vibe. four functions, two targets, keys. iconic.

key is a pointer to an lc_key_t structure. The set functions will use this to set the key on the context or channel, and the set functions will return a copy of the current key in this structure β€” and yes bestie, it really does say set both times, I'm literally just reading the page to you, I don't make the rules πŸ’€

The type argument must be one of the following options:

  • LC_CODE_SYMM β€” Symmetric key. πŸ”
  • LC_CODE_PUBK β€” Public key. πŸ—οΈ

πŸ‘‘ RETURN VALUE πŸ‘‘

These functions return zero on success. On error, -1 is returned and errno is set to indicate the error. zero = we ate. -1 = check errno, bestie, she's telling you everything. 😭


πŸ”₯ ERRORS πŸ”₯

  • EINVAL β€” Invalid argument.

that's it. that's the list. one error, doing her best. πŸ™ˆ


🌈 SEE ALSO 🌈

lc_ctx_coding_set(3), lc_channel_new(3), lc_channel_close(3), lc_channel_coding_set(3), lc_channel_send(3), lc_channel_set_sym_key(3), lc_ctx_new(3), lc_socket_setopt(3), lc_socket_recv(3)

go read those next, iykyk πŸ“–βœ¨


and that's the whole page, bestie πŸ¦‹ this one ships from LIBRECAST, dated 2023-07-31, and it lives at the very bottom of LC_CTX_GETKEY(3) β€” go forth and set your keys, you main character πŸ”‘πŸ‘‘πŸ’œ

πŸ“¦ where this page comes from